//===================================================================== /// <summary> /// Constructor /// </summary> /// <param name="owner">The owning dialog</param> /// <param name="buildProperty">The build property to edit or null /// for a new property</param> public PropertyItem(UserDefinedPropertyEditorDlg owner, ProjectPropertyElement buildProperty) { string newPropName; int idx = 1; this.Owner = owner; this.buildProp = buildProperty; if (buildProp != null) { name = buildProp.Name; condition = buildProp.Condition; propValue = buildProp.Value; } else { do { newPropName = "NewProperty" + idx.ToString( CultureInfo.InvariantCulture); idx++; } while(!this.Owner.Project.IsValidUserDefinedPropertyName(newPropName) || this.Owner.UserDefinedProperties.Where( p => p.Name == newPropName).Count() != 0); name = newPropName; propValue = String.Empty; } }
public override object EditValue(System.ComponentModel.ITypeDescriptorContext context, IServiceProvider provider, object value) { // Get the project SandcastleProject project = value as SandcastleProject; if(context == null || provider == null || context.Instance == null || project == null) return base.EditValue(context, provider, value); using(UserDefinedPropertyEditorDlg dlg = new UserDefinedPropertyEditorDlg(project)) { dlg.ShowDialog(); } return value; }
public override object EditValue(System.ComponentModel.ITypeDescriptorContext context, IServiceProvider provider, object value) { // Get the project SandcastleProject project = value as SandcastleProject; if (context == null || provider == null || context.Instance == null || project == null) { return(base.EditValue(context, provider, value)); } using (UserDefinedPropertyEditorDlg dlg = new UserDefinedPropertyEditorDlg(project)) { dlg.ShowDialog(); } return(value); }
//===================================================================== /// <summary> /// Constructor /// </summary> /// <param name="owner">The owning dialog</param> /// <param name="buildProperty">The build property to edit or null /// for a new property</param> public PropertyItem(UserDefinedPropertyEditorDlg owner, BuildProperty buildProperty) { string newPropName; int idx = 1; this.Owner = owner; buildProp = buildProperty; if(buildProp != null) { name = buildProp.Name; condition = buildProp.Condition; propValue = buildProp.Value; } else { do { newPropName = "NewProperty" + idx.ToString( CultureInfo.InvariantCulture); idx++; } while(!this.Owner.Project.IsValidUserDefinedPropertyName(newPropName) || this.Owner.UserDefinedProperties.Where( p => p.Name == newPropName).Count() != 0); name = newPropName; propValue = String.Empty; } }