Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 34 additions & 4 deletions MarkDownSharpEditor/Form1.cs
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,8 @@ public Form1()
//WebBrowserClickSoundOFF();
CoInternetSetFeatureEnabled(FEATURE_DISABLE_NAVIGATION_SOUNDS, SET_FEATURE_ON_PROCESS, true);

//ちらつき防止(ビューアモード)→Shown()で戻す
this.splitContainer1.Visible = false;
}

//----------------------------------------------------------------------
Expand Down Expand Up @@ -226,13 +228,28 @@ private void Form1_Shown(object sender, EventArgs e)

ArrayList FileArray = new ArrayList();

//TODO: 「新しいウィンドウで開く」="/new"などの引数も含まれるので、
// その辺りの処理も将来的に入れる。

//コマンドラインでファイルが投げ込まれてきている
//Launch with arguments
string[] cmds = System.Environment.GetCommandLineArgs();
for (int i = 1; i < cmds.Count(); i++)
int i;
for (i = 1; i < cmds.Count(); i++)
{
if (cmds[i][0] != '/' && cmds[i][0] != '-') break;

switch (cmds[i].Substring(1))
{
case "r":
case "readonly":
//読み取り専用=ビューアモード
changeToViewerMode();
break;

//TODO: 「新しいウィンドウで開く」="/new"などの引数も含まれるので、
// その辺りの処理も将来的に入れる。
}
}
this.splitContainer1.Visible = true;
for (; i < cmds.Count(); i++)
{
if (File.Exists(cmds[i]) == true)
{
Expand Down Expand Up @@ -332,6 +349,19 @@ private void Form1_Shown(object sender, EventArgs e)
}
}

//----------------------------------------------------------------------
// ビューアモードへ変更
//----------------------------------------------------------------------
private void changeToViewerMode() {
this.richTextBox1.ScrollBars = RichTextBoxScrollBars.None;
this.splitContainer1.SplitterWidth = 1;
this.splitContainer1.SplitterDistance = this.splitContainer1.Panel1MinSize = 0;
this.splitContainer1.IsSplitterFixed = true;

this.menuSaveFile.Enabled = this.menuSaveAsFile.Enabled = false;
this.menuEdit.Enabled = this.menuViewToolBar.Enabled = this.menuViewWidthEvenly.Enabled = false;
}

//----------------------------------------------------------------------
// フォームタイトルの表示(更新)
// Refresh form caption
Expand Down
2 changes: 1 addition & 1 deletion MarkDownSharpEditor/MarkDownSharpEditor.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@
<TargetZone>LocalIntranet</TargetZone>
</PropertyGroup>
<PropertyGroup>
<GenerateManifests>true</GenerateManifests>
<GenerateManifests>false</GenerateManifests>
</PropertyGroup>
<PropertyGroup />
<PropertyGroup>
Expand Down