private SmartObjectDefinition CreateSmartObject(string smoName) { try { // Delete the smartobject if it already exists this.DeleteSmartObject(smoName); toolStripStatusLabel1.Text = ("Creating SmartObject properties for '" + smoName + "'"); statusStrip1.Update(); ManagementServerConnect(); // Get SmartBox service instance ServiceInstance serviceInstance = ServiceInstance.Create(_smoManagementServer.GetServiceInstanceForExtend(new Guid(_smartboxGuid), string.Empty)); ExtendObject extendObject = serviceInstance.GetCreateExtender(); extendObject.Name = smoName; extendObject.Metadata.DisplayName = smoName; // Create 'id' property ExtendObjectProperty idProperty = new ExtendObjectProperty(); idProperty.Name = "ID"; idProperty.Metadata.DisplayName = idProperty.Name; idProperty.Type = PropertyDefinitionType.Autonumber; idProperty.ExtendType = ExtendPropertyType.UniqueIdAuto; // Create 'name' property ExtendObjectProperty nameProperty = new ExtendObjectProperty(); nameProperty.Name = "Name"; nameProperty.Metadata.DisplayName = nameProperty.Name; nameProperty.Type = PropertyDefinitionType.Text; // Create other properties here as needed // Add the new properties below // Add properties extendObject.Properties.Add(idProperty); extendObject.Properties.Add(nameProperty); SmartObjectDefinition smoDefinition = new SmartObjectDefinition(); // Create SmartObject Definition smoDefinition.Create(extendObject); smoDefinition.AddDeploymentCategory("Test SmartObjects"); smoDefinition.Build(); return(smoDefinition); } catch (Exception ex) { throw ex; } finally { ManagementServerCloseConnection(); } }