Skip to content

Commit b25d1e8

Browse files
Merge pull request xmedius#1 from lpperras/master
Async suffix on methods and .gitignore for VS.
2 parents 9c05932 + 1c40953 commit b25d1e8

File tree

8 files changed

+361
-86
lines changed

8 files changed

+361
-86
lines changed

.gitignore

Lines changed: 275 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,275 @@
1+
## Ignore Visual Studio temporary files, build results, and
2+
## files generated by popular Visual Studio add-ons.
3+
##
4+
## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore
5+
6+
# User-specific files
7+
*.suo
8+
*.user
9+
*.userosscache
10+
*.sln.docstates
11+
*.vcxproj.filters
12+
13+
# User-specific files (MonoDevelop/Xamarin Studio)
14+
*.userprefs
15+
16+
# Build results
17+
[Dd]ebug/
18+
[Dd]ebugPublic/
19+
[Rr]elease/
20+
[Rr]eleases/
21+
x64/
22+
x86/
23+
bld/
24+
[Bb]in/
25+
[Oo]bj/
26+
[Ll]og/
27+
28+
# Visual Studio 2015 cache/options directory
29+
.vs/
30+
# Uncomment if you have tasks that create the project's static files in wwwroot
31+
#wwwroot/
32+
33+
# MSTest test Results
34+
[Tt]est[Rr]esult*/
35+
[Bb]uild[Ll]og.*
36+
37+
# NUNIT
38+
*.VisualState.xml
39+
TestResult.xml
40+
41+
# Build Results of an ATL Project
42+
[Dd]ebugPS/
43+
[Rr]eleasePS/
44+
dlldata.c
45+
46+
# .NET Core
47+
project.lock.json
48+
project.fragment.lock.json
49+
artifacts/
50+
**/Properties/launchSettings.json
51+
52+
*_i.c
53+
*_p.c
54+
*_i.h
55+
*.ilk
56+
*.meta
57+
*.obj
58+
*.pch
59+
*.pdb
60+
*.pgc
61+
*.pgd
62+
*.rsp
63+
*.sbr
64+
*.tlb
65+
*.tli
66+
*.tlh
67+
*.tmp
68+
*.tmp_proj
69+
*.log
70+
*.vspscc
71+
*.vssscc
72+
.builds
73+
*.pidb
74+
*.svclog
75+
*.scc
76+
77+
# Chutzpah Test files
78+
_Chutzpah*
79+
80+
# Visual C++ cache files
81+
ipch/
82+
*.aps
83+
*.ncb
84+
*.opendb
85+
*.opensdf
86+
*.sdf
87+
*.cachefile
88+
*.VC.db
89+
*.VC.VC.opendb
90+
91+
# Visual Studio profiler
92+
*.psess
93+
*.vsp
94+
*.vspx
95+
*.sap
96+
97+
# TFS 2012 Local Workspace
98+
$tf/
99+
100+
# Guidance Automation Toolkit
101+
*.gpState
102+
103+
# ReSharper is a .NET coding add-in
104+
_ReSharper*/
105+
*.[Rr]e[Ss]harper
106+
*.DotSettings.user
107+
108+
# JustCode is a .NET coding add-in
109+
.JustCode
110+
111+
# TeamCity is a build add-in
112+
_TeamCity*
113+
114+
# DotCover is a Code Coverage Tool
115+
*.dotCover
116+
117+
# Visual Studio code coverage results
118+
*.coverage
119+
*.coveragexml
120+
121+
# NCrunch
122+
_NCrunch_*
123+
.*crunch*.local.xml
124+
nCrunchTemp_*
125+
126+
# MightyMoose
127+
*.mm.*
128+
AutoTest.Net/
129+
130+
# Web workbench (sass)
131+
.sass-cache/
132+
133+
# Installshield output folder
134+
[Ee]xpress/
135+
136+
# DocProject is a documentation generator add-in
137+
DocProject/buildhelp/
138+
DocProject/Help/*.HxT
139+
DocProject/Help/*.HxC
140+
DocProject/Help/*.hhc
141+
DocProject/Help/*.hhk
142+
DocProject/Help/*.hhp
143+
DocProject/Help/Html2
144+
DocProject/Help/html
145+
146+
# Click-Once directory
147+
publish/
148+
149+
# Publish Web Output
150+
*.[Pp]ublish.xml
151+
*.azurePubxml
152+
# TODO: Comment the next line if you want to checkin your web deploy settings
153+
# but database connection strings (with potential passwords) will be unencrypted
154+
*.pubxml
155+
*.publishproj
156+
157+
# Microsoft Azure Web App publish settings. Comment the next line if you want to
158+
# checkin your Azure Web App publish settings, but sensitive information contained
159+
# in these scripts will be unencrypted
160+
PublishScripts/
161+
162+
# NuGet Packages
163+
*.nupkg
164+
# The packages folder can be ignored because of Package Restore
165+
**/packages/*
166+
# except build/, which is used as an MSBuild target.
167+
!**/packages/build/
168+
# Uncomment if necessary however generally it will be regenerated when needed
169+
#!**/packages/repositories.config
170+
# NuGet v3's project.json files produces more ignoreable files
171+
*.nuget.props
172+
*.nuget.targets
173+
174+
# Microsoft Azure Build Output
175+
csx/
176+
*.build.csdef
177+
178+
# Microsoft Azure Emulator
179+
ecf/
180+
rcf/
181+
182+
# Windows Store app package directories and files
183+
AppPackages/
184+
BundleArtifacts/
185+
Package.StoreAssociation.xml
186+
_pkginfo.txt
187+
188+
# Visual Studio cache files
189+
# files ending in .cache can be ignored
190+
*.[Cc]ache
191+
# but keep track of directories ending in .cache
192+
!*.[Cc]ache/
193+
194+
# Others
195+
ClientBin/
196+
~$*
197+
*~
198+
*.dbmdl
199+
*.dbproj.schemaview
200+
*.jfm
201+
*.pfx
202+
*.publishsettings
203+
node_modules/
204+
orleans.codegen.cs
205+
206+
# Since there are multiple workflows, uncomment next line to ignore bower_components
207+
# (https://github.com/github/gitignore/pull/1529#issuecomment-104372622)
208+
#bower_components/
209+
210+
# RIA/Silverlight projects
211+
Generated_Code/
212+
213+
# Backup & report files from converting an old project file
214+
# to a newer Visual Studio version. Backup files are not needed,
215+
# because we have git ;-)
216+
_UpgradeReport_Files/
217+
Backup*/
218+
UpgradeLog*.XML
219+
UpgradeLog*.htm
220+
221+
# SQL Server files
222+
*.mdf
223+
*.ldf
224+
225+
# Business Intelligence projects
226+
*.rdl.data
227+
*.bim.layout
228+
*.bim_*.settings
229+
230+
# Microsoft Fakes
231+
FakesAssemblies/
232+
233+
# GhostDoc plugin setting file
234+
*.GhostDoc.xml
235+
236+
# Node.js Tools for Visual Studio
237+
.ntvs_analysis.dat
238+
239+
# Visual Studio 6 build log
240+
*.plg
241+
242+
# Visual Studio 6 workspace options file
243+
*.opt
244+
245+
# Visual Studio 6 auto-generated workspace file (contains which files were open etc.)
246+
*.vbw
247+
248+
# Visual Studio LightSwitch build output
249+
**/*.HTMLClient/GeneratedArtifacts
250+
**/*.DesktopClient/GeneratedArtifacts
251+
**/*.DesktopClient/ModelManifest.xml
252+
**/*.Server/GeneratedArtifacts
253+
**/*.Server/ModelManifest.xml
254+
_Pvt_Extensions
255+
256+
# Paket dependency manager
257+
.paket/paket.exe
258+
paket-files/
259+
260+
# FAKE - F# Make
261+
.fake/
262+
263+
# JetBrains Rider
264+
.idea/
265+
*.sln.iml
266+
267+
# CodeRush
268+
.cr/
269+
270+
# Python Tools for Visual Studio (PTVS)
271+
__pycache__/
272+
*.pyc
273+
274+
# Cake - Uncomment if you are using it
275+
# tools/

README.md

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ namespace SendSecureClient
6565
{
6666
try
6767
{
68-
string token = GetUserToken().Result;
68+
string token = GetUserTokenAsync().GetAwaiter().GetResult();
6969
}
7070
catch (XMedius.SendSecure.Exceptions.SendSecureException e)
7171
{
@@ -77,9 +77,9 @@ namespace SendSecureClient
7777
}
7878
}
7979

80-
public static async Task<string> GetUserToken()
80+
public static async Task<string> GetUserTokenAsync()
8181
{
82-
string token = await XMedius.SendSecure.Client.GetUserToken("deathstar", "darthvader", "d@Rk$1De", "DV-TIE/x1", "TIE Advanced x1", "The Force App", new Uri("https://portal.xmedius.com"));
82+
string token = await XMedius.SendSecure.Client.GetUserTokenAsync("deathstar", "darthvader", "d@Rk$1De", "DV-TIE/x1", "TIE Advanced x1", "The Force App", new Uri("https://portal.xmedius.com"));
8383

8484
Console.WriteLine(token);
8585
return token;
@@ -112,7 +112,7 @@ namespace SendSecureClient
112112
{
113113
string token = "USER|1d495165-4953-4457-8b5b-4fcf801e621a";
114114

115-
string previewUrl = SubmitSafebox(token).GetAwaiter().GetResult();
115+
string previewUrl = SubmitSafeboxAsync(token).GetAwaiter().GetResult();
116116
}
117117
catch (XMedius.SendSecure.Exceptions.SendSecureException e)
118118
{
@@ -124,7 +124,7 @@ namespace SendSecureClient
124124
}
125125
}
126126

127-
public static async Task<string> SubmitSafebox(string token)
127+
public static async Task<string> SubmitSafeboxAsync(string token)
128128
{
129129
var safebox2 = new XMedius.SendSecure.Helpers.Safebox("[email protected]");
130130
safebox2.Subject = "Family matters";
@@ -138,7 +138,7 @@ namespace SendSecureClient
138138
safebox2.Recipients.Add(recipient);
139139

140140
XMedius.SendSecure.Client client = new Client(token, "deathstar", new Uri("https://portal.xmedius.com"));
141-
XMedius.SendSecure.Helpers.SafeboxResponse safeboxResponse = await client.SubmitSafebox(safebox2);
141+
XMedius.SendSecure.Helpers.SafeboxResponse safeboxResponse = await client.SubmitSafeboxAsync(safebox2);
142142

143143
Console.WriteLine(safeboxResponse.PreviewUrl);
144144
return safeboxResponse.PreviewUrl;
@@ -154,7 +154,7 @@ namespace SendSecureClient
154154

155155
### Get User Token
156156
```
157-
GetUserToken(enterpriseAccount, username, password, deviceId, deviceName, applicationType, endpoint, oneTimePassword, cancellationToken)
157+
GetUserTokenAsync(enterpriseAccount, username, password, deviceId, deviceName, applicationType, endpoint, oneTimePassword, cancellationToken)
158158
```
159159
Creates and returns an API Token for a specific user within a SendSecure enterprise account.
160160
Calling this method again with the exact same params will always return the same Token.
@@ -185,7 +185,7 @@ locale | String | The locale in which the server errors will be retur
185185

186186
### Get Enterprise Settings
187187
```
188-
EnterpriseSettings(cancellationToken)
188+
EnterpriseSettingsAsync(cancellationToken)
189189
```
190190
Returns all values/properties of the enterprise account's settings specific to SendSecure.
191191

@@ -195,7 +195,7 @@ cancellationToken | CancellationToken | A cancellation token that can be used by
195195

196196
### Get Default Security Profile
197197
```
198-
DefaultSecurityProfile(userEmail, cancellationToken)
198+
DefaultSecurityProfileAsync(userEmail, cancellationToken)
199199
```
200200
Returns the default security profile (if it has been set) for a specific user, with all its setting values/properties.
201201

@@ -206,7 +206,7 @@ cancellationToken | CancellationToken | A cancellation token that can be used by
206206

207207
### Get Security Profiles
208208
```
209-
SecurityProfiles(userEmail, cancellationToken)
209+
SecurityProfilesAsync(userEmail, cancellationToken)
210210
```
211211
Returns the list of all security profiles available to a specific user, with all their setting values/properties.
212212

@@ -217,7 +217,7 @@ cancellationToken | CancellationToken | A cancellation token that can be used by
217217

218218
### Initialize SafeBox
219219
```
220-
InitializeSafebox(safebox, cancellationToken)
220+
InitializeSafeboxAsync(safebox, cancellationToken)
221221
```
222222
Pre-creates a SafeBox on the SendSecure system and returns the updated Safebox object with the necessary system parameters filled out (GUID, public encryption key, upload URL).
223223

@@ -228,7 +228,7 @@ cancellationToken | CancellationToken | A cancellation token that can be used by
228228

229229
### Upload Attachment
230230
```
231-
UploadAttachment(safebox, attachment, cancellationToken)
231+
UploadAttachmentAsync(safebox, attachment, cancellationToken)
232232
```
233233
Uploads the specified file as an Attachment of the specified SafeBox and returns the updated Attachment object with the GUID parameter filled out.
234234

@@ -240,7 +240,7 @@ cancellationToken | CancellationToken | A cancellation token that can be used by
240240

241241
### Commit SafeBox
242242
```
243-
CommitSafebox(safebox, cancellationToken)
243+
CommitSafeboxAsync(safebox, cancellationToken)
244244
```
245245
Finalizes the creation (commit) of the SafeBox on the SendSecure system.
246246
This actually "Sends" the SafeBox with all content and contact info previously specified.
@@ -252,7 +252,7 @@ cancellationToken | CancellationToken | A cancellation token that can be used by
252252

253253
### Submit SafeBox
254254
```
255-
SubmitSafebox(safebox, cancellationToken)
255+
SubmitSafeboxAsync(safebox, cancellationToken)
256256
```
257257
This method is a high-level combo that initializes the SafeBox, uploads all attachments and commits the SafeBox.
258258

0 commit comments

Comments
 (0)