private Boolean ApplyLatestServerInfo(FortViewData data) { try { var ret = PostServer("/latest", "", "post", data.Setting); if (ret != null) { data.Mapper.ApplyLatestInfo(ret); return true; } else { throw new System.Net.WebException(); } } catch { MessageBox.Show("通信に失敗しました。", "エラー", MessageBoxButtons.OK, MessageBoxIcon.Error); return false; } }
private void watchTeButton_Click(object sender, EventArgs e) { if (dataForWatch != null) { if (dataForWatch.GvType == "TE") { chatLogTimer.Enabled = false; loadPanel.Enabled = true; loadTePanel.Enabled = true; startPanel.Enabled = true; dataForWatch = null; watchButton.Text = "監視開始"; watchTeButton.Text = "監視開始"; } else { return; } } else { String path = targetPathTeBox.Text; if (!Directory.Exists(path)) { MessageBox.Show("指定されたフォルダは存在しません。", "エラー", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } chatLogTimer.Enabled = true; loadPanel.Enabled = false; loadTePanel.Enabled = false; startPanel.Enabled = false; dataForWatch = teData; watchButton.Text = "TE監視中"; watchTeButton.Text = "監視停止"; MessageBox.Show("TEの監視を開始しました。", "ROGv", MessageBoxButtons.OK, MessageBoxIcon.Asterisk); } }
private void ViewTeFortsInfo(FortViewData data) { if (data.LastFile != null) { logUpdateTimeTeLabel.Text = data.LastFile.LastWriteTime.ToString(); } FortMapper map = data.Mapper; dataUpdateTimeTeLabel.Text = map.UpdateTime.ToString(); SetFortInfo("G1", resultG1, map); SetFortInfo("G2", resultG2, map); SetFortInfo("G3", resultG3, map); SetFortInfo("G4", resultG4, map); SetFortInfo("G5", resultG5, map); SetFortInfo("K1", resultK1, map); SetFortInfo("K2", resultK2, map); SetFortInfo("K3", resultK3, map); SetFortInfo("K4", resultK4, map); SetFortInfo("K5", resultK5, map); }
private void ViewFortsInfo(FortViewData data) { if (data.GvType == "FE") { ViewFeFortsInfo(data); } else if (data.GvType == "TE") { ViewTeFortsInfo(data); } }
private void ViewFeFortsInfo(FortViewData data) { if (data.LastFile != null) { logUpdateTimeLabel.Text = data.LastFile.LastWriteTime.ToString(); } FortMapper map = data.Mapper; dataUpdateTimeLabel.Text = map.UpdateTime.ToString(); SetFortInfo("V1", resultV1, map); SetFortInfo("V2", resultV2, map); SetFortInfo("V3", resultV3, map); SetFortInfo("V4", resultV4, map); SetFortInfo("V5", resultV5, map); SetFortInfo("C1", resultC1, map); SetFortInfo("C2", resultC2, map); SetFortInfo("C3", resultC3, map); SetFortInfo("C4", resultC4, map); SetFortInfo("C5", resultC5, map); SetFortInfo("B1", resultB1, map); SetFortInfo("B2", resultB2, map); SetFortInfo("B3", resultB3, map); SetFortInfo("B4", resultB4, map); SetFortInfo("B5", resultB5, map); SetFortInfo("L1", resultL1, map); SetFortInfo("L2", resultL2, map); SetFortInfo("L3", resultL3, map); SetFortInfo("L4", resultL4, map); SetFortInfo("L5", resultL5, map); SetFortInfo("N1", resultN1, map); SetFortInfo("N2", resultN2, map); SetFortInfo("N3", resultN3, map); SetFortInfo("N4", resultN4, map); SetFortInfo("N5", resultN5, map); SetFortInfo("F1", resultF1, map); SetFortInfo("F2", resultF2, map); SetFortInfo("F3", resultF3, map); SetFortInfo("F4", resultF4, map); SetFortInfo("F5", resultF5, map); }
private Boolean UpdateServerInfo(FortViewData data) { return PostMapperInfo("/update", data); }
private Boolean PostMapperInfo(String path, FortViewData data) { try { if (PostServer(path, data.Mapper.Serialize(), "put", data.Setting) == "OK") { return true; } else { throw new System.Net.WebException(); } } catch { MessageBox.Show("通信に失敗しました。", "エラー", MessageBoxButtons.OK, MessageBoxIcon.Error); return false; } }
private Boolean CutInServerInfo(FortViewData data) { return PostMapperInfo("/cutin", data); }