Ejemplo n.º 1
0
 public void AddAnnotationToGridView(AnnotationDef annotationDef, Annotations annotations)
 {
     var row = dataGridView1.Rows[dataGridView1.Rows.Add()];
     row.Tag = annotationDef;
     row.Cells[colName.Index].Value = annotationDef.Name;
     var value = annotations.GetAnnotation(annotationDef);
     if (annotationDef.Type == AnnotationDef.AnnotationType.true_false)
     {
         row.Cells[colValue.Index] = new DataGridViewCheckBoxCell {Value = value};
     }
     else if (annotationDef.Type == AnnotationDef.AnnotationType.value_list)
     {
         var cell = new DataGridViewComboBoxCell();
         row.Cells[colValue.Index] = cell;
         cell.Items.Add(string.Empty);
         foreach (var item in annotationDef.Items)
         {
             cell.Items.Add(item);
         }
         cell.Value = value;
     }
     else
     {
         var cell = row.Cells[colValue.Index];
         if (annotationDef.Type == AnnotationDef.AnnotationType.number)
         {
             cell.ValueType = typeof (double);
         }
         cell.Value = value;
     }
 }
        protected virtual IProperty GetNonRootDiscriminatorProperty()
        {
            var propertyName = (string)Annotations.GetAnnotation(RelationalAnnotationNames.DiscriminatorProperty);

            return(propertyName == null ? null : EntityType.FindProperty(propertyName));
        }