StreamLoadingEventArgs¶
Namespace: ThinkGeo.Core
This class represents the event arguments for the StreamLoading event.
public class StreamLoadingEventArgs : System.EventArgs
Inheritance object → EventArgs → StreamLoadingEventArgs
Remarks:
Alternate Streams
Where possible we allow you to use stream in place of concreate files on the file system. This gives you the flexibility to retrieve data from isolated storage, encrypted files, compressed files, fast memory streams or any other stream origin. This is typically available where you would pass in a path and file name. Streams can be substituted in a number of places such as images, shape files etc. Below describes how the system works though specific places may have slightly different variations.
You will create the object that will use the stream normally such as a ShapeFielFeatureSource and then subscribe to the StreamLoading event. For these classes you typically need to supply a path and file name, while this is still required you can pass in a valid path that does not exist such as "Z:\ShapeFile1.shp". When we need the stream from you we will give you this string so you can find the associated stream. In essence you can use the path and file name as a key to kink to the source of your stream.
When we need the file we will raise the StreamLoading event and allow you to pass an alternate stream. In the StreamLoading event we provide you with the path and file name you used and we expect for you to create the stream and set it as the AlternatStream property along with setting the FileMode and File access appropriate to the stream. This helps us know our limits with the stream.
Properties¶
AlternateStreamName¶
Gets or sets an identifier for the stream the caller should supply.
public string AlternateStreamName { get; set; }
Property Value¶
string
A user-defined key, typically a pseudo file path, used to correlate the requested stream.
Remarks:
This name is assigned by the event source so subscribers can determine which resource is being requested. It is often a pseudo file path such as "Z:\test.shp" used only as a lookup key.
AlternateStream¶
Gets or sets the alternate stream that should be used in place of the on-disk file.
public Stream AlternateStream { get; set; }
Property Value¶
Remarks:
When the event is raised the user should be responsible for either ignoring this property or setting it. It should default to null and if the user wishes to use an alternate stream instead of a file from the disk then they should replace it here.
Alternate Streams
Where possible we allow you to use stream in place of concreate files on the file system. This gives you the flexibility to retrieve data from isolated storage, encrypted files, compressed files, fast memory streams or any other stream origin. This is typically available where you would pass in a path and file name. Streams can be substituted in a number of places such as images, shape files etc. Below describes how the system works though specific places may have slightly different variations.
You will create the object that will use the stream normally such as a ShapeFielFeatureSource and then subscribe to the StreamLoading event. For these classes you typically need to supply a path and file name, while this is still required you can pass in a valid path that does not exist such as "Z:\ShapeFile1.shp". When we need the stream from you we will give you this string so you can find the associated stream. In essence you can use the path and file name as a key to kink to the source of your stream.
When we need the file we will raise the StreamLoading event and allow you to pass an alternate stream. In the StreamLoading event we provide you with the path and file name you used and we expect for you to create the stream and set it as the AlternatStream property along with setting the FileMode and File access appropriate to the stream. This helps us know our limits with the stream.
FileMode¶
Gets or sets the StreamLoadingEventArgs.FileMode that applies to the supplied alternate stream.
public FileMode FileMode { get; set; }
Property Value¶
Remarks:
You should set the file mode to the mode that best describes the limitations inherent to your alternate stream.
Alternate Streams
Where possible we allow you to use stream in place of concreate files on the file system. This gives you the flexibility to retrieve data from isolated storage, encrypted files, compressed files, fast memory streams or any other stream origin. This is typically available where you would pass in a path and file name. Streams can be substituted in a number of places such as images, shape files etc. Below describes how the system works though specific places may have slightly different variations.
You will create the object that will use the stream normally such as a ShapeFielFeatureSource and then subscribe to the StreamLoading event. For these classes you typically need to supply a path and file name, while this is still required you can pass in a valid path that does not exist such as "Z:\ShapeFile1.shp". When we need the stream from you we will give you this string so you can find the associated stream. In essence you can use the path and file name as a key to kink to the source of your stream.
When we need the file we will raise the StreamLoading event and allow you to pass an alternate stream. In the StreamLoading event we provide you with the path and file name you used and we expect for you to create the stream and set it as the AlternatStream property along with setting the FileMode and File access appropriate to the stream. This helps us know our limits with the stream.
ReadWriteMode¶
Gets or sets the FileAccess required to work with the alternate stream.
public FileAccess ReadWriteMode { get; set; }
Property Value¶
Remarks:
Match this value to the capabilities of the stream you provide so consumers know how it may be used.
StreamType¶
Gets or sets the stream category requested by the consumer.
public string StreamType { get; }
Property Value¶
Remarks:
Values such as "SHP File", "DBF File", or "NativeImage" tell subscribers which resource to provide.
Constructors¶
StreamLoadingEventArgs()¶
Initializes a new instance of the StreamLoadingEventArgs class with default values.
public StreamLoadingEventArgs()
StreamLoadingEventArgs(string, string)¶
Initializes a new instance of the StreamLoadingEventArgs class with a stream name and type.
public StreamLoadingEventArgs(string alternateStreamName, string streamType)
Parameters¶
alternateStreamName string
The lookup key used to identify the alternate stream.
streamType string
Describes the type of stream being requested.
StreamLoadingEventArgs(string, Stream, FileMode, FileAccess)¶
Initializes a new instance of the StreamLoadingEventArgs class with an alternate stream.
public StreamLoadingEventArgs(string alternateStreamName, Stream alternateStream, FileMode fileMode, FileAccess readWriteMode)
Parameters¶
alternateStreamName string
The lookup key used to identify the alternate stream.
alternateStream Stream
The alternate stream supplied by the event subscriber.
fileMode FileMode
The file mode required by the consumer.
readWriteMode FileAccess
The file access required by the consumer.
StreamLoadingEventArgs(string, string, Stream, FileMode, FileAccess)¶
This is the constructor for the class.
public StreamLoadingEventArgs(string alternateStreamName, string streamType, Stream alternateStream, FileMode fileMode, FileAccess readWriteMode)
Parameters¶
alternateStreamName string
This parameter represents the key string you will use to find the stream on the client end.
streamType string
The stream category used to locate the resource.
alternateStream Stream
Alternate stream supplied by the event subscriber.
fileMode FileMode
The file mode required by the consumer.
readWriteMode FileAccess
The file access required by the consumer.
Remarks:
This is the constructor we suggest you you when creating this class.
Alternate Streams
Where possible we allow you to use stream in place of concreate files on the file system. This gives you the flexibility to retrieve data from isolated storage, encrypted files, compressed files, fast memory streams or any other stream origin. This is typically available where you would pass in a path and file name. Streams can be substituted in a number of places such as images, shape files etc. Below describes how the system works though specific places may have slightly different variations.
You will create the object that will use the stream normally such as a ShapeFielFeatureSource and then subscribe to the StreamLoading event. For these classes you typically need to supply a path and file name, while this is still required you can pass in a valid path that does not exist such as "Z:\ShapeFile1.shp". When we need the stream from you we will give you this string so you can find the associated stream. In essence you can use the path and file name as a key to kink to the source of your stream.
When we need the file we will raise the StreamLoading event and allow you to pass an alternate stream. In the StreamLoading event we provide you with the path and file name you used and we expect for you to create the stream and set it as the AlternatStream property along with setting the FileMode and File access appropriate to the stream. This helps us know our limits with the stream.