Beispiel #1
0
        public override object EditValue(
            ITypeDescriptorContext context,
            IServiceProvider provider, object value)
        {
            // Attempts to obtain an IWindowsFormsEditorService
            IWindowsFormsEditorService edSvc =
                provider.GetService(typeof(IWindowsFormsEditorService))
                as IWindowsFormsEditorService;

            if (edSvc == null)
            {
                return(value);
            }

            // Displays a drop-down control
            PenEdit editForm = new PenEdit();

            editForm.Pen = value as MindFusion.FlowChartX.Pen;
            edSvc.DropDownControl(editForm);
            Pen newValue = editForm.Pen;

            editForm.Dispose();
            GC.Collect();

            return(newValue);
        }
Beispiel #2
0
		public override object EditValue(
			ITypeDescriptorContext context,
			IServiceProvider provider, object value) 
		{
			// Attempts to obtain an IWindowsFormsEditorService
			IWindowsFormsEditorService edSvc =
				provider.GetService(typeof(IWindowsFormsEditorService))
					as IWindowsFormsEditorService;
			if (edSvc == null)
				return value;

            // Displays a drop-down control
			PenEdit editForm = new PenEdit();
			editForm.Pen = value as MindFusion.FlowChartX.Pen;
			edSvc.DropDownControl(editForm);
			Pen newValue = editForm.Pen;

			editForm.Dispose();
			GC.Collect();

			return newValue;
		}