private void LoadAMapFromStreams_StreamLoading(object sender, StreamLoadingEventArgs e) { string fileName = System.IO.Path.GetFileName(e.AlternateStreamName); //TODO: Portable Change. //e.AlternateStream = new FileStream(@"..\..\SampleData\Data\" + fileName, e.FileMode, e.FileAccess); e.AlternateStream = new FileStream(@"..\..\SampleData\Data\" + fileName, (FileMode)e.FileMode, (FileAccess)e.FileAccess); }
private void LoadAMapFromStreams_StreamLoading(object sender, StreamLoadingEventArgs e) { string fileName = System.IO.Path.GetFileName(e.AlternateStreamName); string ext = Path.GetExtension(fileName); fileName = SampleHelper.Get(fileName, DataFormat.Shapefile); fileName = Path.ChangeExtension(fileName, ext); e.AlternateStream = new FileStream(fileName, (FileMode)e.FileMode, (FileAccess)e.ReadWriteMode); }
void MainForm_StreamLoading(object sender, StreamLoadingEventArgs e) { if (e.StreamType == "Image File") { Stream stream = new FileStream(@"..\..\Data\world.tif", FileMode.Open, FileAccess.Read); e.AlternateStream = stream; } if (e.StreamType == "World File") { Stream stream = new FileStream(@"..\..\Data\world.tfw", FileMode.Open, FileAccess.Read); e.AlternateStream = stream; } }
private void LoadAMapFromStreams_StreamLoading(object sender, StreamLoadingEventArgs e) { string fileName = Path.GetFileName(e.AlternateStreamName); e.AlternateStream = new FileStream(Server.MapPath("~/App_Data/" + fileName), (FileMode)e.FileMode, (FileAccess)(e.ReadWriteMode + 1)); }
private void LoadAMapFromStreams_StreamLoading(object sender, StreamLoadingEventArgs e) { string fileName = Path.GetFileName(e.AlternateStreamName); e.AlternateStream = new FileStream(Samples.RootDirectory + @"Data\" + fileName, (FileMode)e.FileMode, (FileAccess)e.ReadWriteMode); }