Ejemplo n.º 1
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="context"></param>
        /// <param name="provider"></param>
        /// <param name="value"></param>
        /// <returns></returns>
        public override System.Object EditValue(
            System.ComponentModel.ITypeDescriptorContext context,
            System.IServiceProvider provider, System.Object value)
        {
            if (value is ConnectionType)
            {
                ConnectionType type = value as ConnectionType;

                if (ConnectionStringUIDialog.ShowDialog(ref type) == DialogResult.OK)
                {
                    return(type);
                }
                else
                {
                    return(value);
                }
            }
            else
            {
                string strConnectionString = (value == null) ? "" : value.ToString();

                if (ConnectionStringUIDialog.ShowDialog(ref strConnectionString) == DialogResult.OK)
                {
                    return(strConnectionString);
                }
                else
                {
                    return(value);
                }
            }
        }
Ejemplo n.º 2
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="context"></param>
        /// <param name="provider"></param>
        /// <param name="value"></param>
        /// <returns></returns>
        public override System.Object EditValue(
            System.ComponentModel.ITypeDescriptorContext context,
            System.IServiceProvider provider, System.Object value)
        {
            ConnectionType connectionType = value as ConnectionType;

            if (ConnectionStringUIDialog.ShowDialog(ref connectionType) == DialogResult.OK)
            {
                return(connectionType);
            }
            else
            {
                return(value);
            }
        }
Ejemplo n.º 3
0
 /// <summary>
 ///
 /// </summary>
 /// <returns></returns>
 public virtual DialogResult ShowDialog()
 {
     return(ConnectionStringUIDialog.ShowDialog(ref mstrConnectionString));
 }