public void UpdateView() { this.ViewUpdating = true; ShellControlHelper.PropertyDescriptorUpdate(this, this._entity); FormElementPictureBoxEntityDev entity = (FormElementPictureBoxEntityDev)_formElement; PropertyDescriptorCollection pdc = TypeDescriptor.GetProperties(this); PropertyDescriptor pds; pds = pdc.Find("Image", false); if (pds != null) { if (String.IsNullOrEmpty(entity.Img) == false) { ImageResourceInfo imageResource = _resourceComponentService.GetImageResource(entity.Img); if (imageResource != null) { Image image = imageResource.GetImage(); pds.SetValue(this, image); } } else { pds.SetValue(this, null); } } ShellControlHelper.SetProperty(this, "SizeMode", entity.SizeMode); this.ViewUpdating = false; }
public void UpdateView() { this.ViewUpdating = true; ShellControlHelper.PropertyDescriptorUpdate(this, this._entity); FormElementComboBoxEntityDev entity = (FormElementComboBoxEntityDev)_formElement; ShellControlHelper.SetProperty(this, "DropDownStyle", entity.ComboBoxStyle); ShellControlHelper.SetProperty(this, "WaterText", entity.WaterText); this.ViewUpdating = false; }
public void UpdateView() { this.ViewUpdating = true; ShellControlHelper.PropertyDescriptorUpdate(this, this._entity); FormElementTextBoxEntityDev entity = (FormElementTextBoxEntityDev)_formElement; ShellControlHelper.SetProperty(this, "ReadOnly", entity.ReadOnly); ShellControlHelper.SetProperty(this, "Multiline", entity.MultiLine); this.ViewUpdating = false; }
public void UpdateView() { this.ViewUpdating = true; ShellControlHelper.PropertyDescriptorUpdate(this, this._entity); FormElementLabelEntityDev entity = (FormElementLabelEntityDev)_formElement; ShellControlHelper.SetProperty(this, "AutoSize", entity.AutoSize); ShellControlHelper.SetProperty(this, "TextAlign", entity.TextAlign); this.ViewUpdating = false; }
public void CreateEntity(WindowEntity formEntity) { FormElementDataListEntityDev entity = new FormElementDataListEntityDev(); entity.Id = Guid.NewGuid().ToString(); entity.Code = ShellControlHelper.EntityCodeCreation(PREFIX, formEntity); entity.Name = entity.Code; formEntity.Elements.Add(entity); this.Entity = entity; }
public void UpdateEntity() { ShellControlHelper.UpdateEntity(this._formElement, this); }
public void UpdateView() { this.ViewUpdating = true; //同步特有属性 FormElementDataListEntityDev formElement = (FormElementDataListEntityDev)_formElement; PropertyDescriptor pds; #region 主体部分 AnchorStyles anchorStyles = new AnchorStyles(); //处理边缘锚定 //先清除所有方向描定,.net默认左上角锚定 anchorStyles = anchorStyles & (AnchorStyles)AnchorStyles.Top; anchorStyles = anchorStyles & (AnchorStyles)AnchorStyles.Right; anchorStyles = anchorStyles & (AnchorStyles)AnchorStyles.Bottom; anchorStyles = anchorStyles & (AnchorStyles)AnchorStyles.Left; if (formElement.Anchor.Top) { anchorStyles = anchorStyles | (AnchorStyles)AnchorStyles.Top; } if (formElement.Anchor.Right) { anchorStyles = anchorStyles | (AnchorStyles)AnchorStyles.Right; } if (formElement.Anchor.Bottom) { anchorStyles = anchorStyles | (AnchorStyles)AnchorStyles.Bottom; } if (formElement.Anchor.Left) { anchorStyles = anchorStyles | (AnchorStyles)AnchorStyles.Left; } ShellControlHelper.SetProperty(this, "Anchor", anchorStyles); ShellControlHelper.SetProperty(this, "Text", formElement.Text); ShellControlHelper.SetProperty(this, "Size", formElement.Size); ShellControlHelper.SetProperty(this, "Location", formElement.Location); ShellControlHelper.SetProperty(this, "Text", formElement.Text); ShellControlHelper.SetProperty(this, "ForeColor", formElement.ForeColor); ShellControlHelper.SetProperty(this, "Visible", formElement.Visible); ShellControlHelper.SetProperty(this, "Enabled", formElement.Enabled); //ShellControlHelper.SetProperty(this, "NavigationLocation", formElement.NavigationLocation); ShellControlHelper.SetProperty(this, "Pagination", formElement.Pagination); ShellControlHelper.SetProperty(this, "ShowItemCount", formElement.ShowItemCount); ShellControlHelper.SetProperty(this, "ShowPageCount", formElement.ShowPageCount); ShellControlHelper.SetProperty(this, "ShowPageHomeEnd", formElement.ShowPageHomeEnd); ShellControlHelper.SetProperty(this, "TabIndex", formElement.TabIndex); #endregion #region DataGridView部分 PropertyDescriptorCollection pdcDataGridView = TypeDescriptor.GetProperties(this.DataGridView); pds = pdcDataGridView.Find("BackgroundColor", false); if (pds != null) { //DataGridView.BackgroundColor不支持Color.Empty if (formElement.BackColor == Color.Empty) { formElement.BackColorValue = "2.Window"; } if (!pds.GetValue(this.DataGridView).Equals(formElement.BackColor)) { pds.SetValue(this.DataGridView, formElement.BackColor); } } #region 列同步不能,原因不明 //列 /* * DataGridViewColumnCollection dataGridViewColumnCollection = new DataGridViewColumnCollection(this.DataGridView); * foreach (FormElementDataColumnEntityDev column in formElement.DataColumns) * { * dataGridViewColumnCollection.Add(new DataGridViewTextBoxColumnDev(column)); * } * * pds = pdcDataGridView.Find("Columns", false); * if (pds != null) * { * pds.SetValue(this.DataGridView, dataGridViewColumnCollection); * } */ #endregion this.DataGridView.Columns.Clear(); foreach (FormElementDataListTextBoxColumnEntityDev column in formElement.DataColumns) { //编辑数据列之后,列对象的DataList属性会为空 //在这里将DataList属性再次绑定上,放在这里也是为了避免其它类似潜在的问题 column.DataList = (FormElementDataListEntityDev)this._entity; // Debug.Assert(column.DataList != null, "FormElementDataColumnEntityDev 对象的 DataList 属性为 null"); this.DataGridView.Columns.Add(DataGridViewColumnFactory.GetDataGridViewColumn(column)); } #endregion this.ViewUpdating = false; }
public void UpdateView() { this.ViewUpdating = true; ShellControlHelper.PropertyDescriptorUpdate(this, this._entity); this.ViewUpdating = false; }