├── assemblies ├── Thrift.dll ├── CsQuery.dll ├── Evernote.dll ├── EvernoteSDK.dll ├── EvernoteSDK.tlb ├── PreMailer.Net.dll ├── SgmlReaderDll.dll ├── en-html2enml.dll └── EvernoteOAuthNet.dll ├── samples ├── VBA │ ├── ExcelSample.xlsm │ └── ExcelSampleAdvanced.xlsm ├── CS │ ├── SampleApp │ │ ├── SampleApp │ │ │ ├── SampleApp.csproj.user │ │ │ ├── Properties │ │ │ │ ├── Settings.settings │ │ │ │ ├── Settings.Designer.cs │ │ │ │ ├── AssemblyInfo.cs │ │ │ │ ├── Resources.Designer.cs │ │ │ │ └── Resources.resx │ │ │ ├── Program.cs │ │ │ ├── Form1.Designer.cs │ │ │ ├── SampleApp.csproj │ │ │ └── Form1.resx │ │ └── SampleApp.sln │ └── SampleAppAdvanced │ │ ├── SampleAppAdvanced │ │ ├── SampleAppAdvanced.csproj.user │ │ ├── Properties │ │ │ └── AssemblyInfo.cs │ │ ├── Program.cs │ │ └── SampleAppAdvanced.csproj │ │ └── SampleAppAdvanced.sln └── VB.NET │ ├── SampleAppAdvanced │ ├── SampleAppAdvanced │ │ ├── SampleAppAdvanced.vbproj.user │ │ ├── My Project │ │ │ ├── Settings.settings │ │ │ ├── Application.Designer.vb │ │ │ ├── Application.myapp │ │ │ ├── AssemblyInfo.vb │ │ │ ├── Resources.Designer.vb │ │ │ ├── Settings.Designer.vb │ │ │ └── Resources.resx │ │ ├── Module1.vb │ │ └── SampleAppAdvanced.vbproj │ └── SampleAppAdvanced.sln │ └── SampleApp │ ├── SampleApp │ ├── SampleApp.vbproj.user │ ├── My Project │ │ ├── Settings.settings │ │ ├── Application.myapp │ │ ├── AssemblyInfo.vb │ │ ├── Application.Designer.vb │ │ ├── Resources.Designer.vb │ │ ├── Settings.Designer.vb │ │ └── Resources.resx │ ├── Form1.Designer.vb │ ├── Form1.vb │ └── Form1.resx │ └── SampleApp.sln ├── COM Setup └── EvernoteSDK_COMSetup.msi ├── nuget └── evernote-cloud-sdk-windows.1.0.8.nupkg ├── src ├── EvernoteSDK │ ├── Support Assemblies │ │ ├── Thrift.dll │ │ ├── Evernote.dll │ │ ├── PreMailer.Net.dll │ │ └── SgmlReaderDll.dll │ ├── Private │ │ ├── Supporting Files │ │ │ ├── en-html2enml.dll │ │ │ └── XSL Source │ │ │ │ └── en-html2enml.xslt │ │ ├── ValidationError.cs │ │ ├── ENHTMLNoteContent.cs │ │ ├── ENBusinessNoteStoreClient.cs │ │ ├── ENLinkedNoteStoreClient.cs │ │ ├── ENPlaintextNoteContent.cs │ │ ├── String_ENScrubbing.cs │ │ ├── ENCredentialStore.cs │ │ ├── ENLinkedNotebookRef.cs │ │ ├── ENShareUrlHelper.cs │ │ ├── ENAuthCache.cs │ │ └── ENCredentials.cs │ ├── Advanced │ │ ├── Utilities │ │ │ ├── ENMLWriter │ │ │ │ ├── ENMLWriterCOM.cs │ │ │ │ ├── ENEncryptedContentInfo.cs │ │ │ │ └── String_EDAMNullAdditions.cs │ │ │ ├── ENMLConstants.cs │ │ │ ├── ByteArray_EvernoteSDK.cs │ │ │ ├── TimeConversions_EvernoteSDK.cs │ │ │ ├── ENRegistry.cs │ │ │ └── CipherUtility.cs │ │ ├── EdamTag.cs │ │ ├── EdamNote.cs │ │ └── ENPreferencesStore.cs │ ├── Properties │ │ ├── Settings.settings │ │ ├── Application.Designer.cs │ │ ├── Application.myapp │ │ ├── Settings.Designer.cs │ │ ├── AssemblyInfo.cs │ │ ├── Resources.Designer.cs │ │ └── Resources.resx │ ├── ENNoteSearchForCOM.cs │ ├── ENNoteContentForCOM.cs │ ├── ENConstants.cs │ ├── ENSessionForCOM.cs │ ├── EvernoteSDK.csproj.user │ ├── ENSDKLogger.cs │ ├── ENNoteContent.cs │ ├── ENNoteSearch.cs │ ├── ENNoteRef.cs │ └── ENResource.cs ├── Evernote OAuth │ ├── AuthSample │ │ ├── AuthSample │ │ │ ├── EvernoteOAuthNet.dll │ │ │ ├── app.config │ │ │ ├── Properties │ │ │ │ ├── Settings.settings │ │ │ │ ├── Settings.Designer.cs │ │ │ │ ├── AssemblyInfo.cs │ │ │ │ ├── Resources.Designer.cs │ │ │ │ └── Resources.resx │ │ │ ├── Program.cs │ │ │ └── AuthSample.csproj │ │ └── AuthSample.sln │ └── EvernoteOAuthNet │ │ ├── EvernoteOAuthNet │ │ ├── Evernote.ico │ │ ├── Properties │ │ │ ├── Settings.settings │ │ │ ├── Settings.Designer.cs │ │ │ ├── AssemblyInfo.cs │ │ │ ├── Resources.Designer.cs │ │ │ └── Resources.resx │ │ ├── LoginForm.cs │ │ ├── LoginForm.Designer.cs │ │ └── EvernoteOAuth.cs │ │ └── EvernoteOAuthNet.sln └── Evernote-SDK-Windows.sln ├── README.md ├── .gitattributes └── .gitignore /assemblies/Thrift.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Evernote/evernote-cloud-sdk-windows/HEAD/assemblies/Thrift.dll -------------------------------------------------------------------------------- /assemblies/CsQuery.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Evernote/evernote-cloud-sdk-windows/HEAD/assemblies/CsQuery.dll -------------------------------------------------------------------------------- /assemblies/Evernote.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Evernote/evernote-cloud-sdk-windows/HEAD/assemblies/Evernote.dll -------------------------------------------------------------------------------- /assemblies/EvernoteSDK.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Evernote/evernote-cloud-sdk-windows/HEAD/assemblies/EvernoteSDK.dll -------------------------------------------------------------------------------- /assemblies/EvernoteSDK.tlb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Evernote/evernote-cloud-sdk-windows/HEAD/assemblies/EvernoteSDK.tlb -------------------------------------------------------------------------------- /assemblies/PreMailer.Net.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Evernote/evernote-cloud-sdk-windows/HEAD/assemblies/PreMailer.Net.dll -------------------------------------------------------------------------------- /assemblies/SgmlReaderDll.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Evernote/evernote-cloud-sdk-windows/HEAD/assemblies/SgmlReaderDll.dll -------------------------------------------------------------------------------- /assemblies/en-html2enml.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Evernote/evernote-cloud-sdk-windows/HEAD/assemblies/en-html2enml.dll -------------------------------------------------------------------------------- /samples/VBA/ExcelSample.xlsm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Evernote/evernote-cloud-sdk-windows/HEAD/samples/VBA/ExcelSample.xlsm -------------------------------------------------------------------------------- /assemblies/EvernoteOAuthNet.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Evernote/evernote-cloud-sdk-windows/HEAD/assemblies/EvernoteOAuthNet.dll -------------------------------------------------------------------------------- /COM Setup/EvernoteSDK_COMSetup.msi: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Evernote/evernote-cloud-sdk-windows/HEAD/COM Setup/EvernoteSDK_COMSetup.msi -------------------------------------------------------------------------------- /samples/VBA/ExcelSampleAdvanced.xlsm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Evernote/evernote-cloud-sdk-windows/HEAD/samples/VBA/ExcelSampleAdvanced.xlsm -------------------------------------------------------------------------------- /nuget/evernote-cloud-sdk-windows.1.0.8.nupkg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Evernote/evernote-cloud-sdk-windows/HEAD/nuget/evernote-cloud-sdk-windows.1.0.8.nupkg -------------------------------------------------------------------------------- /src/EvernoteSDK/Support Assemblies/Thrift.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Evernote/evernote-cloud-sdk-windows/HEAD/src/EvernoteSDK/Support Assemblies/Thrift.dll -------------------------------------------------------------------------------- /src/EvernoteSDK/Support Assemblies/Evernote.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Evernote/evernote-cloud-sdk-windows/HEAD/src/EvernoteSDK/Support Assemblies/Evernote.dll -------------------------------------------------------------------------------- /src/EvernoteSDK/Support Assemblies/PreMailer.Net.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Evernote/evernote-cloud-sdk-windows/HEAD/src/EvernoteSDK/Support Assemblies/PreMailer.Net.dll -------------------------------------------------------------------------------- /src/EvernoteSDK/Support Assemblies/SgmlReaderDll.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Evernote/evernote-cloud-sdk-windows/HEAD/src/EvernoteSDK/Support Assemblies/SgmlReaderDll.dll -------------------------------------------------------------------------------- /src/EvernoteSDK/Private/Supporting Files/en-html2enml.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Evernote/evernote-cloud-sdk-windows/HEAD/src/EvernoteSDK/Private/Supporting Files/en-html2enml.dll -------------------------------------------------------------------------------- /src/Evernote OAuth/AuthSample/AuthSample/EvernoteOAuthNet.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Evernote/evernote-cloud-sdk-windows/HEAD/src/Evernote OAuth/AuthSample/AuthSample/EvernoteOAuthNet.dll -------------------------------------------------------------------------------- /samples/CS/SampleApp/SampleApp/SampleApp.csproj.user: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /src/Evernote OAuth/EvernoteOAuthNet/EvernoteOAuthNet/Evernote.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Evernote/evernote-cloud-sdk-windows/HEAD/src/Evernote OAuth/EvernoteOAuthNet/EvernoteOAuthNet/Evernote.ico -------------------------------------------------------------------------------- /src/Evernote OAuth/AuthSample/AuthSample/app.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /src/EvernoteSDK/Private/Supporting Files/XSL Source/en-html2enml.xslt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Evernote/evernote-cloud-sdk-windows/HEAD/src/EvernoteSDK/Private/Supporting Files/XSL Source/en-html2enml.xslt -------------------------------------------------------------------------------- /samples/CS/SampleAppAdvanced/SampleAppAdvanced/SampleAppAdvanced.csproj.user: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /samples/VB.NET/SampleAppAdvanced/SampleAppAdvanced/SampleAppAdvanced.vbproj.user: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /samples/VB.NET/SampleApp/SampleApp/SampleApp.vbproj.user: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | ShowAllFiles 5 | 6 | -------------------------------------------------------------------------------- /src/Evernote OAuth/EvernoteOAuthNet/EvernoteOAuthNet/Properties/Settings.settings: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /src/EvernoteSDK/Advanced/Utilities/ENMLWriter/ENMLWriterCOM.cs: -------------------------------------------------------------------------------- 1 | 2 | namespace EvernoteSDK 3 | { 4 | namespace Advanced 5 | { 6 | 7 | public class ENMLWriterCOM 8 | { 9 | 10 | public string EmptyNote() 11 | { 12 | return ENMLWriter.EmptyNote(); 13 | } 14 | 15 | } 16 | 17 | } 18 | 19 | } -------------------------------------------------------------------------------- /samples/CS/SampleApp/SampleApp/Properties/Settings.settings: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /src/Evernote OAuth/AuthSample/AuthSample/Properties/Settings.settings: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /src/EvernoteSDK/Properties/Settings.settings: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /src/EvernoteSDK/Advanced/EdamTag.cs: -------------------------------------------------------------------------------- 1 | 2 | namespace EvernoteSDK.Advanced 3 | { 4 | public class EdamTag 5 | { 6 | public string Guid { get; set; } 7 | public string Name { get; set; } 8 | public string ParentGuid { get; set; } 9 | public int UpdateSequenceNum { get; set; } 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /samples/VB.NET/SampleApp/SampleApp/My Project/Settings.settings: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /samples/VB.NET/SampleAppAdvanced/SampleAppAdvanced/My Project/Settings.settings: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /src/EvernoteSDK/ENNoteSearchForCOM.cs: -------------------------------------------------------------------------------- 1 | 2 | namespace EvernoteSDK 3 | { 4 | public class ENNoteSearchForCOM 5 | { 6 | 7 | public ENNoteSearch NoteSearch(string searchString) 8 | { 9 | return ENNoteSearch.NoteSearch(searchString); 10 | } 11 | 12 | public ENNoteSearch NoteSearchCreatedByThisApplication() 13 | { 14 | return ENNoteSearch.NoteSearchCreatedByThisApplication(); 15 | } 16 | 17 | } 18 | 19 | } -------------------------------------------------------------------------------- /src/EvernoteSDK/Advanced/Utilities/ENMLWriter/ENEncryptedContentInfo.cs: -------------------------------------------------------------------------------- 1 | 2 | namespace EvernoteSDK 3 | { 4 | public class ENEncryptedContentInfo 5 | { 6 | 7 | public string Hint {get; set;} 8 | public string Cipher {get; set;} 9 | public int KeyLength {get; set;} 10 | public string CipherText {get; set;} 11 | 12 | public ENEncryptedContentInfo() 13 | { 14 | Cipher = "RC2"; 15 | KeyLength = 64; 16 | } 17 | 18 | } 19 | 20 | } -------------------------------------------------------------------------------- /src/EvernoteSDK/ENNoteContentForCOM.cs: -------------------------------------------------------------------------------- 1 | 2 | namespace EvernoteSDK 3 | { 4 | public class ENNoteContentForCOM 5 | { 6 | 7 | public ENNoteContent NoteContentWithString(string contentString) 8 | { 9 | return ENNoteContent.NoteContentWithString(contentString); 10 | } 11 | 12 | public ENNoteContent NoteContentWithSanitizedHTML(string html) 13 | { 14 | return ENNoteContent.NoteContentWithSanitizedHTML(html); 15 | } 16 | 17 | } 18 | 19 | } -------------------------------------------------------------------------------- /src/EvernoteSDK/Private/ValidationError.cs: -------------------------------------------------------------------------------- 1 | 2 | namespace EvernoteSDK 3 | { 4 | public class ValidationError 5 | { 6 | 7 | public string Message {get; set;} 8 | public int LineNumber {get; set;} 9 | public int LinePosition {get; set;} 10 | 11 | public ValidationError(string errMessage, int errLineNumber, int errLinePosition) 12 | { 13 | Message = errMessage; 14 | LineNumber = errLineNumber; 15 | LinePosition = errLinePosition; 16 | } 17 | 18 | } 19 | 20 | } -------------------------------------------------------------------------------- /src/EvernoteSDK/Properties/Application.Designer.cs: -------------------------------------------------------------------------------- 1 | 2 | //------------------------------------------------------------------------------ 3 | // 4 | // This code was generated by a tool. 5 | // Runtime Version:4.0.30319.18444 6 | // 7 | // Changes to this file may cause incorrect behavior and will be lost if 8 | // the code is regenerated. 9 | // 10 | //------------------------------------------------------------------------------ 11 | 12 | 13 | -------------------------------------------------------------------------------- /src/EvernoteSDK/Properties/Application.myapp: -------------------------------------------------------------------------------- 1 | 2 | 3 | false 4 | false 5 | 0 6 | true 7 | 0 8 | 1 9 | true 10 | 11 | -------------------------------------------------------------------------------- /samples/VB.NET/SampleAppAdvanced/SampleAppAdvanced/My Project/Application.Designer.vb: -------------------------------------------------------------------------------- 1 | '------------------------------------------------------------------------------ 2 | ' 3 | ' This code was generated by a tool. 4 | ' Runtime Version:4.0.30319.18444 5 | ' 6 | ' Changes to this file may cause incorrect behavior and will be lost if 7 | ' the code is regenerated. 8 | ' 9 | '------------------------------------------------------------------------------ 10 | 11 | Option Strict On 12 | Option Explicit On 13 | 14 | -------------------------------------------------------------------------------- /samples/VB.NET/SampleAppAdvanced/SampleAppAdvanced/My Project/Application.myapp: -------------------------------------------------------------------------------- 1 | 2 | 3 | false 4 | false 5 | 0 6 | true 7 | 0 8 | 2 9 | true 10 | 11 | -------------------------------------------------------------------------------- /samples/VB.NET/SampleApp/SampleApp/My Project/Application.myapp: -------------------------------------------------------------------------------- 1 | 2 | 3 | true 4 | Form1 5 | false 6 | 0 7 | true 8 | 0 9 | 0 10 | true 11 | 12 | -------------------------------------------------------------------------------- /src/EvernoteSDK/Private/ENHTMLNoteContent.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | 3 | namespace EvernoteSDK 4 | { 5 | public class ENHTMLNoteContent : ENNoteContent 6 | { 7 | private string _html {get; set;} 8 | 9 | public ENHTMLNoteContent(string html) 10 | { 11 | _html = html; 12 | } 13 | 14 | internal override string EnmlWithResources(List resources) 15 | { 16 | // Doesn't handle resources (yet?) 17 | var converter = new ENHTMLtoENMLConverter(); 18 | string enml = converter.ENMLFromHTMLContent(_html); 19 | return enml; 20 | } 21 | 22 | } 23 | 24 | } -------------------------------------------------------------------------------- /samples/CS/SampleApp/SampleApp/Program.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Windows.Forms; 5 | 6 | namespace SampleApp 7 | { 8 | static class Program 9 | { 10 | /// 11 | /// The main entry point for the application. 12 | /// 13 | [STAThread] 14 | static void Main() 15 | { 16 | Application.EnableVisualStyles(); 17 | Application.SetCompatibleTextRenderingDefault(false); 18 | Application.Run(new Form1()); 19 | } 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /src/EvernoteSDK/Advanced/Utilities/ENMLWriter/String_EDAMNullAdditions.cs: -------------------------------------------------------------------------------- 1 | 2 | 3 | namespace EvernoteSDK 4 | { 5 | namespace Advanced 6 | { 7 | internal static class String_EDAMNullAdditions 8 | { 9 | // Extension methods on 'string' to deal with Evernote API data. 10 | 11 | public static bool EnIsEqualToStringWithEmptyEqualToNull(this string s, string stringToCompare) 12 | { 13 | if (string.IsNullOrEmpty(s)) 14 | { 15 | return string.IsNullOrEmpty(stringToCompare); 16 | } 17 | else 18 | { 19 | return string.Equals(s, stringToCompare); 20 | } 21 | } 22 | 23 | } 24 | } 25 | 26 | } -------------------------------------------------------------------------------- /src/EvernoteSDK/Advanced/Utilities/ENMLConstants.cs: -------------------------------------------------------------------------------- 1 | 2 | namespace EvernoteSDK 3 | { 4 | internal static class ENMLConstants 5 | { 6 | internal const string ENMLTagCrypt = "en-crypt"; 7 | internal const string ENMLTagTodo = "en-todo"; 8 | internal const string ENMLTagNote = "en-note"; 9 | internal const string ENHTMLClassIgnore = "en-ignore"; 10 | internal const string ENHTMLClassAttachment = "en-attachment"; 11 | internal const string ENHTMLAttributeMime = "x-evernote-mime"; 12 | internal const string ENMIMETypeOctetStream = "application/octet-stream"; 13 | internal const string ENMLTagMedia = "en-media"; 14 | } 15 | 16 | } -------------------------------------------------------------------------------- /src/EvernoteSDK/ENConstants.cs: -------------------------------------------------------------------------------- 1 | 2 | namespace EvernoteSDK 3 | { 4 | internal static class ENConstants 5 | { 6 | private const string ENSessionHostSandbox = "sandbox.evernote.com"; 7 | private const string ENSessionHostProduction = "www.evernote.com"; 8 | private const string ENSessionDidAuthenticateNotification = "ENSessionDidAuthenticateNotification"; 9 | private const string ENSessionDidUnauthenticateNotification = "ENSessionDidUnauthenticateNotification"; 10 | 11 | internal const string ENBootstrapProfileNameInternational = "Evernote"; 12 | internal const string ENBootstrapProfileNameChina = "Evernote-China"; 13 | } 14 | 15 | } -------------------------------------------------------------------------------- /src/EvernoteSDK/Advanced/Utilities/ByteArray_EvernoteSDK.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Security.Cryptography; 3 | 4 | namespace EvernoteSDK 5 | { 6 | namespace Advanced 7 | { 8 | internal static class ByteArray_EvernoteSDK 9 | { 10 | // Extension methods on 'byte array' to deal with Evernote API data. 11 | 12 | // Compute and return the byte array's MD5 hash. 13 | public static byte[] Enmd5(this byte[] bytes) 14 | { 15 | MD5 md5Hash = MD5.Create(); 16 | return md5Hash.ComputeHash(bytes); 17 | } 18 | 19 | public static string EnlowercaseHexDigits(this byte[] bytes) 20 | { 21 | return BitConverter.ToString(bytes).Replace("-", "").ToLower(); 22 | } 23 | 24 | } 25 | } 26 | 27 | } -------------------------------------------------------------------------------- /src/EvernoteSDK/ENSessionForCOM.cs: -------------------------------------------------------------------------------- 1 | 2 | namespace EvernoteSDK 3 | { 4 | public class ENSessionForCOM 5 | { 6 | 7 | public void SetSharedSessionConsumerKey(string sessionConsumerKey, string sessionConsumerSecret, string sessionHost = null) 8 | { 9 | ENSession.SetSharedSessionConsumerKey(sessionConsumerKey, sessionConsumerSecret, sessionHost); 10 | } 11 | 12 | public void SetSharedSessionDeveloperToken(string sessionDeveloperToken, string sessionNoteStoreUrl) 13 | { 14 | ENSession.SetSharedSessionDeveloperToken(sessionDeveloperToken, sessionNoteStoreUrl); 15 | } 16 | 17 | public ENSession SharedSession() 18 | { 19 | return ENSession.SharedSession; 20 | } 21 | 22 | } 23 | 24 | } -------------------------------------------------------------------------------- /src/EvernoteSDK/EvernoteSDK.csproj.user: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | ShowAllFiles 5 | 6 | 7 | Project 8 | 9 | 10 | 11 | 12 | 13 | 14 | Project 15 | 16 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /src/EvernoteSDK/Private/ENBusinessNoteStoreClient.cs: -------------------------------------------------------------------------------- 1 | 2 | using EvernoteSDK.Advanced; 3 | 4 | namespace EvernoteSDK 5 | { 6 | public class ENBusinessNoteStoreClient : ENNoteStoreClient 7 | { 8 | internal interface IENBusinessNoteStoreClient 9 | { 10 | string NoteStoreUrlForBusinessStoreClient(ENBusinessNoteStoreClient client); 11 | string AuthenticationTokenForBusinessStoreClient(ENBusinessNoteStoreClient client); 12 | } 13 | 14 | internal IENBusinessNoteStoreClient DelegateObj {get; set;} 15 | 16 | protected internal override string NoteStoreUrl() 17 | { 18 | return DelegateObj.NoteStoreUrlForBusinessStoreClient(this); 19 | } 20 | 21 | protected internal override string AuthenticationToken() 22 | { 23 | return DelegateObj.AuthenticationTokenForBusinessStoreClient(this); 24 | } 25 | 26 | internal static object NoteStoreClientForBusiness() 27 | { 28 | return new ENBusinessNoteStoreClient(); 29 | } 30 | 31 | } 32 | 33 | } -------------------------------------------------------------------------------- /src/Evernote OAuth/EvernoteOAuthNet/EvernoteOAuthNet.sln: -------------------------------------------------------------------------------- 1 | 2 | Microsoft Visual Studio Solution File, Format Version 11.00 3 | # Visual Studio 2010 4 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "EvernoteOAuthNet", "EvernoteOAuthNet\EvernoteOAuthNet.csproj", "{D98E0824-0A4A-4105-8F76-1CAC1D91FFCE}" 5 | EndProject 6 | Global 7 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 8 | Debug|Any CPU = Debug|Any CPU 9 | Release|Any CPU = Release|Any CPU 10 | EndGlobalSection 11 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 12 | {D98E0824-0A4A-4105-8F76-1CAC1D91FFCE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 13 | {D98E0824-0A4A-4105-8F76-1CAC1D91FFCE}.Debug|Any CPU.Build.0 = Debug|Any CPU 14 | {D98E0824-0A4A-4105-8F76-1CAC1D91FFCE}.Release|Any CPU.ActiveCfg = Release|Any CPU 15 | {D98E0824-0A4A-4105-8F76-1CAC1D91FFCE}.Release|Any CPU.Build.0 = Release|Any CPU 16 | EndGlobalSection 17 | GlobalSection(SolutionProperties) = preSolution 18 | HideSolutionNode = FALSE 19 | EndGlobalSection 20 | EndGlobal 21 | -------------------------------------------------------------------------------- /src/EvernoteSDK/Private/ENLinkedNoteStoreClient.cs: -------------------------------------------------------------------------------- 1 | 2 | using EvernoteSDK.Advanced; 3 | 4 | namespace EvernoteSDK 5 | { 6 | public class ENLinkedNoteStoreClient : ENNoteStoreClient 7 | { 8 | internal interface IENLinkedNoteStoreClient 9 | { 10 | string AuthenticationTokenForLinkedNotebookRef(ENLinkedNotebookRef linkedNotebookRef); 11 | } 12 | 13 | internal IENLinkedNoteStoreClient DelegateObj {get; set;} 14 | private ENLinkedNotebookRef LinkedNotebookRef {get; set;} 15 | 16 | protected internal override string NoteStoreUrl() 17 | { 18 | return LinkedNotebookRef.NoteStoreUrl; 19 | } 20 | 21 | protected internal override string AuthenticationToken() 22 | { 23 | return DelegateObj.AuthenticationTokenForLinkedNotebookRef(LinkedNotebookRef); 24 | } 25 | 26 | internal static object NoteStoreClientForLinkedNotebookRef(ENLinkedNotebookRef linkedNotebookRef) 27 | { 28 | ENLinkedNoteStoreClient client = new ENLinkedNoteStoreClient(); 29 | client.LinkedNotebookRef = linkedNotebookRef; 30 | return client; 31 | } 32 | 33 | } 34 | 35 | } -------------------------------------------------------------------------------- /samples/CS/SampleApp/SampleApp.sln: -------------------------------------------------------------------------------- 1 | 2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio 2013 4 | VisualStudioVersion = 12.0.30723.0 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SampleApp", "SampleApp\SampleApp.csproj", "{F6E7F018-2D86-488B-AAC4-11E4AE71457C}" 7 | EndProject 8 | Global 9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 10 | Debug|Any CPU = Debug|Any CPU 11 | Release|Any CPU = Release|Any CPU 12 | EndGlobalSection 13 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 14 | {F6E7F018-2D86-488B-AAC4-11E4AE71457C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 15 | {F6E7F018-2D86-488B-AAC4-11E4AE71457C}.Debug|Any CPU.Build.0 = Debug|Any CPU 16 | {F6E7F018-2D86-488B-AAC4-11E4AE71457C}.Release|Any CPU.ActiveCfg = Release|Any CPU 17 | {F6E7F018-2D86-488B-AAC4-11E4AE71457C}.Release|Any CPU.Build.0 = Release|Any CPU 18 | EndGlobalSection 19 | GlobalSection(SolutionProperties) = preSolution 20 | HideSolutionNode = FALSE 21 | EndGlobalSection 22 | EndGlobal 23 | -------------------------------------------------------------------------------- /samples/VB.NET/SampleApp/SampleApp.sln: -------------------------------------------------------------------------------- 1 | 2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio 2013 4 | VisualStudioVersion = 12.0.30723.0 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{F184B08F-C81C-45F6-A57F-5ABD9991F28F}") = "SampleApp", "SampleApp\SampleApp.vbproj", "{E145AF60-1E39-4046-ADC8-6C2B743653CA}" 7 | EndProject 8 | Global 9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 10 | Debug|Any CPU = Debug|Any CPU 11 | Release|Any CPU = Release|Any CPU 12 | EndGlobalSection 13 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 14 | {E145AF60-1E39-4046-ADC8-6C2B743653CA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 15 | {E145AF60-1E39-4046-ADC8-6C2B743653CA}.Debug|Any CPU.Build.0 = Debug|Any CPU 16 | {E145AF60-1E39-4046-ADC8-6C2B743653CA}.Release|Any CPU.ActiveCfg = Release|Any CPU 17 | {E145AF60-1E39-4046-ADC8-6C2B743653CA}.Release|Any CPU.Build.0 = Release|Any CPU 18 | EndGlobalSection 19 | GlobalSection(SolutionProperties) = preSolution 20 | HideSolutionNode = FALSE 21 | EndGlobalSection 22 | EndGlobal 23 | -------------------------------------------------------------------------------- /src/EvernoteSDK/ENSDKLogger.cs: -------------------------------------------------------------------------------- 1 | 2 | namespace EvernoteSDK 3 | { 4 | internal class ENSDKLogger 5 | { 6 | 7 | // The SDK sends some info and error messages to a log output. By default, these will just use Debug.WriteLine. 8 | // You can plug into your app's own logging infrastructure if you wish by setting the shared ENSession's 9 | // logger property to any object that implements this simple interface. You can also suppress output 10 | // entirely by setting the property to null. 11 | 12 | public interface ENSDKLogging 13 | { 14 | void EvernoteLogInfoString(string str); 15 | void EvernoteLogErrorString(string str); 16 | } 17 | 18 | 19 | // These are shortcut methods for calling the logging routines. 20 | 21 | public static void ENSDKLogInfo(string evernoteLogInfoString) 22 | { 23 | ENSession.SharedSession.Logger.EvernoteLogInfoString(evernoteLogInfoString); 24 | } 25 | 26 | public static void ENSDKLogError(string evernoteLogErrorString) 27 | { 28 | ENSession.SharedSession.Logger.EvernoteLogErrorString(evernoteLogErrorString); 29 | } 30 | 31 | } 32 | 33 | } -------------------------------------------------------------------------------- /samples/CS/SampleAppAdvanced/SampleAppAdvanced.sln: -------------------------------------------------------------------------------- 1 | 2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio 2013 4 | VisualStudioVersion = 12.0.30723.0 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SampleAppAdvanced", "SampleAppAdvanced\SampleAppAdvanced.csproj", "{62E1BF07-DE5C-41D9-B524-38964E166D68}" 7 | EndProject 8 | Global 9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 10 | Debug|Any CPU = Debug|Any CPU 11 | Release|Any CPU = Release|Any CPU 12 | EndGlobalSection 13 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 14 | {62E1BF07-DE5C-41D9-B524-38964E166D68}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 15 | {62E1BF07-DE5C-41D9-B524-38964E166D68}.Debug|Any CPU.Build.0 = Debug|Any CPU 16 | {62E1BF07-DE5C-41D9-B524-38964E166D68}.Release|Any CPU.ActiveCfg = Release|Any CPU 17 | {62E1BF07-DE5C-41D9-B524-38964E166D68}.Release|Any CPU.Build.0 = Release|Any CPU 18 | EndGlobalSection 19 | GlobalSection(SolutionProperties) = preSolution 20 | HideSolutionNode = FALSE 21 | EndGlobalSection 22 | EndGlobal 23 | -------------------------------------------------------------------------------- /src/EvernoteSDK/ENNoteContent.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | 3 | namespace EvernoteSDK 4 | { 5 | public class ENNoteContent 6 | { 7 | 8 | private string Emml {get; set;} 9 | 10 | 11 | internal ENNoteContent() 12 | { 13 | } 14 | 15 | internal ENNoteContent(string enml) 16 | { 17 | Emml = enml; 18 | } 19 | 20 | public static ENNoteContent NoteContentWithString(string contentString) 21 | { 22 | return new ENPlaintextNoteContent(contentString); 23 | } 24 | 25 | public static ENNoteContent NoteContentWithSanitizedHTML(string html) 26 | { 27 | return new ENHTMLNoteContent(html); 28 | } 29 | 30 | internal static ENNoteContent NoteContentWithENML(string enml) 31 | { 32 | return new ENNoteContent(enml); 33 | } 34 | 35 | internal virtual string EnmlWithResources(List resources) 36 | { 37 | // If we are using precooked ENML, we assume the resources have already been validly written 38 | // into the document. 39 | return Emml; 40 | } 41 | 42 | internal string Enml() 43 | { 44 | return EnmlWithResources(null); 45 | } 46 | 47 | } 48 | 49 | } -------------------------------------------------------------------------------- /samples/VB.NET/SampleAppAdvanced/SampleAppAdvanced.sln: -------------------------------------------------------------------------------- 1 | 2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio 2013 4 | VisualStudioVersion = 12.0.30723.0 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{F184B08F-C81C-45F6-A57F-5ABD9991F28F}") = "SampleAppAdvanced", "SampleAppAdvanced\SampleAppAdvanced.vbproj", "{DF9487E7-A842-409F-8135-759DB3DEFBA0}" 7 | EndProject 8 | Global 9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 10 | Debug|Any CPU = Debug|Any CPU 11 | Release|Any CPU = Release|Any CPU 12 | EndGlobalSection 13 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 14 | {DF9487E7-A842-409F-8135-759DB3DEFBA0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 15 | {DF9487E7-A842-409F-8135-759DB3DEFBA0}.Debug|Any CPU.Build.0 = Debug|Any CPU 16 | {DF9487E7-A842-409F-8135-759DB3DEFBA0}.Release|Any CPU.ActiveCfg = Release|Any CPU 17 | {DF9487E7-A842-409F-8135-759DB3DEFBA0}.Release|Any CPU.Build.0 = Release|Any CPU 18 | EndGlobalSection 19 | GlobalSection(SolutionProperties) = preSolution 20 | HideSolutionNode = FALSE 21 | EndGlobalSection 22 | EndGlobal 23 | -------------------------------------------------------------------------------- /src/EvernoteSDK/Properties/Settings.Designer.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // This code was generated by a tool. 4 | // Runtime Version:4.0.30319.18444 5 | // 6 | // Changes to this file may cause incorrect behavior and will be lost if 7 | // the code is regenerated. 8 | // 9 | //------------------------------------------------------------------------------ 10 | 11 | namespace My { 12 | 13 | 14 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] 15 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "12.0.0.0")] 16 | internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase { 17 | 18 | private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); 19 | 20 | public static Settings Default { 21 | get { 22 | return defaultInstance; 23 | } 24 | } 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /samples/CS/SampleApp/SampleApp/Properties/Settings.Designer.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // This code was generated by a tool. 4 | // Runtime Version:4.0.30319.18444 5 | // 6 | // Changes to this file may cause incorrect behavior and will be lost if 7 | // the code is regenerated. 8 | // 9 | //------------------------------------------------------------------------------ 10 | 11 | namespace SampleApp.Properties 12 | { 13 | 14 | 15 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] 16 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0")] 17 | internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase 18 | { 19 | 20 | private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); 21 | 22 | public static Settings Default 23 | { 24 | get 25 | { 26 | return defaultInstance; 27 | } 28 | } 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /src/Evernote OAuth/AuthSample/AuthSample/Properties/Settings.Designer.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // This code was generated by a tool. 4 | // Runtime Version:4.0.30319.269 5 | // 6 | // Changes to this file may cause incorrect behavior and will be lost if 7 | // the code is regenerated. 8 | // 9 | //------------------------------------------------------------------------------ 10 | 11 | namespace AuthSample.Properties { 12 | 13 | 14 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] 15 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "10.0.0.0")] 16 | internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase { 17 | 18 | private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); 19 | 20 | public static Settings Default { 21 | get { 22 | return defaultInstance; 23 | } 24 | } 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /src/Evernote OAuth/EvernoteOAuthNet/EvernoteOAuthNet/Properties/Settings.Designer.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // This code was generated by a tool. 4 | // Runtime Version:4.0.30319.269 5 | // 6 | // Changes to this file may cause incorrect behavior and will be lost if 7 | // the code is regenerated. 8 | // 9 | //------------------------------------------------------------------------------ 10 | 11 | namespace EvernoteOAuthNet.Properties { 12 | 13 | 14 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] 15 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "10.0.0.0")] 16 | internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase { 17 | 18 | private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); 19 | 20 | public static Settings Default { 21 | get { 22 | return defaultInstance; 23 | } 24 | } 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /src/EvernoteSDK/Advanced/Utilities/TimeConversions_EvernoteSDK.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace EvernoteSDK 4 | { 5 | public static class TimeConversions_EvernoteSDK 6 | { 7 | public static DateTime ToDateTime(this long edamTimestamp) 8 | { 9 | try 10 | { 11 | TimeSpan ts = new TimeSpan((edamTimestamp * 10000)); 12 | // Create a date with the standard web base of 01/01/1970, then 13 | // add the timespan difference. 14 | DateTime newDate = (new DateTime(1970, 1, 1)).Add(ts); 15 | // Adjust for the current timezone. 16 | ts = TimeZone.CurrentTimeZone.GetUtcOffset(newDate); 17 | newDate = newDate.Add(ts); 18 | return newDate; 19 | } 20 | catch (Exception) 21 | { 22 | return Convert.ToDateTime("12:00:00 AM"); 23 | } 24 | } 25 | 26 | public static long ToEdamTimestamp(this DateTime theDate) 27 | { 28 | // Adjust for the current timezone. 29 | theDate = theDate.ToUniversalTime(); 30 | // Get the ticks as a base for the standard web base date. 31 | long baseOffset = (new DateTime(1970, 1, 1)).Ticks; 32 | // Get the difference between the base and our date. 33 | long newDate = theDate.Ticks - baseOffset; 34 | // Convert from ticks to seconds. 35 | newDate = newDate / 10000; 36 | return newDate; 37 | } 38 | 39 | } 40 | 41 | } -------------------------------------------------------------------------------- /samples/VB.NET/SampleApp/SampleApp/My Project/AssemblyInfo.vb: -------------------------------------------------------------------------------- 1 | Imports System 2 | Imports System.Reflection 3 | Imports System.Runtime.InteropServices 4 | 5 | ' General Information about an assembly is controlled through the following 6 | ' set of attributes. Change these attribute values to modify the information 7 | ' associated with an assembly. 8 | 9 | ' Review the values of the assembly attributes 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 'The following GUID is for the ID of the typelib if this project is exposed to COM 21 | 22 | 23 | ' Version information for an assembly consists of the following four values: 24 | ' 25 | ' Major Version 26 | ' Minor Version 27 | ' Build Number 28 | ' Revision 29 | ' 30 | ' You can specify all the values or you can default the Build and Revision Numbers 31 | ' by using the '*' as shown below: 32 | ' 33 | 34 | 35 | 36 | -------------------------------------------------------------------------------- /samples/VB.NET/SampleAppAdvanced/SampleAppAdvanced/My Project/AssemblyInfo.vb: -------------------------------------------------------------------------------- 1 | Imports System 2 | Imports System.Reflection 3 | Imports System.Runtime.InteropServices 4 | 5 | ' General Information about an assembly is controlled through the following 6 | ' set of attributes. Change these attribute values to modify the information 7 | ' associated with an assembly. 8 | 9 | ' Review the values of the assembly attributes 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 'The following GUID is for the ID of the typelib if this project is exposed to COM 21 | 22 | 23 | ' Version information for an assembly consists of the following four values: 24 | ' 25 | ' Major Version 26 | ' Minor Version 27 | ' Build Number 28 | ' Revision 29 | ' 30 | ' You can specify all the values or you can default the Build and Revision Numbers 31 | ' by using the '*' as shown below: 32 | ' 33 | 34 | 35 | 36 | -------------------------------------------------------------------------------- /src/EvernoteSDK/Private/ENPlaintextNoteContent.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using EvernoteSDK.Advanced; 4 | 5 | namespace EvernoteSDK 6 | { 7 | public class ENPlaintextNoteContent : ENNoteContent 8 | { 9 | private string _contentString {get; set;} 10 | 11 | public ENPlaintextNoteContent(string contentString) 12 | { 13 | _contentString = contentString; 14 | } 15 | 16 | internal override string EnmlWithResources(List resources) 17 | { 18 | // Wrap each line in a div. Empty lines get
19 | // From: http://dev.evernote.com/doc/articles/enml.php "representing plaintext notes" 20 | ENMLWriter writer = new ENMLWriter(); 21 | writer.WriteStartDocument(); 22 | //string[] lines = _contentString.Split("\\n".ToCharArray()); 23 | string[] lines = _contentString.Split(new string[] {"\r\n", "\n"}, StringSplitOptions.None); 24 | foreach (string line in lines) 25 | { 26 | writer.WriteStartElement("div"); 27 | if (line.Length == 0) 28 | { 29 | writer.WriteElementWithAttributes("br", null, null); 30 | } 31 | else 32 | { 33 | writer.WriteString(line); 34 | } 35 | writer.WriteEndElement(); 36 | } 37 | foreach (ENResource resource in resources) 38 | { 39 | writer.WriteResourceWithDataHash(resource.DataHash, resource.MimeType, null); 40 | } 41 | writer.WriteEndDocument(); 42 | writer.Flush(); 43 | return writer.Contents.ToString(); 44 | } 45 | 46 | } 47 | 48 | } -------------------------------------------------------------------------------- /src/EvernoteSDK/Private/String_ENScrubbing.cs: -------------------------------------------------------------------------------- 1 | 2 | using System.Text; 3 | using System.Text.RegularExpressions; 4 | 5 | namespace EvernoteSDK 6 | { 7 | internal static class String_ENScrubbing 8 | { 9 | 10 | public static string EnScrubUsingRegex(this string s, string regexPattern, int minLength, int maxLength, string invalidCharacterReplacement) 11 | { 12 | if (s.Length < minLength) 13 | { 14 | return null; 15 | } 16 | 17 | if (s.Length > maxLength) 18 | { 19 | s = s.Substring(0, maxLength); 20 | } 21 | Regex regex = new Regex(regexPattern); 22 | MatchCollection matches = regex.Matches(s); 23 | if (matches.Count == 0) 24 | { 25 | StringBuilder newString = new StringBuilder(s.Length); 26 | for (int i = 0; i <= s.Length; i++) 27 | { 28 | string oneCharSubString = s.Substring(i, 1); 29 | matches = regex.Matches(oneCharSubString); 30 | if (matches.Count > 0) 31 | { 32 | newString.Append(oneCharSubString); 33 | } 34 | else if (invalidCharacterReplacement != null) 35 | { 36 | newString.Append(invalidCharacterReplacement); 37 | } 38 | } 39 | s = newString.ToString(); 40 | } 41 | 42 | if (s.Length < minLength) 43 | { 44 | return null; 45 | } 46 | 47 | return s; 48 | } 49 | 50 | public static string EnScrubUsingRegex(this string s, string regexPattern, int minLength, int maxLength) 51 | { 52 | return s.EnScrubUsingRegex(regexPattern, minLength, maxLength, null); 53 | } 54 | 55 | 56 | } 57 | 58 | 59 | } -------------------------------------------------------------------------------- /src/EvernoteSDK/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Reflection; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | 9 | // Review the values of the assembly attributes 10 | 11 | [assembly: AssemblyTitle("EvernoteSDK")] 12 | [assembly: AssemblyDescription("Evernote Cloud SDK for Windows")] 13 | [assembly: AssemblyCompany("Evernote")] 14 | [assembly: AssemblyProduct("EvernoteSDK")] 15 | [assembly: AssemblyCopyright("Copyright © 2014 Evernote Corp.")] 16 | [assembly: AssemblyTrademark("All rights reserved.")] 17 | 18 | [assembly: ComVisible(true)] 19 | 20 | //The following GUID is for the ID of the typelib if this project is exposed to COM 21 | [assembly: Guid("EFA7A8FF-9A51-482C-B769-8C75612B3C37")] 22 | 23 | // Version information for an assembly consists of the following four values: 24 | // 25 | // Major Version 26 | // Minor Version 27 | // Build Number 28 | // Revision 29 | // 30 | // You can specify all the values or you can default the Build and Revision Numbers 31 | // by using the '*' as shown below: 32 | // 33 | 34 | [assembly: AssemblyVersion("1.0.12.0")] 35 | [assembly: AssemblyFileVersion("1.0.12.0")] 36 | 37 | 38 | [assembly: AssemblyConfiguration("")] 39 | [assembly: AssemblyDelaySign(false)] 40 | [assembly: AssemblyKeyFile("")] 41 | [assembly: AssemblyKeyName("")] 42 | -------------------------------------------------------------------------------- /src/Evernote-SDK-Windows.sln: -------------------------------------------------------------------------------- 1 | 2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio 2013 4 | VisualStudioVersion = 12.0.30723.0 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "EvernoteSDK", "EvernoteSDK\EvernoteSDK.csproj", "{EFB2706A-EE60-4B33-ABD4-695B509F277B}" 7 | EndProject 8 | Project("{54435603-DBB4-11D2-8724-00A0C9A8B90C}") = "EvernoteSDK_COMSetup", "EvernoteSDK_COMSetup\EvernoteSDK_COMSetup.vdproj", "{1AB456C0-75F7-4606-A6C3-258F088D6B07}" 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 | {EFB2706A-EE60-4B33-ABD4-695B509F277B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 17 | {EFB2706A-EE60-4B33-ABD4-695B509F277B}.Debug|Any CPU.Build.0 = Debug|Any CPU 18 | {EFB2706A-EE60-4B33-ABD4-695B509F277B}.Release|Any CPU.ActiveCfg = Release|Any CPU 19 | {EFB2706A-EE60-4B33-ABD4-695B509F277B}.Release|Any CPU.Build.0 = Release|Any CPU 20 | {1AB456C0-75F7-4606-A6C3-258F088D6B07}.Debug|Any CPU.ActiveCfg = Debug 21 | {1AB456C0-75F7-4606-A6C3-258F088D6B07}.Debug|Any CPU.Build.0 = Debug 22 | {1AB456C0-75F7-4606-A6C3-258F088D6B07}.Release|Any CPU.ActiveCfg = Release 23 | {1AB456C0-75F7-4606-A6C3-258F088D6B07}.Release|Any CPU.Build.0 = Release 24 | EndGlobalSection 25 | GlobalSection(SolutionProperties) = preSolution 26 | HideSolutionNode = FALSE 27 | EndGlobalSection 28 | EndGlobal 29 | -------------------------------------------------------------------------------- /src/EvernoteSDK/Advanced/Utilities/ENRegistry.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Diagnostics; 3 | using System.Reflection; 4 | using Microsoft.Win32; 5 | 6 | namespace EvernoteSDK 7 | { 8 | namespace Advanced 9 | { 10 | public class ENRegistry 11 | { 12 | public string CompanyKey {get; set;} 13 | public string ProductKey {get; set;} 14 | 15 | public ENRegistry() 16 | { 17 | FileVersionInfo vi = FileVersionInfo.GetVersionInfo(Assembly.GetExecutingAssembly().Location); 18 | CompanyKey = vi.CompanyName; 19 | ProductKey = vi.ProductName; 20 | if (CompanyKey.Length == 0) 21 | { 22 | CompanyKey = ProductKey; 23 | } 24 | } 25 | 26 | private RegistryKey AppRegistryKey(string service) 27 | { 28 | return Registry.CurrentUser.CreateSubKey("Software").CreateSubKey(CompanyKey).CreateSubKey(ProductKey).CreateSubKey(service); 29 | } 30 | 31 | public string GetValue(string service, string valueName) 32 | { 33 | try 34 | { 35 | return Convert.ToString(AppRegistryKey(service).GetValue(valueName)); 36 | } 37 | catch (Exception ex) 38 | { 39 | throw new Exception(ex.Message); 40 | } 41 | } 42 | 43 | public void SetValue(string service, string valueName, string value) 44 | { 45 | AppRegistryKey(service).SetValue(valueName, value); 46 | } 47 | 48 | public void DeleteValue(string service, string valueName) 49 | { 50 | try 51 | { 52 | AppRegistryKey(service).DeleteValue(valueName); 53 | } 54 | catch (Exception) 55 | { 56 | } 57 | } 58 | 59 | } 60 | 61 | } 62 | 63 | } -------------------------------------------------------------------------------- /src/Evernote OAuth/AuthSample/AuthSample/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("AuthSample")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("MoreProductiveNow")] 12 | [assembly: AssemblyProduct("AuthSample")] 13 | [assembly: AssemblyCopyright("")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Setting ComVisible to false makes the types in this assembly not visible 18 | // to COM components. If you need to access a type in this assembly from 19 | // COM, set the ComVisible attribute to true on that type. 20 | [assembly: ComVisible(false)] 21 | 22 | // The following GUID is for the ID of the typelib if this project is exposed to COM 23 | [assembly: Guid("0116a837-3005-45e5-9b1c-1f82faa0491d")] 24 | 25 | // Version information for an assembly consists of the following four values: 26 | // 27 | // Major Version 28 | // Minor Version 29 | // Build Number 30 | // Revision 31 | // 32 | // You can specify all the values or you can default the Build and Revision Numbers 33 | // by using the '*' as shown below: 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion("1.0.0.0")] 36 | [assembly: AssemblyFileVersion("1.0.0.0")] 37 | -------------------------------------------------------------------------------- /samples/CS/SampleApp/SampleApp/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("SampleApp")] 9 | [assembly: AssemblyDescription("Sample app illustrating Evernote Cloud SDK for Windows")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("Evernote Corp.")] 12 | [assembly: AssemblyProduct("SampleApp")] 13 | [assembly: AssemblyCopyright("")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Setting ComVisible to false makes the types in this assembly not visible 18 | // to COM components. If you need to access a type in this assembly from 19 | // COM, set the ComVisible attribute to true on that type. 20 | [assembly: ComVisible(false)] 21 | 22 | // The following GUID is for the ID of the typelib if this project is exposed to COM 23 | [assembly: Guid("5ee6ae6c-68c4-4ca0-9e7f-dcd21e9903e4")] 24 | 25 | // Version information for an assembly consists of the following four values: 26 | // 27 | // Major Version 28 | // Minor Version 29 | // Build Number 30 | // Revision 31 | // 32 | // You can specify all the values or you can default the Build and Revision Numbers 33 | // by using the '*' as shown below: 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion("1.0.3.0")] 36 | [assembly: AssemblyFileVersion("1.0.3.0")] 37 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | Evernote Cloud SDK 2.0 for Windows 2 | ================================== 3 | 4 | What Is This? 5 | ------------- 6 | 7 | A newly-redesigned, simple, workflow-oriented library built on the Evernote Cloud API. It's designed to drop into your app easily and make most common Evernote integrations very simple to accomplish. (And even the more complex integrations easier than they used to be.) 8 | 9 | How Do I Get Started? 10 | --------------------- 11 | 12 | Setup instructions and sample snippets are all in the [Getting Started](Getting_Started.md) guide. [Have a look there next](Getting_Started.md) and you'll be working with Evernote in just a few minutes. 13 | 14 | Note for users of the 1.x SDK for C# 15 | ------------------------------------ 16 | 17 | This library is the spiritual, although not syntactic, successor to to the [Evernote SDK for C# 1.x](https://github.com/evernote/evernote-sdk-csharp). Currently, both libraries are available and supported. This one is not a "drop-in" update to the previous library -- the objects that you use to get to the traditional (EDAM) API are a little different -- and in fact, it uses the previous library for its low-level calls. 18 | 19 | FAQ 20 | --- 21 | 22 | ### What languages are supported? 23 | 24 | This version of the SDK is designed for Microsoft .NET 4.0 and above, for programs written in C# or VB.NET. The library is also COM-compatible, meaning it can be used for programs written in VBA (for example, inside of Microsoft Office applications). 25 | 26 | ### Where can I find out more about the Evernote for Developers? 27 | 28 | Please check out the [Evernote Developers portal page](http://dev.evernote.com). 29 | -------------------------------------------------------------------------------- /samples/VB.NET/SampleApp/SampleApp/My Project/Application.Designer.vb: -------------------------------------------------------------------------------- 1 | '------------------------------------------------------------------------------ 2 | ' 3 | ' This code was generated by a tool. 4 | ' Runtime Version:4.0.30319.18444 5 | ' 6 | ' Changes to this file may cause incorrect behavior and will be lost if 7 | ' the code is regenerated. 8 | ' 9 | '------------------------------------------------------------------------------ 10 | 11 | Option Strict On 12 | Option Explicit On 13 | 14 | 15 | Namespace My 16 | 17 | 'NOTE: This file is auto-generated; do not modify it directly. To make changes, 18 | ' or if you encounter build errors in this file, go to the Project Designer 19 | ' (go to Project Properties or double-click the My Project node in 20 | ' Solution Explorer), and make changes on the Application tab. 21 | ' 22 | Partial Friend Class MyApplication 23 | 24 | _ 25 | Public Sub New() 26 | MyBase.New(Global.Microsoft.VisualBasic.ApplicationServices.AuthenticationMode.Windows) 27 | Me.IsSingleInstance = false 28 | Me.EnableVisualStyles = true 29 | Me.SaveMySettingsOnExit = true 30 | Me.ShutDownStyle = Global.Microsoft.VisualBasic.ApplicationServices.ShutdownMode.AfterMainFormCloses 31 | End Sub 32 | 33 | _ 34 | Protected Overrides Sub OnCreateMainForm() 35 | Me.MainForm = Global.SampleApp.Form1 36 | End Sub 37 | End Class 38 | End Namespace 39 | -------------------------------------------------------------------------------- /samples/CS/SampleAppAdvanced/SampleAppAdvanced/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("SampleAppAdvanced")] 9 | [assembly: AssemblyDescription("Sample app illustrating advanced features of the Evernote Cloud SDK for Windows")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("Evernote Corp.")] 12 | [assembly: AssemblyProduct("SampleAppAdvanced")] 13 | [assembly: AssemblyCopyright("")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Setting ComVisible to false makes the types in this assembly not visible 18 | // to COM components. If you need to access a type in this assembly from 19 | // COM, set the ComVisible attribute to true on that type. 20 | [assembly: ComVisible(false)] 21 | 22 | // The following GUID is for the ID of the typelib if this project is exposed to COM 23 | [assembly: Guid("a0f46ae0-289d-4d02-bd3b-5c14d07ac3e5")] 24 | 25 | // Version information for an assembly consists of the following four values: 26 | // 27 | // Major Version 28 | // Minor Version 29 | // Build Number 30 | // Revision 31 | // 32 | // You can specify all the values or you can default the Build and Revision Numbers 33 | // by using the '*' as shown below: 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion("1.0.3.0")] 36 | [assembly: AssemblyFileVersion("1.0.3.0")] 37 | -------------------------------------------------------------------------------- /src/Evernote OAuth/AuthSample/AuthSample.sln: -------------------------------------------------------------------------------- 1 | 2 | Microsoft Visual Studio Solution File, Format Version 11.00 3 | # Visual Studio 2010 4 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AuthSample", "AuthSample\AuthSample.csproj", "{79764ACF-F279-4F37-92C4-EFF488F0F14E}" 5 | EndProject 6 | Global 7 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 8 | Debug|Any CPU = Debug|Any CPU 9 | Debug|Mixed Platforms = Debug|Mixed Platforms 10 | Debug|x86 = Debug|x86 11 | Release|Any CPU = Release|Any CPU 12 | Release|Mixed Platforms = Release|Mixed Platforms 13 | Release|x86 = Release|x86 14 | EndGlobalSection 15 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 16 | {79764ACF-F279-4F37-92C4-EFF488F0F14E}.Debug|Any CPU.ActiveCfg = Debug|x86 17 | {79764ACF-F279-4F37-92C4-EFF488F0F14E}.Debug|Mixed Platforms.ActiveCfg = Debug|x86 18 | {79764ACF-F279-4F37-92C4-EFF488F0F14E}.Debug|Mixed Platforms.Build.0 = Debug|x86 19 | {79764ACF-F279-4F37-92C4-EFF488F0F14E}.Debug|x86.ActiveCfg = Debug|x86 20 | {79764ACF-F279-4F37-92C4-EFF488F0F14E}.Debug|x86.Build.0 = Debug|x86 21 | {79764ACF-F279-4F37-92C4-EFF488F0F14E}.Release|Any CPU.ActiveCfg = Release|x86 22 | {79764ACF-F279-4F37-92C4-EFF488F0F14E}.Release|Mixed Platforms.ActiveCfg = Release|x86 23 | {79764ACF-F279-4F37-92C4-EFF488F0F14E}.Release|Mixed Platforms.Build.0 = Release|x86 24 | {79764ACF-F279-4F37-92C4-EFF488F0F14E}.Release|x86.ActiveCfg = Release|x86 25 | {79764ACF-F279-4F37-92C4-EFF488F0F14E}.Release|x86.Build.0 = Release|x86 26 | EndGlobalSection 27 | GlobalSection(SolutionProperties) = preSolution 28 | HideSolutionNode = FALSE 29 | EndGlobalSection 30 | EndGlobal 31 | -------------------------------------------------------------------------------- /src/EvernoteSDK/ENNoteSearch.cs: -------------------------------------------------------------------------------- 1 | // 2 | // A note search represents a search query for the Evernote service used in finding notes. 3 | // 4 | 5 | 6 | namespace EvernoteSDK 7 | { 8 | public class ENNoteSearch 9 | { 10 | 11 | // 12 | // The search in the Evernote search grammar. 13 | // 14 | public string SearchString {get; set;} 15 | 16 | //internal ENNoteSearch() 17 | //{ 18 | //} 19 | 20 | // 21 | // The designated initializer for a note search, from a raw search string. 22 | // You can use the full search grammar as described at http://dev.evernote.com/doc/articles/search_grammar.php 23 | // 24 | // @param searchString A search string. 25 | // 26 | // @return An initialized note search object. 27 | // 28 | public ENNoteSearch(string search) 29 | { 30 | SearchString = search; 31 | } 32 | 33 | // 34 | // Class method to get a new search object from a raw search string. 35 | // You can use the full search grammar as described at http://dev.evernote.com/doc/articles/search_grammar.php 36 | // 37 | // @param searchString A search string. 38 | // 39 | // @return A note search object. 40 | // 41 | public static ENNoteSearch NoteSearch(string searchString) 42 | { 43 | if (searchString == null) 44 | { 45 | return null; 46 | } 47 | return new ENNoteSearch(searchString); 48 | } 49 | 50 | // 51 | // Class method to get a new search object that represents all notes created by this application. 52 | // "This application" is based on the sourceApplication property on ENSession. 53 | // 54 | // @return A note search object. 55 | // 56 | public static ENNoteSearch NoteSearchCreatedByThisApplication() 57 | { 58 | string search = string.Format("sourceApplication:{0}", ENSession.SharedSession.SourceApplication); 59 | return new ENNoteSearch(search); 60 | } 61 | 62 | } 63 | 64 | } -------------------------------------------------------------------------------- /samples/VB.NET/SampleAppAdvanced/SampleAppAdvanced/Module1.vb: -------------------------------------------------------------------------------- 1 | Imports EvernoteSDK 2 | Imports EvernoteSDK.Advanced 3 | Imports Evernote.EDAM.Type 4 | 5 | Module Module1 6 | 7 | Sub Main() 8 | 9 | ' Supply your key using ENSessionAdvanced instead of ENEsssion, to indicate your use of the Advanced interface. 10 | ' Be sure to put your own consumer key and consumer secret here. 11 | ENSessionAdvanced.SetSharedSessionConsumerKey("your key", "your secret") 12 | 13 | If ENSession.SharedSession.IsAuthenticated = False Then 14 | ENSession.SharedSession.AuthenticateToEvernote() 15 | End If 16 | 17 | ' Create a note (in the user's default notebook) with an attribute set (in this case, the ReminderOrder attribute to create a Reminder). 18 | Dim myNoteAdv As New ENNoteAdvanced() 19 | myNoteAdv.Title = "Sample note with Reminder set" 20 | myNoteAdv.Content = ENNoteContent.NoteContentWithString("Hello, world - this note has a Reminder on it.") 21 | myNoteAdv.EdamAttributes("ReminderOrder") = DateTime.Now.ToEdamTimestamp() 22 | Dim myRef As ENNoteRef = ENSession.SharedSession.UploadNote(myNoteAdv, Nothing) 23 | 24 | ' Now we'll create an EDAM Note. 25 | ' First create the ENML content for the note. 26 | Dim writer As New ENMLWriter() 27 | writer.WriteStartDocument() 28 | writer.WriteString("Hello again, world.") 29 | writer.WriteEndDocument() 30 | ' Create a note locally. 31 | Dim myNote As New Note() 32 | myNote.Title = "Sample note from the Advanced world" 33 | myNote.Content = writer.Contents.ToString() 34 | ' Create the note in the service, in the user's personal, default notebook. 35 | Dim store As ENNoteStoreClient = ENSessionAdvanced.SharedSession.PrimaryNoteStore 36 | Dim resultNote As Note = store.CreateNote(myNote) 37 | End Sub 38 | 39 | End Module 40 | -------------------------------------------------------------------------------- /src/EvernoteSDK/Advanced/Utilities/CipherUtility.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.IO; 3 | using System.Security.Cryptography; 4 | using System.Text; 5 | 6 | namespace EvernoteSDK 7 | { 8 | public class CipherUtility 9 | { 10 | public static string Encrypt(string value, string password, string salt) where T: SymmetricAlgorithm, new() 11 | { 12 | DeriveBytes rgb = new Rfc2898DeriveBytes(password, Encoding.Unicode.GetBytes(salt)); 13 | 14 | SymmetricAlgorithm algorithm = new T(); 15 | 16 | byte[] rgbKey = rgb.GetBytes(algorithm.KeySize >> 3); 17 | byte[] rgbIV = rgb.GetBytes(algorithm.BlockSize >> 3); 18 | 19 | ICryptoTransform transform = algorithm.CreateEncryptor(rgbKey, rgbIV); 20 | 21 | using (MemoryStream buffer = new MemoryStream()) 22 | { 23 | using (CryptoStream stream = new CryptoStream(buffer, transform, CryptoStreamMode.Write)) 24 | { 25 | using (StreamWriter writer = new StreamWriter(stream, Encoding.Unicode)) 26 | { 27 | writer.Write(value); 28 | } 29 | } 30 | 31 | return Convert.ToBase64String(buffer.ToArray()); 32 | } 33 | } 34 | 35 | public static string Decrypt(string text, string password, string salt) where T: SymmetricAlgorithm, new() 36 | { 37 | DeriveBytes rgb = new Rfc2898DeriveBytes(password, Encoding.Unicode.GetBytes(salt)); 38 | 39 | SymmetricAlgorithm algorithm = new T(); 40 | 41 | byte[] rgbKey = rgb.GetBytes(algorithm.KeySize >> 3); 42 | byte[] rgbIV = rgb.GetBytes(algorithm.BlockSize >> 3); 43 | 44 | ICryptoTransform transform = algorithm.CreateDecryptor(rgbKey, rgbIV); 45 | 46 | using (MemoryStream buffer = new MemoryStream(Convert.FromBase64String(text))) 47 | { 48 | using (CryptoStream stream = new CryptoStream(buffer, transform, CryptoStreamMode.Read)) 49 | { 50 | using (StreamReader reader = new StreamReader(stream, Encoding.Unicode)) 51 | { 52 | return reader.ReadToEnd(); 53 | } 54 | } 55 | } 56 | } 57 | } 58 | } -------------------------------------------------------------------------------- /src/EvernoteSDK/Private/ENCredentialStore.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | 4 | namespace EvernoteSDK 5 | { 6 | [Serializable] 7 | public class ENCredentialStore 8 | { 9 | 10 | // Permanent store of Evernote credentials. 11 | // Credentials are unique per (host,consumer key) tuple. 12 | 13 | private Dictionary Store {get; set;} 14 | 15 | internal ENCredentialStore() 16 | { 17 | Store = new Dictionary(); 18 | } 19 | 20 | // Add credentials to the store. 21 | // Also saves the authentication token to the keychain. 22 | public void AddCredentials(ENCredentials credentials) 23 | { 24 | // Save auth token to registry. 25 | credentials.SaveToRegistry(); 26 | 27 | // Add it to our host => credentials dictionary. 28 | Store[credentials.Host] = credentials; 29 | } 30 | 31 | // Look up the credentials for the given host. 32 | public ENCredentials CredentialsForHost(string host) 33 | { 34 | ENCredentials credentials = null; 35 | if (Store == null) 36 | { 37 | return null; 38 | } 39 | Store.TryGetValue(host, out credentials); 40 | if (credentials != null && !credentials.AreValid()) 41 | { 42 | RemoveCredentials(credentials); 43 | return null; 44 | } 45 | 46 | return credentials; 47 | } 48 | 49 | // Remove credentials from the store. 50 | // Also deletes the credentials' auth token from the keychain. 51 | public void RemoveCredentials(ENCredentials credentials) 52 | { 53 | // Delete auth token from registry. 54 | credentials.DeleteFromRegistry(); 55 | 56 | // Update user defaults. 57 | Store.Remove(credentials.Host); 58 | } 59 | 60 | // Remove all credentials from the store. 61 | // Also deletes the credentials' auth tokens from the keychain. 62 | public void ClearAllCredentials() 63 | { 64 | foreach (var entry in Store) 65 | { 66 | entry.Value.DeleteFromRegistry(); 67 | } 68 | 69 | Store.Clear(); 70 | } 71 | 72 | } 73 | 74 | } -------------------------------------------------------------------------------- /src/EvernoteSDK/Private/ENLinkedNotebookRef.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using Evernote.EDAM.Type; 3 | 4 | namespace EvernoteSDK 5 | { 6 | [Serializable] 7 | public class ENLinkedNotebookRef 8 | { 9 | 10 | // This object contains the minimum information required to authenticate to a shared notebook. 11 | // It is intentionally narrower than a full EDAMLinkedNotebook, allowing these general bits of information 12 | // to be persisted independently of a full EDAMLinkedNotebook. 13 | 14 | public string Guid {get; set;} 15 | public string NoteStoreUrl {get; set;} 16 | public string ShardId {get; set;} 17 | public string SharedNotebookGlobalId {get; set;} 18 | 19 | internal static ENLinkedNotebookRef LinkedNotebookRefFromLinkedNotebook(LinkedNotebook linkedNotebook) 20 | { 21 | ENLinkedNotebookRef linkedNotebookRef = new ENLinkedNotebookRef(); 22 | linkedNotebookRef.Guid = linkedNotebook.Guid; 23 | linkedNotebookRef.NoteStoreUrl = linkedNotebook.NoteStoreUrl; 24 | linkedNotebookRef.ShardId = linkedNotebook.ShardId; 25 | linkedNotebookRef.SharedNotebookGlobalId = linkedNotebook.ShareKey; 26 | return linkedNotebookRef; 27 | } 28 | 29 | internal bool IsEqual(object obj) 30 | { 31 | if (this == (EvernoteSDK.ENLinkedNotebookRef)obj) 32 | { 33 | return true; 34 | } 35 | if (obj != null && obj.GetType() != this.GetType()) 36 | { 37 | return false; 38 | } 39 | 40 | ENLinkedNotebookRef other = (EvernoteSDK.ENLinkedNotebookRef)obj; 41 | if (other.Guid == Guid && other.NoteStoreUrl == NoteStoreUrl && other.ShardId == ShardId && other.SharedNotebookGlobalId == SharedNotebookGlobalId) 42 | { 43 | return true; 44 | } 45 | 46 | return false; 47 | } 48 | 49 | internal int Hash() 50 | { 51 | int prime = 31; 52 | int result = 1; 53 | result = prime * result + Guid.GetHashCode(); 54 | result = prime * result + NoteStoreUrl.GetHashCode(); 55 | result = prime * result + ShardId.GetHashCode(); 56 | result = prime * result + SharedNotebookGlobalId.GetHashCode(); 57 | return result; 58 | } 59 | 60 | } 61 | 62 | } -------------------------------------------------------------------------------- /samples/CS/SampleAppAdvanced/SampleAppAdvanced/Program.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using EvernoteSDK; 6 | using EvernoteSDK.Advanced; 7 | using Evernote.EDAM.Type; 8 | 9 | namespace SampleAppAdvanced 10 | { 11 | class Program 12 | { 13 | static void Main(string[] args) 14 | { 15 | // Supply your key using ENSessionAdvanced instead of ENEsssion, to indicate your use of the Advanced interface. 16 | // Be sure to put your own consumer key and consumer secret here. 17 | ENSessionAdvanced.SetSharedSessionConsumerKey("your key", "your secret"); 18 | 19 | if (ENSession.SharedSession.IsAuthenticated == false) 20 | { 21 | ENSession.SharedSession.AuthenticateToEvernote(); 22 | } 23 | 24 | // Create a note (in the user's default notebook) with an attribute set (in this case, the ReminderOrder attribute to create a Reminder). 25 | ENNoteAdvanced myNoteAdv = new ENNoteAdvanced(); 26 | myNoteAdv.Title = "Sample note with Reminder set"; 27 | myNoteAdv.Content = ENNoteContent.NoteContentWithString("Hello, world - this note has a Reminder on it."); 28 | myNoteAdv.EdamAttributes["ReminderOrder"] = DateTime.Now.ToEdamTimestamp(); 29 | ENNoteRef myRef = ENSession.SharedSession.UploadNote(myNoteAdv, null); 30 | 31 | // Now we'll create an EDAM Note. 32 | // First create the ENML content for the note. 33 | ENMLWriter writer = new ENMLWriter(); 34 | writer.WriteStartDocument(); 35 | writer.WriteString("Hello again, world."); 36 | writer.WriteEndDocument(); 37 | // Create a note locally. 38 | Note myNote = new Note(); 39 | myNote.Title = "Sample note from the Advanced world"; 40 | myNote.Content = writer.Contents.ToString(); 41 | // Create the note in the service, in the user's personal, default notebook. 42 | ENNoteStoreClient store = ENSessionAdvanced.SharedSession.PrimaryNoteStore; 43 | Note resultNote = store.CreateNote(myNote); 44 | } 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /src/EvernoteSDK/Advanced/EdamNote.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using Evernote.EDAM.Type; 3 | 4 | namespace EvernoteSDK.Advanced 5 | { 6 | public class EdamNote 7 | { 8 | public string Guid { get; set; } 9 | public string Title { get; set; } 10 | public string Content { get; set; } 11 | public byte[] ContentHash { get; set; } 12 | public int ContentLength { get; set; } 13 | public long Created { get; set; } 14 | public long Updated { get; set; } 15 | public long Deleted { get; set; } 16 | public bool Active { get; set; } 17 | public int UpdateSequenceNum { get; set; } 18 | public string NotebookGuid { get; set; } 19 | internal List TagGuidsList { get; set; } 20 | public List ResourcesList { get; set; } 21 | public NoteAttributes Attributes { get; set; } 22 | public List TagNamesList { get; set; } 23 | 24 | public ENCollection TagGuids 25 | { 26 | get 27 | { 28 | ENCollection comResults = new ENCollection(); 29 | if (TagGuidsList != null) 30 | { 31 | foreach (string tag in TagGuidsList) 32 | { 33 | object tempvar = tag; 34 | comResults.Add(ref tempvar); 35 | } 36 | } 37 | return comResults; 38 | } 39 | } 40 | 41 | public ENCollection Resources 42 | { 43 | get 44 | { 45 | ENCollection comResults = new ENCollection(); 46 | foreach (Resource resource in ResourcesList) 47 | { 48 | object tempvar = resource; 49 | comResults.Add(ref tempvar); 50 | } 51 | return comResults; 52 | } 53 | } 54 | 55 | public ENCollection TagNames 56 | { 57 | get 58 | { 59 | ENCollection comResults = new ENCollection(); 60 | foreach (string tag in TagNamesList) 61 | { 62 | object tempvar = tag; 63 | comResults.Add(ref tempvar); 64 | } 65 | return comResults; 66 | } 67 | } 68 | 69 | } 70 | } 71 | -------------------------------------------------------------------------------- /src/EvernoteSDK/Private/ENShareUrlHelper.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Text.RegularExpressions; 3 | 4 | namespace EvernoteSDK 5 | { 6 | public class ENShareUrlHelper 7 | { 8 | 9 | internal static string ShareUrlString(string guid, string shardId, string shareKey, string serviceHost, string encodedAdditionalString) 10 | { 11 | // All of the standard pieces of information come from the service in string format. We need their underlying bytes/numeric 12 | // values to create a packed byte array. Get the correct values for each, and if any of them appear not to be in the expected 13 | // format, fall back to the long form share URL. 14 | 15 | // Shard ID to number 16 | int shardNumber = -1; 17 | if (shardId.Length > 1 && shardId.StartsWith("s")) 18 | { 19 | // Ignore the leading "s" character. 20 | string shardString = shardId.Substring(1); 21 | shardString = Regex.Replace(shardString, "[^0-9]+", string.Empty); 22 | if (shardString.Length < 1) 23 | { 24 | shardNumber = -1; 25 | } 26 | if (shardNumber > UInt16.MaxValue) 27 | { 28 | shardNumber = -1; 29 | } 30 | } 31 | 32 | // Note guid to UUID 33 | Guid noteUUID = new Guid(guid); 34 | 35 | // Share key to binary value. First truncate it to initial 16 characters (it's normally 32). 36 | byte[] shareKeyData = null; 37 | if (shareKey.Length >= 16) 38 | { 39 | shareKeyData = StringToByteArray(shareKey); 40 | } 41 | 42 | // Check that all our values appear valid. If not, return the old style share URL instead. 43 | if (shardNumber < 0 || noteUUID == new Guid() || shareKeyData == null) 44 | { 45 | return string.Format("https://{0}/shard/{1}/sh/{2}/{3}", serviceHost, shardId, guid, shareKey); 46 | } 47 | 48 | // Until this function is completed, for now just return the old style share URL. 49 | return string.Format("https://{0}/shard/{1}/sh/{2}/{3}", serviceHost, shardId, guid, shareKey); 50 | 51 | // TODO: Need to complete this function to produce the new "shortened" URL format 52 | 53 | } 54 | 55 | public static byte[] StringToByteArray(string hex) 56 | { 57 | int NumberChars = hex.Length; 58 | byte[] bytes = new byte[(int)((double)NumberChars / 2 - 1 + 1)]; 59 | for (int i = 0; i <= NumberChars - 1; i += 2) 60 | { 61 | bytes[(int)((double)i / 2)] = Convert.ToByte(hex.Substring(i, 2), 16); 62 | } 63 | return bytes; 64 | } 65 | 66 | } 67 | 68 | } -------------------------------------------------------------------------------- /src/Evernote OAuth/EvernoteOAuthNet/EvernoteOAuthNet/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Resources; 3 | using System.Runtime.CompilerServices; 4 | using System.Runtime.InteropServices; 5 | using System.Windows; 6 | 7 | // General Information about an assembly is controlled through the following 8 | // set of attributes. Change these attribute values to modify the information 9 | // associated with an assembly. 10 | [assembly: AssemblyTitle("EvernoteOAuth")] 11 | [assembly: AssemblyDescription("")] 12 | [assembly: AssemblyConfiguration("")] 13 | [assembly: AssemblyCompany("More Productive Now")] 14 | [assembly: AssemblyProduct("EvernoteOAuth")] 15 | [assembly: AssemblyCopyright("Copyright © 2013 More Productive Now")] 16 | [assembly: AssemblyTrademark("")] 17 | [assembly: AssemblyCulture("")] 18 | 19 | // Setting ComVisible to false makes the types in this assembly not visible 20 | // to COM components. If you need to access a type in this assembly from 21 | // COM, set the ComVisible attribute to true on that type. 22 | [assembly: ComVisible(false)] 23 | 24 | //In order to begin building localizable applications, set 25 | //CultureYouAreCodingWith in your .csproj file 26 | //inside a . For example, if you are using US english 27 | //in your source files, set the to en-US. Then uncomment 28 | //the NeutralResourceLanguage attribute below. Update the "en-US" in 29 | //the line below to match the UICulture setting in the project file. 30 | 31 | //[assembly: NeutralResourcesLanguage("en-US", UltimateResourceFallbackLocation.Satellite)] 32 | 33 | 34 | [assembly: ThemeInfo( 35 | ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located 36 | //(used if a resource is not found in the page, 37 | // or application resource dictionaries) 38 | ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located 39 | //(used if a resource is not found in the page, 40 | // app, or any theme specific resource dictionaries) 41 | )] 42 | 43 | 44 | // Version information for an assembly consists of the following four values: 45 | // 46 | // Major Version 47 | // Minor Version 48 | // Build Number 49 | // Revision 50 | // 51 | // You can specify all the values or you can default the Build and Revision Numbers 52 | // by using the '*' as shown below: 53 | // [assembly: AssemblyVersion("1.0.*")] 54 | [assembly: AssemblyVersion("2.1.0.0")] 55 | [assembly: AssemblyFileVersion("2.1.0.0")] 56 | -------------------------------------------------------------------------------- /src/Evernote OAuth/AuthSample/AuthSample/Program.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Windows.Forms; 5 | using EvernoteOAuthNet; 6 | 7 | namespace AuthSample 8 | { 9 | static class Program 10 | { 11 | /// 12 | /// The main entry point for the application. 13 | /// 14 | [STAThread] 15 | static void Main() 16 | { 17 | /* 18 | * To use EvernoteOAuth: 19 | * 1. Instantiate the class, indicating via the parameters whether you're targeting the Sandbox, Production, or Yinxiang Biji service, and supplying your ConsumerKey and ConsumerSecret. 20 | * You can also optionally pass a boolean True if you're using App Notebooks and want to allow the user to select a Shared/Business notebook as the App Notebook, 21 | * as well as optionally the caption for the authorization window, if you want to override the default caption. 22 | * 2. Call EvernoteOAuth.Authorize. 23 | * 3. If the user's account was not successfully authorized, the specific error text will be returned from the Authorize call. 24 | * If the authorization was successful, the return value will be null, and the following fields will be set and available for you to query: 25 | * Token 26 | * Expires 27 | * NoteStoreUrl 28 | * UserId 29 | * WebApiUrlPrefix 30 | * LinkedAppNotebookSelected 31 | */ 32 | 33 | string myConsumerKey = "Specify your Consumer Key here"; 34 | string myConsumerSecret = "Specify your Consumer Secret here"; 35 | EvernoteOAuth oauth = new EvernoteOAuth(EvernoteOAuth.HostService.Production, myConsumerKey, myConsumerSecret, true); 36 | string errResponse = oauth.Authorize(); 37 | if (errResponse.Length == 0) 38 | { 39 | MessageBox.Show(string.Format("Token: {0}\r\n\r\nExpires: {1}\r\n\r\nNoteStoreUrl: {2}\r\n\r\nUserId: {3}\r\n\r\nWebApiUrlPrefix: {4}\r\n\r\nLinked App Notebook was selected: {5}", oauth.Token, oauth.Expires, oauth.NoteStoreUrl, oauth.UserId, oauth.WebApiUrlPrefix, oauth.LinkedAppNotebookSelected.ToString())); 40 | } 41 | else 42 | { 43 | MessageBox.Show("A problem has occurred in attempting to authorize the use of your Evernote account: " + errResponse); 44 | } 45 | } 46 | 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /samples/VB.NET/SampleApp/SampleApp/My Project/Resources.Designer.vb: -------------------------------------------------------------------------------- 1 | '------------------------------------------------------------------------------ 2 | ' 3 | ' This code was generated by a tool. 4 | ' Runtime Version:4.0.30319.18444 5 | ' 6 | ' Changes to this file may cause incorrect behavior and will be lost if 7 | ' the code is regenerated. 8 | ' 9 | '------------------------------------------------------------------------------ 10 | 11 | Option Strict On 12 | Option Explicit On 13 | 14 | 15 | Namespace My.Resources 16 | 17 | 'This class was auto-generated by the StronglyTypedResourceBuilder 18 | 'class via a tool like ResGen or Visual Studio. 19 | 'To add or remove a member, edit your .ResX file then rerun ResGen 20 | 'with the /str option, or rebuild your VS project. 21 | ''' 22 | ''' A strongly-typed resource class, for looking up localized strings, etc. 23 | ''' 24 | _ 28 | Friend Module Resources 29 | 30 | Private resourceMan As Global.System.Resources.ResourceManager 31 | 32 | Private resourceCulture As Global.System.Globalization.CultureInfo 33 | 34 | ''' 35 | ''' Returns the cached ResourceManager instance used by this class. 36 | ''' 37 | _ 38 | Friend ReadOnly Property ResourceManager() As Global.System.Resources.ResourceManager 39 | Get 40 | If Object.ReferenceEquals(resourceMan, Nothing) Then 41 | Dim temp As Global.System.Resources.ResourceManager = New Global.System.Resources.ResourceManager("SampleApp.Resources", GetType(Resources).Assembly) 42 | resourceMan = temp 43 | End If 44 | Return resourceMan 45 | End Get 46 | End Property 47 | 48 | ''' 49 | ''' Overrides the current thread's CurrentUICulture property for all 50 | ''' resource lookups using this strongly typed resource class. 51 | ''' 52 | _ 53 | Friend Property Culture() As Global.System.Globalization.CultureInfo 54 | Get 55 | Return resourceCulture 56 | End Get 57 | Set(ByVal value As Global.System.Globalization.CultureInfo) 58 | resourceCulture = value 59 | End Set 60 | End Property 61 | End Module 62 | End Namespace 63 | -------------------------------------------------------------------------------- /samples/VB.NET/SampleAppAdvanced/SampleAppAdvanced/My Project/Resources.Designer.vb: -------------------------------------------------------------------------------- 1 | '------------------------------------------------------------------------------ 2 | ' 3 | ' This code was generated by a tool. 4 | ' Runtime Version:4.0.30319.18444 5 | ' 6 | ' Changes to this file may cause incorrect behavior and will be lost if 7 | ' the code is regenerated. 8 | ' 9 | '------------------------------------------------------------------------------ 10 | 11 | Option Strict On 12 | Option Explicit On 13 | 14 | 15 | Namespace My.Resources 16 | 17 | 'This class was auto-generated by the StronglyTypedResourceBuilder 18 | 'class via a tool like ResGen or Visual Studio. 19 | 'To add or remove a member, edit your .ResX file then rerun ResGen 20 | 'with the /str option, or rebuild your VS project. 21 | ''' 22 | ''' A strongly-typed resource class, for looking up localized strings, etc. 23 | ''' 24 | _ 28 | Friend Module Resources 29 | 30 | Private resourceMan As Global.System.Resources.ResourceManager 31 | 32 | Private resourceCulture As Global.System.Globalization.CultureInfo 33 | 34 | ''' 35 | ''' Returns the cached ResourceManager instance used by this class. 36 | ''' 37 | _ 38 | Friend ReadOnly Property ResourceManager() As Global.System.Resources.ResourceManager 39 | Get 40 | If Object.ReferenceEquals(resourceMan, Nothing) Then 41 | Dim temp As Global.System.Resources.ResourceManager = New Global.System.Resources.ResourceManager("SampleAppAdvanced.Resources", GetType(Resources).Assembly) 42 | resourceMan = temp 43 | End If 44 | Return resourceMan 45 | End Get 46 | End Property 47 | 48 | ''' 49 | ''' Overrides the current thread's CurrentUICulture property for all 50 | ''' resource lookups using this strongly typed resource class. 51 | ''' 52 | _ 53 | Friend Property Culture() As Global.System.Globalization.CultureInfo 54 | Get 55 | Return resourceCulture 56 | End Get 57 | Set(ByVal value As Global.System.Globalization.CultureInfo) 58 | resourceCulture = value 59 | End Set 60 | End Property 61 | End Module 62 | End Namespace 63 | -------------------------------------------------------------------------------- /src/EvernoteSDK/Private/ENAuthCache.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using Evernote.EDAM.UserStore; 4 | 5 | namespace EvernoteSDK 6 | { 7 | public class ENAuthCache 8 | { 9 | 10 | private class ENAuthCacheEntry 11 | { 12 | internal AuthenticationResult AuthResult {get; set;} 13 | internal DateTime CachedDate {get; set;} 14 | 15 | internal static ENAuthCacheEntry EntryWithResult(AuthenticationResult result) 16 | { 17 | if (result == null) 18 | { 19 | return null; 20 | } 21 | ENAuthCacheEntry entry = new ENAuthCacheEntry(); 22 | entry.AuthResult = result; 23 | entry.CachedDate = DateTime.Now; 24 | return entry; 25 | } 26 | 27 | internal bool IsValid() 28 | { 29 | TimeSpan age = DateTime.Now.Subtract(CachedDate).Duration(); 30 | long expirationAge = (AuthResult.Expiration - AuthResult.CurrentTime) / 1000; 31 | // We're okay if the token is within 90% of the expiration time. 32 | if (age.Ticks > (0.9 * expirationAge)) 33 | { 34 | return false; 35 | } 36 | return true; 37 | } 38 | } 39 | 40 | private Dictionary LinkedCache {get; set;} 41 | private ENAuthCacheEntry BusinessCache {get; set;} 42 | 43 | internal ENAuthCache() 44 | { 45 | LinkedCache = new Dictionary(); 46 | } 47 | 48 | internal void SetAuthenticationResultForLinkedNotebook(AuthenticationResult result, string guid) 49 | { 50 | if (result == null) 51 | { 52 | return; 53 | } 54 | 55 | ENAuthCacheEntry entry = ENAuthCacheEntry.EntryWithResult(result); 56 | LinkedCache[guid] = entry; 57 | } 58 | 59 | internal AuthenticationResult AuthenticationResultForLinkedNotebook(string guid) 60 | { 61 | AuthenticationResult result = null; 62 | ENAuthCacheEntry entry = null; 63 | LinkedCache.TryGetValue(guid, out entry); 64 | if (entry != null && !entry.IsValid()) 65 | { 66 | // This auth result has already expired, so evict it. 67 | LinkedCache.Remove(guid); 68 | entry = null; 69 | } 70 | else if (entry != null) 71 | { 72 | result = entry.AuthResult; 73 | } 74 | return result; 75 | } 76 | 77 | internal void SetAuthenticationResultForBusiness(AuthenticationResult result) 78 | { 79 | if (result == null) 80 | { 81 | return; 82 | } 83 | 84 | ENAuthCacheEntry entry = ENAuthCacheEntry.EntryWithResult(result); 85 | BusinessCache = entry; 86 | } 87 | 88 | internal AuthenticationResult AuthenticationResultForBusiness() 89 | { 90 | AuthenticationResult result = null; 91 | ENAuthCacheEntry entry = BusinessCache; 92 | if (entry != null && !entry.IsValid()) 93 | { 94 | // This auth result has already expired, so evict it. 95 | BusinessCache = null; 96 | entry = null; 97 | } 98 | if (entry != null) 99 | { 100 | result = entry.AuthResult; 101 | } 102 | return result; 103 | } 104 | 105 | } 106 | 107 | } -------------------------------------------------------------------------------- /src/EvernoteSDK/Properties/Resources.Designer.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // This code was generated by a tool. 4 | // Runtime Version:4.0.30319.18444 5 | // 6 | // Changes to this file may cause incorrect behavior and will be lost if 7 | // the code is regenerated. 8 | // 9 | //------------------------------------------------------------------------------ 10 | 11 | namespace EvernoteSDK.Properties { 12 | using System; 13 | 14 | 15 | /// 16 | /// A strongly-typed resource class, for looking up localized strings, etc. 17 | /// 18 | // This class was auto-generated by the StronglyTypedResourceBuilder 19 | // class via a tool like ResGen or Visual Studio. 20 | // To add or remove a member, edit your .ResX file then rerun ResGen 21 | // with the /str option, or rebuild your VS project. 22 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")] 23 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] 24 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] 25 | internal class Resources { 26 | 27 | private static global::System.Resources.ResourceManager resourceMan; 28 | 29 | private static global::System.Globalization.CultureInfo resourceCulture; 30 | 31 | [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] 32 | internal Resources() { 33 | } 34 | 35 | /// 36 | /// Returns the cached ResourceManager instance used by this class. 37 | /// 38 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] 39 | internal static global::System.Resources.ResourceManager ResourceManager { 40 | get { 41 | if (object.ReferenceEquals(resourceMan, null)) { 42 | global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("EvernoteSDK.Properties.Resources", typeof(Resources).Assembly); 43 | resourceMan = temp; 44 | } 45 | return resourceMan; 46 | } 47 | } 48 | 49 | /// 50 | /// Overrides the current thread's CurrentUICulture property for all 51 | /// resource lookups using this strongly typed resource class. 52 | /// 53 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] 54 | internal static global::System.Globalization.CultureInfo Culture { 55 | get { 56 | return resourceCulture; 57 | } 58 | set { 59 | resourceCulture = value; 60 | } 61 | } 62 | } 63 | } 64 | -------------------------------------------------------------------------------- /src/EvernoteSDK/Private/ENCredentials.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Security.Cryptography; 3 | using Evernote.EDAM.UserStore; 4 | using EvernoteSDK.Advanced; 5 | 6 | namespace EvernoteSDK 7 | { 8 | [Serializable] 9 | public class ENCredentials 10 | { 11 | internal string Host {get; set;} 12 | internal string EdamUserId {get; set;} 13 | internal string NoteStoreUrl {get; set;} 14 | internal string WebApiUrlPrefix {get; set;} 15 | internal DateTime ExpirationDate {get; set;} 16 | 17 | [NonSerialized] 18 | private string _authenticationToken; 19 | internal string AuthenticationToken 20 | { 21 | get 22 | { 23 | try 24 | { 25 | string token = CipherUtility.Decrypt(RegistryStore.GetValue(Host, EdamUserId), EdamUserId, Host); 26 | return token; 27 | } 28 | catch (Exception ex) 29 | { 30 | Console.WriteLine("Error getting authentication token from registry: " + ex.Message); 31 | return null; 32 | } 33 | } 34 | set 35 | { 36 | _authenticationToken = value; 37 | } 38 | } 39 | 40 | [NonSerialized] 41 | private ENRegistry _registryStore; 42 | private ENRegistry RegistryStore 43 | { 44 | get 45 | { 46 | if (_registryStore == null) 47 | { 48 | _registryStore = new ENRegistry(); 49 | } 50 | return _registryStore; 51 | } 52 | } 53 | 54 | internal ENCredentials(string host, string edamUserId, string noteStoreUrl, string webApiUrlPrefix, string authenticationToken, DateTime expirationDate) 55 | { 56 | Host = host; 57 | EdamUserId = edamUserId; 58 | NoteStoreUrl = noteStoreUrl; 59 | WebApiUrlPrefix = webApiUrlPrefix; 60 | AuthenticationToken = authenticationToken; 61 | ExpirationDate = expirationDate; 62 | } 63 | 64 | internal ENCredentials(string host, AuthenticationResult authenticationResult) 65 | { 66 | Host = host; 67 | EdamUserId = authenticationResult.User.Id.ToString(); 68 | NoteStoreUrl = authenticationResult.NoteStoreUrl; 69 | WebApiUrlPrefix = authenticationResult.WebApiUrlPrefix; 70 | AuthenticationToken = authenticationResult.AuthenticationToken; 71 | ExpirationDate = authenticationResult.Expiration.ToDateTime(); 72 | } 73 | 74 | internal void SaveToRegistry() 75 | { 76 | // Auth token gets encrypted and saved to the registry. 77 | RegistryStore.SetValue(Host, EdamUserId, CipherUtility.Encrypt(_authenticationToken, EdamUserId, Host)); 78 | } 79 | 80 | internal void DeleteFromRegistry() 81 | { 82 | RegistryStore.DeleteValue(Host, EdamUserId); 83 | } 84 | 85 | internal bool AreValid() 86 | { 87 | // Not all credentials are guaranteed to have a valid expiration. If none is present, 88 | // then assume it's valid. 89 | if (ExpirationDate == new DateTime()) 90 | { 91 | return true; 92 | } 93 | 94 | // Check the expiration date. 95 | if (DateTime.Now > ExpirationDate) 96 | { 97 | return false; 98 | } 99 | 100 | return true; 101 | } 102 | 103 | } 104 | 105 | } -------------------------------------------------------------------------------- /samples/CS/SampleApp/SampleApp/Properties/Resources.Designer.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // This code was generated by a tool. 4 | // Runtime Version:4.0.30319.18444 5 | // 6 | // Changes to this file may cause incorrect behavior and will be lost if 7 | // the code is regenerated. 8 | // 9 | //------------------------------------------------------------------------------ 10 | 11 | namespace SampleApp.Properties 12 | { 13 | 14 | 15 | /// 16 | /// A strongly-typed resource class, for looking up localized strings, etc. 17 | /// 18 | // This class was auto-generated by the StronglyTypedResourceBuilder 19 | // class via a tool like ResGen or Visual Studio. 20 | // To add or remove a member, edit your .ResX file then rerun ResGen 21 | // with the /str option, or rebuild your VS project. 22 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")] 23 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] 24 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] 25 | internal class Resources 26 | { 27 | 28 | private static global::System.Resources.ResourceManager resourceMan; 29 | 30 | private static global::System.Globalization.CultureInfo resourceCulture; 31 | 32 | [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] 33 | internal Resources() 34 | { 35 | } 36 | 37 | /// 38 | /// Returns the cached ResourceManager instance used by this class. 39 | /// 40 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] 41 | internal static global::System.Resources.ResourceManager ResourceManager 42 | { 43 | get 44 | { 45 | if ((resourceMan == null)) 46 | { 47 | global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("SampleApp.Properties.Resources", typeof(Resources).Assembly); 48 | resourceMan = temp; 49 | } 50 | return resourceMan; 51 | } 52 | } 53 | 54 | /// 55 | /// Overrides the current thread's CurrentUICulture property for all 56 | /// resource lookups using this strongly typed resource class. 57 | /// 58 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] 59 | internal static global::System.Globalization.CultureInfo Culture 60 | { 61 | get 62 | { 63 | return resourceCulture; 64 | } 65 | set 66 | { 67 | resourceCulture = value; 68 | } 69 | } 70 | } 71 | } 72 | -------------------------------------------------------------------------------- /src/Evernote OAuth/AuthSample/AuthSample/Properties/Resources.Designer.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // This code was generated by a tool. 4 | // Runtime Version:4.0.30319.269 5 | // 6 | // Changes to this file may cause incorrect behavior and will be lost if 7 | // the code is regenerated. 8 | // 9 | //------------------------------------------------------------------------------ 10 | 11 | namespace AuthSample.Properties { 12 | using System; 13 | 14 | 15 | /// 16 | /// A strongly-typed resource class, for looking up localized strings, etc. 17 | /// 18 | // This class was auto-generated by the StronglyTypedResourceBuilder 19 | // class via a tool like ResGen or Visual Studio. 20 | // To add or remove a member, edit your .ResX file then rerun ResGen 21 | // with the /str option, or rebuild your VS project. 22 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")] 23 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] 24 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] 25 | internal class Resources { 26 | 27 | private static global::System.Resources.ResourceManager resourceMan; 28 | 29 | private static global::System.Globalization.CultureInfo resourceCulture; 30 | 31 | [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] 32 | internal Resources() { 33 | } 34 | 35 | /// 36 | /// Returns the cached ResourceManager instance used by this class. 37 | /// 38 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] 39 | internal static global::System.Resources.ResourceManager ResourceManager { 40 | get { 41 | if (object.ReferenceEquals(resourceMan, null)) { 42 | global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("AuthSample.Properties.Resources", typeof(Resources).Assembly); 43 | resourceMan = temp; 44 | } 45 | return resourceMan; 46 | } 47 | } 48 | 49 | /// 50 | /// Overrides the current thread's CurrentUICulture property for all 51 | /// resource lookups using this strongly typed resource class. 52 | /// 53 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] 54 | internal static global::System.Globalization.CultureInfo Culture { 55 | get { 56 | return resourceCulture; 57 | } 58 | set { 59 | resourceCulture = value; 60 | } 61 | } 62 | } 63 | } 64 | -------------------------------------------------------------------------------- /src/Evernote OAuth/EvernoteOAuthNet/EvernoteOAuthNet/Properties/Resources.Designer.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // This code was generated by a tool. 4 | // Runtime Version:4.0.30319.269 5 | // 6 | // Changes to this file may cause incorrect behavior and will be lost if 7 | // the code is regenerated. 8 | // 9 | //------------------------------------------------------------------------------ 10 | 11 | namespace EvernoteOAuthNet.Properties { 12 | using System; 13 | 14 | 15 | /// 16 | /// A strongly-typed resource class, for looking up localized strings, etc. 17 | /// 18 | // This class was auto-generated by the StronglyTypedResourceBuilder 19 | // class via a tool like ResGen or Visual Studio. 20 | // To add or remove a member, edit your .ResX file then rerun ResGen 21 | // with the /str option, or rebuild your VS project. 22 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")] 23 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] 24 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] 25 | internal class Resources { 26 | 27 | private static global::System.Resources.ResourceManager resourceMan; 28 | 29 | private static global::System.Globalization.CultureInfo resourceCulture; 30 | 31 | [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] 32 | internal Resources() { 33 | } 34 | 35 | /// 36 | /// Returns the cached ResourceManager instance used by this class. 37 | /// 38 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] 39 | internal static global::System.Resources.ResourceManager ResourceManager { 40 | get { 41 | if (object.ReferenceEquals(resourceMan, null)) { 42 | global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("EvernoteOAuthNet.Properties.Resources", typeof(Resources).Assembly); 43 | resourceMan = temp; 44 | } 45 | return resourceMan; 46 | } 47 | } 48 | 49 | /// 50 | /// Overrides the current thread's CurrentUICulture property for all 51 | /// resource lookups using this strongly typed resource class. 52 | /// 53 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] 54 | internal static global::System.Globalization.CultureInfo Culture { 55 | get { 56 | return resourceCulture; 57 | } 58 | set { 59 | resourceCulture = value; 60 | } 61 | } 62 | } 63 | } 64 | -------------------------------------------------------------------------------- /samples/VB.NET/SampleApp/SampleApp/My Project/Settings.Designer.vb: -------------------------------------------------------------------------------- 1 | '------------------------------------------------------------------------------ 2 | ' 3 | ' This code was generated by a tool. 4 | ' Runtime Version:4.0.30319.18444 5 | ' 6 | ' Changes to this file may cause incorrect behavior and will be lost if 7 | ' the code is regenerated. 8 | ' 9 | '------------------------------------------------------------------------------ 10 | 11 | Option Strict On 12 | Option Explicit On 13 | 14 | 15 | Namespace My 16 | 17 | _ 20 | Partial Friend NotInheritable Class MySettings 21 | Inherits Global.System.Configuration.ApplicationSettingsBase 22 | 23 | Private Shared defaultInstance As MySettings = CType(Global.System.Configuration.ApplicationSettingsBase.Synchronized(New MySettings), MySettings) 24 | 25 | #Region "My.Settings Auto-Save Functionality" 26 | #If _MyType = "WindowsForms" Then 27 | Private Shared addedHandler As Boolean 28 | 29 | Private Shared addedHandlerLockObject As New Object 30 | 31 | _ 32 | Private Shared Sub AutoSaveSettings(ByVal sender As Global.System.Object, ByVal e As Global.System.EventArgs) 33 | If My.Application.SaveMySettingsOnExit Then 34 | My.Settings.Save() 35 | End If 36 | End Sub 37 | #End If 38 | #End Region 39 | 40 | Public Shared ReadOnly Property [Default]() As MySettings 41 | Get 42 | 43 | #If _MyType = "WindowsForms" Then 44 | If Not addedHandler Then 45 | SyncLock addedHandlerLockObject 46 | If Not addedHandler Then 47 | AddHandler My.Application.Shutdown, AddressOf AutoSaveSettings 48 | addedHandler = True 49 | End If 50 | End SyncLock 51 | End If 52 | #End If 53 | Return defaultInstance 54 | End Get 55 | End Property 56 | End Class 57 | End Namespace 58 | 59 | Namespace My 60 | 61 | _ 64 | Friend Module MySettingsProperty 65 | 66 | _ 67 | Friend ReadOnly Property Settings() As Global.SampleApp.My.MySettings 68 | Get 69 | Return Global.SampleApp.My.MySettings.Default 70 | End Get 71 | End Property 72 | End Module 73 | End Namespace 74 | -------------------------------------------------------------------------------- /samples/VB.NET/SampleApp/SampleApp/Form1.Designer.vb: -------------------------------------------------------------------------------- 1 | _ 2 | Partial Class Form1 3 | Inherits System.Windows.Forms.Form 4 | 5 | 'Form overrides dispose to clean up the component list. 6 | _ 7 | Protected Overrides Sub Dispose(ByVal disposing As Boolean) 8 | Try 9 | If disposing AndAlso components IsNot Nothing Then 10 | components.Dispose() 11 | End If 12 | Finally 13 | MyBase.Dispose(disposing) 14 | End Try 15 | End Sub 16 | 17 | 'Required by the Windows Form Designer 18 | Private components As System.ComponentModel.IContainer 19 | 20 | 'NOTE: The following procedure is required by the Windows Form Designer 21 | 'It can be modified using the Windows Form Designer. 22 | 'Do not modify it using the code editor. 23 | _ 24 | Private Sub InitializeComponent() 25 | Me.PictureBoxThumbnail = New System.Windows.Forms.PictureBox() 26 | Me.label1 = New System.Windows.Forms.Label() 27 | Me.WebBrowser1 = New System.Windows.Forms.WebBrowser() 28 | CType(Me.PictureBoxThumbnail, System.ComponentModel.ISupportInitialize).BeginInit() 29 | Me.SuspendLayout() 30 | ' 31 | 'PictureBoxThumbnail 32 | ' 33 | Me.PictureBoxThumbnail.Location = New System.Drawing.Point(41, 23) 34 | Me.PictureBoxThumbnail.Name = "PictureBoxThumbnail" 35 | Me.PictureBoxThumbnail.Size = New System.Drawing.Size(120, 120) 36 | Me.PictureBoxThumbnail.TabIndex = 0 37 | Me.PictureBoxThumbnail.TabStop = False 38 | ' 39 | 'label1 40 | ' 41 | Me.label1.AutoSize = True 42 | Me.label1.Location = New System.Drawing.Point(44, 156) 43 | Me.label1.Name = "label1" 44 | Me.label1.Size = New System.Drawing.Size(115, 13) 45 | Me.label1.TabIndex = 2 46 | Me.label1.Text = "Downloaded thumbnail" 47 | ' 48 | 'WebBrowser1 49 | ' 50 | Me.WebBrowser1.Location = New System.Drawing.Point(210, 23) 51 | Me.WebBrowser1.MinimumSize = New System.Drawing.Size(20, 20) 52 | Me.WebBrowser1.Name = "WebBrowser1" 53 | Me.WebBrowser1.Size = New System.Drawing.Size(490, 370) 54 | Me.WebBrowser1.TabIndex = 3 55 | ' 56 | 'Form1 57 | ' 58 | Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!) 59 | Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font 60 | Me.ClientSize = New System.Drawing.Size(719, 447) 61 | Me.Controls.Add(Me.WebBrowser1) 62 | Me.Controls.Add(Me.label1) 63 | Me.Controls.Add(Me.PictureBoxThumbnail) 64 | Me.Name = "Form1" 65 | Me.Text = "Form1" 66 | CType(Me.PictureBoxThumbnail, System.ComponentModel.ISupportInitialize).EndInit() 67 | Me.ResumeLayout(False) 68 | Me.PerformLayout() 69 | 70 | End Sub 71 | Friend WithEvents PictureBoxThumbnail As System.Windows.Forms.PictureBox 72 | Private WithEvents label1 As System.Windows.Forms.Label 73 | Friend WithEvents WebBrowser1 As System.Windows.Forms.WebBrowser 74 | End Class 75 | -------------------------------------------------------------------------------- /samples/VB.NET/SampleAppAdvanced/SampleAppAdvanced/My Project/Settings.Designer.vb: -------------------------------------------------------------------------------- 1 | '------------------------------------------------------------------------------ 2 | ' 3 | ' This code was generated by a tool. 4 | ' Runtime Version:4.0.30319.18444 5 | ' 6 | ' Changes to this file may cause incorrect behavior and will be lost if 7 | ' the code is regenerated. 8 | ' 9 | '------------------------------------------------------------------------------ 10 | 11 | Option Strict On 12 | Option Explicit On 13 | 14 | 15 | Namespace My 16 | 17 | _ 20 | Partial Friend NotInheritable Class MySettings 21 | Inherits Global.System.Configuration.ApplicationSettingsBase 22 | 23 | Private Shared defaultInstance As MySettings = CType(Global.System.Configuration.ApplicationSettingsBase.Synchronized(New MySettings), MySettings) 24 | 25 | #Region "My.Settings Auto-Save Functionality" 26 | #If _MyType = "WindowsForms" Then 27 | Private Shared addedHandler As Boolean 28 | 29 | Private Shared addedHandlerLockObject As New Object 30 | 31 | _ 32 | Private Shared Sub AutoSaveSettings(ByVal sender As Global.System.Object, ByVal e As Global.System.EventArgs) 33 | If My.Application.SaveMySettingsOnExit Then 34 | My.Settings.Save() 35 | End If 36 | End Sub 37 | #End If 38 | #End Region 39 | 40 | Public Shared ReadOnly Property [Default]() As MySettings 41 | Get 42 | 43 | #If _MyType = "WindowsForms" Then 44 | If Not addedHandler Then 45 | SyncLock addedHandlerLockObject 46 | If Not addedHandler Then 47 | AddHandler My.Application.Shutdown, AddressOf AutoSaveSettings 48 | addedHandler = True 49 | End If 50 | End SyncLock 51 | End If 52 | #End If 53 | Return defaultInstance 54 | End Get 55 | End Property 56 | End Class 57 | End Namespace 58 | 59 | Namespace My 60 | 61 | _ 64 | Friend Module MySettingsProperty 65 | 66 | _ 67 | Friend ReadOnly Property Settings() As Global.SampleAppAdvanced.My.MySettings 68 | Get 69 | Return Global.SampleAppAdvanced.My.MySettings.Default 70 | End Get 71 | End Property 72 | End Module 73 | End Namespace 74 | -------------------------------------------------------------------------------- /.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 | 65 | # Auto detect text files and perform LF normalization 66 | * text=auto 67 | 68 | # Custom for Visual Studio 69 | *.cs diff=csharp 70 | *.sln merge=union 71 | *.csproj merge=union 72 | *.vbproj merge=union 73 | *.fsproj merge=union 74 | *.dbproj merge=union 75 | 76 | # Standard to msysgit 77 | *.doc diff=astextplain 78 | *.DOC diff=astextplain 79 | *.docx diff=astextplain 80 | *.DOCX diff=astextplain 81 | *.dot diff=astextplain 82 | *.DOT diff=astextplain 83 | *.pdf diff=astextplain 84 | *.PDF diff=astextplain 85 | *.rtf diff=astextplain 86 | *.RTF diff=astextplain -------------------------------------------------------------------------------- /src/EvernoteSDK/ENNoteRef.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.IO; 3 | using System.Runtime.Serialization.Formatters.Binary; 4 | using System.Text; 5 | 6 | namespace EvernoteSDK 7 | { 8 | [Serializable] 9 | public class ENNoteRef 10 | { 11 | // An opaque reference to an existing note in the service. It can be used to 12 | // share or update that same note at a later time. 13 | 14 | public enum ENNoteRefType 15 | { 16 | TypePersonal, 17 | TypeBusiness, 18 | TypeShared 19 | } 20 | 21 | public ENNoteRefType Type {get; set;} 22 | public string Guid {get; set;} 23 | public ENLinkedNotebookRef LinkedNotebook {get; set;} 24 | 25 | public byte[] AsData() 26 | { 27 | BinaryFormatter bf = new BinaryFormatter(); 28 | MemoryStream ms = new MemoryStream(); 29 | bf.Serialize(ms, this); 30 | return ms.ToArray(); 31 | } 32 | 33 | public static ENNoteRef NoteRefFromData(byte[] data) 34 | { 35 | MemoryStream memStream = new MemoryStream(); 36 | BinaryFormatter binForm = new BinaryFormatter(); 37 | memStream.Write(data, 0, data.Length); 38 | memStream.Seek(0, SeekOrigin.Begin); 39 | ENNoteRef obj = new ENNoteRef(); 40 | obj = (ENNoteRef)binForm.Deserialize(memStream); 41 | return obj; 42 | } 43 | 44 | public override bool Equals(object Object) 45 | { 46 | if (this == Object) 47 | { 48 | return true; 49 | } 50 | 51 | if (Object == null) 52 | { 53 | return false; 54 | } 55 | 56 | if (Object.GetType() != typeof(ENNoteRef)) 57 | { 58 | return false; 59 | } 60 | 61 | ENNoteRef other = (ENNoteRef)Object; 62 | if (other.Type == this.Type && this.Guid == other.Guid && (this.LinkedNotebook == other.LinkedNotebook || other.LinkedNotebook.IsEqual(this.LinkedNotebook))) 63 | { 64 | return true; 65 | } 66 | 67 | return false; 68 | } 69 | 70 | public override int GetHashCode() 71 | { 72 | int prime = 31; 73 | int result = 1; 74 | result = prime * result + (int)this.Type; 75 | result = prime * result + this.Guid.GetHashCode(); 76 | result = prime * result + this.LinkedNotebook.Hash(); 77 | return result; 78 | } 79 | 80 | public string Description() 81 | { 82 | StringBuilder str = null; 83 | string typeStr = null; 84 | switch (this.Type) 85 | { 86 | case ENNoteRefType.TypePersonal : 87 | typeStr = "personal"; 88 | break; 89 | case ENNoteRefType.TypeBusiness : 90 | typeStr = "business"; 91 | break; 92 | case ENNoteRefType.TypeShared : 93 | typeStr = "shared"; 94 | break; 95 | } 96 | 97 | str.AppendFormat("<{0}: {1}; guid = {2}; type = {3}", typeof(ENNoteRef), this, this.Guid, typeStr); 98 | if (this.LinkedNotebook != null) 99 | { 100 | str.AppendFormat("; link shard = {0}", this.LinkedNotebook.ShardId); 101 | } 102 | 103 | str.Append(">"); 104 | return str.ToString(); 105 | } 106 | 107 | } 108 | 109 | } -------------------------------------------------------------------------------- /src/EvernoteSDK/Advanced/ENPreferencesStore.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Diagnostics; 4 | using System.IO; 5 | using System.Reflection; 6 | 7 | namespace EvernoteSDK 8 | { 9 | namespace Advanced 10 | { 11 | public class ENPreferencesStore 12 | { 13 | private string Pathname {get; set;} 14 | private Dictionary Store {get; set;} 15 | 16 | private static object PathnameForStoreFilename(string filename) 17 | { 18 | FileVersionInfo vi = FileVersionInfo.GetVersionInfo(Assembly.GetExecutingAssembly().Location); 19 | var companyKey = vi.CompanyName; 20 | var productKey = vi.ProductName; 21 | if (companyKey.Length == 0) 22 | { 23 | companyKey = productKey; 24 | } 25 | return string.Format("{0}\\{1}\\{2}\\{3}", Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData), companyKey, productKey, filename); 26 | } 27 | 28 | public ENPreferencesStore(string filename) 29 | { 30 | Pathname = PathnameForStoreFilename(filename).ToString(); 31 | Store = new Dictionary(); 32 | Load(); 33 | } 34 | 35 | public object ObjectForKey(string key) 36 | { 37 | object value = null; 38 | Store.TryGetValue(key, out value); 39 | return value; 40 | } 41 | 42 | public void SetObject(object objectToStore, string key) 43 | { 44 | if (objectToStore != null) 45 | { 46 | Store[key] = objectToStore; 47 | } 48 | else 49 | { 50 | Store.Remove(key); 51 | } 52 | Save(); 53 | } 54 | 55 | private void Save() 56 | { 57 | string dir = Path.GetDirectoryName(Pathname); 58 | if (!(Directory.Exists(dir))) 59 | { 60 | Directory.CreateDirectory(dir); 61 | } 62 | 63 | FileStream stream = new FileStream(Pathname, FileMode.OpenOrCreate); 64 | System.Runtime.Serialization.Formatters.Binary.BinaryFormatter formatter = new System.Runtime.Serialization.Formatters.Binary.BinaryFormatter(); 65 | formatter.Serialize(stream, Store); 66 | stream.Close(); 67 | } 68 | 69 | public void RemoveAllObjects() 70 | { 71 | Store.Clear(); 72 | Save(); 73 | } 74 | 75 | private void Load() 76 | { 77 | AppDomain currentDomain = AppDomain.CurrentDomain; 78 | 79 | currentDomain.AssemblyResolve += MyResolveEventHandler; 80 | 81 | if (File.Exists(Pathname)) 82 | { 83 | FileStream stream = new FileStream(Pathname, FileMode.Open); 84 | System.Runtime.Serialization.Formatters.Binary.BinaryFormatter formatter = new System.Runtime.Serialization.Formatters.Binary.BinaryFormatter(); 85 | Store = (Dictionary)formatter.Deserialize(stream); 86 | stream.Close(); 87 | } 88 | } 89 | 90 | private Assembly MyResolveEventHandler(object sender, ResolveEventArgs args) 91 | { 92 | Assembly[] ayAssemblies = AppDomain.CurrentDomain.GetAssemblies(); 93 | foreach (Assembly item in ayAssemblies) 94 | { 95 | if (item.FullName == args.Name) 96 | { 97 | return item; 98 | } 99 | } 100 | 101 | return null; 102 | } 103 | 104 | } 105 | } 106 | 107 | } -------------------------------------------------------------------------------- /src/Evernote OAuth/EvernoteOAuthNet/EvernoteOAuthNet/LoginForm.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.ComponentModel; 4 | using System.Data; 5 | using System.Drawing; 6 | using System.Text; 7 | using System.Windows.Forms; 8 | using System.Web; 9 | using System.Collections.Specialized; 10 | 11 | namespace EvernoteOAuthNet 12 | { 13 | internal partial class LoginForm : Form 14 | { 15 | private oAuthEvernote _oauth; 16 | private String _token; 17 | private String _verifier; 18 | private String _tokenSecret; 19 | private bool _linkedAppNotebookSelected; 20 | 21 | public String Token 22 | { 23 | get 24 | { 25 | return _token; 26 | } 27 | } 28 | 29 | public String Verifier 30 | { 31 | get 32 | { 33 | return _verifier; 34 | } 35 | } 36 | 37 | public String TokenSecret 38 | { 39 | get 40 | { 41 | return _tokenSecret; 42 | } 43 | } 44 | 45 | public bool LinkedAppNotebookSelected 46 | { 47 | get 48 | { 49 | return _linkedAppNotebookSelected; 50 | } 51 | } 52 | 53 | 54 | public LoginForm(oAuthEvernote o, string windowTitle) 55 | { 56 | _oauth = o; 57 | _token = null; 58 | InitializeComponent(); 59 | this.Text = windowTitle; 60 | this.addressTextBox.Text = o.AuthorizationLink; 61 | _token = _oauth.Token; 62 | _tokenSecret = _oauth.TokenSecret; 63 | browser.Navigate(new Uri(_oauth.AuthorizationLink)); 64 | 65 | } 66 | 67 | private void webBrowser1_DocumentCompleted(object sender, WebBrowserDocumentCompletedEventArgs e) 68 | { 69 | 70 | } 71 | 72 | private void webBrowser1_Navigating(object sender, WebBrowserNavigatingEventArgs e) 73 | { 74 | this.addressTextBox.Text = e.Url.ToString(); 75 | } 76 | 77 | private void browser_Navigated(object sender, WebBrowserNavigatedEventArgs e) 78 | { 79 | //if (browser.Url.ToString().Contains(_oauth.CALLBACK_URL) | browser.Url.ToString().Contains(_oauth.CALLBACK_ALT_URL)) 80 | if (!browser.Url.ToString().Contains(@"evernote.com") & !browser.Url.ToString().Contains(@"yinxiang.com")) 81 | { 82 | string queryParams = e.Url.Query; 83 | if (queryParams.Length > 0) 84 | { 85 | //Store the Token and Token Secret 86 | NameValueCollection qs = HttpUtility.ParseQueryString(queryParams); 87 | if (qs["oauth_token"] != null) 88 | { 89 | _token = qs["oauth_token"]; 90 | } 91 | if (qs["oauth_verifier"] != null) 92 | { 93 | _verifier = qs["oauth_verifier"]; 94 | } 95 | if (qs["sandbox_lnb"] != null) 96 | { 97 | _linkedAppNotebookSelected = qs["sandbox_lnb"] == "true" ? true : false; 98 | } 99 | } 100 | this.Close(); 101 | } 102 | } 103 | 104 | private void addressTextBox_KeyPress(object sender, KeyPressEventArgs e) 105 | { 106 | //Cancel the key press so the user can't enter a new url 107 | e.Handled = true; 108 | } 109 | 110 | } 111 | } 112 | -------------------------------------------------------------------------------- /src/Evernote OAuth/EvernoteOAuthNet/EvernoteOAuthNet/LoginForm.Designer.cs: -------------------------------------------------------------------------------- 1 | namespace EvernoteOAuthNet 2 | { 3 | partial class LoginForm 4 | { 5 | /// 6 | /// Required designer variable. 7 | /// 8 | private System.ComponentModel.IContainer components = null; 9 | 10 | /// 11 | /// Clean up any resources being used. 12 | /// 13 | /// true if managed resources should be disposed; otherwise, false. 14 | protected override void Dispose(bool disposing) 15 | { 16 | if (disposing && (components != null)) 17 | { 18 | components.Dispose(); 19 | } 20 | base.Dispose(disposing); 21 | } 22 | 23 | #region Windows Form Designer generated code 24 | 25 | /// 26 | /// Required method for Designer support - do not modify 27 | /// the contents of this method with the code editor. 28 | /// 29 | private void InitializeComponent() 30 | { 31 | System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(LoginForm)); 32 | this.browser = new System.Windows.Forms.WebBrowser(); 33 | this.addressTextBox = new System.Windows.Forms.TextBox(); 34 | this.SuspendLayout(); 35 | // 36 | // browser 37 | // 38 | this.browser.Location = new System.Drawing.Point(0, 0); 39 | this.browser.MinimumSize = new System.Drawing.Size(20, 20); 40 | this.browser.Name = "browser"; 41 | this.browser.ScriptErrorsSuppressed = true; 42 | this.browser.ScrollBarsEnabled = false; 43 | this.browser.Size = new System.Drawing.Size(864, 669); 44 | this.browser.TabIndex = 0; 45 | this.browser.DocumentCompleted += new System.Windows.Forms.WebBrowserDocumentCompletedEventHandler(this.webBrowser1_DocumentCompleted); 46 | this.browser.Navigated += new System.Windows.Forms.WebBrowserNavigatedEventHandler(this.browser_Navigated); 47 | this.browser.Navigating += new System.Windows.Forms.WebBrowserNavigatingEventHandler(this.webBrowser1_Navigating); 48 | // 49 | // addressTextBox 50 | // 51 | this.addressTextBox.Dock = System.Windows.Forms.DockStyle.Top; 52 | this.addressTextBox.Location = new System.Drawing.Point(0, 0); 53 | this.addressTextBox.Name = "addressTextBox"; 54 | this.addressTextBox.Size = new System.Drawing.Size(864, 20); 55 | this.addressTextBox.TabIndex = 1; 56 | this.addressTextBox.Visible = false; 57 | // 58 | // LoginForm 59 | // 60 | this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); 61 | this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; 62 | this.ClientSize = new System.Drawing.Size(864, 669); 63 | this.Controls.Add(this.browser); 64 | this.Controls.Add(this.addressTextBox); 65 | this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon"))); 66 | this.MaximizeBox = false; 67 | this.MinimizeBox = false; 68 | this.Name = "LoginForm"; 69 | this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen; 70 | this.Text = "Please provide authorization to access your Evernote account"; 71 | this.ResumeLayout(false); 72 | this.PerformLayout(); 73 | 74 | } 75 | 76 | #endregion 77 | 78 | private System.Windows.Forms.WebBrowser browser; 79 | private System.Windows.Forms.TextBox addressTextBox; 80 | } 81 | } -------------------------------------------------------------------------------- /.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 | *.sln.docstates 8 | 9 | # Build results 10 | 11 | [Dd]ebug/ 12 | [Rr]elease/ 13 | x64/ 14 | build/ 15 | [Bb]in/ 16 | [Oo]bj/ 17 | 18 | # Enable "build/" folder in the NuGet Packages folder since NuGet packages use it for MSBuild targets 19 | !packages/*/build/ 20 | 21 | # MSTest test Results 22 | [Tt]est[Rr]esult*/ 23 | [Bb]uild[Ll]og.* 24 | 25 | *_i.c 26 | *_p.c 27 | *.ilk 28 | *.meta 29 | *.obj 30 | *.pch 31 | *.pdb 32 | *.pgc 33 | *.pgd 34 | *.rsp 35 | *.sbr 36 | *.tlb 37 | *.tli 38 | *.tlh 39 | *.tmp 40 | *.tmp_proj 41 | *.log 42 | *.vspscc 43 | *.vssscc 44 | .builds 45 | *.pidb 46 | *.log 47 | *.scc 48 | 49 | # Visual C++ cache files 50 | ipch/ 51 | *.aps 52 | *.ncb 53 | *.opensdf 54 | *.sdf 55 | *.cachefile 56 | 57 | # Visual Studio profiler 58 | *.psess 59 | *.vsp 60 | *.vspx 61 | 62 | # Guidance Automation Toolkit 63 | *.gpState 64 | 65 | # ReSharper is a .NET coding add-in 66 | _ReSharper*/ 67 | *.[Rr]e[Ss]harper 68 | 69 | # TeamCity is a build add-in 70 | _TeamCity* 71 | 72 | # DotCover is a Code Coverage Tool 73 | *.dotCover 74 | 75 | # NCrunch 76 | *.ncrunch* 77 | .*crunch*.local.xml 78 | 79 | # Installshield output folder 80 | [Ee]xpress/ 81 | 82 | # DocProject is a documentation generator add-in 83 | DocProject/buildhelp/ 84 | DocProject/Help/*.HxT 85 | DocProject/Help/*.HxC 86 | DocProject/Help/*.hhc 87 | DocProject/Help/*.hhk 88 | DocProject/Help/*.hhp 89 | DocProject/Help/Html2 90 | DocProject/Help/html 91 | 92 | # Click-Once directory 93 | publish/ 94 | 95 | # Publish Web Output 96 | *.Publish.xml 97 | 98 | # NuGet Packages Directory 99 | ## TODO: If you have NuGet Package Restore enabled, uncomment the next line 100 | #packages/ 101 | 102 | # Windows Azure Build Output 103 | csx 104 | *.build.csdef 105 | 106 | # Windows Store app package directory 107 | AppPackages/ 108 | 109 | # Others 110 | sql/ 111 | *.Cache 112 | ClientBin/ 113 | [Ss]tyle[Cc]op.* 114 | ~$* 115 | *~ 116 | *.dbmdl 117 | *.[Pp]ublish.xml 118 | *.pfx 119 | *.publishsettings 120 | 121 | # RIA/Silverlight projects 122 | Generated_Code/ 123 | 124 | # Backup & report files from converting an old project file to a newer 125 | # Visual Studio version. Backup files are not needed, because we have git ;-) 126 | _UpgradeReport_Files/ 127 | Backup*/ 128 | UpgradeLog*.XML 129 | UpgradeLog*.htm 130 | 131 | # SQL Server files 132 | App_Data/*.mdf 133 | App_Data/*.ldf 134 | 135 | 136 | #LightSwitch generated files 137 | GeneratedArtifacts/ 138 | _Pvt_Extensions/ 139 | ModelManifest.xml 140 | 141 | # ========================= 142 | # Windows detritus 143 | # ========================= 144 | 145 | # Windows image file caches 146 | Thumbs.db 147 | ehthumbs.db 148 | 149 | # Folder config file 150 | Desktop.ini 151 | 152 | # Recycle Bin used on file shares 153 | $RECYCLE.BIN/ 154 | 155 | # Mac desktop service store files 156 | .DS_Store 157 | 158 | # Windows image file caches 159 | Thumbs.db 160 | ehthumbs.db 161 | 162 | # Folder config file 163 | Desktop.ini 164 | 165 | # Recycle Bin used on file shares 166 | $RECYCLE.BIN/ 167 | 168 | # Windows Installer files 169 | *.cab 170 | # *.msi 171 | *.msm 172 | *.msp 173 | 174 | # ========================= 175 | # Operating System Files 176 | # ========================= 177 | 178 | # OSX 179 | # ========================= 180 | 181 | .DS_Store 182 | .AppleDouble 183 | .LSOverride 184 | 185 | # Icon must end with two \r 186 | Icon 187 | 188 | # Thumbnails 189 | ._* 190 | 191 | # Files that might appear on external disk 192 | .Spotlight-V100 193 | .Trashes 194 | 195 | # Directories potentially created on remote AFP share 196 | .AppleDB 197 | .AppleDesktop 198 | Network Trash Folder 199 | Temporary Items 200 | .apdisk 201 | 202 | -------------------------------------------------------------------------------- /src/EvernoteSDK/ENResource.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Drawing; 3 | using System.Drawing.Imaging; 4 | using Evernote.EDAM.Type; 5 | using EvernoteSDK.Advanced; 6 | 7 | namespace EvernoteSDK 8 | { 9 | public class ENResource 10 | { 11 | private byte[] _data; 12 | public byte[] Data 13 | { 14 | get 15 | { 16 | return _data; 17 | } 18 | set 19 | { 20 | if (value != null && value.Length >= Int32.MaxValue) 21 | { 22 | ENSDKLogger.ENSDKLogError("Data length for resource is greater than Int32."); 23 | value = null; 24 | } 25 | 26 | DataHash = null; 27 | _data = value; 28 | } 29 | } 30 | 31 | public string MimeType {get; set;} 32 | public string Filename {get; set;} 33 | internal string SourceUrl {get; set;} 34 | private string Guid {get; set;} 35 | 36 | private byte[] _dataHash; 37 | internal byte[] DataHash 38 | { 39 | get 40 | { 41 | // Compute and cache the hash value. 42 | if (_dataHash == null && Data.Length > 0) 43 | { 44 | _dataHash = Data.Enmd5(); 45 | } 46 | return _dataHash; 47 | } 48 | set 49 | { 50 | _dataHash = value; 51 | } 52 | } 53 | 54 | internal ENResource() 55 | { 56 | } 57 | 58 | public ENResource(byte[] data, string mimeType, string filename) 59 | { 60 | Data = data; 61 | MimeType = mimeType; 62 | Filename = filename; 63 | 64 | if (data == null) 65 | { 66 | throw new ArgumentException("Invalid argument", "data"); 67 | } 68 | } 69 | 70 | public ENResource(byte[] data, string mimeType) : this(data, mimeType, null) 71 | { 72 | } 73 | 74 | public ENResource(Image image) : this() 75 | { 76 | System.IO.MemoryStream memstream = new System.IO.MemoryStream(); 77 | image.Save(memstream, image.RawFormat); 78 | Data = memstream.ToArray(); 79 | 80 | if (image.RawFormat.Equals(ImageFormat.Png)) 81 | { 82 | MimeType = Evernote.EDAM.Limits.Constants.EDAM_MIME_TYPE_PNG; 83 | } 84 | else if (image.RawFormat.Equals(ImageFormat.Jpeg)) 85 | { 86 | MimeType = Evernote.EDAM.Limits.Constants.EDAM_MIME_TYPE_JPEG; 87 | //ElseIf image.RawFormat.Equals(ImageFormat.Gif) Then 88 | // TODO: Find out if it's OK to include the GIF format 89 | // Me.mimeType = Evernote.EDAM.Limits.Constants.EDAM_MIME_TYPE_GIF 90 | } 91 | else 92 | { 93 | throw new ArgumentException("Unsupported image format", "image"); 94 | } 95 | } 96 | 97 | internal static ENResource ResourceWithServiceResource(Resource serviceResource) 98 | { 99 | if (serviceResource.Data.Body == null) 100 | { 101 | ENSDKLogger.ENSDKLogError("Can't create an ENResource from an EDAMResource with no body"); 102 | return null; 103 | } 104 | 105 | var resource = new ENResource(); 106 | resource.Data = serviceResource.Data.Body; 107 | resource.MimeType = serviceResource.Mime; 108 | resource.Filename = serviceResource.Attributes.FileName; 109 | resource.SourceUrl = serviceResource.Attributes.SourceURL; 110 | return resource; 111 | } 112 | 113 | internal Resource EDAMResource() 114 | { 115 | if (Data == null) 116 | { 117 | return null; 118 | } 119 | 120 | Resource resource = new Resource(); 121 | resource.Guid = Guid; 122 | if (resource.Guid == null && Data != null) 123 | { 124 | resource.Data = new Data(); 125 | resource.Data.BodyHash = DataHash; 126 | resource.Data.Size = Data.Length; 127 | resource.Data.Body = Data; 128 | } 129 | resource.Mime = MimeType; 130 | ResourceAttributes attributes = new ResourceAttributes(); 131 | if (Filename != null) 132 | { 133 | attributes.FileName = Filename; 134 | } 135 | if (SourceUrl != null) 136 | { 137 | attributes.SourceURL = SourceUrl; 138 | } 139 | resource.Attributes = attributes; 140 | return resource; 141 | } 142 | 143 | } 144 | 145 | } -------------------------------------------------------------------------------- /samples/CS/SampleAppAdvanced/SampleAppAdvanced/SampleAppAdvanced.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Debug 6 | AnyCPU 7 | {62E1BF07-DE5C-41D9-B524-38964E166D68} 8 | Exe 9 | Properties 10 | SampleAppAdvanced 11 | SampleAppAdvanced 12 | v4.0 13 | 512 14 | 15 | 16 | AnyCPU 17 | true 18 | full 19 | false 20 | bin\Debug\ 21 | DEBUG;TRACE 22 | prompt 23 | 4 24 | 25 | 26 | AnyCPU 27 | pdbonly 28 | true 29 | bin\Release\ 30 | TRACE 31 | prompt 32 | 4 33 | 34 | 35 | SampleAppAdvanced.Program 36 | 37 | 38 | 39 | ..\..\..\..\assemblies\CsQuery.dll 40 | 41 | 42 | ..\..\..\..\assemblies\en-html2enml.dll 43 | 44 | 45 | ..\..\..\..\assemblies\Evernote.dll 46 | 47 | 48 | ..\..\..\..\assemblies\EvernoteOAuthNet.dll 49 | 50 | 51 | False 52 | ..\..\..\..\assemblies\EvernoteSDK.dll 53 | 54 | 55 | ..\..\..\..\assemblies\PreMailer.Net.dll 56 | 57 | 58 | ..\..\..\..\assemblies\SgmlReaderDll.dll 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | ..\..\..\..\assemblies\Thrift.dll 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 85 | -------------------------------------------------------------------------------- /src/Evernote OAuth/AuthSample/AuthSample/AuthSample.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Debug 5 | x86 6 | 8.0.30703 7 | 2.0 8 | {79764ACF-F279-4F37-92C4-EFF488F0F14E} 9 | WinExe 10 | Properties 11 | AuthSample 12 | AuthSample 13 | v4.0 14 | 15 | 16 | 512 17 | 18 | 19 | x86 20 | true 21 | full 22 | false 23 | bin\Debug\ 24 | DEBUG;TRACE 25 | prompt 26 | 4 27 | 28 | 29 | x86 30 | pdbonly 31 | true 32 | bin\Release\ 33 | TRACE 34 | prompt 35 | 4 36 | 37 | 38 | AuthSample.Program 39 | 40 | 41 | 42 | False 43 | .\EvernoteOAuthNet.dll 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | ResXFileCodeGenerator 61 | Resources.Designer.cs 62 | Designer 63 | 64 | 65 | True 66 | Resources.resx 67 | True 68 | 69 | 70 | 71 | SettingsSingleFileGenerator 72 | Settings.Designer.cs 73 | 74 | 75 | True 76 | Settings.settings 77 | True 78 | 79 | 80 | 81 | 88 | -------------------------------------------------------------------------------- /src/Evernote OAuth/EvernoteOAuthNet/EvernoteOAuthNet/EvernoteOAuth.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Collections.Specialized; 4 | using System.Linq; 5 | using System.Text; 6 | 7 | namespace EvernoteOAuthNet 8 | { 9 | public class EvernoteOAuth 10 | { 11 | 12 | public EvernoteOAuth(HostService service, string consumerKey, string consumerSecret, string windowTitle = "Please provide authorization to access your Evernote account") 13 | { 14 | _service = service; 15 | _consumerKey = consumerKey; 16 | _consumerSecret = consumerSecret; 17 | _windowTitle = windowTitle; 18 | _supportLinkedAppNotebook = false; 19 | } 20 | 21 | public EvernoteOAuth(HostService service, string consumerKey, string consumerSecret, bool supportLinkedAppNotebook, string windowTitle = "Please provide authorization to access your Evernote account") 22 | { 23 | _service = service; 24 | _consumerKey = consumerKey; 25 | _consumerSecret = consumerSecret; 26 | _supportLinkedAppNotebook = supportLinkedAppNotebook; 27 | _windowTitle = windowTitle; 28 | } 29 | 30 | public enum HostService { Production, Sandbox, Yinxiang }; 31 | 32 | private string _consumerKey; 33 | private string _consumerSecret; 34 | private HostService _service; 35 | private string _windowTitle; 36 | 37 | private oAuthEvernote _oauth; 38 | 39 | private string _oauth_token; 40 | private string _edam_noteStoreUrl; 41 | private string _edam_userId; 42 | private long _edam_expires; 43 | private string _edam_webApiUrlPrefix; 44 | private bool _supportLinkedAppNotebook = false; 45 | private bool _linkedAppNotebookSelected; 46 | 47 | public string Token { get { return _oauth_token; } set { _oauth_token = value; } } 48 | public string NoteStoreUrl { get { return _edam_noteStoreUrl; } set { _edam_noteStoreUrl = value; } } 49 | public string UserId { get { return _edam_userId; } set { _edam_userId = value; } } 50 | public long Expires { get { return _edam_expires; } set { _edam_expires = value; } } 51 | public string WebApiUrlPrefix { get { return _edam_webApiUrlPrefix; } set { _edam_webApiUrlPrefix = value; } } 52 | public bool SupportLinkedAppNotebook { get { return _supportLinkedAppNotebook; } set { _supportLinkedAppNotebook = value; } } 53 | public bool LinkedAppNotebookSelected { get { return _linkedAppNotebookSelected; } set { _linkedAppNotebookSelected = value; } } 54 | 55 | 56 | public string Authorize() 57 | { 58 | try 59 | { 60 | _oauth = new oAuthEvernote(_service, _consumerKey, _consumerSecret, _supportLinkedAppNotebook, _windowTitle); 61 | String requestToken = _oauth.getRequestToken(); 62 | // txtOutput.Text += "\n" + "Received request token: " + requestToken; 63 | 64 | _oauth.authorizeToken(_windowTitle); 65 | // txtOutput.Text += "\n" + "Token was authorized: " + _oauth.Token + " with verifier: " + _oauth.Verifier; 66 | 67 | NameValueCollection accessInfo = _oauth.getAccessToken(); 68 | 69 | Token = accessInfo["oauth_token"]; 70 | NoteStoreUrl = accessInfo["edam_noteStoreUrl"]; 71 | UserId = accessInfo["edam_userId"]; 72 | Expires = Convert.ToInt64(accessInfo["edam_expires"]); 73 | WebApiUrlPrefix = accessInfo["edam_webApiUrlPrefix"]; 74 | LinkedAppNotebookSelected = _oauth.LinkedAppNotebookSelected; 75 | return string.Empty; 76 | 77 | // txtOutput.Text += "\n" + "Access token was received: " + _oauth.Token; 78 | } 79 | catch (Exception exp) 80 | { 81 | // txtOutput.Text += "\nException: " + exp.Message; 82 | return exp.Message; 83 | } 84 | } 85 | 86 | } 87 | } 88 | -------------------------------------------------------------------------------- /samples/CS/SampleApp/SampleApp/Form1.Designer.cs: -------------------------------------------------------------------------------- 1 | namespace SampleApp 2 | { 3 | partial class Form1 4 | { 5 | /// 6 | /// Required designer variable. 7 | /// 8 | private System.ComponentModel.IContainer components = null; 9 | 10 | /// 11 | /// Clean up any resources being used. 12 | /// 13 | /// true if managed resources should be disposed; otherwise, false. 14 | protected override void Dispose(bool disposing) 15 | { 16 | if (disposing && (components != null)) 17 | { 18 | components.Dispose(); 19 | } 20 | base.Dispose(disposing); 21 | } 22 | 23 | #region Windows Form Designer generated code 24 | 25 | /// 26 | /// Required method for Designer support - do not modify 27 | /// the contents of this method with the code editor. 28 | /// 29 | private void InitializeComponent() 30 | { 31 | this.pictureBoxThumbnail = new System.Windows.Forms.PictureBox(); 32 | this.label1 = new System.Windows.Forms.Label(); 33 | this.webBrowser1 = new System.Windows.Forms.WebBrowser(); 34 | this.label2 = new System.Windows.Forms.Label(); 35 | ((System.ComponentModel.ISupportInitialize)(this.pictureBoxThumbnail)).BeginInit(); 36 | this.SuspendLayout(); 37 | // 38 | // pictureBoxThumbnail 39 | // 40 | this.pictureBoxThumbnail.Location = new System.Drawing.Point(40, 25); 41 | this.pictureBoxThumbnail.Name = "pictureBoxThumbnail"; 42 | this.pictureBoxThumbnail.Size = new System.Drawing.Size(120, 120); 43 | this.pictureBoxThumbnail.TabIndex = 0; 44 | this.pictureBoxThumbnail.TabStop = false; 45 | // 46 | // label1 47 | // 48 | this.label1.AutoSize = true; 49 | this.label1.Location = new System.Drawing.Point(44, 159); 50 | this.label1.Name = "label1"; 51 | this.label1.Size = new System.Drawing.Size(115, 13); 52 | this.label1.TabIndex = 1; 53 | this.label1.Text = "Downloaded thumbnail"; 54 | // 55 | // webBrowser1 56 | // 57 | this.webBrowser1.Location = new System.Drawing.Point(193, 25); 58 | this.webBrowser1.MinimumSize = new System.Drawing.Size(20, 20); 59 | this.webBrowser1.Name = "webBrowser1"; 60 | this.webBrowser1.Size = new System.Drawing.Size(490, 370); 61 | this.webBrowser1.TabIndex = 2; 62 | // 63 | // label2 64 | // 65 | this.label2.AutoSize = true; 66 | this.label2.Location = new System.Drawing.Point(375, 414); 67 | this.label2.Name = "label2"; 68 | this.label2.Size = new System.Drawing.Size(74, 13); 69 | this.label2.TabIndex = 3; 70 | this.label2.Text = "Note contents"; 71 | // 72 | // Form1 73 | // 74 | this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); 75 | this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; 76 | this.ClientSize = new System.Drawing.Size(719, 447); 77 | this.Controls.Add(this.label2); 78 | this.Controls.Add(this.webBrowser1); 79 | this.Controls.Add(this.label1); 80 | this.Controls.Add(this.pictureBoxThumbnail); 81 | this.Name = "Form1"; 82 | this.Text = "Form1"; 83 | this.Load += new System.EventHandler(this.Form1_Load); 84 | ((System.ComponentModel.ISupportInitialize)(this.pictureBoxThumbnail)).EndInit(); 85 | this.ResumeLayout(false); 86 | this.PerformLayout(); 87 | 88 | } 89 | 90 | #endregion 91 | 92 | private System.Windows.Forms.PictureBox pictureBoxThumbnail; 93 | private System.Windows.Forms.Label label1; 94 | private System.Windows.Forms.WebBrowser webBrowser1; 95 | private System.Windows.Forms.Label label2; 96 | } 97 | } 98 | 99 | -------------------------------------------------------------------------------- /samples/CS/SampleApp/SampleApp/SampleApp.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Debug 6 | AnyCPU 7 | {F6E7F018-2D86-488B-AAC4-11E4AE71457C} 8 | WinExe 9 | Properties 10 | SampleApp 11 | SampleApp 12 | v4.0 13 | 512 14 | 15 | 16 | AnyCPU 17 | true 18 | full 19 | false 20 | bin\Debug\ 21 | DEBUG;TRACE 22 | prompt 23 | 4 24 | 25 | 26 | AnyCPU 27 | pdbonly 28 | true 29 | bin\Release\ 30 | TRACE 31 | prompt 32 | 4 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | ..\..\..\..\assemblies\CsQuery.dll 41 | 42 | 43 | ..\..\..\..\assemblies\en-html2enml.dll 44 | 45 | 46 | ..\..\..\..\assemblies\Evernote.dll 47 | 48 | 49 | ..\..\..\..\assemblies\EvernoteOAuthNet.dll 50 | 51 | 52 | False 53 | ..\..\..\..\assemblies\EvernoteSDK.dll 54 | 55 | 56 | ..\..\..\..\assemblies\PreMailer.Net.dll 57 | 58 | 59 | ..\..\..\..\assemblies\SgmlReaderDll.dll 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | ..\..\..\..\assemblies\Thrift.dll 73 | 74 | 75 | 76 | 77 | Form 78 | 79 | 80 | Form1.cs 81 | 82 | 83 | 84 | 85 | Form1.cs 86 | Designer 87 | 88 | 89 | ResXFileCodeGenerator 90 | Resources.Designer.cs 91 | Designer 92 | 93 | 94 | True 95 | Resources.resx 96 | 97 | 98 | SettingsSingleFileGenerator 99 | Settings.Designer.cs 100 | 101 | 102 | True 103 | Settings.settings 104 | True 105 | 106 | 107 | 108 | 115 | -------------------------------------------------------------------------------- /samples/VB.NET/SampleApp/SampleApp/Form1.vb: -------------------------------------------------------------------------------- 1 | Imports EvernoteSDK 2 | Imports System.IO 3 | 4 | Public Class Form1 5 | 6 | Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load 7 | 8 | ' Be sure to put your own consumer key and consumer secret here. 9 | ENSession.SetSharedSessionConsumerKey("your key", "your secret") 10 | 11 | If ENSession.SharedSession.IsAuthenticated = False Then 12 | ENSession.SharedSession.AuthenticateToEvernote() 13 | End If 14 | 15 | ' Get a list of all notebooks in the user's account. 16 | Dim myNotebookList As List(Of ENNotebook) = ENSession.SharedSession.ListNotebooks() 17 | 18 | ' Create a new note (in the user's default notebook) with some plain text content. 19 | Dim myPlainNote As ENNote = New ENNote() 20 | myPlainNote.Title = "My plain text note" 21 | myPlainNote.Content = ENNoteContent.NoteContentWithString("Hello, world!") 22 | Dim myPlainNoteRef As ENNoteRef = ENSession.SharedSession.UploadNote(myPlainNote, Nothing) 23 | 24 | ' Share this new note publicly. "shareUrl" is the public URL to distribute to access the note. 25 | Dim shareUrl = ENSession.SharedSession.ShareNote(myPlainNoteRef) 26 | 27 | ' Create a new note (in the user's default notebook) with some HTML content. 28 | Dim myFancyNote As ENNote = New ENNote() 29 | myFancyNote.Title = "My plain text note" 30 | myFancyNote.Content = ENNoteContent.NoteContentWithSanitizedHTML("

Hello, world - this is a fancy note - and here is a table:



RedGreen
BlueYellow
") 31 | Dim myFancyNoteRef As ENNoteRef = ENSession.SharedSession.UploadNote(myFancyNote, Nothing) 32 | 33 | ' Delete the HTML content note we just created. 34 | ENSession.SharedSession.DeleteNote(myFancyNoteRef) 35 | 36 | ' Create a new note with a resource. 37 | Dim myResourceNote As ENNote = New ENNote() 38 | myResourceNote.Title = "My test note with a resource" 39 | myResourceNote.Content = ENNoteContent.NoteContentWithString("Hello, resource!") 40 | Dim myFile As Byte() = StreamFile("") ' Be sure to replace this with a real JPG file 41 | Dim myResource As ENResource = New ENResource(myFile, "image/jpg", "My Best Shot.jpg") 42 | myResourceNote.Resources.Add(myResource) 43 | Dim myResourceRef As ENNoteRef = ENSession.SharedSession.UploadNote(myResourceNote, Nothing) 44 | 45 | ' Search for some text across all notes (i.e. personal, shared, and business). 46 | ' Change the Search Scope parameter to limit the search to only personal, shared, business - or combine flags for some combination. 47 | Dim textToFind = "some text to find*" 48 | Dim myResultsList As List(Of ENSessionFindNotesResult) = ENSession.SharedSession.FindNotes(ENNoteSearch.NoteSearch(textToFind), Nothing, ENSession.SearchScope.All, ENSession.SortOrder.RecentlyUpdated, 500) 49 | Dim personalCount As Integer = 0 50 | Dim sharedCount As Integer = 0 51 | Dim bizCount As Integer = 0 52 | If myResultsList.Count > 0 Then 53 | For Each note As ENSessionFindNotesResult In myResultsList 54 | Select Case note.NoteRef.Type 55 | Case ENNoteRef.ENNoteRefType.TypePersonal 56 | personalCount += 1 57 | Case ENNoteRef.ENNoteRefType.TypeShared 58 | sharedCount += 1 59 | Case ENNoteRef.ENNoteRefType.TypeBusiness 60 | bizCount += 1 61 | End Select 62 | Next 63 | End If 64 | 65 | If myResultsList.Count > 0 Then 66 | ' Given a NoteRef instance, download that note. 67 | Dim myDownloadedNote As ENNote = ENSession.SharedSession.DownloadNote(myResultsList(0).NoteRef) 68 | 69 | ' Serialize a NoteRef. 70 | Dim mySavedRef As Byte() = myResultsList(0).NoteRef.AsData 71 | ' And deserialize it. 72 | Dim newRef As ENNoteRef = ENNoteRef.NoteRefFromData(mySavedRef) 73 | 74 | ' Download the thumbnail for a note; then display it on this app's form. 75 | Dim thumbnail As Byte() = ENSession.SharedSession.DownloadThumbnailForNote(myResultsList(0).NoteRef, 120) 76 | Try 77 | Dim ms As New MemoryStream(thumbnail, 0, thumbnail.Length) 78 | ms.Position = 0 79 | Dim image1 As System.Drawing.Image = System.Drawing.Image.FromStream(ms, False, False) 80 | PictureBoxThumbnail.Image = image1 81 | Catch ex As Exception 82 | Throw New Exception(ex.Message) 83 | End Try 84 | 85 | ' Display a note's content as HTML in a WebBrowser control. 86 | Dim myContent = myDownloadedNote.HtmlContent 87 | WebBrowser1.DocumentText = myContent 88 | End If 89 | 90 | End Sub 91 | 92 | 93 | ' Support routine for displaying a note thumbnail. 94 | Private Function StreamFile(ByVal filename As String) As Byte() 95 | Dim fs As New FileStream(filename, FileMode.Open, FileAccess.Read) 96 | 97 | ' Create a byte array of file stream length 98 | Dim ImageData As Byte() = New Byte(CInt(fs.Length - 1)) {} 99 | 100 | 'Read block of bytes from stream into the byte array 101 | fs.Read(ImageData, 0, System.Convert.ToInt32(fs.Length)) 102 | 103 | 'Close the File Stream 104 | fs.Close() 105 | 'return the byte data 106 | Return ImageData 107 | End Function 108 | 109 | End Class -------------------------------------------------------------------------------- /samples/CS/SampleApp/SampleApp/Properties/Resources.resx: -------------------------------------------------------------------------------- 1 | 2 | 3 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | text/microsoft-resx 107 | 108 | 109 | 2.0 110 | 111 | 112 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 113 | 114 | 115 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 116 | 117 | -------------------------------------------------------------------------------- /samples/VB.NET/SampleApp/SampleApp/My Project/Resources.resx: -------------------------------------------------------------------------------- 1 | 2 | 3 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | text/microsoft-resx 107 | 108 | 109 | 2.0 110 | 111 | 112 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 113 | 114 | 115 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 116 | 117 | -------------------------------------------------------------------------------- /samples/VB.NET/SampleAppAdvanced/SampleAppAdvanced/My Project/Resources.resx: -------------------------------------------------------------------------------- 1 | 2 | 3 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | text/microsoft-resx 107 | 108 | 109 | 2.0 110 | 111 | 112 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 113 | 114 | 115 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 116 | 117 | -------------------------------------------------------------------------------- /src/Evernote OAuth/AuthSample/AuthSample/Properties/Resources.resx: -------------------------------------------------------------------------------- 1 | 2 | 3 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | text/microsoft-resx 107 | 108 | 109 | 2.0 110 | 111 | 112 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 113 | 114 | 115 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 116 | 117 | -------------------------------------------------------------------------------- /src/Evernote OAuth/EvernoteOAuthNet/EvernoteOAuthNet/Properties/Resources.resx: -------------------------------------------------------------------------------- 1 | 2 | 3 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | text/microsoft-resx 107 | 108 | 109 | 2.0 110 | 111 | 112 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 113 | 114 | 115 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 116 | 117 | -------------------------------------------------------------------------------- /samples/CS/SampleApp/SampleApp/Form1.resx: -------------------------------------------------------------------------------- 1 | 2 | 3 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | text/microsoft-resx 110 | 111 | 112 | 2.0 113 | 114 | 115 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 116 | 117 | 118 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 119 | 120 | -------------------------------------------------------------------------------- /src/EvernoteSDK/Properties/Resources.resx: -------------------------------------------------------------------------------- 1 | 2 | 3 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | text/microsoft-resx 110 | 111 | 112 | 2.0 113 | 114 | 115 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 116 | 117 | 118 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 119 | 120 | -------------------------------------------------------------------------------- /samples/VB.NET/SampleApp/SampleApp/Form1.resx: -------------------------------------------------------------------------------- 1 | 2 | 3 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | text/microsoft-resx 110 | 111 | 112 | 2.0 113 | 114 | 115 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 116 | 117 | 118 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 119 | 120 | -------------------------------------------------------------------------------- /samples/VB.NET/SampleAppAdvanced/SampleAppAdvanced/SampleAppAdvanced.vbproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Debug 6 | AnyCPU 7 | {DF9487E7-A842-409F-8135-759DB3DEFBA0} 8 | Exe 9 | SampleAppAdvanced.Module1 10 | SampleAppAdvanced 11 | SampleAppAdvanced 12 | 512 13 | Console 14 | v4.0 15 | 16 | 17 | AnyCPU 18 | true 19 | full 20 | true 21 | true 22 | bin\Debug\ 23 | SampleAppAdvanced.xml 24 | 42016,41999,42017,42018,42019,42032,42036,42020,42021,42022 25 | 26 | 27 | AnyCPU 28 | pdbonly 29 | false 30 | true 31 | true 32 | bin\Release\ 33 | SampleAppAdvanced.xml 34 | 42016,41999,42017,42018,42019,42032,42036,42020,42021,42022 35 | 36 | 37 | On 38 | 39 | 40 | Binary 41 | 42 | 43 | Off 44 | 45 | 46 | On 47 | 48 | 49 | 50 | ..\..\..\..\assemblies\CsQuery.dll 51 | 52 | 53 | ..\..\..\..\assemblies\en-html2enml.dll 54 | 55 | 56 | ..\..\..\..\assemblies\Evernote.dll 57 | 58 | 59 | ..\..\..\..\assemblies\EvernoteOAuthNet.dll 60 | 61 | 62 | ..\..\..\..\assemblies\EvernoteSDK.dll 63 | 64 | 65 | ..\..\..\..\assemblies\PreMailer.Net.dll 66 | 67 | 68 | ..\..\..\..\assemblies\SgmlReaderDll.dll 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | ..\..\..\..\assemblies\Thrift.dll 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | True 96 | Application.myapp 97 | 98 | 99 | True 100 | True 101 | Resources.resx 102 | 103 | 104 | True 105 | Settings.settings 106 | True 107 | 108 | 109 | 110 | 111 | VbMyResourcesResXFileCodeGenerator 112 | Resources.Designer.vb 113 | My.Resources 114 | Designer 115 | 116 | 117 | 118 | 119 | MyApplicationCodeGenerator 120 | Application.Designer.vb 121 | 122 | 123 | SettingsSingleFileGenerator 124 | My 125 | Settings.Designer.vb 126 | 127 | 128 | 129 | 136 | --------------------------------------------------------------------------------