internal static object NoteStoreClientForLinkedNotebookRef(ENLinkedNotebookRef linkedNotebookRef)
        {
            ENLinkedNoteStoreClient client = new ENLinkedNoteStoreClient();

            client.LinkedNotebookRef = linkedNotebookRef;
            return(client);
        }
		internal static ENLinkedNotebookRef LinkedNotebookRefFromLinkedNotebook(LinkedNotebook linkedNotebook)
		{
			ENLinkedNotebookRef linkedNotebookRef = new ENLinkedNotebookRef();
			linkedNotebookRef.Guid = linkedNotebook.Guid;
			linkedNotebookRef.NoteStoreUrl = linkedNotebook.NoteStoreUrl;
			linkedNotebookRef.ShardId = linkedNotebook.ShardId;
			linkedNotebookRef.SharedNotebookGlobalId = linkedNotebook.ShareKey;
			return linkedNotebookRef;
		}
        internal static ENLinkedNotebookRef LinkedNotebookRefFromLinkedNotebook(LinkedNotebook linkedNotebook)
        {
            ENLinkedNotebookRef linkedNotebookRef = new ENLinkedNotebookRef();

            linkedNotebookRef.Guid                   = linkedNotebook.Guid;
            linkedNotebookRef.NoteStoreUrl           = linkedNotebook.NoteStoreUrl;
            linkedNotebookRef.ShardId                = linkedNotebook.ShardId;
            linkedNotebookRef.SharedNotebookGlobalId = linkedNotebook.ShareKey;
            return(linkedNotebookRef);
        }
        internal bool IsEqual(object obj)
        {
            if (this == (EvernoteSDK.ENLinkedNotebookRef)obj)
            {
                return(true);
            }
            if (obj != null && obj.GetType() != this.GetType())
            {
                return(false);
            }

            ENLinkedNotebookRef other = (EvernoteSDK.ENLinkedNotebookRef)obj;

            if (other.Guid == Guid && other.NoteStoreUrl == NoteStoreUrl && other.ShardId == ShardId && other.SharedNotebookGlobalId == SharedNotebookGlobalId)
            {
                return(true);
            }

            return(false);
        }
		internal string AuthenticationTokenForLinkedNotebookRef(ENLinkedNotebookRef linkedNotebookRef)
		{
			// See if we have auth data already for this notebook.
			AuthenticationResult auth = AuthCache.AuthenticationResultForLinkedNotebook(linkedNotebookRef.Guid);
			if (auth == null)
			{
				// Create a temporary note store client for the linked note store, with our primary auth token,
				// in order to authenticate to the shared notebook.
				ENNoteStoreClient linkedNoteStore = ENNoteStoreClient.NoteStoreClient(linkedNotebookRef.NoteStoreUrl, PrimaryAuthenticationToken);
				auth = linkedNoteStore.AuthenticateToSharedNotebook(linkedNotebookRef.SharedNotebookGlobalId);
				AuthCache.SetAuthenticationResultForLinkedNotebook(auth, linkedNotebookRef.Guid);
			}
			return auth.AuthenticationToken;
		}
		string ENLinkedNoteStoreClient.IENLinkedNoteStoreClient.AuthenticationTokenForLinkedNotebookRef(ENLinkedNotebookRef linkedNotebookRef)
		{
			return this.AuthenticationTokenForLinkedNotebookRef(linkedNotebookRef);
		}
		internal static object NoteStoreClientForLinkedNotebookRef(ENLinkedNotebookRef linkedNotebookRef)
		{
			ENLinkedNoteStoreClient client = new ENLinkedNoteStoreClient();
			client.LinkedNotebookRef = linkedNotebookRef;
			return client;
		}