private async Task<Dictionary<string, List<RevealCommonSvc.ComboBoxDTO>>> GetGrouping() { Dictionary<string, List<RevealCommonSvc.ComboBoxDTO>> retValue = new Dictionary<string, List<RevealCommonSvc.ComboBoxDTO>>(); WinAppLibrary.Utilities.Helper helper = new WinAppLibrary.Utilities.Helper(); try { //Get CWP var stream = await helper.GetFileStream(ContentPath.OffModeFolder, ContentPath.GroupingCWP); var list = await (new WinAppLibrary.Utilities.Helper()).EncryptDeserializeFrom<List<RevealCommonSvc.ComboBoxDTO>>(stream); retValue.Add(HashKey.Key_CWP, list); //Get FIWP stream = await helper.GetFileStream(ContentPath.OffModeFolder, ContentPath.GroupingFIWP); list = await (new WinAppLibrary.Utilities.Helper()).EncryptDeserializeFrom<List<RevealCommonSvc.ComboBoxDTO>>(stream); retValue.Add(HashKey.Key_FIWP, list); //Get Drawing Type stream = await helper.GetFileStream(ContentPath.OffModeFolder, ContentPath.GroupingDrawingType); list = await helper.EncryptDeserializeFrom<List<RevealCommonSvc.ComboBoxDTO>>(stream); retValue.Add(HashKey.Key_DrawingType, list); } catch (Exception e) { helper.ExceptionHandler(e, "GetGrouping"); throw e; } return retValue; }
private async Task<ObservableCollection<RevealProjectSvc.DocumentnoteDTO>> GetDocumentNote() { ObservableCollection<RevealProjectSvc.DocumentnoteDTO> retValue = new ObservableCollection<RevealProjectSvc.DocumentnoteDTO>(); WinAppLibrary.Utilities.Helper helper = new WinAppLibrary.Utilities.Helper(); try { //Get Sticky Note var stream = await helper.GetFileStream(ContentPath.OffModeFolder, ContentPath.DocumentNote); retValue = await helper.EncryptDeserializeFrom<ObservableCollection<RevealProjectSvc.DocumentnoteDTO>>(stream); } catch (Exception e) { helper.ExceptionHandler(e, "GetStickyNote"); throw e; } return retValue; }
public async Task<bool> GetDrawingOffMode(int curpage) { bool retValue = false; WinAppLibrary.Utilities.Helper helper = new WinAppLibrary.Utilities.Helper(); try { if (_drawingpage_off == null) { var stream = await helper.GetFileStream(ContentPath.OffModeFolder, ContentPath.DrawingSource); _drawingpage_off = await helper.EncryptDeserializeFrom<RevealProjectSvc.DrawingPageTotal>(stream); } if (_drawingpage_off != null && _drawingpage_off.drawing != null) { int from = (int)Math.Min(Math.Floor(_drawingpage_off.drawing.Count / (double)ItemCount), curpage - 1); int count = (int)Math.Min(_drawingpage_off.drawing.Count - from * ItemCount, ItemCount); _drawingpage.drawing = _drawingpage_off.drawing.GetRange(from * ItemCount, count); _drawingpage.CurrentPage = from + 1; _drawingpage.TotalPageCount = (int)Math.Ceiling(_drawingpage_off.drawing.Count / (double)ItemCount); retValue = true; } } catch (Exception e) { helper.ExceptionHandler(e, "GetDrawingOffMode"); throw e; } return retValue; }