SaveAsFile() private method

private SaveAsFile ( Stream s ) : void
s Stream
return void
Beispiel #1
0
 public TemporarySaveFile(IssueDetail form)
 {
     uuid_xpath comment = form.commentToUUID.ContainsKey(form.Comments.SelectedNode) ? form.commentToUUID[form.Comments.SelectedNode] : null;
     var ext = MIMETypesDictionary.ContainsKey(form.DraggableIcon.Items[0].Text) ? MIMETypesDictionary[form.DraggableIcon.Items[0].Text] : "bin";
     string tempfilepath = Path.GetTempPath() + "BEurtle";
     tempfilename = tempfilepath + @"\comment-" + (comment!=null ? comment.Item1.ToString() : "new") + "." + ext;
     if (!Directory.Exists(tempfilepath)) Directory.CreateDirectory(tempfilepath);
     data = new FileStream(tempfilename, FileMode.Create, FileAccess.ReadWrite, FileShare.Delete | FileShare.ReadWrite);
     form.SaveAsFile(data);
     data.Seek(0, SeekOrigin.Begin);
 }