public DataField[] GetDataFields(int?procID) { if (!procID.HasValue) { return(Enumerable.Empty <DataField>().ToArray()); } var server = this.GetServer(); using (server.Connection) { var processDataFields = server.GetProcessDataFields(procID.Value); var xmlFields = server.GetProcessXMLFields(procID.Value); return(DataField.GetEnumerable(processDataFields.Cast <SourceCode.Workflow.Management.ProcessDataField>()) .Union(DataField.GetEnumerable(xmlFields.Cast <SourceCode.Workflow.Management.ProcessXMLField>())) .ToArray()); } }