[C#]
public
IObjectClass CreateObjectClass_Example(IWorkspace2 workspace, String nameOfObjectClass, IFields fields,string
configKeyword) { IFeatureWorkspace featureWorkspace = (IFeatureWorkspace)workspace;if
(workspace.get_NameExists(esriDatasetType.esriDTTable, nameOfObjectClass)) {// If table with that name already exists, return that table.
return
(IObjectClass)featureWorkspace.OpenTable(nameOfObjectClass); }// Create an object class description to use if needed for fields collection and for the CLSID parameter.
IObjectClassDescription ocDesc =new
ObjectClassDescription();// If no field collection is supplied, create one using the IObjectClassDescription.
if
(fields ==null
) {//Get the set of required fields collection.
fields = ocDesc.RequiredFields; }return
(IObjectClass) featureWorkspace.CreateTable(nameOfObjectClass, fields, ocDesc.InstanceCLSID, ocDesc.ClassExtensionCLSID, configKeyword); }