public TDAPIOLELib.QCResource CreateResource(TDAPIOLELib.QCResourceFolder qCResourceFolder, String Name, String ResourceFilePath, ResourceUploadType resourceUploadType, ResourceType resourceType) { //Check if Resource type is folder and should be uploaded or not if ((resourceUploadType == ResourceUploadType.Folder) && (resourceType != TestResources.ResourceType.TestResource)) { throw (new Exception("Folder cant be uploaded to " + GetResourceType(resourceType) + " resource type")); } TDAPIOLELib.QCResourceFactory qCResourceFactory = qCResourceFolder.QCResourceFactory; TDAPIOLELib.QCResource qCResource = qCResourceFactory.AddItem(System.DBNull.Value); qCResource.Name = Name; qCResource.ResourceType = GetResourceType(resourceType); String ResourceType = GetResourceType(resourceType); if (resourceUploadType == ResourceUploadType.File) { UploadFileToResource(qCResource, ResourceFilePath); } else { UploadFolderToResource(qCResource, ResourceFilePath); } return(qCResource); }
public TDAPIOLELib.QCResource CreateResource(TDAPIOLELib.QCResourceFolder qCResourceFolder, String Name) { TDAPIOLELib.QCResourceFactory qCResourceFactory = qCResourceFolder.QCResourceFactory; TDAPIOLELib.QCResource qCResource = qCResourceFactory.AddItem(System.DBNull.Value); qCResource.Name = Name; qCResource.Post(); return(qCResource); }
public System.Collections.Generic.List <String> GetResourceNames(TDAPIOLELib.QCResourceFolder qCResourceFolder) { TDAPIOLELib.QCResourceFactory qCResourceFactory = qCResourceFolder.QCResourceFactory; System.Collections.Generic.List <String> list = new System.Collections.Generic.List <string>(); foreach (TDAPIOLELib.QCResourceFolder folder in qCResourceFactory.NewList("")) { list.Add(folder.Name); } return(list); }
public TDAPIOLELib.List GetResources(TDAPIOLELib.QCResourceFolder qCResourceFolder) { TDAPIOLELib.QCResourceFactory qCResourceFactory = qCResourceFolder.QCResourceFactory; return(qCResourceFactory.NewList("")); }