コード例 #1
0
        List <NoDbColumn> GetColumns(ITypeDescriptorContext context)
        {
            List <NoDbColumn> response = null;
            var onkafAttribute         = (NoDbColumnAttribute)context.PropertyDescriptor.Attributes?[typeof(NoDbColumnAttribute)];

            if (onkafAttribute != null)
            {
                var project = StaticManager.GetSelectedProject(StaticManager.SelectedProject);
                var table   = project.Tables.FirstOrDefault(x => x.Detail.Name == StaticManager.SelectedForeignTable);
                if (table != null)
                {
                    response = table.ColumnsWithRelated();
                }
            }
            else
            {
                response = StaticManager.SelectedTable?.ColumnsWithRelated();
            }
            return(response ?? new List <NoDbColumn>());
        }