├── .gitattributes
├── .gitignore
├── BlazorAnimation.png
├── BlazorAnimation.sln
├── BlazorAnimation.sln.DotSettings
├── BlazorAnimation
├── Animation.razor
├── AnimationOptions.cs
├── BlazorAnimation.csproj
├── CssClass.cs
├── Delay.cs
├── Effect.cs
├── Speed.cs
├── _Imports.razor
└── wwwroot
│ ├── animate.css
│ └── blazorAnimationInterop.js
├── BlazorAnimation2.gif
├── LICENSE
├── README.md
├── Sample
├── App.razor
├── Data
│ ├── WeatherForecast.cs
│ └── WeatherForecastService.cs
├── Pages
│ ├── Counter.razor
│ ├── Error.razor
│ ├── FetchData.razor
│ ├── Index.razor
│ ├── InputPassword.razor
│ └── _Host.cshtml
├── Program.cs
├── Properties
│ ├── Annotations.cs
│ ├── PublishProfiles
│ │ └── FolderProfile.pubxml
│ └── launchSettings.json
├── Sample.csproj
├── Shared
│ ├── MainLayout.razor
│ └── NavMenu.razor
├── Startup.cs
├── _Imports.razor
├── appsettings.Development.json
├── appsettings.json
└── wwwroot
│ ├── css
│ ├── bootstrap
│ │ ├── bootstrap.min.css
│ │ └── bootstrap.min.css.map
│ ├── open-iconic
│ │ ├── FONT-LICENSE
│ │ ├── ICON-LICENSE
│ │ ├── README.md
│ │ └── font
│ │ │ ├── css
│ │ │ └── open-iconic-bootstrap.min.css
│ │ │ └── fonts
│ │ │ ├── open-iconic.eot
│ │ │ ├── open-iconic.otf
│ │ │ ├── open-iconic.svg
│ │ │ ├── open-iconic.ttf
│ │ │ └── open-iconic.woff
│ └── site.css
│ └── favicon.ico
├── inputpassword1.gif
└── inputpassword2.gif
/.gitattributes:
--------------------------------------------------------------------------------
1 | ###############################################################################
2 | # Set default behavior to automatically normalize line endings.
3 | ###############################################################################
4 | * text=auto
5 |
6 | ###############################################################################
7 | # Set default behavior for command prompt diff.
8 | #
9 | # This is need for earlier builds of msysgit that does not have it on by
10 | # default for csharp files.
11 | # Note: This is only used by command line
12 | ###############################################################################
13 | #*.cs diff=csharp
14 |
15 | ###############################################################################
16 | # Set the merge driver for project and solution files
17 | #
18 | # Merging from the command prompt will add diff markers to the files if there
19 | # are conflicts (Merging from VS is not affected by the settings below, in VS
20 | # the diff markers are never inserted). Diff markers may cause the following
21 | # file extensions to fail to load in VS. An alternative would be to treat
22 | # these files as binary and thus will always conflict and require user
23 | # intervention with every merge. To do so, just uncomment the entries below
24 | ###############################################################################
25 | #*.sln merge=binary
26 | #*.csproj merge=binary
27 | #*.vbproj merge=binary
28 | #*.vcxproj merge=binary
29 | #*.vcproj merge=binary
30 | #*.dbproj merge=binary
31 | #*.fsproj merge=binary
32 | #*.lsproj merge=binary
33 | #*.wixproj merge=binary
34 | #*.modelproj merge=binary
35 | #*.sqlproj merge=binary
36 | #*.wwaproj merge=binary
37 |
38 | ###############################################################################
39 | # behavior for image files
40 | #
41 | # image files are treated as binary by default.
42 | ###############################################################################
43 | #*.jpg binary
44 | #*.png binary
45 | #*.gif binary
46 |
47 | ###############################################################################
48 | # diff behavior for common document formats
49 | #
50 | # Convert binary document formats to text before diffing them. This feature
51 | # is only available from the command line. Turn it on by uncommenting the
52 | # entries below.
53 | ###############################################################################
54 | #*.doc diff=astextplain
55 | #*.DOC diff=astextplain
56 | #*.docx diff=astextplain
57 | #*.DOCX diff=astextplain
58 | #*.dot diff=astextplain
59 | #*.DOT diff=astextplain
60 | #*.pdf diff=astextplain
61 | #*.PDF diff=astextplain
62 | #*.rtf diff=astextplain
63 | #*.RTF diff=astextplain
64 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | ## Ignore Visual Studio temporary files, build results, and
2 | ## files generated by popular Visual Studio add-ons.
3 |
4 | # User-specific files
5 | *.suo
6 | *.user
7 | *.userosscache
8 | *.sln.docstates
9 |
10 | # User-specific files (MonoDevelop/Xamarin Studio)
11 | *.userprefs
12 |
13 | # Build results
14 | [Dd]ebug/
15 | [Dd]ebugPublic/
16 | [Rr]elease/
17 | [Rr]eleases/
18 | x64/
19 | x86/
20 | bld/
21 | [Bb]in/
22 | [Oo]bj/
23 | [Ll]og/
24 |
25 | # Visual Studio 2015 cache/options directory
26 | .vs/
27 | # Uncomment if you have tasks that create the project's static files in wwwroot
28 | #wwwroot/
29 |
30 | # MSTest test Results
31 | [Tt]est[Rr]esult*/
32 | [Bb]uild[Ll]og.*
33 |
34 | # NUNIT
35 | *.VisualState.xml
36 | TestResult.xml
37 |
38 | # Build Results of an ATL Project
39 | [Dd]ebugPS/
40 | [Rr]eleasePS/
41 | dlldata.c
42 |
43 | # DNX
44 | project.lock.json
45 | project.fragment.lock.json
46 | artifacts/
47 |
48 | *_i.c
49 | *_p.c
50 | *_i.h
51 | *.ilk
52 | *.meta
53 | *.obj
54 | *.pch
55 | *.pdb
56 | *.pgc
57 | *.pgd
58 | *.rsp
59 | *.sbr
60 | *.tlb
61 | *.tli
62 | *.tlh
63 | *.tmp
64 | *.tmp_proj
65 | *.log
66 | *.vspscc
67 | *.vssscc
68 | .builds
69 | *.pidb
70 | *.svclog
71 | *.scc
72 |
73 | # Chutzpah Test files
74 | _Chutzpah*
75 |
76 | # Visual C++ cache files
77 | ipch/
78 | *.aps
79 | *.ncb
80 | *.opendb
81 | *.opensdf
82 | *.sdf
83 | *.cachefile
84 | *.VC.db
85 | *.VC.VC.opendb
86 |
87 | # Visual Studio profiler
88 | *.psess
89 | *.vsp
90 | *.vspx
91 | *.sap
92 |
93 | # TFS 2012 Local Workspace
94 | $tf/
95 |
96 | # Guidance Automation Toolkit
97 | *.gpState
98 |
99 | # ReSharper is a .NET coding add-in
100 | _ReSharper*/
101 | *.[Rr]e[Ss]harper
102 | *.DotSettings.user
103 |
104 | # JustCode is a .NET coding add-in
105 | .JustCode
106 |
107 | # TeamCity is a build add-in
108 | _TeamCity*
109 |
110 | # DotCover is a Code Coverage Tool
111 | *.dotCover
112 |
113 | # NCrunch
114 | _NCrunch_*
115 | .*crunch*.local.xml
116 | nCrunchTemp_*
117 |
118 | # MightyMoose
119 | *.mm.*
120 | AutoTest.Net/
121 |
122 | # Web workbench (sass)
123 | .sass-cache/
124 |
125 | # Installshield output folder
126 | [Ee]xpress/
127 |
128 | # DocProject is a documentation generator add-in
129 | DocProject/buildhelp/
130 | DocProject/Help/*.HxT
131 | DocProject/Help/*.HxC
132 | DocProject/Help/*.hhc
133 | DocProject/Help/*.hhk
134 | DocProject/Help/*.hhp
135 | DocProject/Help/Html2
136 | DocProject/Help/html
137 |
138 | # Click-Once directory
139 | publish/
140 |
141 | # Publish Web Output
142 | *.[Pp]ublish.xml
143 | *.azurePubxml
144 | # TODO: Comment the next line if you want to checkin your web deploy settings
145 | # but database connection strings (with potential passwords) will be unencrypted
146 | #*.pubxml
147 | *.publishproj
148 |
149 | # Microsoft Azure Web App publish settings. Comment the next line if you want to
150 | # checkin your Azure Web App publish settings, but sensitive information contained
151 | # in these scripts will be unencrypted
152 | PublishScripts/
153 |
154 | # NuGet Packages
155 | *.nupkg
156 | # The packages folder can be ignored because of Package Restore
157 | **/packages/*
158 | # except build/, which is used as an MSBuild target.
159 | !**/packages/build/
160 | # Uncomment if necessary however generally it will be regenerated when needed
161 | #!**/packages/repositories.config
162 | # NuGet v3's project.json files produces more ignoreable files
163 | *.nuget.props
164 | *.nuget.targets
165 |
166 | # Microsoft Azure Build Output
167 | csx/
168 | *.build.csdef
169 |
170 | # Microsoft Azure Emulator
171 | ecf/
172 | rcf/
173 |
174 | # Windows Store app package directories and files
175 | AppPackages/
176 | BundleArtifacts/
177 | Package.StoreAssociation.xml
178 | _pkginfo.txt
179 |
180 | # Visual Studio cache files
181 | # files ending in .cache can be ignored
182 | *.[Cc]ache
183 | # but keep track of directories ending in .cache
184 | !*.[Cc]ache/
185 |
186 | # Others
187 | ClientBin/
188 | ~$*
189 | *~
190 | *.dbmdl
191 | *.dbproj.schemaview
192 | *.jfm
193 | *.pfx
194 | *.publishsettings
195 | node_modules/
196 | orleans.codegen.cs
197 |
198 | # Since there are multiple workflows, uncomment next line to ignore bower_components
199 | # (https://github.com/github/gitignore/pull/1529#issuecomment-104372622)
200 | #bower_components/
201 |
202 | # RIA/Silverlight projects
203 | Generated_Code/
204 |
205 | # Backup & report files from converting an old project file
206 | # to a newer Visual Studio version. Backup files are not needed,
207 | # because we have git ;-)
208 | _UpgradeReport_Files/
209 | Backup*/
210 | UpgradeLog*.XML
211 | UpgradeLog*.htm
212 |
213 | # SQL Server files
214 | *.mdf
215 | *.ldf
216 |
217 | # Business Intelligence projects
218 | *.rdl.data
219 | *.bim.layout
220 | *.bim_*.settings
221 |
222 | # Microsoft Fakes
223 | FakesAssemblies/
224 |
225 | # GhostDoc plugin setting file
226 | *.GhostDoc.xml
227 |
228 | # Node.js Tools for Visual Studio
229 | .ntvs_analysis.dat
230 |
231 | # Visual Studio 6 build log
232 | *.plg
233 |
234 | # Visual Studio 6 workspace options file
235 | *.opt
236 |
237 | # Visual Studio LightSwitch build output
238 | **/*.HTMLClient/GeneratedArtifacts
239 | **/*.DesktopClient/GeneratedArtifacts
240 | **/*.DesktopClient/ModelManifest.xml
241 | **/*.Server/GeneratedArtifacts
242 | **/*.Server/ModelManifest.xml
243 | _Pvt_Extensions
244 |
245 | # Paket dependency manager
246 | .paket/paket.exe
247 | paket-files/
248 |
249 | # FAKE - F# Make
250 | .fake/
251 |
252 | # JetBrains Rider
253 | .idea/
254 | *.sln.iml
255 |
256 | # CodeRush
257 | .cr/
258 |
259 | # Python Tools for Visual Studio (PTVS)
260 | __pycache__/
261 | *.pyc
--------------------------------------------------------------------------------
/BlazorAnimation.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/aboudoux/BlazorAnimation/52db90c43b9db70bb0844ef289bf063943658ae3/BlazorAnimation.png
--------------------------------------------------------------------------------
/BlazorAnimation.sln:
--------------------------------------------------------------------------------
1 |
2 | Microsoft Visual Studio Solution File, Format Version 12.00
3 | # Visual Studio Version 16
4 | VisualStudioVersion = 16.0.29806.167
5 | MinimumVisualStudioVersion = 10.0.40219.1
6 | Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "BlazorAnimation", "BlazorAnimation\BlazorAnimation.csproj", "{F349E011-EE43-43F0-B2B0-EBA6FD33C83F}"
7 | EndProject
8 | Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Sample", "Sample\Sample.csproj", "{8F5EA6B9-A262-4536-AF82-6FFC9048EE98}"
9 | EndProject
10 | Global
11 | GlobalSection(SolutionConfigurationPlatforms) = preSolution
12 | Debug|Any CPU = Debug|Any CPU
13 | Release|Any CPU = Release|Any CPU
14 | EndGlobalSection
15 | GlobalSection(ProjectConfigurationPlatforms) = postSolution
16 | {F349E011-EE43-43F0-B2B0-EBA6FD33C83F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
17 | {F349E011-EE43-43F0-B2B0-EBA6FD33C83F}.Debug|Any CPU.Build.0 = Debug|Any CPU
18 | {F349E011-EE43-43F0-B2B0-EBA6FD33C83F}.Release|Any CPU.ActiveCfg = Release|Any CPU
19 | {F349E011-EE43-43F0-B2B0-EBA6FD33C83F}.Release|Any CPU.Build.0 = Release|Any CPU
20 | {8F5EA6B9-A262-4536-AF82-6FFC9048EE98}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
21 | {8F5EA6B9-A262-4536-AF82-6FFC9048EE98}.Debug|Any CPU.Build.0 = Debug|Any CPU
22 | {8F5EA6B9-A262-4536-AF82-6FFC9048EE98}.Release|Any CPU.ActiveCfg = Release|Any CPU
23 | {8F5EA6B9-A262-4536-AF82-6FFC9048EE98}.Release|Any CPU.Build.0 = Release|Any CPU
24 | EndGlobalSection
25 | GlobalSection(SolutionProperties) = preSolution
26 | HideSolutionNode = FALSE
27 | EndGlobalSection
28 | GlobalSection(ExtensibilityGlobals) = postSolution
29 | SolutionGuid = {6F97D3A0-5F56-4D0C-9968-CBE5867698E4}
30 | EndGlobalSection
31 | EndGlobal
32 |
--------------------------------------------------------------------------------
/BlazorAnimation.sln.DotSettings:
--------------------------------------------------------------------------------
1 |
2 | True
--------------------------------------------------------------------------------
/BlazorAnimation/Animation.razor:
--------------------------------------------------------------------------------
1 | @using Microsoft.Extensions.Options
2 | @using Microsoft.JSInterop
3 | @inject IJSRuntime JsRuntime
4 | @inject IOptionsSnapshot OptionsSnapshot
5 |
6 |
7 | @ChildContent
8 |
9 |
10 | @code {
11 |
12 | protected override void OnParametersSet() => ApplyConfiguration();
13 |
14 | protected override void OnAfterRender(bool firstRender) {
15 | if (firstRender) {
16 | var dotNetReference = DotNetObjectReference.Create(this);
17 | JsRuntime.InvokeVoidAsync("AnimatedComponent.animationend", DivElementReference, dotNetReference);
18 | }
19 | }
20 |
21 | private ElementReference DivElementReference;
22 |
23 | private string Animate => Enabled ? "animate__animated" : string.Empty;
24 |
25 | private string AnimationType => Enabled ? "animate__" + Effect?.Name : string.Empty;
26 |
27 | [Parameter] public RenderFragment ChildContent { get; set; }
28 |
29 | [Parameter] public bool Enabled
30 | {
31 | get => _enabled ?? true;
32 | set => _enabled = value;
33 | }
34 |
35 | [Parameter] public string OptionsName { get; set; } = Options.DefaultName;
36 |
37 | [Parameter] public AnimationEffect Effect { get; set; }
38 |
39 | [Parameter] public TimeSpan Delay {
40 | get => _delay ?? BlazorAnimation.Delay.None;
41 | set => _delay = value;
42 | }
43 |
44 | [Parameter] public TimeSpan Speed
45 | {
46 | get => _speed ?? BlazorAnimation.Speed.Slow;
47 | set => _speed = value;
48 | }
49 |
50 | [Parameter] public string Class { get; set; } = string.Empty;
51 |
52 | [Parameter] public string Style { get; set; } = string.Empty;
53 |
54 | [Parameter]
55 | public int IterationCount
56 | {
57 | get => _iterationCount is null
58 | ? 1
59 | : _iterationCount < 0 ? int.MaxValue : _iterationCount.Value;
60 | set => _iterationCount = value;
61 | }
62 |
63 | [Parameter(CaptureUnmatchedValues = true)]
64 | public Dictionary AdditionalAttributes { get; set; }
65 |
66 | [JSInvokable("OnAnimationEnd")]
67 | public async void AnimationEnd() => await _animationEnd.InvokeAsync(this);
68 |
69 | private EventCallback _animationEnd;
70 | private int? _iterationCount;
71 | private bool? _enabled;
72 | private TimeSpan? _speed;
73 | private TimeSpan? _delay;
74 |
75 | [CascadingParameter(Name = "OnAnimationEnd")]
76 | private EventCallback CascadingOnAnimationEnd
77 | {
78 | set => _animationEnd = value;
79 | }
80 |
81 | [Parameter]
82 | public EventCallback OnAnimationEnd
83 | {
84 | set => _animationEnd = value;
85 | }
86 |
87 | private void ApplyConfiguration()
88 | {
89 | var options = OptionsSnapshot.Get(OptionsName);
90 | if (options == null) return;
91 | Effect ??= options.Effect;
92 | if (options.Delay is not null && Delay == BlazorAnimation.Delay.None)
93 | Delay = options.Delay.Value;
94 | if (options.Speed is not null && Speed == BlazorAnimation.Speed.Slow)
95 | Speed = options.Speed.Value;
96 | if (options.IterationCount is not null && _iterationCount is null)
97 | IterationCount = options.IterationCount.Value;
98 | if (options.Enabled is not null && _enabled is null)
99 | Enabled = options.Enabled.Value;
100 | }
101 | }
102 |
103 |
--------------------------------------------------------------------------------
/BlazorAnimation/AnimationOptions.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace BlazorAnimation
4 | {
5 | public class AnimationOptions
6 | {
7 | public AnimationEffect Effect { get; set; }
8 | public TimeSpan? Delay { get; set; }
9 | public TimeSpan? Speed { get; set; }
10 | public int? IterationCount { get; set; }
11 | public bool? Enabled { get; set; }
12 | }
13 | }
--------------------------------------------------------------------------------
/BlazorAnimation/BlazorAnimation.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | netstandard2.0
5 | 3.0
6 | latest
7 | 2.3.0
8 | True
9 | Aurelien BOUDOUX
10 | a Blazor component based on animate.css to easly animate your content
11 | MIT
12 | https://github.com/aboudoux/BlazorAnimation
13 | BlazorAnimation.png
14 |
15 | Allows parameters to override options
16 | Blazor Animation Animate Html Content
17 | https://github.com/aboudoux/BlazorAnimation
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 | PreserveNewest
30 |
31 |
32 | PreserveNewest
33 |
34 |
35 |
36 |
37 |
38 |
39 | True
40 |
41 |
42 |
43 |
44 |
45 |
--------------------------------------------------------------------------------
/BlazorAnimation/CssClass.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace BlazorAnimation
4 | {
5 | public class CssClass : IEquatable
6 | {
7 | public string Name { get; }
8 |
9 | public CssClass(string name)
10 | {
11 | Name = name;
12 | }
13 |
14 | public bool Equals(CssClass other)
15 | {
16 | if (ReferenceEquals(null, other)) return false;
17 | if (ReferenceEquals(this, other)) return true;
18 | return Name == other.Name;
19 | }
20 |
21 | public override bool Equals(object obj)
22 | {
23 | if (ReferenceEquals(null, obj)) return false;
24 | if (ReferenceEquals(this, obj)) return true;
25 | if (obj.GetType() != this.GetType()) return false;
26 | return Equals((CssClass) obj);
27 | }
28 |
29 | public override int GetHashCode()
30 | {
31 | return (Name != null ? Name.GetHashCode() : 0);
32 | }
33 |
34 | public static bool operator ==(CssClass left, CssClass right) {
35 | if (left is null)
36 | return right is null;
37 | return left.Equals(right);
38 | }
39 |
40 | public static bool operator !=(CssClass left, CssClass right) => !(left == right);
41 | }
42 | }
--------------------------------------------------------------------------------
/BlazorAnimation/Delay.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace BlazorAnimation
4 | {
5 | public static class Delay
6 | {
7 | public static TimeSpan None => TimeSpan.Zero;
8 | public static TimeSpan OneSecond => TimeSpan.FromSeconds(1);
9 | public static TimeSpan TwoSeconds => TimeSpan.FromSeconds(2);
10 | public static TimeSpan ThreeSeconds => TimeSpan.FromSeconds(3);
11 | public static TimeSpan FourSeconds => TimeSpan.FromSeconds(4);
12 | public static TimeSpan FiveSeconds => TimeSpan.FromSeconds(5);
13 | }
14 | }
--------------------------------------------------------------------------------
/BlazorAnimation/Effect.cs:
--------------------------------------------------------------------------------
1 | namespace BlazorAnimation {
2 | public static class Effect
3 | {
4 | public static AnimationEffect Bounce => new AnimationEffect("bounce");
5 | public static AnimationEffect Flash => new AnimationEffect("flash");
6 | public static AnimationEffect Pulse => new AnimationEffect("pulse");
7 | public static AnimationEffect RubberBand => new AnimationEffect("rubberBand");
8 | public static AnimationEffect Shake => ShakeX; // v3.7.2 compatibility
9 | public static AnimationEffect ShakeX => new AnimationEffect("shakeX");
10 | public static AnimationEffect ShakeY => new AnimationEffect("shakeY");
11 | public static AnimationEffect HeadShake => new AnimationEffect("headShake");
12 | public static AnimationEffect Swing => new AnimationEffect("swing");
13 | public static AnimationEffect Tada => new AnimationEffect("tada");
14 | public static AnimationEffect Wobble => new AnimationEffect("wobble");
15 | public static AnimationEffect Jello => new AnimationEffect("jello");
16 | public static AnimationEffect BounceIn => new AnimationEffect("bounceIn");
17 | public static AnimationEffect BounceInDown => new AnimationEffect("bounceInDown");
18 | public static AnimationEffect BounceInLeft => new AnimationEffect("bounceInLeft");
19 | public static AnimationEffect BounceInRight => new AnimationEffect("bounceInRight");
20 | public static AnimationEffect BounceInUp => new AnimationEffect("bounceInUp");
21 | public static AnimationEffect BounceOut => new AnimationEffect("bounceOut");
22 | public static AnimationEffect BounceOutDown => new AnimationEffect("bounceOutDown");
23 | public static AnimationEffect BounceOutLeft => new AnimationEffect("bounceOutLeft");
24 | public static AnimationEffect BounceOutRight => new AnimationEffect("bounceOutRight");
25 | public static AnimationEffect BounceOutUp => new AnimationEffect("bounceOutUp");
26 | public static AnimationEffect FadeIn => new AnimationEffect("fadeIn");
27 | public static AnimationEffect FadeInDown => new AnimationEffect("fadeInDown");
28 | public static AnimationEffect FadeInDownBig => new AnimationEffect("fadeInDownBig");
29 | public static AnimationEffect FadeInLeft => new AnimationEffect("fadeInLeft");
30 | public static AnimationEffect FadeInLeftBig => new AnimationEffect("fadeInLeftBig");
31 | public static AnimationEffect FadeInRight => new AnimationEffect("fadeInRight");
32 | public static AnimationEffect FadeInRightBig => new AnimationEffect("fadeInRightBig");
33 | public static AnimationEffect FadeInUp => new AnimationEffect("fadeInUp");
34 | public static AnimationEffect FadeInUpBig => new AnimationEffect("fadeInUpBig");
35 | public static AnimationEffect FadeOut => new AnimationEffect("fadeOut");
36 | public static AnimationEffect FadeOutDown => new AnimationEffect("fadeOutDown");
37 | public static AnimationEffect FadeOutDownBig => new AnimationEffect("fadeOutDownBig");
38 | public static AnimationEffect FadeOutLeft => new AnimationEffect("fadeOutLeft");
39 | public static AnimationEffect FadeOutLeftBig => new AnimationEffect("fadeOutLeftBig");
40 | public static AnimationEffect FadeOutRight => new AnimationEffect("fadeOutRight");
41 | public static AnimationEffect FadeOutRightBig => new AnimationEffect("fadeOutRightBig");
42 | public static AnimationEffect FadeOutUp => new AnimationEffect("fadeOutUp");
43 | public static AnimationEffect FadeOutUpBig => new AnimationEffect("fadeOutUpBig");
44 | public static AnimationEffect FlipInX => new AnimationEffect("flipInX");
45 | public static AnimationEffect FlipInY => new AnimationEffect("flipInY");
46 | public static AnimationEffect FlipOutX => new AnimationEffect("flipOutX");
47 | public static AnimationEffect FlipOutY => new AnimationEffect("flipOutY");
48 | public static AnimationEffect LightSpeedIn => LightSpeedInRight; // v3.7.2 compatibility
49 | public static AnimationEffect LightSpeedOut => LightSpeedOutRight; // v3.7.2 compatibility
50 | public static AnimationEffect LightSpeedInRight => new AnimationEffect("lightSpeedInRight");
51 | public static AnimationEffect LightSpeedInLeft => new AnimationEffect("lightSpeedInLeft");
52 | public static AnimationEffect LightSpeedOutRight => new AnimationEffect("lightSpeedOutRight");
53 | public static AnimationEffect LightSpeedOutLeft => new AnimationEffect("lightSpeedOutLeft");
54 | public static AnimationEffect RotateIn => new AnimationEffect("rotateIn");
55 | public static AnimationEffect RotateInDownLeft => new AnimationEffect("rotateInDownLeft");
56 | public static AnimationEffect RotateInDownRight => new AnimationEffect("rotateInDownRight");
57 | public static AnimationEffect RotateInUpLeft => new AnimationEffect("rotateInUpLeft");
58 | public static AnimationEffect RotateInUpRight => new AnimationEffect("rotateInUpRight");
59 | public static AnimationEffect RotateOut => new AnimationEffect("rotateOut");
60 | public static AnimationEffect RotateOutDownLeft => new AnimationEffect("rotateOutDownLeft");
61 | public static AnimationEffect RotateOutDownRight => new AnimationEffect("rotateOutDownRight");
62 | public static AnimationEffect RotateOutUpLeft => new AnimationEffect("rotateOutUpLeft");
63 | public static AnimationEffect RotateOutUpRight => new AnimationEffect("rotateOutUpRight");
64 | public static AnimationEffect Hinge => new AnimationEffect("hinge");
65 | public static AnimationEffect JackInTheBox => new AnimationEffect("jackInTheBox");
66 | private static AnimationEffect RollIn => new AnimationEffect("rollIn");
67 | public static AnimationEffect RollOut => new AnimationEffect("rollOut");
68 | public static AnimationEffect ZoomIn => new AnimationEffect("zoomIn");
69 | public static AnimationEffect ZoomInDown => new AnimationEffect("zoomInDown");
70 | public static AnimationEffect ZoomInLeft => new AnimationEffect("zoomInLeft");
71 | public static AnimationEffect ZoomInRight => new AnimationEffect("zoomInRight");
72 | public static AnimationEffect ZoomInUp => new AnimationEffect("zoomInUp");
73 | public static AnimationEffect ZoomOut => new AnimationEffect("zoomOut");
74 | public static AnimationEffect ZoomOutDown => new AnimationEffect("zoomOutDown");
75 | public static AnimationEffect ZoomOutLeft => new AnimationEffect("zoomOutLeft");
76 | public static AnimationEffect ZoomOutRight => new AnimationEffect("zoomOutRight");
77 | public static AnimationEffect ZoomOutUp => new AnimationEffect("zoomOutUp");
78 | public static AnimationEffect SlideInDown => new AnimationEffect("slideInDown");
79 | public static AnimationEffect SlideInLeft => new AnimationEffect("slideInLeft");
80 | public static AnimationEffect SlideInRight => new AnimationEffect("slideInRight");
81 | public static AnimationEffect SlideInUp => new AnimationEffect("slideInUp");
82 | public static AnimationEffect SlideOutDown => new AnimationEffect("slideOutDown");
83 | public static AnimationEffect SlideOutLeft => new AnimationEffect("slideOutLeft");
84 | public static AnimationEffect SlideOutRight => new AnimationEffect("slideOutRight");
85 | public static AnimationEffect SlideOutUp => new AnimationEffect("slideOutUp");
86 | public static AnimationEffect HeartBeat => new AnimationEffect("heartBeat");
87 | public static AnimationEffect FadeInTopLeft => new AnimationEffect("fadeInTopLeft");
88 | public static AnimationEffect FadeInTopRight => new AnimationEffect("fadeInTopRight");
89 | public static AnimationEffect FadeInBottomLeft => new AnimationEffect("fadeInBottomLeft");
90 | public static AnimationEffect FadeInBottomRight => new AnimationEffect("fadeInBottomRight");
91 | public static AnimationEffect FadeOutTopLeft => new AnimationEffect("fadeOutTopLeft");
92 | public static AnimationEffect FadeOutTopRight => new AnimationEffect("fadeOutTopRight");
93 | public static AnimationEffect FadeOutBottomRight => new AnimationEffect("fadeOutBottomRight");
94 | public static AnimationEffect FadeOutBottomLeft => new AnimationEffect("fadeOutBottomLeft");
95 | public static AnimationEffect BackOutDown => new AnimationEffect("backOutDown");
96 | public static AnimationEffect BackOutLeft => new AnimationEffect("backOutLeft");
97 | public static AnimationEffect BackOutRight => new AnimationEffect("backOutRight");
98 | public static AnimationEffect BackOutUp => new AnimationEffect("backOutUp");
99 | }
100 |
101 | public class AnimationEffect : CssClass
102 | {
103 | public AnimationEffect(string name) : base(name)
104 | {
105 | }
106 | }
107 | }
108 |
--------------------------------------------------------------------------------
/BlazorAnimation/Speed.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace BlazorAnimation
4 | {
5 | public static class Speed
6 | {
7 | public static TimeSpan Slow => TimeSpan.FromSeconds(2);
8 | public static TimeSpan Slower => TimeSpan.FromSeconds(3);
9 | public static TimeSpan Fast => TimeSpan.FromMilliseconds(800);
10 | public static TimeSpan Faster => TimeSpan.FromMilliseconds(500);
11 | }
12 | }
--------------------------------------------------------------------------------
/BlazorAnimation/_Imports.razor:
--------------------------------------------------------------------------------
1 | @using Microsoft.AspNetCore.Components.Web
2 |
--------------------------------------------------------------------------------
/BlazorAnimation/wwwroot/blazorAnimationInterop.js:
--------------------------------------------------------------------------------
1 | document.getElementsByTagName("head")[0].insertAdjacentHTML(
2 | "beforeend",
3 | "");
4 |
5 |
6 |
7 | var AnimatedComponent = AnimatedComponent || {};
8 | AnimatedComponent.animationend = function (element, dotNet) {
9 | element.addEventListener('animationend', function(e) {
10 | if(e.target === this)dotNet.invokeMethodAsync("OnAnimationEnd")
11 | });
12 | };
--------------------------------------------------------------------------------
/BlazorAnimation2.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/aboudoux/BlazorAnimation/52db90c43b9db70bb0844ef289bf063943658ae3/BlazorAnimation2.gif
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) 2022 Aurélien BOUDOUX
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
22 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # BlazorAnimation
2 |
3 | a Blazor component based on animate.css to easly animate your content
4 |
5 | 
6 |
7 | ## Quick Start
8 |
9 | To animate a component, wrap it inside Animation component and use the Effect parameter to define the animation:
10 |
11 | ```
12 |
13 |
Hello, world!
14 |
15 | ```
16 |
17 | ## Getting Started
18 |
19 | Few steps are required in order to use the library.
20 |
21 | #### Add NuGet
22 |
23 | ```csharp
24 | Install-Package BlazorAnimation
25 | ```
26 |
27 | #### Configure _Imports.razor
28 |
29 | ```
30 | ...
31 | @using BlazorAnimation
32 | ```
33 |
34 | #### Add JS interop into _Host.cshtml
35 |
36 | ```
37 |
38 | ```
39 |
40 | #### If you notice any error in blazor wasm, add a configuration in program.cs
41 | ```
42 | ...
43 | builder.Services.Configure(Guid.NewGuid().ToString(),c=>{});
44 | ```
45 |
46 | #### Use the Animation component
47 |
48 | ```
49 |
50 |
Hello, world!
51 |
52 | ```
53 |
54 | ## Sample
55 |
56 | For a sample, please view http://blazoranimation.boudoux.fr
57 |
58 | ## Parameters
59 |
60 | Here's are the parameters to configure the component
61 |
62 | |Parameter Name| Abstract | Default |
63 | |--|--|--|
64 | | [Effect](https://github.com/aboudoux/BlazorAnimation/blob/master/README.md#effect) | Define the effect to use for animate the component. | @Effect.Bounce |
65 | | [Delay](https://github.com/aboudoux/BlazorAnimation/blob/master/README.md#delay) | The time to wait before the animation begin. | @Delay.None
66 | | [Speed](https://github.com/aboudoux/BlazorAnimation/blob/master/README.md#speed) | The total animation duration. | @Speed.Slow
67 | | [IterationCount](https://github.com/aboudoux/BlazorAnimation/blob/master/README.md#iterationcount) | the number of times the animation will be played. For an infinite loop, you can set a negative number. | 1
68 | | [Enabled](https://github.com/aboudoux/BlazorAnimation/blob/master/README.md#enabled) | You can enable or disable the animation component by code with this parameters. Very convenient in certain situations| True
69 | | [OnAnimationEnd](https://github.com/aboudoux/BlazorAnimation/blob/master/README.md#onanimationend) | Call a method when the animation end. | null
70 | | Class | Append some css classes to the component | string.Empty
71 | | Style | Append some css styles to the component | string.Empty
72 |
73 | ### Effect
74 | Define the effect to use for animate the component.
75 |
76 | You can use one of the 90 animations provided by the [animate.css class](https://animate.style/). Just use the `@Effect` into the `Effect` parameters to list them all.
77 |
78 | Example
79 | ```
80 |
81 |
Hello !
82 |
83 | ```
84 | ### Delay
85 | The time to wait before the animation begin.
86 |
87 | You can use one of the 6 predefined delay by using the `@Delay` enumeration that contains :
88 |
89 | - None
90 | - OneSecond
91 | - TwoSeconds
92 | - ThreeSeconds
93 | - FourSeconds
94 | - FiveSeconds
95 |
96 | Example :
97 | ```
98 |
99 |
Hello !
100 |
101 | ```
102 |
103 | Or just define your own time manualy with a `TimeSpan` like below :
104 |
105 | Example with custom time :
106 | ```
107 |
108 |
Hello !
109 |
110 | ```
111 |
112 | ### Speed
113 |
114 | the total time of the animation from the time when the delay has elapsed.
115 |
116 | You can use one of the 4 predefined speed by using the `@Speed` enumeration that contains :
117 |
118 | - Slow (2s)
119 | - Slower (3s)
120 | - Fast (800ms)
121 | - Faster (500ms)
122 |
123 | ```
124 |
125 |
Hello !
126 |
127 | ```
128 | Or just define your own time manualy with a `TimeSpan` like below :
129 |
130 | Example with custom time :
131 | ```
132 |
133 |
Hello !
134 |
135 | ```
136 | ### IterationCount
137 | the number of times the animation will be played. For an infinite loop, you can set a negative number.
138 |
139 | Example :
140 | ```
141 |
142 |
Hello !
143 |
144 | ```
145 | Exemple with infinite loop :
146 | ```
147 |
148 |
Hello !
149 |
150 | ```
151 |
152 | > Notice that an IterationCount defined to 0 do not play the animation.
153 |
154 | ### Enabled
155 | Provide a way to enable or disable animation by code. This can be useful for certain scenarios like animating based on events (mouse, keyboard, ...) or to react to actions in a flux architectural pattern.
156 |
157 | Example
158 | ```
159 |
160 |
9 | Swapping to Development environment will display more detailed information about the error that occurred.
10 |
11 |
12 | The Development environment shouldn't be enabled for deployed applications.
13 | It can result in displaying sensitive information from exceptions to end users.
14 | For local debugging, enable the Development environment by setting the ASPNETCORE_ENVIRONMENT environment variable to Development
15 | and restarting the app.
16 |
24 |
25 | An error has occurred. This application may no longer respond until reloaded.
26 |
27 |
28 | An unhandled exception has occurred. See browser dev tools for details.
29 |
30 | Reload
31 | 🗙
32 |
33 |
34 |
35 |
36 |
37 |
38 |
--------------------------------------------------------------------------------
/Sample/Program.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.IO;
4 | using System.Linq;
5 | using System.Threading.Tasks;
6 | using Microsoft.AspNetCore;
7 | using Microsoft.AspNetCore.Hosting;
8 | using Microsoft.Extensions.Configuration;
9 | using Microsoft.Extensions.Hosting;
10 | using Microsoft.Extensions.Logging;
11 |
12 | namespace Sample {
13 | public class Program {
14 | public static void Main(string[] args) {
15 | CreateHostBuilder(args).Build().Run();
16 | }
17 |
18 | public static IHostBuilder CreateHostBuilder(string[] args) =>
19 | Host.CreateDefaultBuilder(args)
20 | .ConfigureWebHostDefaults(webBuilder => {
21 | webBuilder.UseStartup();
22 | });
23 | }
24 | }
25 |
--------------------------------------------------------------------------------
/Sample/Properties/Annotations.cs:
--------------------------------------------------------------------------------
1 | /* MIT License
2 |
3 | Copyright (c) 2016 JetBrains http://www.jetbrains.com
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE. */
22 |
23 | using System;
24 | // ReSharper disable InheritdocConsiderUsage
25 |
26 | #pragma warning disable 1591
27 | // ReSharper disable UnusedMember.Global
28 | // ReSharper disable MemberCanBePrivate.Global
29 | // ReSharper disable UnusedAutoPropertyAccessor.Global
30 | // ReSharper disable IntroduceOptionalParameters.Global
31 | // ReSharper disable MemberCanBeProtected.Global
32 | // ReSharper disable InconsistentNaming
33 |
34 | namespace Sample.Annotations
35 | {
36 | ///
37 | /// Indicates that the value of the marked element could be null sometimes,
38 | /// so checking for null is required before its usage.
39 | ///
40 | ///
41 | /// [CanBeNull] object Test() => null;
42 | ///
43 | /// void UseTest() {
44 | /// var p = Test();
45 | /// var s = p.ToString(); // Warning: Possible 'System.NullReferenceException'
46 | /// }
47 | ///
48 | [AttributeUsage(
49 | AttributeTargets.Method | AttributeTargets.Parameter | AttributeTargets.Property |
50 | AttributeTargets.Delegate | AttributeTargets.Field | AttributeTargets.Event |
51 | AttributeTargets.Class | AttributeTargets.Interface | AttributeTargets.GenericParameter)]
52 | public sealed class CanBeNullAttribute : Attribute { }
53 |
54 | ///
55 | /// Indicates that the value of the marked element can never be null.
56 | ///
57 | ///
58 | /// [NotNull] object Foo() {
59 | /// return null; // Warning: Possible 'null' assignment
60 | /// }
61 | ///
62 | [AttributeUsage(
63 | AttributeTargets.Method | AttributeTargets.Parameter | AttributeTargets.Property |
64 | AttributeTargets.Delegate | AttributeTargets.Field | AttributeTargets.Event |
65 | AttributeTargets.Class | AttributeTargets.Interface | AttributeTargets.GenericParameter)]
66 | public sealed class NotNullAttribute : Attribute { }
67 |
68 | ///
69 | /// Can be applied to symbols of types derived from IEnumerable as well as to symbols of Task
70 | /// and Lazy classes to indicate that the value of a collection item, of the Task.Result property
71 | /// or of the Lazy.Value property can never be null.
72 | ///
73 | ///
74 | /// public void Foo([ItemNotNull]List<string> books)
75 | /// {
76 | /// foreach (var book in books) {
77 | /// if (book != null) // Warning: Expression is always true
78 | /// Console.WriteLine(book.ToUpper());
79 | /// }
80 | /// }
81 | ///
82 | [AttributeUsage(
83 | AttributeTargets.Method | AttributeTargets.Parameter | AttributeTargets.Property |
84 | AttributeTargets.Delegate | AttributeTargets.Field)]
85 | public sealed class ItemNotNullAttribute : Attribute { }
86 |
87 | ///
88 | /// Can be applied to symbols of types derived from IEnumerable as well as to symbols of Task
89 | /// and Lazy classes to indicate that the value of a collection item, of the Task.Result property
90 | /// or of the Lazy.Value property can be null.
91 | ///
92 | ///
93 | /// public void Foo([ItemCanBeNull]List<string> books)
94 | /// {
95 | /// foreach (var book in books)
96 | /// {
97 | /// // Warning: Possible 'System.NullReferenceException'
98 | /// Console.WriteLine(book.ToUpper());
99 | /// }
100 | /// }
101 | ///
102 | [AttributeUsage(
103 | AttributeTargets.Method | AttributeTargets.Parameter | AttributeTargets.Property |
104 | AttributeTargets.Delegate | AttributeTargets.Field)]
105 | public sealed class ItemCanBeNullAttribute : Attribute { }
106 |
107 | ///
108 | /// Indicates that the marked method builds string by the format pattern and (optional) arguments.
109 | /// The parameter, which contains the format string, should be given in constructor. The format string
110 | /// should be in -like form.
111 | ///
112 | ///
113 | /// [StringFormatMethod("message")]
114 | /// void ShowError(string message, params object[] args) { /* do something */ }
115 | ///
116 | /// void Foo() {
117 | /// ShowError("Failed: {0}"); // Warning: Non-existing argument in format string
118 | /// }
119 | ///
120 | [AttributeUsage(
121 | AttributeTargets.Constructor | AttributeTargets.Method |
122 | AttributeTargets.Property | AttributeTargets.Delegate)]
123 | public sealed class StringFormatMethodAttribute : Attribute
124 | {
125 | ///
126 | /// Specifies which parameter of an annotated method should be treated as the format string
127 | ///
128 | public StringFormatMethodAttribute([NotNull] string formatParameterName)
129 | {
130 | FormatParameterName = formatParameterName;
131 | }
132 |
133 | [NotNull] public string FormatParameterName { get; }
134 | }
135 |
136 | ///
137 | /// Use this annotation to specify a type that contains static or const fields
138 | /// with values for the annotated property/field/parameter.
139 | /// The specified type will be used to improve completion suggestions.
140 | ///
141 | ///
142 | /// namespace TestNamespace
143 | /// {
144 | /// public class Constants
145 | /// {
146 | /// public static int INT_CONST = 1;
147 | /// public const string STRING_CONST = "1";
148 | /// }
149 | ///
150 | /// public class Class1
151 | /// {
152 | /// [ValueProvider("TestNamespace.Constants")] public int myField;
153 | /// public void Foo([ValueProvider("TestNamespace.Constants")] string str) { }
154 | ///
155 | /// public void Test()
156 | /// {
157 | /// Foo(/*try completion here*/);//
158 | /// myField = /*try completion here*/
159 | /// }
160 | /// }
161 | /// }
162 | ///
163 | [AttributeUsage(
164 | AttributeTargets.Parameter | AttributeTargets.Property | AttributeTargets.Field,
165 | AllowMultiple = true)]
166 | public sealed class ValueProviderAttribute : Attribute
167 | {
168 | public ValueProviderAttribute([NotNull] string name)
169 | {
170 | Name = name;
171 | }
172 |
173 | [NotNull] public string Name { get; }
174 | }
175 |
176 | ///
177 | /// Indicates that the function argument should be a string literal and match one
178 | /// of the parameters of the caller function. For example, ReSharper annotates
179 | /// the parameter of .
180 | ///
181 | ///
182 | /// void Foo(string param) {
183 | /// if (param == null)
184 | /// throw new ArgumentNullException("par"); // Warning: Cannot resolve symbol
185 | /// }
186 | ///
187 | [AttributeUsage(AttributeTargets.Parameter)]
188 | public sealed class InvokerParameterNameAttribute : Attribute { }
189 |
190 | ///
191 | /// Indicates that the method is contained in a type that implements
192 | /// System.ComponentModel.INotifyPropertyChanged interface and this method
193 | /// is used to notify that some property value changed.
194 | ///
195 | ///
196 | /// The method should be non-static and conform to one of the supported signatures:
197 | ///
198 | /// NotifyChanged(string)
199 | /// NotifyChanged(params string[])
200 | /// NotifyChanged{T}(Expression{Func{T}})
201 | /// NotifyChanged{T,U}(Expression{Func{T,U}})
202 | /// SetProperty{T}(ref T, T, string)
203 | ///
204 | ///
205 | ///
206 | /// public class Foo : INotifyPropertyChanged {
207 | /// public event PropertyChangedEventHandler PropertyChanged;
208 | ///
209 | /// [NotifyPropertyChangedInvocator]
210 | /// protected virtual void NotifyChanged(string propertyName) { ... }
211 | ///
212 | /// string _name;
213 | ///
214 | /// public string Name {
215 | /// get { return _name; }
216 | /// set { _name = value; NotifyChanged("LastName"); /* Warning */ }
217 | /// }
218 | /// }
219 | ///
220 | /// Examples of generated notifications:
221 | ///
222 | /// NotifyChanged("Property")
223 | /// NotifyChanged(() => Property)
224 | /// NotifyChanged((VM x) => x.Property)
225 | /// SetProperty(ref myField, value, "Property")
226 | ///
227 | ///
228 | [AttributeUsage(AttributeTargets.Method)]
229 | public sealed class NotifyPropertyChangedInvocatorAttribute : Attribute
230 | {
231 | public NotifyPropertyChangedInvocatorAttribute() { }
232 | public NotifyPropertyChangedInvocatorAttribute([NotNull] string parameterName)
233 | {
234 | ParameterName = parameterName;
235 | }
236 |
237 | [CanBeNull] public string ParameterName { get; }
238 | }
239 |
240 | ///
241 | /// Describes dependency between method input and output.
242 | ///
243 | ///
244 | ///
Function Definition Table syntax:
245 | ///
246 | /// FDT ::= FDTRow [;FDTRow]*
247 | /// FDTRow ::= Input => Output | Output <= Input
248 | /// Input ::= ParameterName: Value [, Input]*
249 | /// Output ::= [ParameterName: Value]* {halt|stop|void|nothing|Value}
250 | /// Value ::= true | false | null | notnull | canbenull
251 | ///
252 | /// If the method has a single input parameter, its name could be omitted.
253 | /// Using halt (or void/nothing, which is the same) for the method output
254 | /// means that the method doesn't return normally (throws or terminates the process).
255 | /// Value canbenull is only applicable for output parameters.
256 | /// You can use multiple [ContractAnnotation] for each FDT row, or use single attribute
257 | /// with rows separated by semicolon. There is no notion of order rows, all rows are checked
258 | /// for applicability and applied per each program state tracked by the analysis engine.
259 | ///
260 | ///
261 | ///
262 | /// [ContractAnnotation("=> halt")]
263 | /// public void TerminationMethod()
264 | ///
265 | ///
266 | /// [ContractAnnotation("null <= param:null")] // reverse condition syntax
267 | /// public string GetName(string surname)
268 | ///
269 | ///
270 | /// [ContractAnnotation("s:null => true")]
271 | /// public bool IsNullOrEmpty(string s) // string.IsNullOrEmpty()
272 | ///
273 | ///
274 | /// // A method that returns null if the parameter is null,
275 | /// // and not null if the parameter is not null
276 | /// [ContractAnnotation("null => null; notnull => notnull")]
277 | /// public object Transform(object data)
278 | ///
279 | ///
280 | /// [ContractAnnotation("=> true, result: notnull; => false, result: null")]
281 | /// public bool TryParse(string s, out Person result)
282 | ///
283 | ///
284 | [AttributeUsage(AttributeTargets.Method, AllowMultiple = true)]
285 | public sealed class ContractAnnotationAttribute : Attribute
286 | {
287 | public ContractAnnotationAttribute([NotNull] string contract)
288 | : this(contract, false) { }
289 |
290 | public ContractAnnotationAttribute([NotNull] string contract, bool forceFullStates)
291 | {
292 | Contract = contract;
293 | ForceFullStates = forceFullStates;
294 | }
295 |
296 | [NotNull] public string Contract { get; }
297 |
298 | public bool ForceFullStates { get; }
299 | }
300 |
301 | ///
302 | /// Indicates whether the marked element should be localized.
303 | ///
304 | ///
305 | /// [LocalizationRequiredAttribute(true)]
306 | /// class Foo {
307 | /// string str = "my string"; // Warning: Localizable string
308 | /// }
309 | ///
310 | [AttributeUsage(AttributeTargets.All)]
311 | public sealed class LocalizationRequiredAttribute : Attribute
312 | {
313 | public LocalizationRequiredAttribute() : this(true) { }
314 |
315 | public LocalizationRequiredAttribute(bool required)
316 | {
317 | Required = required;
318 | }
319 |
320 | public bool Required { get; }
321 | }
322 |
323 | ///
324 | /// Indicates that the value of the marked type (or its derivatives)
325 | /// cannot be compared using '==' or '!=' operators and Equals()
326 | /// should be used instead. However, using '==' or '!=' for comparison
327 | /// with null is always permitted.
328 | ///
329 | ///
330 | /// [CannotApplyEqualityOperator]
331 | /// class NoEquality { }
332 | ///
333 | /// class UsesNoEquality {
334 | /// void Test() {
335 | /// var ca1 = new NoEquality();
336 | /// var ca2 = new NoEquality();
337 | /// if (ca1 != null) { // OK
338 | /// bool condition = ca1 == ca2; // Warning
339 | /// }
340 | /// }
341 | /// }
342 | ///
343 | [AttributeUsage(AttributeTargets.Interface | AttributeTargets.Class | AttributeTargets.Struct)]
344 | public sealed class CannotApplyEqualityOperatorAttribute : Attribute { }
345 |
346 | ///
347 | /// When applied to a target attribute, specifies a requirement for any type marked
348 | /// with the target attribute to implement or inherit specific type or types.
349 | ///
350 | ///
351 | /// [BaseTypeRequired(typeof(IComponent)] // Specify requirement
352 | /// class ComponentAttribute : Attribute { }
353 | ///
354 | /// [Component] // ComponentAttribute requires implementing IComponent interface
355 | /// class MyComponent : IComponent { }
356 | ///
357 | [AttributeUsage(AttributeTargets.Class, AllowMultiple = true)]
358 | [BaseTypeRequired(typeof(Attribute))]
359 | public sealed class BaseTypeRequiredAttribute : Attribute
360 | {
361 | public BaseTypeRequiredAttribute([NotNull] Type baseType)
362 | {
363 | BaseType = baseType;
364 | }
365 |
366 | [NotNull] public Type BaseType { get; }
367 | }
368 |
369 | ///
370 | /// Indicates that the marked symbol is used implicitly (e.g. via reflection, in external library),
371 | /// so this symbol will not be reported as unused (as well as by other usage inspections).
372 | ///
373 | [AttributeUsage(AttributeTargets.All, Inherited = false)]
374 | public sealed class UsedImplicitlyAttribute : Attribute
375 | {
376 | public UsedImplicitlyAttribute()
377 | : this(ImplicitUseKindFlags.Default, ImplicitUseTargetFlags.Default) { }
378 |
379 | public UsedImplicitlyAttribute(ImplicitUseKindFlags useKindFlags)
380 | : this(useKindFlags, ImplicitUseTargetFlags.Default) { }
381 |
382 | public UsedImplicitlyAttribute(ImplicitUseTargetFlags targetFlags)
383 | : this(ImplicitUseKindFlags.Default, targetFlags) { }
384 |
385 | public UsedImplicitlyAttribute(ImplicitUseKindFlags useKindFlags, ImplicitUseTargetFlags targetFlags)
386 | {
387 | UseKindFlags = useKindFlags;
388 | TargetFlags = targetFlags;
389 | }
390 |
391 | public ImplicitUseKindFlags UseKindFlags { get; }
392 |
393 | public ImplicitUseTargetFlags TargetFlags { get; }
394 | }
395 |
396 | ///
397 | /// Can be applied to attributes, type parameters, and parameters of a type assignable from .
398 | /// When applied to an attribute, the decorated attribute behaves the same as .
399 | /// When applied to a type parameter or to a parameter of type , indicates that the corresponding type
400 | /// is used implicitly.
401 | ///
402 | [AttributeUsage(AttributeTargets.Class | AttributeTargets.GenericParameter | AttributeTargets.Parameter)]
403 | public sealed class MeansImplicitUseAttribute : Attribute
404 | {
405 | public MeansImplicitUseAttribute()
406 | : this(ImplicitUseKindFlags.Default, ImplicitUseTargetFlags.Default) { }
407 |
408 | public MeansImplicitUseAttribute(ImplicitUseKindFlags useKindFlags)
409 | : this(useKindFlags, ImplicitUseTargetFlags.Default) { }
410 |
411 | public MeansImplicitUseAttribute(ImplicitUseTargetFlags targetFlags)
412 | : this(ImplicitUseKindFlags.Default, targetFlags) { }
413 |
414 | public MeansImplicitUseAttribute(ImplicitUseKindFlags useKindFlags, ImplicitUseTargetFlags targetFlags)
415 | {
416 | UseKindFlags = useKindFlags;
417 | TargetFlags = targetFlags;
418 | }
419 |
420 | [UsedImplicitly] public ImplicitUseKindFlags UseKindFlags { get; }
421 |
422 | [UsedImplicitly] public ImplicitUseTargetFlags TargetFlags { get; }
423 | }
424 |
425 | ///
426 | /// Specify the details of implicitly used symbol when it is marked
427 | /// with or .
428 | ///
429 | [Flags]
430 | public enum ImplicitUseKindFlags
431 | {
432 | Default = Access | Assign | InstantiatedWithFixedConstructorSignature,
433 | /// Only entity marked with attribute considered used.
434 | Access = 1,
435 | /// Indicates implicit assignment to a member.
436 | Assign = 2,
437 | ///
438 | /// Indicates implicit instantiation of a type with fixed constructor signature.
439 | /// That means any unused constructor parameters won't be reported as such.
440 | ///
441 | InstantiatedWithFixedConstructorSignature = 4,
442 | /// Indicates implicit instantiation of a type.
443 | InstantiatedNoFixedConstructorSignature = 8,
444 | }
445 |
446 | ///
447 | /// Specify what is considered to be used implicitly when marked
448 | /// with or .
449 | ///
450 | [Flags]
451 | public enum ImplicitUseTargetFlags
452 | {
453 | Default = Itself,
454 | Itself = 1,
455 | /// Members of entity marked with attribute are considered used.
456 | Members = 2,
457 | /// Entity marked with attribute and all its members considered used.
458 | WithMembers = Itself | Members
459 | }
460 |
461 | ///
462 | /// This attribute is intended to mark publicly available API
463 | /// which should not be removed and so is treated as used.
464 | ///
465 | [MeansImplicitUse(ImplicitUseTargetFlags.WithMembers)]
466 | [AttributeUsage(AttributeTargets.All, Inherited = false)]
467 | public sealed class PublicAPIAttribute : Attribute
468 | {
469 | public PublicAPIAttribute() { }
470 |
471 | public PublicAPIAttribute([NotNull] string comment)
472 | {
473 | Comment = comment;
474 | }
475 |
476 | [CanBeNull] public string Comment { get; }
477 | }
478 |
479 | ///
480 | /// Tells code analysis engine if the parameter is completely handled when the invoked method is on stack.
481 | /// If the parameter is a delegate, indicates that delegate is executed while the method is executed.
482 | /// If the parameter is an enumerable, indicates that it is enumerated while the method is executed.
483 | ///
484 | [AttributeUsage(AttributeTargets.Parameter)]
485 | public sealed class InstantHandleAttribute : Attribute { }
486 |
487 | ///
488 | /// Indicates that a method does not make any observable state changes.
489 | /// The same as System.Diagnostics.Contracts.PureAttribute.
490 | ///
491 | ///
492 | /// [Pure] int Multiply(int x, int y) => x * y;
493 | ///
494 | /// void M() {
495 | /// Multiply(123, 42); // Waring: Return value of pure method is not used
496 | /// }
497 | ///
498 | [AttributeUsage(AttributeTargets.Method)]
499 | public sealed class PureAttribute : Attribute { }
500 |
501 | ///
502 | /// Indicates that the return value of the method invocation must be used.
503 | ///
504 | ///
505 | /// Methods decorated with this attribute (in contrast to pure methods) might change state,
506 | /// but make no sense without using their return value.
507 | /// Similarly to , this attribute
508 | /// will help detecting usages of the method when the return value in not used.
509 | /// Additionally, you can optionally specify a custom message, which will be used when showing warnings, e.g.
510 | /// [MustUseReturnValue("Use the return value to...")].
511 | ///
512 | [AttributeUsage(AttributeTargets.Method)]
513 | public sealed class MustUseReturnValueAttribute : Attribute
514 | {
515 | public MustUseReturnValueAttribute() { }
516 |
517 | public MustUseReturnValueAttribute([NotNull] string justification)
518 | {
519 | Justification = justification;
520 | }
521 |
522 | [CanBeNull] public string Justification { get; }
523 | }
524 |
525 | ///
526 | /// Indicates the type member or parameter of some type, that should be used instead of all other ways
527 | /// to get the value of that type. This annotation is useful when you have some "context" value evaluated
528 | /// and stored somewhere, meaning that all other ways to get this value must be consolidated with existing one.
529 | ///
530 | ///
531 | /// class Foo {
532 | /// [ProvidesContext] IBarService _barService = ...;
533 | ///
534 | /// void ProcessNode(INode node) {
535 | /// DoSomething(node, node.GetGlobalServices().Bar);
536 | /// // ^ Warning: use value of '_barService' field
537 | /// }
538 | /// }
539 | ///
540 | [AttributeUsage(
541 | AttributeTargets.Field | AttributeTargets.Property | AttributeTargets.Parameter | AttributeTargets.Method |
542 | AttributeTargets.Class | AttributeTargets.Interface | AttributeTargets.Struct | AttributeTargets.GenericParameter)]
543 | public sealed class ProvidesContextAttribute : Attribute { }
544 |
545 | ///
546 | /// Indicates that a parameter is a path to a file or a folder within a web project.
547 | /// Path can be relative or absolute, starting from web root (~).
548 | ///
549 | [AttributeUsage(AttributeTargets.Parameter)]
550 | public sealed class PathReferenceAttribute : Attribute
551 | {
552 | public PathReferenceAttribute() { }
553 |
554 | public PathReferenceAttribute([NotNull, PathReference] string basePath)
555 | {
556 | BasePath = basePath;
557 | }
558 |
559 | [CanBeNull] public string BasePath { get; }
560 | }
561 |
562 | ///
563 | /// An extension method marked with this attribute is processed by code completion
564 | /// as a 'Source Template'. When the extension method is completed over some expression, its source code
565 | /// is automatically expanded like a template at call site.
566 | ///
567 | ///
568 | /// Template method body can contain valid source code and/or special comments starting with '$'.
569 | /// Text inside these comments is added as source code when the template is applied. Template parameters
570 | /// can be used either as additional method parameters or as identifiers wrapped in two '$' signs.
571 | /// Use the attribute to specify macros for parameters.
572 | ///
573 | ///
574 | /// In this example, the 'forEach' method is a source template available over all values
575 | /// of enumerable types, producing ordinary C# 'foreach' statement and placing caret inside block:
576 | ///
577 | /// [SourceTemplate]
578 | /// public static void forEach<T>(this IEnumerable<T> xs) {
579 | /// foreach (var x in xs) {
580 | /// //$ $END$
581 | /// }
582 | /// }
583 | ///
584 | ///
585 | [AttributeUsage(AttributeTargets.Method)]
586 | public sealed class SourceTemplateAttribute : Attribute { }
587 |
588 | ///
589 | /// Allows specifying a macro for a parameter of a source template.
590 | ///
591 | ///
592 | /// You can apply the attribute on the whole method or on any of its additional parameters. The macro expression
593 | /// is defined in the property. When applied on a method, the target
594 | /// template parameter is defined in the property. To apply the macro silently
595 | /// for the parameter, set the property value = -1.
596 | ///
597 | ///
598 | /// Applying the attribute on a source template method:
599 | ///
600 | /// [SourceTemplate, Macro(Target = "item", Expression = "suggestVariableName()")]
601 | /// public static void forEach<T>(this IEnumerable<T> collection) {
602 | /// foreach (var item in collection) {
603 | /// //$ $END$
604 | /// }
605 | /// }
606 | ///
607 | /// Applying the attribute on a template method parameter:
608 | ///
609 | /// [SourceTemplate]
610 | /// public static void something(this Entity x, [Macro(Expression = "guid()", Editable = -1)] string newguid) {
611 | /// /*$ var $x$Id = "$newguid$" + x.ToString();
612 | /// x.DoSomething($x$Id); */
613 | /// }
614 | ///
615 | ///
616 | [AttributeUsage(AttributeTargets.Parameter | AttributeTargets.Method, AllowMultiple = true)]
617 | public sealed class MacroAttribute : Attribute
618 | {
619 | ///
620 | /// Allows specifying a macro that will be executed for a source template
621 | /// parameter when the template is expanded.
622 | ///
623 | [CanBeNull] public string Expression { get; set; }
624 |
625 | ///
626 | /// Allows specifying which occurrence of the target parameter becomes editable when the template is deployed.
627 | ///
628 | ///
629 | /// If the target parameter is used several times in the template, only one occurrence becomes editable;
630 | /// other occurrences are changed synchronously. To specify the zero-based index of the editable occurrence,
631 | /// use values >= 0. To make the parameter non-editable when the template is expanded, use -1.
632 | ///
633 | public int Editable { get; set; }
634 |
635 | ///
636 | /// Identifies the target parameter of a source template if the
637 | /// is applied on a template method.
638 | ///
639 | [CanBeNull] public string Target { get; set; }
640 | }
641 |
642 | [AttributeUsage(AttributeTargets.Assembly | AttributeTargets.Field | AttributeTargets.Property, AllowMultiple = true)]
643 | public sealed class AspMvcAreaMasterLocationFormatAttribute : Attribute
644 | {
645 | public AspMvcAreaMasterLocationFormatAttribute([NotNull] string format)
646 | {
647 | Format = format;
648 | }
649 |
650 | [NotNull] public string Format { get; }
651 | }
652 |
653 | [AttributeUsage(AttributeTargets.Assembly | AttributeTargets.Field | AttributeTargets.Property, AllowMultiple = true)]
654 | public sealed class AspMvcAreaPartialViewLocationFormatAttribute : Attribute
655 | {
656 | public AspMvcAreaPartialViewLocationFormatAttribute([NotNull] string format)
657 | {
658 | Format = format;
659 | }
660 |
661 | [NotNull] public string Format { get; }
662 | }
663 |
664 | [AttributeUsage(AttributeTargets.Assembly | AttributeTargets.Field | AttributeTargets.Property, AllowMultiple = true)]
665 | public sealed class AspMvcAreaViewLocationFormatAttribute : Attribute
666 | {
667 | public AspMvcAreaViewLocationFormatAttribute([NotNull] string format)
668 | {
669 | Format = format;
670 | }
671 |
672 | [NotNull] public string Format { get; }
673 | }
674 |
675 | [AttributeUsage(AttributeTargets.Assembly | AttributeTargets.Field | AttributeTargets.Property, AllowMultiple = true)]
676 | public sealed class AspMvcMasterLocationFormatAttribute : Attribute
677 | {
678 | public AspMvcMasterLocationFormatAttribute([NotNull] string format)
679 | {
680 | Format = format;
681 | }
682 |
683 | [NotNull] public string Format { get; }
684 | }
685 |
686 | [AttributeUsage(AttributeTargets.Assembly | AttributeTargets.Field | AttributeTargets.Property, AllowMultiple = true)]
687 | public sealed class AspMvcPartialViewLocationFormatAttribute : Attribute
688 | {
689 | public AspMvcPartialViewLocationFormatAttribute([NotNull] string format)
690 | {
691 | Format = format;
692 | }
693 |
694 | [NotNull] public string Format { get; }
695 | }
696 |
697 | [AttributeUsage(AttributeTargets.Assembly | AttributeTargets.Field | AttributeTargets.Property, AllowMultiple = true)]
698 | public sealed class AspMvcViewLocationFormatAttribute : Attribute
699 | {
700 | public AspMvcViewLocationFormatAttribute([NotNull] string format)
701 | {
702 | Format = format;
703 | }
704 |
705 | [NotNull] public string Format { get; }
706 | }
707 |
708 | ///
709 | /// ASP.NET MVC attribute. If applied to a parameter, indicates that the parameter
710 | /// is an MVC action. If applied to a method, the MVC action name is calculated
711 | /// implicitly from the context. Use this attribute for custom wrappers similar to
712 | /// System.Web.Mvc.Html.ChildActionExtensions.RenderAction(HtmlHelper, String).
713 | ///
714 | [AttributeUsage(AttributeTargets.Parameter | AttributeTargets.Method | AttributeTargets.Field | AttributeTargets.Property)]
715 | public sealed class AspMvcActionAttribute : Attribute
716 | {
717 | public AspMvcActionAttribute() { }
718 |
719 | public AspMvcActionAttribute([NotNull] string anonymousProperty)
720 | {
721 | AnonymousProperty = anonymousProperty;
722 | }
723 |
724 | [CanBeNull] public string AnonymousProperty { get; }
725 | }
726 |
727 | ///
728 | /// ASP.NET MVC attribute. Indicates that the marked parameter is an MVC area.
729 | /// Use this attribute for custom wrappers similar to
730 | /// System.Web.Mvc.Html.ChildActionExtensions.RenderAction(HtmlHelper, String).
731 | ///
732 | [AttributeUsage(AttributeTargets.Parameter | AttributeTargets.Field | AttributeTargets.Property)]
733 | public sealed class AspMvcAreaAttribute : Attribute
734 | {
735 | public AspMvcAreaAttribute() { }
736 |
737 | public AspMvcAreaAttribute([NotNull] string anonymousProperty)
738 | {
739 | AnonymousProperty = anonymousProperty;
740 | }
741 |
742 | [CanBeNull] public string AnonymousProperty { get; }
743 | }
744 |
745 | ///
746 | /// ASP.NET MVC attribute. If applied to a parameter, indicates that the parameter is
747 | /// an MVC controller. If applied to a method, the MVC controller name is calculated
748 | /// implicitly from the context. Use this attribute for custom wrappers similar to
749 | /// System.Web.Mvc.Html.ChildActionExtensions.RenderAction(HtmlHelper, String, String).
750 | ///
751 | [AttributeUsage(AttributeTargets.Parameter | AttributeTargets.Method | AttributeTargets.Field | AttributeTargets.Property)]
752 | public sealed class AspMvcControllerAttribute : Attribute
753 | {
754 | public AspMvcControllerAttribute() { }
755 |
756 | public AspMvcControllerAttribute([NotNull] string anonymousProperty)
757 | {
758 | AnonymousProperty = anonymousProperty;
759 | }
760 |
761 | [CanBeNull] public string AnonymousProperty { get; }
762 | }
763 |
764 | ///
765 | /// ASP.NET MVC attribute. Indicates that the marked parameter is an MVC Master. Use this attribute
766 | /// for custom wrappers similar to System.Web.Mvc.Controller.View(String, String).
767 | ///
768 | [AttributeUsage(AttributeTargets.Parameter | AttributeTargets.Field | AttributeTargets.Property)]
769 | public sealed class AspMvcMasterAttribute : Attribute { }
770 |
771 | ///
772 | /// ASP.NET MVC attribute. Indicates that the marked parameter is an MVC model type. Use this attribute
773 | /// for custom wrappers similar to System.Web.Mvc.Controller.View(String, Object).
774 | ///
775 | [AttributeUsage(AttributeTargets.Parameter)]
776 | public sealed class AspMvcModelTypeAttribute : Attribute { }
777 |
778 | ///
779 | /// ASP.NET MVC attribute. If applied to a parameter, indicates that the parameter is an MVC
780 | /// partial view. If applied to a method, the MVC partial view name is calculated implicitly
781 | /// from the context. Use this attribute for custom wrappers similar to
782 | /// System.Web.Mvc.Html.RenderPartialExtensions.RenderPartial(HtmlHelper, String).
783 | ///
784 | [AttributeUsage(AttributeTargets.Parameter | AttributeTargets.Method | AttributeTargets.Field | AttributeTargets.Property)]
785 | public sealed class AspMvcPartialViewAttribute : Attribute { }
786 |
787 | ///
788 | /// ASP.NET MVC attribute. Allows disabling inspections for MVC views within a class or a method.
789 | ///
790 | [AttributeUsage(AttributeTargets.Class | AttributeTargets.Method)]
791 | public sealed class AspMvcSuppressViewErrorAttribute : Attribute { }
792 |
793 | ///
794 | /// ASP.NET MVC attribute. Indicates that a parameter is an MVC display template.
795 | /// Use this attribute for custom wrappers similar to
796 | /// System.Web.Mvc.Html.DisplayExtensions.DisplayForModel(HtmlHelper, String).
797 | ///
798 | [AttributeUsage(AttributeTargets.Parameter | AttributeTargets.Field | AttributeTargets.Property)]
799 | public sealed class AspMvcDisplayTemplateAttribute : Attribute { }
800 |
801 | ///
802 | /// ASP.NET MVC attribute. Indicates that the marked parameter is an MVC editor template.
803 | /// Use this attribute for custom wrappers similar to
804 | /// System.Web.Mvc.Html.EditorExtensions.EditorForModel(HtmlHelper, String).
805 | ///
806 | [AttributeUsage(AttributeTargets.Parameter | AttributeTargets.Field | AttributeTargets.Property)]
807 | public sealed class AspMvcEditorTemplateAttribute : Attribute { }
808 |
809 | ///
810 | /// ASP.NET MVC attribute. Indicates that the marked parameter is an MVC template.
811 | /// Use this attribute for custom wrappers similar to
812 | /// System.ComponentModel.DataAnnotations.UIHintAttribute(System.String).
813 | ///
814 | [AttributeUsage(AttributeTargets.Parameter | AttributeTargets.Field | AttributeTargets.Property)]
815 | public sealed class AspMvcTemplateAttribute : Attribute { }
816 |
817 | ///
818 | /// ASP.NET MVC attribute. If applied to a parameter, indicates that the parameter
819 | /// is an MVC view component. If applied to a method, the MVC view name is calculated implicitly
820 | /// from the context. Use this attribute for custom wrappers similar to
821 | /// System.Web.Mvc.Controller.View(Object).
822 | ///
823 | [AttributeUsage(AttributeTargets.Parameter | AttributeTargets.Method | AttributeTargets.Field | AttributeTargets.Property)]
824 | public sealed class AspMvcViewAttribute : Attribute { }
825 |
826 | ///
827 | /// ASP.NET MVC attribute. If applied to a parameter, indicates that the parameter
828 | /// is an MVC view component name.
829 | ///
830 | [AttributeUsage(AttributeTargets.Parameter | AttributeTargets.Field | AttributeTargets.Property)]
831 | public sealed class AspMvcViewComponentAttribute : Attribute { }
832 |
833 | ///
834 | /// ASP.NET MVC attribute. If applied to a parameter, indicates that the parameter
835 | /// is an MVC view component view. If applied to a method, the MVC view component view name is default.
836 | ///
837 | [AttributeUsage(AttributeTargets.Parameter | AttributeTargets.Method | AttributeTargets.Field | AttributeTargets.Property)]
838 | public sealed class AspMvcViewComponentViewAttribute : Attribute { }
839 |
840 | ///
841 | /// ASP.NET MVC attribute. When applied to a parameter of an attribute,
842 | /// indicates that this parameter is an MVC action name.
843 | ///
844 | ///
845 | /// [ActionName("Foo")]
846 | /// public ActionResult Login(string returnUrl) {
847 | /// ViewBag.ReturnUrl = Url.Action("Foo"); // OK
848 | /// return RedirectToAction("Bar"); // Error: Cannot resolve action
849 | /// }
850 | ///
851 | [AttributeUsage(AttributeTargets.Parameter | AttributeTargets.Property)]
852 | public sealed class AspMvcActionSelectorAttribute : Attribute { }
853 |
854 | [AttributeUsage(AttributeTargets.Parameter | AttributeTargets.Property | AttributeTargets.Field)]
855 | public sealed class HtmlElementAttributesAttribute : Attribute
856 | {
857 | public HtmlElementAttributesAttribute() { }
858 |
859 | public HtmlElementAttributesAttribute([NotNull] string name)
860 | {
861 | Name = name;
862 | }
863 |
864 | [CanBeNull] public string Name { get; }
865 | }
866 |
867 | [AttributeUsage(AttributeTargets.Parameter | AttributeTargets.Field | AttributeTargets.Property)]
868 | public sealed class HtmlAttributeValueAttribute : Attribute
869 | {
870 | public HtmlAttributeValueAttribute([NotNull] string name)
871 | {
872 | Name = name;
873 | }
874 |
875 | [NotNull] public string Name { get; }
876 | }
877 |
878 | ///
879 | /// Razor attribute. Indicates that the marked parameter or method is a Razor section.
880 | /// Use this attribute for custom wrappers similar to
881 | /// System.Web.WebPages.WebPageBase.RenderSection(String).
882 | ///
883 | [AttributeUsage(AttributeTargets.Parameter | AttributeTargets.Method)]
884 | public sealed class RazorSectionAttribute : Attribute { }
885 |
886 | ///
887 | /// Indicates how method, constructor invocation, or property access
888 | /// over collection type affects the contents of the collection.
889 | /// Use to specify the access type.
890 | ///
891 | ///
892 | /// Using this attribute only makes sense if all collection methods are marked with this attribute.
893 | ///
894 | ///
895 | /// public class MyStringCollection : List<string>
896 | /// {
897 | /// [CollectionAccess(CollectionAccessType.Read)]
898 | /// public string GetFirstString()
899 | /// {
900 | /// return this.ElementAt(0);
901 | /// }
902 | /// }
903 | /// class Test
904 | /// {
905 | /// public void Foo()
906 | /// {
907 | /// // Warning: Contents of the collection is never updated
908 | /// var col = new MyStringCollection();
909 | /// string x = col.GetFirstString();
910 | /// }
911 | /// }
912 | ///
913 | [AttributeUsage(AttributeTargets.Method | AttributeTargets.Constructor | AttributeTargets.Property)]
914 | public sealed class CollectionAccessAttribute : Attribute
915 | {
916 | public CollectionAccessAttribute(CollectionAccessType collectionAccessType)
917 | {
918 | CollectionAccessType = collectionAccessType;
919 | }
920 |
921 | public CollectionAccessType CollectionAccessType { get; }
922 | }
923 |
924 | ///
925 | /// Provides a value for the to define
926 | /// how the collection method invocation affects the contents of the collection.
927 | ///
928 | [Flags]
929 | public enum CollectionAccessType
930 | {
931 | /// Method does not use or modify content of the collection.
932 | None = 0,
933 | /// Method only reads content of the collection but does not modify it.
934 | Read = 1,
935 | /// Method can change content of the collection but does not add new elements.
936 | ModifyExistingContent = 2,
937 | /// Method can add new elements to the collection.
938 | UpdatedContent = ModifyExistingContent | 4
939 | }
940 |
941 | ///
942 | /// Indicates that the marked method is assertion method, i.e. it halts the control flow if
943 | /// one of the conditions is satisfied. To set the condition, mark one of the parameters with
944 | /// attribute.
945 | ///
946 | [AttributeUsage(AttributeTargets.Method)]
947 | public sealed class AssertionMethodAttribute : Attribute { }
948 |
949 | ///
950 | /// Indicates the condition parameter of the assertion method. The method itself should be
951 | /// marked by attribute. The mandatory argument of
952 | /// the attribute is the assertion type.
953 | ///
954 | [AttributeUsage(AttributeTargets.Parameter)]
955 | public sealed class AssertionConditionAttribute : Attribute
956 | {
957 | public AssertionConditionAttribute(AssertionConditionType conditionType)
958 | {
959 | ConditionType = conditionType;
960 | }
961 |
962 | public AssertionConditionType ConditionType { get; }
963 | }
964 |
965 | ///
966 | /// Specifies assertion type. If the assertion method argument satisfies the condition,
967 | /// then the execution continues. Otherwise, execution is assumed to be halted.
968 | ///
969 | public enum AssertionConditionType
970 | {
971 | /// Marked parameter should be evaluated to true.
972 | IS_TRUE = 0,
973 | /// Marked parameter should be evaluated to false.
974 | IS_FALSE = 1,
975 | /// Marked parameter should be evaluated to null value.
976 | IS_NULL = 2,
977 | /// Marked parameter should be evaluated to not null value.
978 | IS_NOT_NULL = 3,
979 | }
980 |
981 | ///
982 | /// Indicates that the marked method unconditionally terminates control flow execution.
983 | /// For example, it could unconditionally throw exception.
984 | ///
985 | [Obsolete("Use [ContractAnnotation('=> halt')] instead")]
986 | [AttributeUsage(AttributeTargets.Method)]
987 | public sealed class TerminatesProgramAttribute : Attribute { }
988 |
989 | ///
990 | /// Indicates that method is pure LINQ method, with postponed enumeration (like Enumerable.Select,
991 | /// .Where). This annotation allows inference of [InstantHandle] annotation for parameters
992 | /// of delegate type by analyzing LINQ method chains.
993 | ///
994 | [AttributeUsage(AttributeTargets.Method)]
995 | public sealed class LinqTunnelAttribute : Attribute { }
996 |
997 | ///
998 | /// Indicates that IEnumerable passed as a parameter is not enumerated.
999 | /// Use this annotation to suppress the 'Possible multiple enumeration of IEnumerable' inspection.
1000 | ///
1001 | ///
1002 | /// static void ThrowIfNull<T>([NoEnumeration] T v, string n) where T : class
1003 | /// {
1004 | /// // custom check for null but no enumeration
1005 | /// }
1006 | ///
1007 | /// void Foo(IEnumerable<string> values)
1008 | /// {
1009 | /// ThrowIfNull(values, nameof(values));
1010 | /// var x = values.ToList(); // No warnings about multiple enumeration
1011 | /// }
1012 | ///
1013 | [AttributeUsage(AttributeTargets.Parameter)]
1014 | public sealed class NoEnumerationAttribute : Attribute { }
1015 |
1016 | ///
1017 | /// Indicates that the marked parameter is a regular expression pattern.
1018 | ///
1019 | [AttributeUsage(AttributeTargets.Parameter)]
1020 | public sealed class RegexPatternAttribute : Attribute { }
1021 |
1022 | ///
1023 | /// Prevents the Member Reordering feature from tossing members of the marked class.
1024 | ///
1025 | ///
1026 | /// The attribute must be mentioned in your member reordering patterns.
1027 | ///
1028 | [AttributeUsage(
1029 | AttributeTargets.Class | AttributeTargets.Interface | AttributeTargets.Struct | AttributeTargets.Enum)]
1030 | public sealed class NoReorderAttribute : Attribute { }
1031 |
1032 | ///
1033 | /// XAML attribute. Indicates the type that has ItemsSource property and should be treated
1034 | /// as ItemsControl-derived type, to enable inner items DataContext type resolve.
1035 | ///
1036 | [AttributeUsage(AttributeTargets.Class)]
1037 | public sealed class XamlItemsControlAttribute : Attribute { }
1038 |
1039 | ///
1040 | /// XAML attribute. Indicates the property of some BindingBase-derived type, that
1041 | /// is used to bind some item of ItemsControl-derived type. This annotation will
1042 | /// enable the DataContext type resolve for XAML bindings for such properties.
1043 | ///
1044 | ///
1045 | /// Property should have the tree ancestor of the ItemsControl type or
1046 | /// marked with the attribute.
1047 | ///
1048 | [AttributeUsage(AttributeTargets.Property)]
1049 | public sealed class XamlItemBindingOfItemsControlAttribute : Attribute { }
1050 |
1051 | [AttributeUsage(AttributeTargets.Class, AllowMultiple = true)]
1052 | public sealed class AspChildControlTypeAttribute : Attribute
1053 | {
1054 | public AspChildControlTypeAttribute([NotNull] string tagName, [NotNull] Type controlType)
1055 | {
1056 | TagName = tagName;
1057 | ControlType = controlType;
1058 | }
1059 |
1060 | [NotNull] public string TagName { get; }
1061 |
1062 | [NotNull] public Type ControlType { get; }
1063 | }
1064 |
1065 | [AttributeUsage(AttributeTargets.Property | AttributeTargets.Method)]
1066 | public sealed class AspDataFieldAttribute : Attribute { }
1067 |
1068 | [AttributeUsage(AttributeTargets.Property | AttributeTargets.Method)]
1069 | public sealed class AspDataFieldsAttribute : Attribute { }
1070 |
1071 | [AttributeUsage(AttributeTargets.Property)]
1072 | public sealed class AspMethodPropertyAttribute : Attribute { }
1073 |
1074 | [AttributeUsage(AttributeTargets.Class, AllowMultiple = true)]
1075 | public sealed class AspRequiredAttributeAttribute : Attribute
1076 | {
1077 | public AspRequiredAttributeAttribute([NotNull] string attribute)
1078 | {
1079 | Attribute = attribute;
1080 | }
1081 |
1082 | [NotNull] public string Attribute { get; }
1083 | }
1084 |
1085 | [AttributeUsage(AttributeTargets.Property)]
1086 | public sealed class AspTypePropertyAttribute : Attribute
1087 | {
1088 | public bool CreateConstructorReferences { get; }
1089 |
1090 | public AspTypePropertyAttribute(bool createConstructorReferences)
1091 | {
1092 | CreateConstructorReferences = createConstructorReferences;
1093 | }
1094 | }
1095 |
1096 | [AttributeUsage(AttributeTargets.Assembly, AllowMultiple = true)]
1097 | public sealed class RazorImportNamespaceAttribute : Attribute
1098 | {
1099 | public RazorImportNamespaceAttribute([NotNull] string name)
1100 | {
1101 | Name = name;
1102 | }
1103 |
1104 | [NotNull] public string Name { get; }
1105 | }
1106 |
1107 | [AttributeUsage(AttributeTargets.Assembly, AllowMultiple = true)]
1108 | public sealed class RazorInjectionAttribute : Attribute
1109 | {
1110 | public RazorInjectionAttribute([NotNull] string type, [NotNull] string fieldName)
1111 | {
1112 | Type = type;
1113 | FieldName = fieldName;
1114 | }
1115 |
1116 | [NotNull] public string Type { get; }
1117 |
1118 | [NotNull] public string FieldName { get; }
1119 | }
1120 |
1121 | [AttributeUsage(AttributeTargets.Assembly, AllowMultiple = true)]
1122 | public sealed class RazorDirectiveAttribute : Attribute
1123 | {
1124 | public RazorDirectiveAttribute([NotNull] string directive)
1125 | {
1126 | Directive = directive;
1127 | }
1128 |
1129 | [NotNull] public string Directive { get; }
1130 | }
1131 |
1132 | [AttributeUsage(AttributeTargets.Assembly, AllowMultiple = true)]
1133 | public sealed class RazorPageBaseTypeAttribute : Attribute
1134 | {
1135 | public RazorPageBaseTypeAttribute([NotNull] string baseType)
1136 | {
1137 | BaseType = baseType;
1138 | }
1139 | public RazorPageBaseTypeAttribute([NotNull] string baseType, string pageName)
1140 | {
1141 | BaseType = baseType;
1142 | PageName = pageName;
1143 | }
1144 |
1145 | [NotNull] public string BaseType { get; }
1146 | [CanBeNull] public string PageName { get; }
1147 | }
1148 |
1149 | [AttributeUsage(AttributeTargets.Method)]
1150 | public sealed class RazorHelperCommonAttribute : Attribute { }
1151 |
1152 | [AttributeUsage(AttributeTargets.Property)]
1153 | public sealed class RazorLayoutAttribute : Attribute { }
1154 |
1155 | [AttributeUsage(AttributeTargets.Method)]
1156 | public sealed class RazorWriteLiteralMethodAttribute : Attribute { }
1157 |
1158 | [AttributeUsage(AttributeTargets.Method)]
1159 | public sealed class RazorWriteMethodAttribute : Attribute { }
1160 |
1161 | [AttributeUsage(AttributeTargets.Parameter)]
1162 | public sealed class RazorWriteMethodParameterAttribute : Attribute { }
1163 | }
--------------------------------------------------------------------------------
/Sample/Properties/PublishProfiles/FolderProfile.pubxml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
8 | FileSystem
9 | FileSystem
10 | Release
11 | Any CPU
12 |
13 | True
14 | False
15 | 8f5ea6b9-a262-4536-af82-6ffc9048ee98
16 | bin\Release\netcoreapp3.1\publish\
17 | False
18 |
19 |
--------------------------------------------------------------------------------
/Sample/Properties/launchSettings.json:
--------------------------------------------------------------------------------
1 | {
2 | "iisSettings": {
3 | "windowsAuthentication": false,
4 | "anonymousAuthentication": true,
5 | "iisExpress": {
6 | "applicationUrl": "http://localhost:60357",
7 | "sslPort": 44341
8 | }
9 | },
10 | "profiles": {
11 | "IIS Express": {
12 | "commandName": "IISExpress",
13 | "launchBrowser": true,
14 | "environmentVariables": {
15 | "ASPNETCORE_ENVIRONMENT": "Development"
16 | }
17 | },
18 | "Sample": {
19 | "commandName": "Project",
20 | "launchBrowser": true,
21 | "applicationUrl": "https://localhost:5001;http://localhost:5000",
22 | "environmentVariables": {
23 | "ASPNETCORE_ENVIRONMENT": "Development"
24 | }
25 | }
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/Sample/Sample.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | netcoreapp3.1
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/Sample/Shared/MainLayout.razor:
--------------------------------------------------------------------------------
1 | @inherits LayoutComponentBase
2 |
3 |
27 |
28 | @code {
29 | private bool collapseNavMenu = true;
30 |
31 | private string NavMenuCssClass => collapseNavMenu ? "collapse" : null;
32 |
33 | private void ToggleNavMenu()
34 | {
35 | collapseNavMenu = !collapseNavMenu;
36 | }
37 | }
38 |
--------------------------------------------------------------------------------
/Sample/Startup.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Threading.Tasks;
5 | using BlazorAnimation;
6 | using Microsoft.AspNetCore.Builder;
7 | using Microsoft.AspNetCore.Components;
8 | using Microsoft.AspNetCore.Hosting;
9 | using Microsoft.AspNetCore.HttpsPolicy;
10 | using Microsoft.Extensions.Configuration;
11 | using Microsoft.Extensions.DependencyInjection;
12 | using Microsoft.Extensions.Hosting;
13 | using Sample.Data;
14 |
15 | namespace Sample {
16 | public class Startup {
17 | public Startup(IConfiguration configuration) {
18 | Configuration = configuration;
19 | }
20 |
21 | public IConfiguration Configuration { get; }
22 |
23 | // This method gets called by the runtime. Use this method to add services to the container.
24 | // For more information on how to configure your application, visit https://go.microsoft.com/fwlink/?LinkID=398940
25 | public void ConfigureServices(IServiceCollection services) {
26 | services.AddRazorPages();
27 | services.AddServerSideBlazor();
28 | services.AddSingleton();
29 | services.Configure("fast", o => {
30 | o.Speed = Speed.Faster;
31 | o.Delay = Delay.None;
32 | });
33 | }
34 |
35 | // This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
36 | public void Configure(IApplicationBuilder app, IWebHostEnvironment env) {
37 | if (env.IsDevelopment()) {
38 | app.UseDeveloperExceptionPage();
39 | }
40 | else {
41 | app.UseExceptionHandler("/Error");
42 | // The default HSTS value is 30 days. You may want to change this for production scenarios, see https://aka.ms/aspnetcore-hsts.
43 | app.UseHsts();
44 | }
45 |
46 | app.UseHttpsRedirection();
47 | app.UseStaticFiles();
48 |
49 | app.UseRouting();
50 |
51 | app.UseEndpoints(endpoints => {
52 | endpoints.MapBlazorHub();
53 | endpoints.MapFallbackToPage("/_Host");
54 | });
55 | }
56 | }
57 | }
58 |
--------------------------------------------------------------------------------
/Sample/_Imports.razor:
--------------------------------------------------------------------------------
1 | @using System.Net.Http
2 | @using Microsoft.AspNetCore.Authorization
3 | @using Microsoft.AspNetCore.Components.Authorization
4 | @using Microsoft.AspNetCore.Components.Forms
5 | @using Microsoft.AspNetCore.Components.Routing
6 | @using Microsoft.AspNetCore.Components.Web
7 | @using Microsoft.JSInterop
8 | @using Sample
9 | @using Sample.Shared
10 | @using BlazorAnimation;
11 |
--------------------------------------------------------------------------------
/Sample/appsettings.Development.json:
--------------------------------------------------------------------------------
1 | {
2 | "DetailedErrors": true,
3 | "Logging": {
4 | "LogLevel": {
5 | "Default": "Information",
6 | "Microsoft": "Warning",
7 | "Microsoft.Hosting.Lifetime": "Information"
8 | }
9 | }
10 | }
11 |
--------------------------------------------------------------------------------
/Sample/appsettings.json:
--------------------------------------------------------------------------------
1 | {
2 | "Logging": {
3 | "LogLevel": {
4 | "Default": "Information",
5 | "Microsoft": "Warning",
6 | "Microsoft.Hosting.Lifetime": "Information"
7 | }
8 | },
9 | "AllowedHosts": "*"
10 | }
11 |
--------------------------------------------------------------------------------
/Sample/wwwroot/css/open-iconic/FONT-LICENSE:
--------------------------------------------------------------------------------
1 | SIL OPEN FONT LICENSE Version 1.1
2 |
3 | Copyright (c) 2014 Waybury
4 |
5 | PREAMBLE
6 | The goals of the Open Font License (OFL) are to stimulate worldwide
7 | development of collaborative font projects, to support the font creation
8 | efforts of academic and linguistic communities, and to provide a free and
9 | open framework in which fonts may be shared and improved in partnership
10 | with others.
11 |
12 | The OFL allows the licensed fonts to be used, studied, modified and
13 | redistributed freely as long as they are not sold by themselves. The
14 | fonts, including any derivative works, can be bundled, embedded,
15 | redistributed and/or sold with any software provided that any reserved
16 | names are not used by derivative works. The fonts and derivatives,
17 | however, cannot be released under any other type of license. The
18 | requirement for fonts to remain under this license does not apply
19 | to any document created using the fonts or their derivatives.
20 |
21 | DEFINITIONS
22 | "Font Software" refers to the set of files released by the Copyright
23 | Holder(s) under this license and clearly marked as such. This may
24 | include source files, build scripts and documentation.
25 |
26 | "Reserved Font Name" refers to any names specified as such after the
27 | copyright statement(s).
28 |
29 | "Original Version" refers to the collection of Font Software components as
30 | distributed by the Copyright Holder(s).
31 |
32 | "Modified Version" refers to any derivative made by adding to, deleting,
33 | or substituting -- in part or in whole -- any of the components of the
34 | Original Version, by changing formats or by porting the Font Software to a
35 | new environment.
36 |
37 | "Author" refers to any designer, engineer, programmer, technical
38 | writer or other person who contributed to the Font Software.
39 |
40 | PERMISSION & CONDITIONS
41 | Permission is hereby granted, free of charge, to any person obtaining
42 | a copy of the Font Software, to use, study, copy, merge, embed, modify,
43 | redistribute, and sell modified and unmodified copies of the Font
44 | Software, subject to the following conditions:
45 |
46 | 1) Neither the Font Software nor any of its individual components,
47 | in Original or Modified Versions, may be sold by itself.
48 |
49 | 2) Original or Modified Versions of the Font Software may be bundled,
50 | redistributed and/or sold with any software, provided that each copy
51 | contains the above copyright notice and this license. These can be
52 | included either as stand-alone text files, human-readable headers or
53 | in the appropriate machine-readable metadata fields within text or
54 | binary files as long as those fields can be easily viewed by the user.
55 |
56 | 3) No Modified Version of the Font Software may use the Reserved Font
57 | Name(s) unless explicit written permission is granted by the corresponding
58 | Copyright Holder. This restriction only applies to the primary font name as
59 | presented to the users.
60 |
61 | 4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font
62 | Software shall not be used to promote, endorse or advertise any
63 | Modified Version, except to acknowledge the contribution(s) of the
64 | Copyright Holder(s) and the Author(s) or with their explicit written
65 | permission.
66 |
67 | 5) The Font Software, modified or unmodified, in part or in whole,
68 | must be distributed entirely under this license, and must not be
69 | distributed under any other license. The requirement for fonts to
70 | remain under this license does not apply to any document created
71 | using the Font Software.
72 |
73 | TERMINATION
74 | This license becomes null and void if any of the above conditions are
75 | not met.
76 |
77 | DISCLAIMER
78 | THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
79 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
80 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
81 | OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE
82 | COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
83 | INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
84 | DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
85 | FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM
86 | OTHER DEALINGS IN THE FONT SOFTWARE.
87 |
--------------------------------------------------------------------------------
/Sample/wwwroot/css/open-iconic/ICON-LICENSE:
--------------------------------------------------------------------------------
1 | The MIT License (MIT)
2 |
3 | Copyright (c) 2014 Waybury
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in
13 | all copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21 | THE SOFTWARE.
--------------------------------------------------------------------------------
/Sample/wwwroot/css/open-iconic/README.md:
--------------------------------------------------------------------------------
1 | [Open Iconic v1.1.1](http://useiconic.com/open)
2 | ===========
3 |
4 | ### Open Iconic is the open source sibling of [Iconic](http://useiconic.com). It is a hyper-legible collection of 223 icons with a tiny footprint—ready to use with Bootstrap and Foundation. [View the collection](http://useiconic.com/open#icons)
5 |
6 |
7 |
8 | ## What's in Open Iconic?
9 |
10 | * 223 icons designed to be legible down to 8 pixels
11 | * Super-light SVG files - 61.8 for the entire set
12 | * SVG sprite—the modern replacement for icon fonts
13 | * Webfont (EOT, OTF, SVG, TTF, WOFF), PNG and WebP formats
14 | * Webfont stylesheets (including versions for Bootstrap and Foundation) in CSS, LESS, SCSS and Stylus formats
15 | * PNG and WebP raster images in 8px, 16px, 24px, 32px, 48px and 64px.
16 |
17 |
18 | ## Getting Started
19 |
20 | #### For code samples and everything else you need to get started with Open Iconic, check out our [Icons](http://useiconic.com/open#icons) and [Reference](http://useiconic.com/open#reference) sections.
21 |
22 | ### General Usage
23 |
24 | #### Using Open Iconic's SVGs
25 |
26 | We like SVGs and we think they're the way to display icons on the web. Since Open Iconic are just basic SVGs, we suggest you display them like you would any other image (don't forget the `alt` attribute).
27 |
28 | ```
29 |
30 | ```
31 |
32 | #### Using Open Iconic's SVG Sprite
33 |
34 | Open Iconic also comes in a SVG sprite which allows you to display all the icons in the set with a single request. It's like an icon font, without being a hack.
35 |
36 | Adding an icon from an SVG sprite is a little different than what you're used to, but it's still a piece of cake. *Tip: To make your icons easily style able, we suggest adding a general class to the* `