Skip to content

Commit 3443107

Browse files
Merge pull request #14 from jeremy-farrance/AccuTheme-AccuKit11
Minor updates and cleanups and additional self-docs etc.
2 parents 0e456ee + aeb682d commit 3443107

18 files changed

+179
-74
lines changed

.editorconfig

+78
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,81 @@
22

33
# IDE1006: Naming Styles
44
dotnet_diagnostic.IDE1006.severity = suggestion
5+
csharp_indent_labels = one_less_than_current
6+
csharp_using_directive_placement = outside_namespace:silent
7+
csharp_prefer_simple_using_statement = true:suggestion
8+
csharp_prefer_braces = true:silent
9+
csharp_style_namespace_declarations = block_scoped:silent
10+
csharp_style_prefer_method_group_conversion = true:silent
11+
csharp_style_prefer_top_level_statements = true:silent
12+
csharp_style_prefer_primary_constructors = true:suggestion
13+
csharp_prefer_system_threading_lock = true:suggestion
14+
csharp_style_expression_bodied_methods = false:silent
15+
csharp_style_expression_bodied_constructors = false:silent
16+
csharp_style_expression_bodied_operators = false:silent
17+
csharp_style_expression_bodied_properties = true:silent
18+
csharp_style_expression_bodied_indexers = true:silent
19+
csharp_style_expression_bodied_accessors = true:silent
20+
csharp_style_expression_bodied_lambdas = true:silent
21+
csharp_style_expression_bodied_local_functions = false:silent
22+
csharp_space_around_binary_operators = before_and_after
23+
24+
[*.{cs,vb}]
25+
#### Naming styles ####
26+
27+
# Naming rules
28+
29+
dotnet_naming_rule.interface_should_be_begins_with_i.severity = suggestion
30+
dotnet_naming_rule.interface_should_be_begins_with_i.symbols = interface
31+
dotnet_naming_rule.interface_should_be_begins_with_i.style = begins_with_i
32+
33+
dotnet_naming_rule.types_should_be_pascal_case.severity = suggestion
34+
dotnet_naming_rule.types_should_be_pascal_case.symbols = types
35+
dotnet_naming_rule.types_should_be_pascal_case.style = pascal_case
36+
37+
dotnet_naming_rule.non_field_members_should_be_pascal_case.severity = suggestion
38+
dotnet_naming_rule.non_field_members_should_be_pascal_case.symbols = non_field_members
39+
dotnet_naming_rule.non_field_members_should_be_pascal_case.style = pascal_case
40+
41+
# Symbol specifications
42+
43+
dotnet_naming_symbols.interface.applicable_kinds = interface
44+
dotnet_naming_symbols.interface.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected
45+
dotnet_naming_symbols.interface.required_modifiers =
46+
47+
dotnet_naming_symbols.types.applicable_kinds = class, struct, interface, enum
48+
dotnet_naming_symbols.types.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected
49+
dotnet_naming_symbols.types.required_modifiers =
50+
51+
dotnet_naming_symbols.non_field_members.applicable_kinds = property, event, method
52+
dotnet_naming_symbols.non_field_members.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected
53+
dotnet_naming_symbols.non_field_members.required_modifiers =
54+
55+
# Naming styles
56+
57+
dotnet_naming_style.begins_with_i.required_prefix = I
58+
dotnet_naming_style.begins_with_i.required_suffix =
59+
dotnet_naming_style.begins_with_i.word_separator =
60+
dotnet_naming_style.begins_with_i.capitalization = pascal_case
61+
62+
dotnet_naming_style.pascal_case.required_prefix =
63+
dotnet_naming_style.pascal_case.required_suffix =
64+
dotnet_naming_style.pascal_case.word_separator =
65+
dotnet_naming_style.pascal_case.capitalization = pascal_case
66+
67+
dotnet_naming_style.pascal_case.required_prefix =
68+
dotnet_naming_style.pascal_case.required_suffix =
69+
dotnet_naming_style.pascal_case.word_separator =
70+
dotnet_naming_style.pascal_case.capitalization = pascal_case
71+
dotnet_style_operator_placement_when_wrapping = beginning_of_line
72+
tab_width = 2
73+
indent_size = 2
74+
end_of_line = crlf
75+
dotnet_style_coalesce_expression = true:suggestion
76+
dotnet_style_null_propagation = true:suggestion
77+
dotnet_style_prefer_is_null_check_over_reference_equality_method = true:suggestion
78+
dotnet_style_prefer_auto_properties = true:silent
79+
dotnet_style_object_initializer = true:suggestion
80+
dotnet_style_collection_initializer = true:suggestion
81+
dotnet_style_prefer_simplified_boolean_expressions = true:suggestion
82+
dotnet_style_prefer_conditional_expression_over_assignment = true:silent

AccuratySolutions.DNN.sln

-2
Original file line numberDiff line numberDiff line change
@@ -60,11 +60,9 @@ Global
6060
{1BEFD128-2503-4C41-9CE0-A9981E580E3A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
6161
{1BEFD128-2503-4C41-9CE0-A9981E580E3A}.Debug|Any CPU.Build.0 = Debug|Any CPU
6262
{1BEFD128-2503-4C41-9CE0-A9981E580E3A}.Release|Any CPU.ActiveCfg = Release|Any CPU
63-
{1BEFD128-2503-4C41-9CE0-A9981E580E3A}.Release|Any CPU.Build.0 = Release|Any CPU
6463
{D7364F99-73F9-4DEC-B626-C469646BAA67}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
6564
{D7364F99-73F9-4DEC-B626-C469646BAA67}.Debug|Any CPU.Build.0 = Debug|Any CPU
6665
{D7364F99-73F9-4DEC-B626-C469646BAA67}.Release|Any CPU.ActiveCfg = Release|Any CPU
67-
{D7364F99-73F9-4DEC-B626-C469646BAA67}.Release|Any CPU.Build.0 = Release|Any CPU
6866
EndGlobalSection
6967
GlobalSection(SolutionProperties) = preSolution
7068
HideSolutionNode = FALSE

Libraries/AccuLadder/Accu/DevHelper.cs

+15-1
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,11 @@ public static void Log(string name, bool value)
7878
}
7979
}
8080

81-
// same as above, but for other types
81+
/// <summary>
82+
/// same as above, but for other types
83+
/// </summary>
84+
/// <param name="name"></param>
85+
/// <param name="value"></param>
8286
public static void Log(string name, int value)
8387
{
8488
if (_isDebug)
@@ -122,6 +126,12 @@ public static IHtmlString GetLog(bool clearLog = true)
122126
}
123127
}
124128

129+
/// <summary>
130+
/// Combines multiple path segments into a single path string with the specified separator.
131+
/// </summary>
132+
/// <param name="pathSeparator">The separator to use between path segments.</param>
133+
/// <param name="segments">The path segments to combine.</param>
134+
/// <returns>A combined path string.</returns>
125135
public static string CombinePathSegments(string pathSeparator = "/", params string[] segments)
126136
{
127137
if (segments == null || segments.Length == 0)
@@ -180,6 +190,10 @@ public static string GetIpAddress()
180190
return stringIpAddress;
181191
}
182192

193+
/// <summary>
194+
/// Is the visitor's IP address an Accuraty IP?
195+
/// </summary>
196+
/// <returns>boolean true/false</returns>
183197
public static bool IsAccuratyIp()
184198
{
185199
var list = new List<string>

Libraries/AccuLadder/Accu/DnnHelper.cs

+2
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,8 @@ public static bool IsHome()
2727
return PortalSettings.Current.ActiveTab.TabID == PortalSettings.Current.HomeTabId;
2828
}
2929

30+
// TODO - the following two functions; we need the same for getting a UserInfo from a UserId
31+
3032
/// <summary>
3133
/// Get a DNN TabInfo for a pageId
3234
/// </summary>

Libraries/AccuLadder/Accu/DnnHelpers.cs

-29
This file was deleted.

Libraries/AccuLadder/Accu/IconHelper.cs

+4-2
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,10 @@ namespace Accuraty.Libraries.AccuLadder
1212
/// </summary>
1313
public partial class Accu
1414
{
15+
// TODO implement Heroicons (https://heroicons.com/)
16+
// TODO implement Ionicons (https://ionicons.com/)
17+
// TODO implement FontAwesome (https://fontawesome.com/icons?d=gallery&p=2&m=free)
18+
1519
/// <summary>
1620
/// Accu.Icon Helper - Simple syntax to an Icon on the page
1721
/// </summary>
@@ -39,8 +43,6 @@ public static IHtmlString Get(string iconName = "search", string iconSize = "md"
3943
{
4044
// TOOD implement iconStyle for Normal, Default, Solid, Outlined, Rounded, TwoTone, Sharp, or Round or whatever they think up next; string iconStyle = "normal"
4145
// TODO implement modern Bootstrap Icons (https://icons.getbootstrap.com/) (standalone since Aug 2020)
42-
// TODO implement Heroicons (https://heroicons.com/)
43-
// TODO implement FontAwesome (https://fontawesome.com/icons?d=gallery&p=2&m=free)
4446
// TODO implement inverse/contrast color; bool invertColor = false (find that cool color/contrast inversion code from ???)
4547
// TODO how would we implement it so that we only load the icon sets resources that are actually used/needed? See Views/Shared/_Layout.cshtml
4648
// TOOD support other icon sets/styles (e.g. Google Symbols or Bootstrap 5)? How would we resolve names between them? (e.g. "lock_outline" vs "lock")

Libraries/AccuLadder/Accu/ThemeHelper.cs

+24-9
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
using System.IO; // Path.Combine or .Join
1+
using System;
2+
using System.IO; // Path.Combine or .Join
23
using System.Web; // HttpContext
34
using DotNetNuke.Entities.Portals; // PortalSettings
45

@@ -20,11 +21,13 @@ public partial class Theme
2021
{
2122
/// <summary>The standard name for the compiled output folder, usually "dist" (default) or "public".</summary>
2223
public static string PublicFolderName { get; set; } = "dist"; // or "public"
24+
#pragma warning disable CS1591 // Missing XML comment for publicly visible type or member
2325
public static string CssFolderName { get; set; } = ""; // or "css"
2426
public static string JsFolderName { get; set; } = ""; // or "js"
2527
public static string MediaFolderName { get; set; } = "media";
2628
public static string ImageFolderName { get; set; } = "images"; // or "img" or "image"
2729
public static string SvgFolderName { get; set; } = "svg";
30+
#pragma warning restore CS1591 // Missing XML comment for publicly visible type or member
2831

2932
/// <summary>Theme path</summary>
3033
/// <remarks>
@@ -34,40 +37,52 @@ public partial class Theme
3437
/// TODO incorporate awareness of Containers (not yet implemented)
3538
/// </remarks>
3639
public static string Path { get; } = PortalSettings.Current.ActiveTab.SkinPath;
37-
public static string ThemePath { get; } = Path;
3840

3941
/// <summary>Theme CSS path</summary>
4042
public static string CssPath { get; } = Dev.CombinePathSegments(segments: new[] { ThemePath, PublicFolderName, CssFolderName } );
41-
public static string ThemeCssPath { get; } = CssPath;
4243

4344
/// <summary>Theme JS path</summary>
4445
public static string JsPath { get; } = Dev.CombinePathSegments(segments: new[] { ThemePath, PublicFolderName, JsFolderName } );
45-
public static string ThemeJsPath { get; } = JsPath;
4646

4747
/// <summary>Theme path</summary>
4848
public static string MediaPath { get; } = Dev.CombinePathSegments(segments: new[] { ThemePath, PublicFolderName, MediaFolderName } );
49-
public static string ThemeMediaPath { get; } = MediaPath;
50-
5149
/// <summary>Theme path</summary>
5250
public static string ImagePath { get; } = Dev.CombinePathSegments(segments: new[] { ThemePath, PublicFolderName, MediaFolderName, ImageFolderName } );
53-
public static string ThemeImagePath { get; } = ImagePath;
5451

5552
/// <summary>Theme path</summary>
5653
public static string SvgPath { get; } = Dev.CombinePathSegments(segments: new[] { ThemePath, PublicFolderName, MediaFolderName, SvgFolderName } );
54+
55+
#pragma warning disable CS1591 // Missing XML comment for publicly visible type or member
56+
public static string ThemePath { get; } = Path;
57+
public static string ThemeCssPath { get; } = CssPath;
58+
public static string ThemeJsPath { get; } = JsPath;
59+
public static string ThemeMediaPath { get; } = MediaPath;
60+
public static string ThemeImagePath { get; } = ImagePath;
5761
public static string ThemeSvgPath { get; } = SvgPath;
62+
#pragma warning restore CS1591 // Missing XML comment for publicly visible type or member
5863

64+
/// <summary>
65+
///
66+
/// </summary>
67+
/// <param name="iconName"></param>
68+
/// <returns></returns>
5969
public static HtmlString AccuIcon(string iconName)
6070
{
61-
string name = Dev.ToSlug(iconName);
71+
string name = Web.ToSlug(iconName);
6272
string svgSprite = ThemeSvgPath + "/AccuTheme-icons.svg";
6373
string output = "<svg class=\"svg svg--icon\" width=\"1em\" height=\"1em\" fill=\"currentColor\" focusable=\"false\" aria-hidden=\"true\"><use xlink:href=\"" + svgSprite + "#" + name + "\"></use></svg>";
6474

6575
return new HtmlString(output);
6676
}
6777

78+
/// <summary>
79+
/// Obsolete: Deprecated, old way of converting an icon name to a Bootstrap SVG icon
80+
/// </summary>
81+
/// <param name="iconName"></param>
82+
/// <returns></returns>
6883
public static HtmlString BootstrapIcon(string iconName)
6984
{
70-
string name = Dev.ToSlug(iconName);
85+
string name = Web.ToSlug(iconName);
7186
string svgSprite = ThemeSvgPath + "/bootstrap-icons.svg";
7287
string output = "<svg class=\"svg svg--icon bi\" width=\"1em\" height=\"1em\" fill=\"currentColor\" focusable=\"false\" aria-hidden=\"true\"><use xlink:href=\"" + svgSprite + "#" + name + "\"></use></svg>";
7388

Libraries/AccuLadder/Accu/_CompatibilityHelper.cs

+2
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
namespace Accuraty.Libraries.AccuLadder
99
{
1010
[Obsolete("AccuKit is Deprecated, use only for quick compatibility hacks. ")]
11+
#pragma warning disable CS1591 // Missing XML comment for publicly visible type or member
1112
public class AccuKit
1213
{
1314
/// <summary>Obsolete: Deprecated, use: Accu.Theme.Path instead</summary>
@@ -48,5 +49,6 @@ public class AccuKit
4849
public static string sbe(string returnTrue = "dev", string returnFalse = "") { return Accu.Nx.Sbe(returnTrue, returnFalse); }
4950

5051
} // end class AccuKit
52+
#pragma warning restore CS1591 // Missing XML comment for publicly visible type or member
5153
} // end namespace Accuraty.Libraries.AccuLadder
5254

Libraries/AccuLadder/AccuLadder.dnn

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<dotnetnuke type="Package" version="6.0">
33
<packages>
4-
<package name="Accuraty.Libraries.AccuLadder" type="Library" version="01.00.09">
4+
<package name="Accuraty.Libraries.AccuLadder" type="Library" version="1001.01.00">
55
<friendlyName>AccuLadder Library</friendlyName>
66
<description><![CDATA[<p>Helpers, tools, utilities, and shortcuts for DNN and 2SC projects</p>]]></description>
77
<owner>

Libraries/AccuLadder/AccuLadder_Symbols.dnn

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<dotnetnuke type="Package" version="6.0">
33
<packages>
4-
<package name="Accuraty.Libraries.AccuLadder_Symbols" type="Library" version="01.00.09">
4+
<package name="Accuraty.Libraries.AccuLadder_Symbols" type="Library" version="1001.01.00">
55
<friendlyName>AccuLadder Library Symbols</friendlyName>
66
<description><![CDATA[Helpers, tools, utilities, and shortcuts for DNN and 2SC projects]]></description>
77
<owner>
@@ -14,7 +14,7 @@
1414
<releaseNotes src="ReleaseNotes.txt" />
1515
<azureCompatible>True</azureCompatible>
1616
<dependencies>
17-
<dependency type="managedPackage" version="1.0.9">Accuraty.Libraries.AccuLadder</dependency>
17+
<dependency type="managedPackage" version="1001.1.0">Accuraty.Libraries.AccuLadder</dependency>
1818
</dependencies>
1919
<components>
2020
<component type="ResourceFile">

Libraries/AccuLadder/Accuraty.Libraries.AccuLadder.csproj

+8-6
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
<AssemblyName>Accuraty.Libraries.AccuLadder</AssemblyName>
1717
<TargetFrameworkVersion>v4.7.2</TargetFrameworkVersion>
1818
<FileAlignment>512</FileAlignment>
19+
<LangVersion>12.0</LangVersion>
1920
</PropertyGroup>
2021
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
2122
<DebugSymbols>true</DebugSymbols>
@@ -45,8 +46,13 @@
4546
<PackageReference Include="DotNetNuke.Web.Client" Version="9.8.0" />
4647
<PackageReference Include="DotNetNuke.Web.Deprecated" Version="9.8.0" />
4748
<PackageReference Include="DotNetNuke.WebApi" Version="9.8.0" />
48-
<PackageReference Include="Newtonsoft.Json" Version="10.0.3" />
49-
<PackageReference Include="Microsoft.AspNet.WebApi.Core" Version="5.2.3" />
49+
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
50+
<PackageReference Include="Microsoft.AspNet.WebApi.Core" Version="5.3.0" />
51+
<PackageReference Include="PolySharp">
52+
<Version>1.15.0</Version>
53+
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
54+
<PrivateAssets>all</PrivateAssets>
55+
</PackageReference>
5056
</ItemGroup>
5157
<ItemGroup>
5258
<Reference Include="Hotcakes.Commerce">
@@ -62,12 +68,9 @@
6268
<Reference Include="System.IdentityModel" />
6369
<Reference Include="System.IdentityModel.Services" />
6470
<Reference Include="System.Net.Http" />
65-
<Reference Include="System.Net.Http.Formatting" />
6671
<Reference Include="System.Net.Http.WebRequest" />
6772
<Reference Include="System.Runtime.Serialization" />
6873
<Reference Include="System.Web" />
69-
<Reference Include="System.Web.Http" />
70-
<Reference Include="System.Web.Http.WebHost" />
7174
<Reference Include="System.Xml.Linq" />
7275
<Reference Include="System.Data.DataSetExtensions" />
7376
<Reference Include="Microsoft.CSharp" />
@@ -77,7 +80,6 @@
7780
<ItemGroup>
7881
<Compile Include="Accu\Accu.cs" />
7982
<Compile Include="Accu\IconHelper.cs" />
80-
<Compile Include="Accu\DnnHelpers.cs" />
8183
<Compile Include="Accu\TextHelper.cs" />
8284
<Compile Include="Accu\NxHelper.cs" />
8385
<Compile Include="Accu\WebHelper.cs" />

Libraries/AccuLadder/Properties/AssemblyInfo.cs

+3-3
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
[assembly: AssemblyConfiguration("")]
1111
[assembly: AssemblyCompany("Accuraty")]
1212
[assembly: AssemblyProduct("AccuLadder Libraries Extension for DNN")]
13-
[assembly: AssemblyCopyright("Copyright 2023 Accuraty")]
13+
[assembly: AssemblyCopyright("Copyright 2022-2025 Accuraty")]
1414
[assembly: AssemblyTrademark("")]
1515
[assembly: AssemblyCulture("")]
1616

@@ -29,5 +29,5 @@
2929
// Build Number
3030
// Revision
3131
//
32-
[assembly: AssemblyVersion("01.00.09")]
33-
[assembly: AssemblyFileVersion("01.00.09")]
32+
[assembly: AssemblyVersion("1001.01.00")]
33+
[assembly: AssemblyFileVersion("1001.01.00")]

Libraries/AccuLadder/README.md

+2
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
## How to Generate the Docs (DocFX)
44

5+
If DocFX is not installed, install it using dotnet: `dotnet tool install -g docfx`
6+
57
PowerShell or command line to C:\dev\gen\docfx
68
Then, run the following command: `docfx build docfx.json [--serve]`
79
Then, browse to http://localhost:8080/

0 commit comments

Comments
 (0)