SenseNet.ContentRepository.Storage.Schema.TypeConverter.ToBoolean C# (CSharp) Метод

ToBoolean() статический приватный Метод

static private ToBoolean ( object value ) : bool
value object
Результат bool
        internal static bool ToBoolean(object value)
        {
            return ((value == null || value == System.DBNull.Value) ? false : ToInt32(value) != 0);
        }

Usage Example

Пример #1
0
 private void BuildPropertyTypeAssignments(DataTable table)
 {
     foreach (DataRow row in table.Rows)
     {
         int          propertyTypeId = TypeConverter.ToInt32(row["PropertyTypeId"]);
         int          propertySetId  = TypeConverter.ToInt32(row["PropertySetID"]);
         bool         isDeclared     = TypeConverter.ToBoolean(row["IsDeclared"]);
         PropertyType propertyType   = _propertyTypes.GetItemById(propertyTypeId);
         if (propertyType == null)
         {
             throw new InvalidSchemaException(String.Concat(SR.Exceptions.Schema.Msg_PropertyTypeDoesNotExist, ": id=", propertyTypeId));
         }
         PropertySet propertySet = null;
         if (propertyType.IsContentListProperty)
         {
             propertySet = _contentListTypes.GetItemById(propertySetId);
         }
         else
         {
             propertySet = _nodeTypes.GetItemById(propertySetId);
         }
         if (isDeclared)
         {
             AddPropertyTypeToPropertySet(propertyType, propertySet);
         }
     }
 }
All Usage Examples Of SenseNet.ContentRepository.Storage.Schema.TypeConverter::ToBoolean