| | |
| | | /// <param name="i_gateway"></param>
|
| | | public void ShowForm(ZbGateway i_gateway)
|
| | | {
|
| | | HdlFileLogic.Current.CreateDirectory(System.IO.Path.Combine(DirNameResourse.LocalMemoryDirectory, "MyTempDir"), true);
|
| | | HdlFileLogic.Current.CreateDirectory(System.IO.Path.Combine(HdlFileNameResourse.LocalMemoryDirectory, "MyTempDir"), true);
|
| | | this.zbGateway = i_gateway;
|
| | | //设置标题信息
|
| | | base.SetTitleText("网关文件列表");
|
| | |
| | |
|
| | | var btnButton = new NormalViewControl(300, 69, true);
|
| | | btnButton.Gravity = Gravity.CenterVertical;
|
| | | btnButton.X = bodyFrameLayout.Width - Application.GetRealWidth(300) - ControlCommonResourse.XXLeft;
|
| | | btnButton.X = bodyFrameLayout.Width - Application.GetRealWidth(300) - HdlControlResourse.XXLeft;
|
| | | btnButton.TextColor = UserCenterColor.Current.TopLayoutTitleText;
|
| | | btnButton.TextAlignment = TextAlignment.CenterRight;
|
| | | btnButton.TextSize = 17;
|
| | |
| | | btnDelete.ButtonClickEvent += (sender, e) =>
|
| | | {
|
| | | this.ShowMassage(ShowMsgType.Confirm, "是否删除网关的这个文件(需谨慎)", async () =>
|
| | | {
|
| | | var result9 = await zbGateway.DelFileOrDirAsync("/etc/hdlDat/" + fileName);
|
| | | if (result9 == null || result9.delFileOrDirResponseData == null)
|
| | | {
|
| | | this.ShowMassage(ShowMsgType.Tip, "删除文件失败,网关没有回复");
|
| | | return;
|
| | | }
|
| | | if (result9.delFileOrDirResponseData.Result == 1)
|
| | | {
|
| | | this.ShowMassage(ShowMsgType.Tip, "删除文件失败,网关说这个东西不存在");
|
| | | return;
|
| | | }
|
| | | if (result9.delFileOrDirResponseData.Result == 2)
|
| | | {
|
| | | this.ShowMassage(ShowMsgType.Tip, "删除文件失败,网关说这个东西不允许删除");
|
| | | return;
|
| | | }
|
| | | if (result9.delFileOrDirResponseData.Result != 0)
|
| | | {
|
| | | this.ShowMassage(ShowMsgType.Tip, "删除文件失败,无法识别的状态码(" + result9.delFileOrDirResponseData.Result + ")");
|
| | | return;
|
| | | }
|
| | | rowContr1.RemoveFromParent();
|
| | | this.ShowMassage(ShowMsgType.Tip, "删除文件成功");
|
| | | });
|
| | | {
|
| | | var result9 = await zbGateway.DelFileOrDirAsync("/etc/hdlDat/" + fileName);
|
| | | if (result9 == null || result9.delFileOrDirResponseData == null)
|
| | | {
|
| | | this.ShowMassage(ShowMsgType.Tip, "删除文件失败,网关没有回复");
|
| | | return;
|
| | | }
|
| | | if (result9.delFileOrDirResponseData.Result == 1)
|
| | | {
|
| | | this.ShowMassage(ShowMsgType.Tip, "删除文件失败,网关说这个东西不存在");
|
| | | return;
|
| | | }
|
| | | if (result9.delFileOrDirResponseData.Result == 2)
|
| | | {
|
| | | this.ShowMassage(ShowMsgType.Tip, "删除文件失败,网关说这个东西不允许删除");
|
| | | return;
|
| | | }
|
| | | if (result9.delFileOrDirResponseData.Result != 0)
|
| | | {
|
| | | this.ShowMassage(ShowMsgType.Tip, "删除文件失败,无法识别的状态码(" + result9.delFileOrDirResponseData.Result + ")");
|
| | | return;
|
| | | }
|
| | | rowContr1.RemoveFromParent();
|
| | | this.ShowMassage(ShowMsgType.Tip, "删除文件成功");
|
| | | });
|
| | | };
|
| | | }
|
| | |
|
| | |
| | | btnDelete.Visible = false;
|
| | | btnDelete.ButtonClickEvent += (sender, e) =>
|
| | | {
|
| | | this.ShowMassage(ShowMsgType.Confirm, "确定是否删除这些文件?",async () =>
|
| | | this.ShowMassage(ShowMsgType.Confirm, "确定是否删除这些文件?", async () =>
|
| | | {
|
| | | foreach (var listfile in this.listDeleteFile)
|
| | | {
|
| | |
| | | /// </summary>
|
| | | public override void CloseFormBefore()
|
| | | {
|
| | | HdlFileLogic.Current.DeleteDirectory(System.IO.Path.Combine(DirNameResourse.LocalMemoryDirectory, "MyTempDir"));
|
| | | |
| | | HdlFileLogic.Current.DeleteDirectory(System.IO.Path.Combine(HdlFileNameResourse.LocalMemoryDirectory, "MyTempDir"));
|
| | |
|
| | | base.CloseFormBefore();
|
| | | }
|
| | |
|
| | | #endregion
|
| | | }
|
| | | }
|
| | | } |