示例#1
0
        public static async Task GetStaticData()
        {
            try
            {
                regularExpressions.Clear();
                solventBoilingPoints.Clear();
                NamePriorities.Clear();

                RestStatus status = await RestHub.GetStaticData();

                if (status.UserObject != null)
                {
                    AppStaticDTO dto = (AppStaticDTO)status.UserObject;
                    regularExpressions.AddRange(dto.RegulerExpressions);
                    solventBoilingPoints.AddRange(dto.SolventBoilingPoints.OrderBy(sbp => sbp.Name).ToList());

                    commentDictionary.FreeText.Clear();
                    commentDictionary.CVT.Clear();

                    commentDictionary.FreeText = new List <FreeText>();
                    commentDictionary.FreeText = dto.CommentDictionary.Freetexts;

                    commentDictionary.CVT = new List <CVT>();
                    commentDictionary.CVT = dto.CommentDictionary.CVTs;
                    NamePriorities.AddRange(dto.NamePriorities);
                }
                else
                {
                    AppErrorBox.ShowErrorMessage("Unable to fetch initial data . .", status.StatusMessage);
                }
            }
            catch (Exception ex)
            {
                Log.This(ex);
            }
        }