private void ColumnNameModified(object sender, EventArgs e)
        {
            ColumnPropertyProxy column = (ColumnPropertyProxy)sender;
            bool find = false;

            foreach (ColumnProperty c in this.listColumns.Items)
            {
                if (c != column.Column)
                {
                    if (c.Name == column.Name)
                    {
                        find = true;
                        break;
                    }
                }
            }

            if (find)
            {
                KryptonMessageBox.Show(Strings.UniqueColumnName, Strings.Error, MessageBoxButtons.OK, MessageBoxIcon.Error);
                column.Name = this.GenerateUniqueName(column.Name);
            }

            this.listColumns.Refresh();
        }
        private void ListColumnsSelectedIndexChanged(object sender, EventArgs e)
        {
            ColumnProperty      cp    = (ColumnProperty)this.listColumns.SelectedItem;
            ColumnPropertyProxy proxy = new ColumnPropertyProxy(this.database, cp);

            proxy.ColumnNameModified          += new EventHandler <EventArgs>(this.ColumnNameModified);
            this.propertyColumn.SelectedObject = proxy;
            this.UpdateButtons();
        }
예제 #3
0
        public override TypeConverter.StandardValuesCollection GetStandardValues(ITypeDescriptorContext context)
        {
            List <ObjectClass>  list = new List <ObjectClass>();
            ColumnPropertyProxy cp   = (ColumnPropertyProxy)context.Instance;

            list.AddRange(cp.Database.Classes.Collection);

            TypeConverter.StandardValuesCollection svc = new TypeConverter.StandardValuesCollection(list);
            return(svc);
        }
예제 #4
0
        public override object ConvertFrom(ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value)
        {
            string name = value as string;

            if (name != null)
            {
                ColumnPropertyProxy cp = (ColumnPropertyProxy)context.Instance;
                return(cp.Database.Classes.Collection.FirstOrDefault(c => c.Name == name));
            }

            return(base.ConvertFrom(context, culture, value));
        }