-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
39 changed files
with
3,399 additions
and
2,457 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,44 +1,44 @@ | ||
|
||
Microsoft Visual Studio Solution File, Format Version 12.00 | ||
# Visual Studio Express 2013 for Windows Desktop | ||
VisualStudioVersion = 12.0.21005.1 | ||
MinimumVisualStudioVersion = 10.0.40219.1 | ||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SpeechCast", "SpeechCast\SpeechCast.csproj", "{DFE33770-559F-4DA1-8C41-49E9A71123D6}" | ||
EndProject | ||
Global | ||
GlobalSection(SolutionConfigurationPlatforms) = preSolution | ||
Debug|Any CPU = Debug|Any CPU | ||
Debug|x64 = Debug|x64 | ||
Debug|x86 = Debug|x86 | ||
DebugX86|Any CPU = DebugX86|Any CPU | ||
DebugX86|x64 = DebugX86|x64 | ||
DebugX86|x86 = DebugX86|x86 | ||
Release|Any CPU = Release|Any CPU | ||
Release|x64 = Release|x64 | ||
Release|x86 = Release|x86 | ||
EndGlobalSection | ||
GlobalSection(ProjectConfigurationPlatforms) = postSolution | ||
{DFE33770-559F-4DA1-8C41-49E9A71123D6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU | ||
{DFE33770-559F-4DA1-8C41-49E9A71123D6}.Debug|Any CPU.Build.0 = Debug|Any CPU | ||
{DFE33770-559F-4DA1-8C41-49E9A71123D6}.Debug|x64.ActiveCfg = Debug|x64 | ||
{DFE33770-559F-4DA1-8C41-49E9A71123D6}.Debug|x64.Build.0 = Debug|x64 | ||
{DFE33770-559F-4DA1-8C41-49E9A71123D6}.Debug|x86.ActiveCfg = Debug|x86 | ||
{DFE33770-559F-4DA1-8C41-49E9A71123D6}.Debug|x86.Build.0 = Debug|x86 | ||
{DFE33770-559F-4DA1-8C41-49E9A71123D6}.DebugX86|Any CPU.ActiveCfg = Debug|Any CPU | ||
{DFE33770-559F-4DA1-8C41-49E9A71123D6}.DebugX86|Any CPU.Build.0 = Debug|Any CPU | ||
{DFE33770-559F-4DA1-8C41-49E9A71123D6}.DebugX86|x64.ActiveCfg = Debug|x64 | ||
{DFE33770-559F-4DA1-8C41-49E9A71123D6}.DebugX86|x64.Build.0 = Debug|x64 | ||
{DFE33770-559F-4DA1-8C41-49E9A71123D6}.DebugX86|x86.ActiveCfg = Release|x86 | ||
{DFE33770-559F-4DA1-8C41-49E9A71123D6}.DebugX86|x86.Build.0 = Release|x86 | ||
{DFE33770-559F-4DA1-8C41-49E9A71123D6}.Release|Any CPU.ActiveCfg = Debug|Any CPU | ||
{DFE33770-559F-4DA1-8C41-49E9A71123D6}.Release|Any CPU.Build.0 = Debug|Any CPU | ||
{DFE33770-559F-4DA1-8C41-49E9A71123D6}.Release|Any CPU.Deploy.0 = Release|Any CPU | ||
{DFE33770-559F-4DA1-8C41-49E9A71123D6}.Release|x64.ActiveCfg = Release|x64 | ||
{DFE33770-559F-4DA1-8C41-49E9A71123D6}.Release|x64.Build.0 = Release|x64 | ||
{DFE33770-559F-4DA1-8C41-49E9A71123D6}.Release|x86.ActiveCfg = Release|x86 | ||
{DFE33770-559F-4DA1-8C41-49E9A71123D6}.Release|x86.Build.0 = Release|x86 | ||
EndGlobalSection | ||
GlobalSection(SolutionProperties) = preSolution | ||
HideSolutionNode = FALSE | ||
EndGlobalSection | ||
EndGlobal | ||
|
||
Microsoft Visual Studio Solution File, Format Version 12.00 | ||
# Visual Studio Express 2013 for Windows Desktop | ||
VisualStudioVersion = 12.0.31101.0 | ||
MinimumVisualStudioVersion = 10.0.40219.1 | ||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SpeechCast", "SpeechCast\SpeechCast.csproj", "{DFE33770-559F-4DA1-8C41-49E9A71123D6}" | ||
EndProject | ||
Global | ||
GlobalSection(SolutionConfigurationPlatforms) = preSolution | ||
Debug|Any CPU = Debug|Any CPU | ||
Debug|x64 = Debug|x64 | ||
Debug|x86 = Debug|x86 | ||
DebugX86|Any CPU = DebugX86|Any CPU | ||
DebugX86|x64 = DebugX86|x64 | ||
DebugX86|x86 = DebugX86|x86 | ||
Release|Any CPU = Release|Any CPU | ||
Release|x64 = Release|x64 | ||
Release|x86 = Release|x86 | ||
EndGlobalSection | ||
GlobalSection(ProjectConfigurationPlatforms) = postSolution | ||
{DFE33770-559F-4DA1-8C41-49E9A71123D6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU | ||
{DFE33770-559F-4DA1-8C41-49E9A71123D6}.Debug|Any CPU.Build.0 = Debug|Any CPU | ||
{DFE33770-559F-4DA1-8C41-49E9A71123D6}.Debug|x64.ActiveCfg = Debug|x64 | ||
{DFE33770-559F-4DA1-8C41-49E9A71123D6}.Debug|x64.Build.0 = Debug|x64 | ||
{DFE33770-559F-4DA1-8C41-49E9A71123D6}.Debug|x86.ActiveCfg = Debug|x86 | ||
{DFE33770-559F-4DA1-8C41-49E9A71123D6}.Debug|x86.Build.0 = Debug|x86 | ||
{DFE33770-559F-4DA1-8C41-49E9A71123D6}.DebugX86|Any CPU.ActiveCfg = Debug|Any CPU | ||
{DFE33770-559F-4DA1-8C41-49E9A71123D6}.DebugX86|Any CPU.Build.0 = Debug|Any CPU | ||
{DFE33770-559F-4DA1-8C41-49E9A71123D6}.DebugX86|x64.ActiveCfg = Debug|x64 | ||
{DFE33770-559F-4DA1-8C41-49E9A71123D6}.DebugX86|x64.Build.0 = Debug|x64 | ||
{DFE33770-559F-4DA1-8C41-49E9A71123D6}.DebugX86|x86.ActiveCfg = Release|x86 | ||
{DFE33770-559F-4DA1-8C41-49E9A71123D6}.DebugX86|x86.Build.0 = Release|x86 | ||
{DFE33770-559F-4DA1-8C41-49E9A71123D6}.Release|Any CPU.ActiveCfg = Debug|Any CPU | ||
{DFE33770-559F-4DA1-8C41-49E9A71123D6}.Release|Any CPU.Build.0 = Debug|Any CPU | ||
{DFE33770-559F-4DA1-8C41-49E9A71123D6}.Release|Any CPU.Deploy.0 = Release|Any CPU | ||
{DFE33770-559F-4DA1-8C41-49E9A71123D6}.Release|x64.ActiveCfg = Release|x64 | ||
{DFE33770-559F-4DA1-8C41-49E9A71123D6}.Release|x64.Build.0 = Release|x64 | ||
{DFE33770-559F-4DA1-8C41-49E9A71123D6}.Release|x86.ActiveCfg = Release|x86 | ||
{DFE33770-559F-4DA1-8C41-49E9A71123D6}.Release|x86.Build.0 = Release|x86 | ||
EndGlobalSection | ||
GlobalSection(SolutionProperties) = preSolution | ||
HideSolutionNode = FALSE | ||
EndGlobalSection | ||
EndGlobal |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,129 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.ComponentModel; | ||
using System.Drawing; | ||
using System.Data; | ||
using System.Text; | ||
using System.Windows.Forms; | ||
using System.Diagnostics; | ||
using System.IO; | ||
|
||
namespace SpeechCast.Controls | ||
{ | ||
public partial class ButtonRunEditor : UserControl | ||
{ | ||
public ButtonRunEditor() | ||
{ | ||
InitializeComponent(); | ||
|
||
this.buttonEdit.Click += new EventHandler(buttonEdit_Click); | ||
} | ||
|
||
void buttonEdit_Click(object sender, EventArgs e) | ||
{ | ||
if (GetEditorFilePath == null) | ||
{ | ||
MessageBox.Show(editorErrorMessage); | ||
} | ||
else | ||
{ | ||
EventEditorArgs ee = new EventEditorArgs(); | ||
GetEditorFilePath(sender, ee); | ||
|
||
if (ee.EditorFilePath != null) | ||
{ | ||
try | ||
{ | ||
|
||
tempFilePath = Path.Combine(Path.Combine(Path.GetTempPath(), "SpeechCast"), DateTime.Now.ToString("yyyyMMdd_hhmmss") + ".txt"); | ||
|
||
string tempDir = Path.GetDirectoryName(tempFilePath); | ||
|
||
if (!Directory.Exists(tempDir)) | ||
{ | ||
Directory.CreateDirectory(tempDir); | ||
} | ||
|
||
using (StreamWriter sw = new StreamWriter(tempFilePath, false, Encoding.GetEncoding("Shift_JIS"))) | ||
{ | ||
sw.Write(textBox.Text); | ||
} | ||
|
||
|
||
processEditor = new Process(); | ||
processEditor.StartInfo.FileName = ee.EditorFilePath; | ||
processEditor.StartInfo.Arguments = "\"" + tempFilePath + "\""; | ||
processEditor.StartInfo.UseShellExecute = false; | ||
processEditor.EnableRaisingEvents = true; | ||
|
||
formWaitForEdit = new FormWaitForEdit(); | ||
formWaitForEdit.SetProcess(processEditor); | ||
|
||
processEditor.Start(); | ||
|
||
if (formWaitForEdit.ShowDialog() == DialogResult.OK) | ||
{ | ||
using (StreamReader sr = new StreamReader(tempFilePath, Encoding.GetEncoding("Shift_JIS"))) | ||
{ | ||
textBox.Text = sr.ReadToEnd(); | ||
} | ||
} | ||
|
||
formWaitForEdit = null; | ||
processEditor = null; | ||
File.Delete(tempFilePath); | ||
} | ||
catch (Exception ex) | ||
{ | ||
MessageBox.Show(ex.Message); | ||
} | ||
|
||
} | ||
} | ||
|
||
} | ||
|
||
private FormWaitForEdit formWaitForEdit; | ||
private Process processEditor = null; | ||
private string tempFilePath = null; | ||
|
||
private string editorErrorMessage = ""; | ||
|
||
public string EditorErrorMessage | ||
{ | ||
get | ||
{ | ||
return this.editorErrorMessage; | ||
} | ||
set | ||
{ | ||
this.editorErrorMessage = value; | ||
} | ||
} | ||
|
||
public event GetEditorFilePathEventHandler GetEditorFilePath; | ||
|
||
private TextBox textBox; | ||
|
||
public TextBox TextBox | ||
{ | ||
get | ||
{ | ||
return this.textBox; | ||
} | ||
set | ||
{ | ||
this.textBox = value; | ||
} | ||
} | ||
|
||
} | ||
|
||
|
||
public class EventEditorArgs : EventArgs | ||
{ | ||
public string EditorFilePath = null; | ||
} | ||
|
||
public delegate void GetEditorFilePathEventHandler(object sender, EventEditorArgs e); | ||
} |
Oops, something went wrong.