예제 #1
0
        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);
        }
예제 #2
0
 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);
 }
예제 #3
0
 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);
 }
예제 #4
0
 public TDAPIOLELib.List GetResources(TDAPIOLELib.QCResourceFolder qCResourceFolder)
 {
     TDAPIOLELib.QCResourceFactory qCResourceFactory = qCResourceFolder.QCResourceFactory;
     return(qCResourceFactory.NewList(""));
 }