public void Open(IFileData fileData) { DevExpress.ExpressApp.Utils.Guard.ArgumentNotNull(fileData, "fileData"); if (!FileDataHelper.IsFileDataEmpty(fileData)) { CustomFileOperationEventArgs customFileOperationEventArgs = new CustomFileOperationEventArgs(fileData); this.OnCustomOpenFileWithDefaultProgram(customFileOperationEventArgs); if (!customFileOperationEventArgs.Handled) { string text = Path.Combine(Path.GetTempPath(), Guid.NewGuid().ToString("B")); try { Directory.CreateDirectory(text); } catch { Tracing.Tracer.LogValue("tempDirectory", text); throw; } string text2 = Path.Combine(text, fileData.FileName); try { using (FileStream fileStream = new FileStream(text2, FileMode.CreateNew)) { fileData.SaveToStream(fileStream); } Process.Start(text2); } catch { Tracing.Tracer.LogValue("tempFileName", text2); throw; } } } }
private void OnCustomOpenFileWithDefaultProgram(CustomFileOperationEventArgs args) { if (this.customOpenFileWithDefaultProgram != null) { this.customOpenFileWithDefaultProgram(this, args); } }