C# 클래스 Bloom.Api.ApiRequest

When the Bloom UI makes an API call, a method that has been registered to handle that endpoint is called and given one of these. That method uses this class to get information on the request, and also to reply to the caller.
The goal here is to reduce code while increasing clarity and error catching.
파일 보기 프로젝트 열기: BloomBooks/BloomDesktop 1 사용 예제들

공개 프로퍼티들

프로퍼티 타입 설명
CurrentBook Book.Book
CurrentCollectionSettings Bloom.Collection.CollectionSettings
Parameters System.Collections.Specialized.NameValueCollection

공개 메소드들

메소드 설명
ApiRequest ( IRequestInfo requestinfo, CollectionSettings currentCollectionSettings, Book currentBook ) : System
Failed ( string text ) : void
Handle ( EndpointRegistration endpointRegistration, IRequestInfo info, CollectionSettings collectionSettings, Book currentBook ) : bool
LocalPath ( ) : string

Get the actual local path that the server would retrieve given a Bloom URL that ends up at a local file. For now it is mainly useful for things in the book folder; it doesn't have all the smarts to locate files shipped with the application, it is just concerned with reversing the various tricks we use to encode paths as URLs.

ReplyWithImage ( string localPath ) : void
ReplyWithJson ( object objectToMakeJson ) : void
ReplyWithJson ( string json ) : void
ReplyWithText ( string text ) : void
RequiredFileNameOrPath ( string name ) : UrlPathString
RequiredParam ( string name ) : string
RequiredPostJson ( ) : string
RequiredPostString ( ) : string
RequiredPostValue ( string key ) : string
Succeeded ( ) : void
SucceededDoNotNavigate ( ) : void

메소드 상세

ApiRequest() 공개 메소드

public ApiRequest ( IRequestInfo requestinfo, CollectionSettings currentCollectionSettings, Book currentBook ) : System
requestinfo IRequestInfo
currentCollectionSettings Bloom.Collection.CollectionSettings
currentBook Book
리턴 System

Failed() 공개 메소드

public Failed ( string text ) : void
text string
리턴 void

Handle() 공개 정적인 메소드

public static Handle ( EndpointRegistration endpointRegistration, IRequestInfo info, CollectionSettings collectionSettings, Book currentBook ) : bool
endpointRegistration EndpointRegistration
info IRequestInfo
collectionSettings Bloom.Collection.CollectionSettings
currentBook Book
리턴 bool

LocalPath() 공개 메소드

Get the actual local path that the server would retrieve given a Bloom URL that ends up at a local file. For now it is mainly useful for things in the book folder; it doesn't have all the smarts to locate files shipped with the application, it is just concerned with reversing the various tricks we use to encode paths as URLs.
public LocalPath ( ) : string
리턴 string

ReplyWithImage() 공개 메소드

public ReplyWithImage ( string localPath ) : void
localPath string
리턴 void

ReplyWithJson() 공개 메소드

public ReplyWithJson ( object objectToMakeJson ) : void
objectToMakeJson object
리턴 void

ReplyWithJson() 공개 메소드

public ReplyWithJson ( string json ) : void
json string
리턴 void

ReplyWithText() 공개 메소드

public ReplyWithText ( string text ) : void
text string
리턴 void

RequiredFileNameOrPath() 공개 메소드

public RequiredFileNameOrPath ( string name ) : UrlPathString
name string
리턴 UrlPathString

RequiredParam() 공개 메소드

public RequiredParam ( string name ) : string
name string
리턴 string

RequiredPostJson() 공개 메소드

public RequiredPostJson ( ) : string
리턴 string

RequiredPostString() 공개 메소드

public RequiredPostString ( ) : string
리턴 string

RequiredPostValue() 공개 메소드

public RequiredPostValue ( string key ) : string
key string
리턴 string

Succeeded() 공개 메소드

public Succeeded ( ) : void
리턴 void

SucceededDoNotNavigate() 공개 메소드

public SucceededDoNotNavigate ( ) : void
리턴 void

프로퍼티 상세

CurrentBook 공개적으로 프로퍼티

public Book.Book CurrentBook
리턴 Book.Book

CurrentCollectionSettings 공개적으로 프로퍼티

public CollectionSettings,Bloom.Collection CurrentCollectionSettings
리턴 Bloom.Collection.CollectionSettings

Parameters 공개적으로 프로퍼티

public NameValueCollection,System.Collections.Specialized Parameters
리턴 System.Collections.Specialized.NameValueCollection