AGS.Types.StringListUIEditor.EditValueHelper C# (CSharp) Method

EditValueHelper() protected method

protected EditValueHelper ( ITypeDescriptorContext context, IServiceProvider provider, string value, IList valueList ) : string
context ITypeDescriptorContext
provider IServiceProvider
value string
valueList IList
return string
        protected string EditValueHelper(ITypeDescriptorContext context, IServiceProvider provider,
            string value, IList<string> valueList)
        {
            if ((value == null) || (valueList == null))
            {
                throw new ArgumentNullException();
            }
            if (provider != null)
            {
                IWindowsFormsEditorService editorService = provider.GetService(typeof(IWindowsFormsEditorService))
                    as IWindowsFormsEditorService;
                if (editorService == null) return value;
                // prepare list
                editor.Begin(editorService, value, valueList);
                // show drop-down now
                editorService.DropDownControl(editor);
                // now we take the result
                value = editor.Value;
                // reset editor
                editor.End();
            }
            return value;
        }