private CustomFieldWrapper ToCustomFieldWrapper(CustomField customField) { var result = new CustomFieldWrapper(customField); result.RelativeItemsCount = DaoFactory.GetCustomFieldDao().GetContactLinkCount(customField.EntityType, customField.ID); return(result); }
private CustomField ToCustomField(CustomFieldWrapper customFieldWrapper) { return(new CustomField { EntityID = customFieldWrapper.EntityId, FieldType = customFieldWrapper.FieldType, ID = customFieldWrapper.ID, Label = customFieldWrapper.Label, Mask = customFieldWrapper.Mask, Position = customFieldWrapper.Position, Value = customFieldWrapper.FieldValue }); }
private void generateCustomFieldsBox() { List<CustomField> customFields = CustomFieldsManager.CustomFieldValues(xenObject); if (customFields.Count <= 0) return; PDSection s = pdSectionCustomFields; foreach (CustomField customField in customFields) { ToolStripMenuItem editValue = new ToolStripMenuItem(Messages.EDIT){Image= Properties.Resources.edit_16}; editValue.Click += delegate { using (PropertiesDialog dialog = new PropertiesDialog(xenObject)) { dialog.SelectCustomFieldsEditPage(); dialog.ShowDialog(); } }; var menuItems = new[] { editValue }; CustomFieldWrapper cfWrapper = new CustomFieldWrapper(xenObject, customField.Definition); s.AddEntry(customField.Definition.Name.Ellipsise(30), cfWrapper.ToString(), menuItems, customField.Definition.Name); } }
private void generateCustomFieldsBox() { List<CustomField> customFields = CustomFieldsManager.CustomFieldValues(xenObject); if (customFields.Count <= 0) return; PDSection s = pdSectionCustomFields; foreach (CustomField customField in customFields) { ToolStripMenuItem editValue = MainWindow.NewToolStripMenuItem(Messages.EDIT, Properties.Resources.edit_16, delegate(object sender, EventArgs e) { PropertiesDialog dialog = new PropertiesDialog(xenObject); dialog.SelectPage(dialog.CustomFieldsEditPage); dialog.ShowDialog(); }); List<ToolStripMenuItem> menuItems = new List<ToolStripMenuItem>(); menuItems.Add(editValue); CustomFieldWrapper cfWrapper = new CustomFieldWrapper(xenObject, customField.Definition); s.AddEntry(customField.Definition.Name.Ellipsise(30), cfWrapper.ToString(), menuItems, customField.Definition.Name); } }