ToString() static private méthode

static private ToString ( object value ) : string
value object
Résultat string
Exemple #1
0
        private void BuildPropertySets(DataTable table, Dictionary <int, PropertySetType> propertySetTypes)
        {
            List <NodeTypeInfo> ntiList = new List <NodeTypeInfo>();

            foreach (DataRow row in table.Rows)
            {
                int             id              = TypeConverter.ToInt32(row["PropertySetID"]);
                int             parentID        = row["ParentID"] is DBNull ? 0 : TypeConverter.ToInt32(row["ParentID"]);
                string          name            = TypeConverter.ToString(row["Name"]);
                string          className       = row["ClassName"] is DBNull ? null : TypeConverter.ToString(row["ClassName"]);
                PropertySetType propertySetType = propertySetTypes[TypeConverter.ToInt32(row["PropertySetTypeID"])];
                switch (propertySetType)
                {
                case PropertySetType.NodeType:
                    ntiList.Add(new NodeTypeInfo(id, parentID, name, className));
                    break;

                case PropertySetType.ContentListType:
                    CreateContentListType(id, name);
                    break;

                default:
                    throw new InvalidSchemaException(String.Concat(SR.Exceptions.Schema.Msg_UnknownPropertySetType, propertySetType));
                }
            }
            while (ntiList.Count > 0)
            {
                for (int i = ntiList.Count - 1; i >= 0; i--)
                {
                    NodeTypeInfo nti    = ntiList[i];
                    NodeType     parent = null;
                    if (nti.ParentId == 0 || ((parent = _nodeTypes.GetItemById(nti.ParentId)) != null))
                    {
                        CreateNodeType(nti.Id, _nodeTypes.GetItemById(nti.ParentId), nti.Name, nti.ClassName);
                        ntiList.Remove(nti);
                    }
                }
            }
        }
Exemple #2
0
        private static Dictionary <int, DataType> BuildDataTypeHelper(DataSet dataSet)
        {
            Dictionary <int, DataType> dataTypeHelper = new Dictionary <int, DataType>();

            foreach (DataRow row in dataSet.Tables["DataTypes"].Rows)
            {
                dataTypeHelper.Add(TypeConverter.ToInt32(row["DataTypeID"]), (DataType)Enum.Parse(typeof(DataType), TypeConverter.ToString(row["Name"])));
            }
            return(dataTypeHelper);
        }