/// <summary> /// 当点击[列表的Item]的[打开文件夹]按钮的时候 /// </summary> /// <param name="_source">触发事件的LatelyProjectData对象</param> public void ClickListItemOpenFolderButton(LatelyProjectData _source) { //取到文件的信息 FileInfo _fileInfo = new FileInfo(_source.Path); //如果文件存在 if (_fileInfo.Exists == true) { //打开文件夹 try { System.Diagnostics.Process.Start(_fileInfo.Directory.FullName);//打开文件夹 } catch (Exception e) { } } //如果文件不存在 else { //提示:是否把这个数据从文件中移除? AppManager.Uis.LatelyProjectTipUi.UiControl.TipTitle = AppManager.Systems.LanguageSystem.LatelyProjectTipTitle; AppManager.Uis.LatelyProjectTipUi.UiControl.TipContent = AppManager.Systems.LanguageSystem.LatelyProjectTipContent + "\n" + "\" " + StringTool.Clamp(_source.Name, 20) + " \""; //把数据传递给提示界面 AppManager.Uis.LatelyProjectTipUi.UiControl.Tag = _source; //打开提示界面 AppManager.Uis.LatelyProjectTipUi.OpenOrClose(true); } }
/// <summary> /// 当点击[删除Bug]按钮时 /// </summary> /// <param name="_source">触发这个事件的Bug控件(Tag属性里有BugData)</param> public void ClickDeleteBugButton(BugListItemControl _source) { //如果用户选择了Bug if (_source != null) { //取到BugData BugItemData _bugItemData = _source.Tag as BugItemData; BugData _bugData = _bugItemData.Data; //如果[还要提示] if (AppManager.Datas.AppData.IsNotAgainShowDeleteBugTip == false) { //显示删除Bug界面 AppManager.Uis.DeleteBugTipUi.UiControl.Data = _bugData; AppManager.Uis.DeleteBugTipUi.UiControl.Text = StringTool.Clamp(_bugData.Name.Text, 50); AppManager.Uis.DeleteBugTipUi.OpenOrClose(true); } //如果[不再提示] else { //直接删除Bug AppManager.Systems.BugSystem.DeleteBug(_bugData); } } }
/// <summary> /// 获取[Bug]日志的文字 /// (通过比较新Bug和旧Bug的区别,来生成日志的文字) /// </summary> /// <param name="_oldBugData">旧的Bug数据</param> /// <param name="_newBugData">新的Bug数据</param> /// <param name="_changeType">改变的类型</param> /// <returns>Bug的修改信息</returns> private string GenerateBugSyncLogText(BugData _oldBugData, BugData _newBugData, ChangeType _changeType) { //容器:Bug的日志 string _log = ""; //判断更改的类型 switch (_changeType) { //如果是[新建Bug] case ChangeType.Add: //文字:创建 Bug: [XXXXXXXXX] if (_newBugData != null) { _log = AddString + " " + BugString + ": [" + StringTool.Clamp(_newBugData.Name.Text, 25) + "]"; } else if (_oldBugData != null) { _log = AddString + " " + BugString + ": [" + StringTool.Clamp(_oldBugData.Name.Text, 25) + "]"; } break; //如果是[删除Bug] case ChangeType.Delete: //文字:删除 Bug: [XXXXXXXXX] if (_newBugData != null) { _log = DeleteString + " " + BugString + ": [" + StringTool.Clamp(_newBugData.Name.Text, 25) + "]"; } else if (_oldBugData != null) { _log = DeleteString + " " + BugString + ": [" + StringTool.Clamp(_oldBugData.Name.Text, 25) + "]"; } break; //如果是[修改Bug] case ChangeType.Change: //文字:修改 Bug: [XXXXXXXXX] if (_newBugData != null) { _log = ChangeString + " " + BugString + ": [" + StringTool.Clamp(_newBugData.Name.Text, 25) + "]"; } else if (_oldBugData != null) { _log = ChangeString + " " + BugString + ": [" + StringTool.Clamp(_oldBugData.Name.Text, 25) + "]"; } break; } //返回值 return(_log); }
/// <summary> /// 获取[Record]日志的文字 /// (通过比较新Record和旧Record的区别,来生成日志的文字) /// </summary> /// <param name="_oldRecordData">旧的Record数据</param> /// <param name="_newRecordData">新的Record数据</param> /// <param name="_changeType">改变的类型</param> /// <returns>Record的修改信息</returns> private string GenerateRecordSyncLogText(RecordData _oldRecordData, RecordData _newRecordData, ChangeType _changeType) { //容器:Record的日志 string _log = ""; //取到Bug BugData _oldBugData = AppManager.Systems.BugSystem.GetBugData(_oldRecordData); BugData _newBugData = AppManager.Systems.BugSystem.GetBugData(_newRecordData); //判断是否有修改? switch (_changeType) { //如果是[新建Record] case ChangeType.Add: //文字:添加 聊天记录: [Bug:XXXXXXXXX] if (_newBugData != null) { _log = AddString + " " + RecordString + ": [Bug:" + StringTool.Clamp(_newBugData.Name.Text, 25) + "]"; } else if (_oldBugData != null) { _log = AddString + " " + RecordString + ": [Bug:" + StringTool.Clamp(_oldBugData.Name.Text, 25) + "]"; } break; //如果是[删除Record] case ChangeType.Delete: //文字:添加 聊天记录: [Bug:XXXXXXXXX] if (_newBugData != null) { _log = DeleteString + " " + RecordString + ": [Bug:" + StringTool.Clamp(_newBugData.Name.Text, 25) + "]"; } else if (_oldBugData != null) { _log = DeleteString + " " + RecordString + ": [Bug:" + StringTool.Clamp(_oldBugData.Name.Text, 25) + "]"; } break; } //返回值 return(_log); }
/// <summary> /// 当点击[记录列表的Item]的[删除]按钮的时候 /// </summary> /// <param name="_source">触发事件的RecordData对象</param> public void ClickRecordListItemDeleteButton(RecordData _source) { //如果用户选择了Bug if (_source != null) { //如果[还要提示] if (AppManager.Datas.AppData.IsNotAgainShowDeleteRecordTip == false) { //显示删除Bug界面 AppManager.Uis.DeleteRecordTipUi.UiControl.Data = _source; AppManager.Uis.DeleteRecordTipUi.UiControl.Text = StringTool.Clamp(_source.Content, 25); AppManager.Uis.DeleteRecordTipUi.OpenOrClose(true); } //如果[不再提示] else { //直接删除Bug AppManager.Systems.RecordSystem.RemoveRecord(_source); } } }
/// <summary> /// 当点击[列表的Item]的[Base]按钮的时候 /// </summary> /// <param name="_source">触发事件的LatelyProjectData对象</param> public void ClickListItemBaseButton(LatelyProjectData _source) { //如果文件存在 if (File.Exists(_source.Path) == true) { //读取项目 AppManager.Uis.MainUi.LoadProjectAll(_source.Path); } //如果文件不存在 else { //提示:是否把这个数据从文件中移除? AppManager.Uis.LatelyProjectTipUi.UiControl.TipTitle = AppManager.Systems.LanguageSystem.LatelyProjectTipTitle; AppManager.Uis.LatelyProjectTipUi.UiControl.TipContent = AppManager.Systems.LanguageSystem.LatelyProjectTipContent + "\n" + "\" " + StringTool.Clamp(_source.Name, 20) + " \""; //把数据传递给提示界面 AppManager.Uis.LatelyProjectTipUi.UiControl.Tag = _source; //打开提示界面 AppManager.Uis.LatelyProjectTipUi.OpenOrClose(true); } }