-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #15 from manojkulkarni30/dev
Sample project is added
- Loading branch information
Showing
226 changed files
with
57,397 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,16 +2,91 @@ | |
|
||
A simple [.Net standard library](https://docs.microsoft.com/en-us/dotnet/articles/standard/library) to easily get profile picture, QR code image for profile and profile information for a user from [Gravatar](http://en.gravatar.com/). | ||
|
||
#### Build Status: | ||
|
||
## Setup | ||
- Available on Nuget: https://www.nuget.org/packages/GravatarHelper.NetStandard/1.0.0-beta | ||
- To use this library in Xamarin.Forms application, install the [GravatarHelper.NetStandard](https://www.nuget.org/packages/GravatarHelper.NetStandard/1.0.0-beta) nuget package in portable class library and [PCLCrypto](https://www.nuget.org/packages/PCLCrypto/) package in each client project (e.g Android, iOS and UWP). | ||
|
||
## Build Status | ||
|
||
![App Veyor](https://ci.appveyor.com/api/projects/status/9gwwfn9lb0bxq846?svg=true) | ||
[![MyGet CI](https://img.shields.io/myget/manojkulkarni30/v/GravatarHelper.NetStandard.svg)](http://myget.org/gallery/manojkulkarni30) | ||
[![NuGet](https://img.shields.io/nuget/v/GravatarHelper.NetStandard.svg)](https://www.nuget.org/packages/GravatarHelper.NetStandard/) | ||
|
||
#### Setup | ||
## Supported Platform | ||
- .NetFramework 3.5 | ||
- .NetFramework 4 | ||
- .NetFramework 4.5 | ||
- .NetFramework 4.5.1 | ||
- .NetFramework 4.5.2 | ||
- .NetFramework 4.6 | ||
- .NetFramework 4.6.1 | ||
- .NetFramework 4.6.2 | ||
- .NetStandard 1.3 | ||
- Portable Class Library (.NETFramework 4.5, Windows 8.0, WindowsPhone 8.0, WindowsPhoneApp 8.1)- Profile 259 | ||
|
||
## How To Get Gravatar Image URL ? | ||
|
||
To get gravatar image url for email address "[[email protected]](mailto:[email protected])", use the following syntax in web application. | ||
|
||
```html | ||
|
||
<!--Returns Gravatar image url over http--> | ||
<img src='@Gravatar.GetGravatarImageUrl("[email protected]")'/> | ||
|
||
``` | ||
To get image url over https use following syntax | ||
```html | ||
|
||
<!--Returns Gravatar image url over https--> | ||
<img src='@Gravatar.GetSecureGravatarImageUrl("[email protected]")'/> | ||
|
||
``` | ||
There are different overload methods available where you can specify different parameters like image size, file extension, rating, gravatar default image type etc. | ||
|
||
## How To Get the QR Code Image For Gravatar Profile ? | ||
|
||
To get the QR code image for email address "[[email protected]](mailto:[email protected])", use the following syntax in web application | ||
|
||
```html | ||
|
||
<img src='@Gravatar.GetGravatarProfileQrCodeImage("[email protected]")'/> | ||
|
||
``` | ||
|
||
## How To Get The Gravatar Profile Information ? | ||
|
||
To get the gravatar profile information for a user using email address "[[email protected]](mailto:[email protected])", use the following syntax. | ||
|
||
```csharp | ||
|
||
// Available only for .Net Framework 4.5 and above | ||
await Gravatar.GetGravatarProfileInformationAsync("[email protected]"); | ||
|
||
// For .Net Framework 3.5 and 4.0 | ||
GetGravatarProfileInformation("[email protected]"); | ||
|
||
``` | ||
Above method will return an object of type ```OperationResult```. | ||
|
||
```csharp | ||
|
||
public class OperationResult | ||
{ | ||
public bool Success { get; set; } | ||
|
||
public ProfileInformation Profile { get; set; } | ||
|
||
public string Error { get; set; } | ||
} | ||
|
||
``` | ||
If request for profile information is successful, then ```Success``` property will be set to true and ```Profile``` object will contain the profile information. | ||
|
||
If request for profile information failed, then ```Success``` property will be set to false, ```Profile``` object will be ```null``` and ```Error``` property will contain the error message. | ||
|
||
- Pre-release version of this package is available for download on [nuget](https://www.nuget.org/packages/GravatarHelper.NetStandard/1.0.0-beta). | ||
**Note: Profile requests will only resolve for the primary email address** | ||
|
||
#### License | ||
## License | ||
|
||
[Apache 2.0](https://github.com/manojkulkarni30/GravatarHelper.NetStandard/blob/master/License.txt) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"directory": "wwwroot/lib" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> | ||
<PropertyGroup> | ||
<VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">14.0</VisualStudioVersion> | ||
<VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath> | ||
</PropertyGroup> | ||
<Import Project="$(VSToolsPath)\DotNet\Microsoft.DotNet.Props" Condition="'$(VSToolsPath)' != ''" /> | ||
<PropertyGroup Label="Globals"> | ||
<ProjectGuid>01c10cb7-59ef-4b71-8656-978193ac8cf6</ProjectGuid> | ||
<RootNamespace>AspNetCoreApp</RootNamespace> | ||
<BaseIntermediateOutputPath Condition="'$(BaseIntermediateOutputPath)'=='' ">.\obj</BaseIntermediateOutputPath> | ||
<OutputPath Condition="'$(OutputPath)'=='' ">.\bin\</OutputPath> | ||
<TargetFrameworkVersion>v4.5.2</TargetFrameworkVersion> | ||
</PropertyGroup> | ||
<PropertyGroup> | ||
<SchemaVersion>2.0</SchemaVersion> | ||
</PropertyGroup> | ||
<ItemGroup> | ||
<DnxInvisibleContent Include="bower.json" /> | ||
<DnxInvisibleContent Include=".bowerrc" /> | ||
</ItemGroup> | ||
<Import Project="$(VSToolsPath)\DotNet.Web\Microsoft.DotNet.Web.targets" Condition="'$(VSToolsPath)' != ''" /> | ||
</Project> |
17 changes: 17 additions & 0 deletions
17
samples/AspNetCore/AspNetCoreApp/Controllers/HomeController.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
using Microsoft.AspNetCore.Mvc; | ||
|
||
namespace AspNetCoreApp.Controllers | ||
{ | ||
public class HomeController : Controller | ||
{ | ||
public IActionResult Index() | ||
{ | ||
return View(); | ||
} | ||
|
||
public IActionResult Error() | ||
{ | ||
return View(); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.IO; | ||
using System.Linq; | ||
using System.Threading.Tasks; | ||
using Microsoft.AspNetCore.Hosting; | ||
|
||
namespace AspNetCoreApp | ||
{ | ||
public class Program | ||
{ | ||
public static void Main(string[] args) | ||
{ | ||
var host = new WebHostBuilder() | ||
.UseKestrel() | ||
.UseContentRoot(Directory.GetCurrentDirectory()) | ||
.UseIISIntegration() | ||
.UseStartup<Startup>() | ||
.Build(); | ||
|
||
host.Run(); | ||
} | ||
} | ||
} |
Oops, something went wrong.