LeanCloud C# SDK
Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | Static Public Attributes | Properties | List of all members
LeanCloud.Storage.LCFile Class Reference

LCFile is a local representation of a LeanCloud file. More...

Inheritance diagram for LeanCloud.Storage.LCFile:
LeanCloud.Storage.LCObject

Public Member Functions

 LCFile ()
 Creates a new file. More...
 
 LCFile (string name, byte[] bytes)
 Creates a new file from a byte array. More...
 
 LCFile (string name, string path)
 Creates a new file from a local file. More...
 
 LCFile (string name, Uri url)
 Creates a new external file from an url. The file content is saved externally, not copied to LeanCloud. More...
 
void AddMetaData (string key, object value)
 Adds metadata. More...
 
async Task< LCFileSave (Action< long, long > onProgress=null)
 Saves the file to LeanCloud. More...
 
new async Task Delete ()
 Deletes the file from LeanCloud. More...
 
string GetThumbnailUrl (int width, int height, int quality=100, bool scaleToFit=true, string format="png")
 Gets the thumbnail url of an image file. More...
 
- Public Member Functions inherited from LeanCloud.Storage.LCObject
void DisableBeforeHook ()
 Disable hooks before saving / updating / deleting LCObject. More...
 
void DisableAfterHook ()
 Disable hooks after saving / updating / deleting LCObject. More...
 
void IgnoreHook (string hookName)
 Ignores the hook for this LCObject. More...
 
ReadOnlyCollection< string > GetUpdatedKeys ()
 Gets the updated keys of this LCObject. More...
 
 LCObject (string className)
 Constructs a new LCObject with no data in it. A LCObject constructed in this way will not have an ObjectedId and will not persist in the cloud until Save(bool, LCQuery<LCObject>)) is called. More...
 
void Unset (string key)
 Removes the key. More...
 
void AddRelation (string key, LCObject value)
 Creates a LCRelation<T> value for a key. More...
 
void RemoveRelation (string key, LCObject value)
 Removes a LCRelation<T> value for a key. More...
 
void Increment (string key, object value)
 Atomically increments the value of the given key with amount. More...
 
void Add (string key, object value)
 Atomically adds value to the end of the array key. More...
 
void AddAll (string key, IEnumerable values)
 Atomically adds values to the end of the array key. More...
 
void AddUnique (string key, object value)
 Atomically adds value to the array key, only if not already present. More...
 
void AddAllUnique (string key, IEnumerable values)
 Atomically adds values to the array key, only if not already present. More...
 
void Remove (string key, object value)
 Atomically removes all value from the array key. More...
 
void RemoveAll (string key, IEnumerable values)
 Atomically removes all values from the array key. More...
 
async Task< LCObjectSave (bool fetchWhenSave=false, LCQuery< LCObject > query=null)
 Saves this object to the cloud. More...
 
async Task Delete ()
 Deletes this object in the cloud. More...
 
async Task< LCObjectFetch (IEnumerable< string > keys=null, IEnumerable< string > includes=null)
 Fetches this object from the cloud. More...
 
override string ToString ()
 Serializes this LCObject to a JSON string. More...
 
void Merge (LCObjectData objectData)
 

Static Public Member Functions

static LCQuery< LCFileGetQuery ()
 Gets LCQuery of LCFile. More...
 
- Static Public Member Functions inherited from LeanCloud.Storage.LCObject
static LCObject CreateWithoutData (string className, string objectId)
 Creates a reference to an existing LCObject. More...
 
static LCObject Create (string className)
 Creates a new LCObject. More...
 
static async Task< List< LCObject > > SaveAll (IEnumerable< LCObject > objects)
 Saves each object in the provided list. More...
 
static async Task DeleteAll (IEnumerable< LCObject > objects)
 Deletes each object in the provided list. More...
 
static async Task< IEnumerable< LCObject > > FetchAll (IEnumerable< LCObject > objects)
 Fetches all of the objects in the provided list. More...
 
static void RegisterSubclass< T > (string className, Func< T > constructor)
 Registers a custom subclass type with LeanCloud SDK, enabling strong-typing of those LCObjects whenever they appear. More...
 
static LCObject ParseObject (string json)
 Deserializes a JSON string to a LCObject. More...
 

Static Public Attributes

const string CLASS_NAME = "_File"
 

Properties

string Name [get, set]
 Gets the name of the file. More...
 
string MimeType [get, set]
 Gets the MIME type of the file. More...
 
string Url [get, set]
 Gets the url of the file. More...
 
Dictionary< string, object > MetaData [get, set]
 Gets the metadata of the file. More...
 
string PathPrefix [get, set]
 Gets the path prefix of the file. More...
 
- Properties inherited from LeanCloud.Storage.LCObject
string ClassName [get]
 Gets the class name for the LCObject. More...
 
string ObjectId [get]
 Gets the object id. An object id is assigned as soon as an object is saved to the server. The combination of a ClassName and an ObjectId uniquely identifies an object in your application. More...
 
DateTime CreatedAt [get]
 Gets the creation time of this object in the cloud. More...
 
DateTime UpdatedAt [get]
 Gets the latest update time of this object in the cloud. More...
 
LCACL ACL [get, set]
 Gets or sets the LCACL governing this object. More...
 
bool IsDirty [get, set]
 
object this[string key] [get, set]
 Gets or sets a value on the object. It is forbidden to name keys with a leading underscore ('_'). More...
 

Detailed Description

LCFile is a local representation of a LeanCloud file.

Constructor & Destructor Documentation

◆ LCFile() [1/4]

LeanCloud.Storage.LCFile.LCFile ( )
inline

Creates a new file.

◆ LCFile() [2/4]

LeanCloud.Storage.LCFile.LCFile ( string  name,
byte[]  bytes 
)
inline

Creates a new file from a byte array.

Parameters
name
bytes

◆ LCFile() [3/4]

LeanCloud.Storage.LCFile.LCFile ( string  name,
string  path 
)
inline

Creates a new file from a local file.

Parameters
name
path

◆ LCFile() [4/4]

LeanCloud.Storage.LCFile.LCFile ( string  name,
Uri  url 
)
inline

Creates a new external file from an url. The file content is saved externally, not copied to LeanCloud.

Parameters
name
url

Member Function Documentation

◆ AddMetaData()

void LeanCloud.Storage.LCFile.AddMetaData ( string  key,
object  value 
)
inline

Adds metadata.

Parameters
key
value

◆ Delete()

new async Task LeanCloud.Storage.LCFile.Delete ( )
inline

Deletes the file from LeanCloud.

Returns

◆ GetQuery()

static LCQuery< LCFile > LeanCloud.Storage.LCFile.GetQuery ( )
inlinestatic

Gets LCQuery of LCFile.

Returns

◆ GetThumbnailUrl()

string LeanCloud.Storage.LCFile.GetThumbnailUrl ( int  width,
int  height,
int  quality = 100,
bool  scaleToFit = true,
string  format = "png" 
)
inline

Gets the thumbnail url of an image file.

Parameters
width
height
quality
scaleToFit
format
Returns

◆ Save()

async Task< LCFile > LeanCloud.Storage.LCFile.Save ( Action< long, long >  onProgress = null)
inline

Saves the file to LeanCloud.

Parameters
onProgress
Returns

Member Data Documentation

◆ CLASS_NAME

const string LeanCloud.Storage.LCFile.CLASS_NAME = "_File"
static

Property Documentation

◆ MetaData

Dictionary<string, object> LeanCloud.Storage.LCFile.MetaData
getset

Gets the metadata of the file.

◆ MimeType

string LeanCloud.Storage.LCFile.MimeType
getset

Gets the MIME type of the file.

◆ Name

string LeanCloud.Storage.LCFile.Name
getset

Gets the name of the file.

◆ PathPrefix

string LeanCloud.Storage.LCFile.PathPrefix
getset

Gets the path prefix of the file.

◆ Url

string LeanCloud.Storage.LCFile.Url
getset

Gets the url of the file.


The documentation for this class was generated from the following file: