当前位置: 首页>>代码示例>>C#>>正文


C# ResourceType.ToString方法代码示例

本文整理汇总了C#中ResourceType.ToString方法的典型用法代码示例。如果您正苦于以下问题:C# ResourceType.ToString方法的具体用法?C# ResourceType.ToString怎么用?C# ResourceType.ToString使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在ResourceType的用法示例。


在下文中一共展示了ResourceType.ToString方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: SetToResource

		public void SetToResource(ResourceType lootType)
		{
			_resourceType = lootType;

			resourceNameDisplay.text = lootType.ToString();

			UpdateDisplay();
		}
开发者ID:mswf,项目名称:game-a-week,代码行数:8,代码来源:ResourceDisplay.cs

示例2: Resource

        int weightValue; // The weight value of the resource

        #endregion Fields

        #region Constructors

        // Create a resource
        public Resource(string itemName, ResourceType itemType, Sprite itemIcon, int weight, int size, int worth)
            : base(itemName, itemType.ToString(), itemIcon)
        {
            // Initialise the item to the given parameters
            weightValue = weight;
            sizeValue = size;
            sellValue = worth;
        }
开发者ID:GSP362DeVryNov2014,项目名称:TheTraveler-sr,代码行数:15,代码来源:Resource.cs

示例3: GetResourcePath

 private static string GetResourcePath(string path, ResourceType type, ResourceLocation loc)
 {
     if (path.StartsWith("/")) {
         path = path.Substring(1);
     }
     return string.Format("{0}{1}/{2}"
         , loc == ResourceLocation.Module ? ModuleFolder : ThemeFolder
         , type.ToString()
         , path
     );
 }
开发者ID:GiscardBiamby,项目名称:Orchard-Syntax-Highlighter,代码行数:11,代码来源:ResourceManifest.cs

示例4: GetResourcesByType

        // Get all the resources of a given type
        public List<Resource> GetResourcesByType(ResourceType resourceType, int playerNum)
        {
            // The list to return; returns empty list if the inventory doesn't exist
            List<Resource> resources = new List<Resource>();

            // Get the inventory script
            Inventory inventory = GameObject.Find("Canvas").transform.Find("Inventory").GetComponent<Inventory>();

            // Make sure the inventory exists
            if (inventory != null)
            {
                // Set the inventory up for the correct player
                inventory.SetPlayer(playerNum, true);

                // Get all the items in the inventory
                List<Item> inventoryItems = inventory.GetItems(playerNum);

                // Find all the resources of the given type
                resources = inventoryItems.FindAll(tempItem => tempItem.Type == resourceType.ToString()).Select(item => (Resource)item).ToList();
            } // end if

            // Return the list of resources
            return resources;
        }
开发者ID:brentspector,项目名称:TheTraveler-sr,代码行数:25,代码来源:ResourceUtility.cs

示例5: Move

 /// <summary>
 /// 演绎函数:移动图片
 /// </summary>
 /// <param name="id">图片ID</param>
 /// <param name="rType">资源类型</param>
 /// <param name="property">改变的属性</param>
 /// <param name="toValue">目标值</param>
 /// <param name="acc">加速度</param>
 /// <param name="duration">完成所需时间</param>
 private void Move(int id, ResourceType rType, string property, double toValue, double acc, Duration duration)
 {
     YuriSprite actionSprite = this.viewMana.GetSprite(id, rType);
     SpriteDescriptor descriptor = Director.ScrMana.GetSpriteDescriptor(id, rType);
     if (actionSprite == null)
     {
         CommonUtils.ConsoleLine(String.Format("Ignored move (sprite is null): {0}, {1}", rType.ToString(), id),
             "UpdateRender", OutputStyle.Warning);
         return;
     }
     switch (property)
     {
         case "x":
             SpriteAnimation.XYMoveToAnimation(actionSprite, duration, toValue, actionSprite.DisplayY, acc, 0);
             descriptor.X = toValue;
             break;
         case "y":
             SpriteAnimation.XYMoveToAnimation(actionSprite, duration, actionSprite.DisplayX, toValue, 0, acc);
             descriptor.Y = toValue;
             break;
         case "o":
         case "opacity":
             SpriteAnimation.OpacityToAnimation(actionSprite, duration, toValue, acc);
             descriptor.Opacity = toValue;
             break;
         case "a":
         case "angle":
             SpriteAnimation.RotateToAnimation(actionSprite, duration, toValue, acc);
             descriptor.Angle = toValue;
             break;
         case "s":
         case "scale":
             SpriteAnimation.ScaleToAnimation(actionSprite, duration, toValue, toValue, acc, acc);
             descriptor.ScaleX = descriptor.ScaleY = toValue;
             break;
         case "sx":
         case "scalex":
             SpriteAnimation.ScaleToAnimation(actionSprite, duration, toValue, descriptor.ScaleY, acc, 0);
             descriptor.ScaleX = toValue;
             break;
         case "sy":
         case "scaley":
             SpriteAnimation.ScaleToAnimation(actionSprite, duration, descriptor.ScaleX, toValue, 0, acc);
             descriptor.ScaleY = toValue;
             break;
         default:
             CommonUtils.ConsoleLine(String.Format("Move instruction without valid parameters: {0}", property),
                 "UpdateRender", OutputStyle.Warning);
             break;
     }
 }
开发者ID:rinkako,项目名称:ProjectYuri,代码行数:60,代码来源:UpdateRender.cs

示例6: FindWebhookResource

 /// <summary>
 /// Find specific webhook resource
 /// </summary>
 /// <param name="resource">resource type object</param>
 /// <returns>WebhookResource object</returns>
 /// <exception cref="BadRequestException">          in case HTTP response code is 400 - Bad request, the request was formatted improperly.</exception>
 /// <exception cref="UnauthorizedException">        in case HTTP response code is 401 - Unauthorized, API Key missing or invalid.</exception>
 /// <exception cref="AccessForbiddenException">     in case HTTP response code is 403 - Forbidden, insufficient permissions.</exception>
 /// <exception cref="ResourceNotFoundException">    in case HTTP response code is 404 - NOT FOUND, the resource requested does not exist.</exception>
 /// <exception cref="InternalServerErrorException"> in case HTTP response code is 500 - Internal Server Error.</exception>
 /// <exception cref="CallfireApiException">         in case HTTP response code is something different from codes listed above.</exception>
 /// <exception cref="CallfireClientException">      in case error has occurred in client.</exception>
 public WebhookResource FindWebhookResource(ResourceType resource, string fields)
 {
     var queryParams = ClientUtils.BuildQueryParams("fields", fields);
     return Client.Get<WebhookResource>(WEBHOOKS_RESOURCE_PATH.ReplaceFirst(ClientConstants.PLACEHOLDER, resource.ToString()), queryParams);
 }
开发者ID:CallFire,项目名称:callfire-api-client-csharp,代码行数:17,代码来源:WebhooksApi.cs

示例7: getResourcePools

 public static ManagementObjectCollection getResourcePools(ResourceType ResourceType, string ResourceSubtype, string PoolId, ManagementScope Scope)
 {
     var myType = (int)ResourceType;
     Console.WriteLine("ResourceType : " + ResourceType.ToString());
     return getManagementObjects(wmiClass.CIM_ResourcePool.ToString(), ResourceType, ResourceSubtype, PoolId, Scope);
 }
开发者ID:jeffpatton1971,项目名称:mod-hyperv,代码行数:6,代码来源:functions.cs

示例8: InsufficientResources

 public void InsufficientResources(ResourceType type)
 {
     Debug.Log(string.Format("{0} has insufficient {1}", name, type.ToString()));
 }
开发者ID:Blkx-Darkreaper,项目名称:Unity,代码行数:4,代码来源:PlayerController.cs

示例9: UploadResourceAndGetInfoAsync

        private async Task<JobResource> UploadResourceAndGetInfoAsync(string filePath, ResourceType resourceType, string driverUploadPath, string localizedName = null)
        {
            if (!_file.Exists(filePath))
            {
                Exceptions.Throw(
                    new FileNotFoundException("Could not find resource file " + filePath),
                    Log);
            }

            var detailsOutputPath = Path.Combine(Path.GetTempPath(), Guid.NewGuid().ToString("N"));

            try
            {
                await _javaLauncher.LaunchAsync(JavaClassNameForResourceUploader,
                    filePath,
                    resourceType.ToString(),
                    driverUploadPath,
                    detailsOutputPath);

                var localizedResourceName = localizedName ?? Path.GetFileName(filePath);
                return ParseGeneratedOutputFile(detailsOutputPath, localizedResourceName, resourceType);
            }
            finally
            {
                if (_file.Exists(detailsOutputPath))
                {
                    _file.Delete(detailsOutputPath);
                }
            }
        }
开发者ID:zerg-junior,项目名称:incubator-reef,代码行数:30,代码来源:LegacyJobResourceUploader.cs

示例10: AddResource

	public void AddResource(ResourceType collectedResource)

	{

		switch (collectedResource) 
		{
		case ResourceType.Skull:
			SoundMan.main.ResourceCollectSkull();
			break;
		case ResourceType.Feather:
			SoundMan.main.ResourceCollectRaven();
			break;
		case ResourceType.Fire:
			SoundMan.main.ResourceCollectFireball();
			//play sound
			break;
		case ResourceType.Pyramid:
			SoundMan.main.ResourceCollectTriangle();
			//play sound
			break;
		}

		if (gameOver) return;
		Debug.Log ("in addResource " + collectedResource.ToString());
		Debug.Log ("Needed resource: " + neededResource);
		if (collectedResource == sequencer.inputArray[colorsScored]) 
		{
			Debug.Log ("got needed color");

			currentResourceTotal++;
			Debug.Log ("currentResource count " + currentResourceTotal);
			if (currentResourceTotal >= maxResources)
			{
				currentResourceTotal = 0;
				Debug.Log ("Reset resources to : " + currentResourceTotal);
				resourceDisplay [colorsScored].SetResourceIcon (collectedResource);

				ColorScored();
			}
		}
	}
开发者ID:mirrorfishmedia,项目名称:GGJ2016,代码行数:41,代码来源:GameMan.cs

示例11: UpdateMedatadaFile

        /// <summary>
        /// Update the metadata file with resource status IsImported
        /// </summary>
        /// <param name="resourceType">Type of resource to be updated in metadata file</param>
        /// <param name="resourceName">Name of the resource</param>
        /// <param name="isImported">If reource is imported successfully</param>
        /// <param name="parentResourceName">Name of parent resource</param>
        internal void UpdateMedatadaFile(ResourceType resourceType, string resourceName = null, bool isImported = true, string parentResourceName = null)
        {
            string methodName = System.Reflection.MethodBase.GetCurrentMethod().Name;
            Logger.Info(methodName, ProgressResources.ExecutionStarted, resourceType.ToString(), resourceName);

            foreach (DataCenter dataCenter in sourceSubscriptionMetadata.DataCenters)
            {
                switch (resourceType)
                {
                    case ResourceType.AffinityGroup:
                        {
                            // For Affinity Group
                            dataCenter.AffinityGroups = dataCenter.AffinityGroups.Select(affinityGroup =>
                            {
                                if (affinityGroup.AffinityGroupDetails.Name.Equals(GetSourceResourceName(ResourceType.AffinityGroup, resourceName),
                                    StringComparison.InvariantCultureIgnoreCase))
                                {
                                    affinityGroup.IsImported = isImported;
                                }
                                return affinityGroup;
                            }).ToList();
                        }
                        break;
                    case ResourceType.NetworkConfiguration:
                        {
                            // For Network Configuration
                            if (dataCenter.NetworkConfiguration != null)
                            {
                                dataCenter.NetworkConfiguration.IsImported = isImported;
                            }
                        }
                        break;
                    case ResourceType.StorageAccount:
                        {
                            // For Storage Account
                            dataCenter.StorageAccounts = dataCenter.StorageAccounts.Select(storageAccount =>
                            {
                                if (storageAccount.StorageAccountDetails.Name.Equals(GetSourceResourceName(ResourceType.StorageAccount, resourceName),
                                    StringComparison.InvariantCultureIgnoreCase))
                                {
                                    storageAccount.IsImported = isImported;
                                }
                                return storageAccount;
                            }).ToList();
                        }
                        break;
                    case ResourceType.CloudService:
                        {
                            // For Cloud Service
                            dataCenter.CloudServices = dataCenter.CloudServices.Select(service =>
                            {
                                if (service.CloudServiceDetails.ServiceName.Equals(GetSourceResourceName(ResourceType.CloudService, resourceName),
                                   StringComparison.InvariantCultureIgnoreCase))
                                {
                                    service.IsImported = isImported;
                                }
                                return service;
                            }).ToList();
                        }
                        break;
                    case ResourceType.Deployment:
                        {
                            // For Deployment
                            dataCenter.CloudServices = dataCenter.CloudServices.Select(service =>
                            {
                                if (service.DeploymentDetails != null &&
                                     service.DeploymentDetails.Name.Equals(GetSourceResourceName(ResourceType.Deployment, resourceName,
                                     ResourceType.CloudService, parentResourceName),
                                    StringComparison.InvariantCultureIgnoreCase)
                                    && service.CloudServiceDetails.ServiceName.
                                    Equals(GetSourceResourceName(ResourceType.CloudService, parentResourceName)))
                                {
                                    service.DeploymentDetails.IsImported = isImported;
                                }
                                return service;
                            }).ToList();
                        }
                        break;

                    case ResourceType.VirtualMachine:
                        {
                            // For Virtual Machine
                            dataCenter.CloudServices = dataCenter.CloudServices.Select(service =>
                            {
                                if (service.DeploymentDetails != null && service.CloudServiceDetails.ServiceName.
                                    Equals(GetSourceResourceName(ResourceType.CloudService, parentResourceName)))
                                {
                                    service.DeploymentDetails.VirtualMachines = service.DeploymentDetails.VirtualMachines.Select(vm =>
                                    {
                                        if (vm.VirtualMachineDetails.RoleName.Equals(
                                              GetSourceResourceName(ResourceType.VirtualMachine, resourceName,
                                                             ResourceType.CloudService, parentResourceName),
                                            // resourceName,
//.........这里部分代码省略.........
开发者ID:ziyezizy7,项目名称:adcms,代码行数:101,代码来源:ResourceImporter.cs

示例12: SearchParameters

 protected SearchParameters(ResourceType resourceType)
 {
     Type = resourceType.ToString().ToLower();
     Page = 1;
 }
开发者ID:niekert,项目名称:FIFA-Ultimate-Team-2014-Toolkit,代码行数:5,代码来源:SearchParameters.cs

示例13: ResourceNotLoadedException

		public ResourceNotLoadedException(int resourceID, ResourceType resourceType) : base("Could not locate resource id '" + resourceID + "', of type '" + resourceType.ToString() + "'.")
		{
		}
开发者ID:628426,项目名称:Strive.NET,代码行数:3,代码来源:Exceptions.cs

示例14: GetCollectionName

 public static string GetCollectionName(ResourceType t)
 {
     return t.ToString().ToLower();
 }
开发者ID:avontd2868,项目名称:vista-novo-fhir,代码行数:4,代码来源:ResourceLocation.cs

示例15: GenerateNewResourceName

        /// <summary>
        /// Generates new name for destination resources by attaching Prefix to source  resources.
        /// </summary>        
        /// <param name="resourceType">Resource type</param>
        /// <param name="originalResourceName">Source subscription resource name</param>
        /// <param name="destinationPrefixValue">Prefix value for destination name</param>
        /// <param name="updateCollection">True to update the internal collection of resource names</param>
        /// <returns>Prefix attached value</returns>
        private string GenerateNewResourceName(ResourceType resourceType, string originalResourceName,
            string destinationPrefixValue, bool updateCollection = true)
        {
            if (originalResourceName == null)
            {
                return null;
            }
            else
            {
                string newResourceName = string.Format("{0}{1}", destinationPrefixValue, originalResourceName);

                if (resourceType != ResourceType.None)
                {
                    newResourceName = ((Constants.GetMaxLengthForResourceType(resourceType) != -1 &&  (newResourceName.Length > Constants.GetMaxLengthForResourceType(resourceType))?
                        newResourceName.Substring(0,  Constants.GetMaxLengthForResourceType(resourceType) - 1) :
                        newResourceName));

                    if (updateCollection)
                    {
                        if (resourceNameCollection.ContainsKey(resourceType) && resourceNameCollection[resourceType].Count() > 0)
                        {
                            if (resourceNameCollection[resourceType].Where(s => s.SourceName.Equals(originalResourceName)).Count() == 0)
                                resourceNameCollection[resourceType].Add(new ResourceNameMapper
                                {
                                    SourceName = originalResourceName,
                                    DestinationName = newResourceName,
                                    //Import = true,
                                    ResourceType = resourceType.ToString()
                                });
                        }
                        else
                        {
                            List<ResourceNameMapper> resourceNames = new List<ResourceNameMapper>();
                            resourceNames.Add(new ResourceNameMapper
                            {
                                SourceName = originalResourceName,
                                DestinationName = newResourceName,
                                //Import = true,
                                ResourceType = resourceType.ToString()
                            });
                            resourceNameCollection.Add(resourceType, resourceNames);
                        }
                    }
                }
                return newResourceName;
            }
        }
开发者ID:clone278,项目名称:adcms,代码行数:55,代码来源:ResourceNameMapper.cs


注:本文中的ResourceType.ToString方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。