public CellDialog(Dictionary<string, Dictionary<string, object>> properties) { InitializeComponent(); DictionaryPropertyGridAdapter adapter = new DictionaryPropertyGridAdapter(); foreach (string key in properties.Keys) { adapter.Add(key, properties[key], true); } pgCell.SelectedObject = adapter; }
public frmCellDialog(Dictionary <string, Dictionary <string, object> > properties) { InitializeComponent(); DictionaryPropertyGridAdapter adapter = new DictionaryPropertyGridAdapter(); foreach (string key in properties.Keys) { adapter.Add(key, properties[key], true); } pgCell.SelectedObject = adapter; }
private void MaterialUpdated() { if (Material != null) { if (MaterialProperties != null) { MaterialProperties.OnPropertyChanged -= Adapter_OnPropertyChanged; } MaterialProperties = new DictionaryPropertyGridAdapter(Material.EditorProperties); MaterialProperties.OnPropertyChanged += Adapter_OnPropertyChanged; OnPropertyChanged("MaterialProperties"); } }
private void cmbFeatures_SelectedIndexChanged(object sender, EventArgs e) { FeatureItem fItem = cmbFeatures.SelectedItem as FeatureItem; if (fItem == null) { gridFeatureProperties.SelectedObject = null; return; } else { DictionaryPropertyGridAdapter dictAdapter = new DictionaryPropertyGridAdapter(fItem.Feature, fItem.Fields); gridFeatureProperties.SelectedObject = dictAdapter; } }
void dgvDynamicEntities_SelectionChanged(object sender, EventArgs e) { try { if (this.dgvDynamicEntities.SelectedRows != null && this.dgvDynamicEntities.SelectedRows.Count > 0) { var item = this.dgvDynamicEntities.SelectedRows[0].DataBoundItem; if (item is DynamicEntity) { item = new DictionaryPropertyGridAdapter((DynamicEntity)item); } this.pgrItemEditor.SelectedObject = item; } } catch (Exception ex) { OpenNETCF.ORM.MainDemo.Logger.LogException(System.Reflection.MethodBase.GetCurrentMethod().Name, ex); } }
internal static object ConvertObject(object obj) { var clientObj = obj as ClientObject; if (clientObj != null) { var properties = new Dictionary <string, object>(); ClientObjectPropertyUtility.CopyProperty(properties, clientObj); object value = null; if (properties.TryGetValue("TitleResource", out value)) { properties["TitleResource"] = new DictionaryPropertyGridAdapter(value as Dictionary <string, string>); } if (properties.TryGetValue("DescriptionResource", out value)) { properties["DescriptionResource"] = new DictionaryPropertyGridAdapter(value as Dictionary <string, string>); } return(new DictionaryPropertyGridAdapter(properties)); } return(obj); }
void dgvDynamicEntities_SelectionChanged(object sender, EventArgs e) { try { if (this.dgvDynamicEntities.SelectedRows != null && this.dgvDynamicEntities.SelectedRows.Count > 0) { var item = this.dgvDynamicEntities.SelectedRows[0].DataBoundItem; if (item is DynamicEntity) { item = new DictionaryPropertyGridAdapter((DynamicEntity)item); } this.pgrItemEditor.SelectedObject = item; } } catch (Exception ex) { OpenNETCF.ORM.MainDemo.Logger.LogException(System.Reflection.MethodBase.GetCurrentMethod().Name, ex); } }