Esempio n. 1
0
        private void build(System.Reflection.PropertyInfo property, System.Data.Linq.Mapping.ColumnAttribute attribute, Table table, SpecificationEnum specification)
        {
            this._key = (attribute.Name != null ? attribute.Name : attribute.Storage.Substring(1)).Trim();

            if (this._key == property.Name)
            {
                throw new Gale.Exception.GaleException("API008", property.Name);
            }

            this._name          = char.ToLower(property.Name[0]) + property.Name.Substring(1);
            this._type          = property.PropertyType;
            this._table         = table;
            this._specification = specification;
            this._selected      = false;

            if (attribute.IsPrimaryKey)
            {
                _specification = SpecificationEnum.Pk;
                table.SetPrimaryKey(this);

                if (attribute.IsPrimaryKey && table.IsForeign == false)
                {
                    this._selected = true;
                }
            }
        }
Esempio n. 2
0
 public bool Equals(SpecificationEnum obj)
 {
     if ((object)obj == null)
     {
         return(false);
     }
     return(StringComparer.OrdinalIgnoreCase.Equals(this.Value, obj.Value));
 }
Esempio n. 3
0
        private void AddEnumRow(object sender, RoutedEventArgs e)
        {
            // Creates a new specification enum to bind on
            SpecificationEnum newEnum = new SpecificationEnum();

            // Adds a localized enumeration value to the new SpecificationEnum for each language
            foreach (var lang in LanguageList)
            {
                newEnum.LocalizedEnumValues.Add(
                    new LocalizedEnumValue
                {
                    LanguageID = lang.ID
                });
            }

            // Adds the specificationEnum to the list and refreshes the grid
            SpecificationEnumList.Add(newEnum);
            dgEnumeration.ItemsSource = SpecificationEnumList;
            dgEnumeration.DataContext = SpecificationEnumList;
        }
Esempio n. 4
0
 public Field(System.Reflection.PropertyInfo property, System.Data.Linq.Mapping.ColumnAttribute attribute, Table table, SpecificationEnum specification)
 {
     build(property, attribute, table, specification);
 }
Esempio n. 5
0
 public Field(System.Reflection.PropertyInfo property, System.Data.Linq.Mapping.ColumnAttribute attribute, Table table, SpecificationEnum specification)
 {
     build(property, attribute, table, specification);
 }
Esempio n. 6
0
        private void build(System.Reflection.PropertyInfo property, System.Data.Linq.Mapping.ColumnAttribute attribute, Table table, SpecificationEnum specification)
        {
            this._key = (attribute.Name != null ? attribute.Name : attribute.Storage.Substring(1)).Trim();

            if (this._key == property.Name)
            {
                throw new Gale.Exception.GaleException("API008",property.Name);
            }

            this._name = char.ToLower(property.Name[0]) + property.Name.Substring(1);
            this._type = property.PropertyType;
            this._table = table;
            this._specification = specification;
            this._selected = false;

            if (attribute.IsPrimaryKey)
            {
                _specification = SpecificationEnum.Pk;
                table.SetPrimaryKey(this);

                if (attribute.IsPrimaryKey && table.IsForeign == false)
                {
                    this._selected = true;
                }
            }
        }