private void InitPropertyItems() { try { mListWidgetPropertyItems.Clear(); for (int i = 0; i < mListWidgetPropertyInfos.Count; i++) { var info = mListWidgetPropertyInfos[i]; WidgetPropertyItem item = new WidgetPropertyItem(); item.WidgetID = info.WidgetID; item.PropertyID = info.PropertyID; item.Name = info.Name; item.Display = CurrentApp.GetLanguageInfo(string.Format("1206WP{0}{1}", info.WidgetID, info.PropertyID.ToString("000")), info.Name); item.Description = item.Display; item.PropertyInfo = info; GetItemDescription(item); var propertyValue = mListWidgetPropertyValues.FirstOrDefault( p => p.WidgetID == item.WidgetID && p.UserID == CurrentApp.Session.UserID && p.PropertyID == item.PropertyID); if (propertyValue == null) { propertyValue = new UserWidgetPropertyValue(); propertyValue.WidgetID = item.WidgetID; propertyValue.UserID = CurrentApp.Session.UserID; propertyValue.PropertyID = item.PropertyID; propertyValue.Value01 = info.DefaultValue; mListWidgetPropertyValues.Add(propertyValue); } item.PropertyValue = propertyValue; item.CurrentApp = CurrentApp; item.WidgetItem = WidgetItem; item.ListAllPropertyItems = mListWidgetPropertyItems; item.ListAllPropertyValues = mListWidgetPropertyValues; mListWidgetPropertyItems.Add(item); } } catch (Exception ex) { ShowException(ex.Message); } }
private void GetItemDescription(WidgetPropertyItem item) { try { var info = item.PropertyInfo; if (info == null) { return; } string str = CurrentApp.GetLanguageInfo(string.Format("1206WPD{0}{1}", info.WidgetID, info.PropertyID.ToString("000")), string.Empty); item.ShowDescription = !string.IsNullOrEmpty(str); item.Description = str; } catch (Exception ex) { CurrentApp.WriteLog("GetItemDescription", string.Format("Fail.\t{0}", ex.Message)); } }