コード例 #1
0
        public static bool NoteGet(int notebookid, string notebookpass, int noteid, ref Tuple <int, string, string> note)
        {
            var input = new NoteGetInput()
            {
                NotebookId   = notebookid,
                NotebookPass = notebookpass,
                NoteId       = noteid,
            };
            var json = JsonConvert.SerializeObject(input);

            string output = null;

            try
            {
                output = HttpReader.HttpPost(ApiDef.NoteGet, json);
            }
            catch (AggregateException)
            {
                return(false);
            }

            var result    = JsonConvert.DeserializeObject <NoteGetOutput>(output);
            var issuccess = ResultStatus.IsSuccess(result.ResultStatus);

            if (issuccess)
            {
                note = Tuple.Create(result.Result.type, result.Result.name, result.Result.data);
            }
            return(issuccess);
        }
コード例 #2
0
ファイル: Program.Methods.cs プロジェクト: sgww/cozy
        public static Note GetNote(int notebookid, string notebookpass, int noteid)
        {
            var notegetinput = new NoteGetInput()
            {
                NotebookId   = notebookid,
                NotebookPass = notebookpass,
                NoteId       = noteid,
            };
            var output        = notemodule.OnNoteGet(JsonConvert.SerializeObject(notegetinput));
            var notegetoutput = JsonConvert.DeserializeObject <NoteGetOutput>(output);

            return(notegetoutput.Result);
        }
コード例 #3
0
ファイル: NoteApi.cs プロジェクト: jun-quan-Lai/cozy
        public static bool NoteGet(int notebookid, string notebookpass, int noteid, ref Note note)
        {
            var input = new NoteGetInput()
            {
                NotebookId   = notebookid,
                NotebookPass = notebookpass,
                NoteId       = noteid,
            };
            var json   = JsonConvert.SerializeObject(input);
            var output = HttpReader.HttpPost(ApiDef.NoteGet, json);

            var result    = JsonConvert.DeserializeObject <NoteGetOutput>(output);
            var issuccess = ResultStatus.IsSuccess(result.ResultStatus);

            if (issuccess)
            {
                note = result.Result;
            }
            return(issuccess);
        }