コード例 #1
0
ファイル: ExtendedVM.cs プロジェクト: davidzhaoblog/Elmah
        public async Task GetDropDownContentsOfElmahUser()
        {
            try
            {
                var client = WebApiClientFactory.CreateListsApiClient();
                var result = await client.ElmahUserList(currentIndex : -1, pageSize : -1, queryOrderByExpression : null);

                var originalDropDownContentsOfElmahUserSelectedItem = this.m_DropDownContentsOfElmahUserSelectedItem;
                var dropDownContentsOfElmahUser = new List <Framework.Models.NameValuePair <string> >();

                if (result != null)
                {
                    foreach (var item in result)
                    {
                        if (item != null)
                        {
                            string value = item.ParseToSystemString(null);
                            dropDownContentsOfElmahUser.Add(new Framework.Models.NameValuePair <string>(value, item.Name));
                        }
                    }
                    this.DropDownContentsOfElmahUser        = new ObservableCollection <Framework.Models.NameValuePair <string> >(dropDownContentsOfElmahUser);
                    DropDownContentsOfElmahUserSelectedItem = originalDropDownContentsOfElmahUserSelectedItem;
                }
            }
            catch //(Exception ex)
            {
            }
        }