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


C# ResourceType类代码示例

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


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

示例1: ResourceTypeToString

 public static String ResourceTypeToString(ResourceType type)
 {
     switch (type)
     {
         case ResourceType.MESH:
             {
                 return "Meshes";
             }
         case ResourceType.FOLDER:
             {
                 return "Folder";
             }
         case ResourceType.MACRO:
             {
                 return "Macros";
             }
         case ResourceType.MATERIAL:
             {
                 return "Materials";
             }
         case ResourceType.SCRIPT:
             {
                 return "Scripts";
             }
         case ResourceType.TEXTURE:
             {
                 return "Textures";
             }
         default:
             return "NONE";
     }
 }
开发者ID:DelBero,项目名称:XnaScrapEdit,代码行数:32,代码来源:Resources.cs

示例2: Tile

        ResourceType resourceType; // The ResourceType the resource on the map is.

        #endregion Fields

        #region Constructors

        // Default Constructor used for creating an empty Tile object
        public Tile()
        {
            // Initialise the variables to a default state
            position = Vector3.zero;
            resourceType = ResourceType.None;
            resourceObj = null;
        }
开发者ID:brentspector,项目名称:TheTraveler-sr,代码行数:14,代码来源:Tile.cs

示例3: NativeObjectSecurity

		protected NativeObjectSecurity (bool isContainer,
						ResourceType resourceType,
						SafeHandle handle,
						AccessControlSections includeSections)
			: this (isContainer, resourceType, handle, includeSections, null, null)
		{
		}
开发者ID:Profit0004,项目名称:mono,代码行数:7,代码来源:NativeObjectSecurity.cs

示例4: 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 destinationPath = driverUploadPath + Path.GetFileName(filePath);
            var remoteFileUri = _fileSystem.CreateUriForPath(destinationPath);

            Log.Log(Level.Verbose, @"Copy {0} to {1}", filePath, remoteFileUri);

            // IFileSystem does not support async APIs; Hence we start the copying in a task
            await Task.Run(() => _fileSystem.CopyFromLocal(filePath, remoteFileUri));
            var fileStatus = _fileSystem.GetFileStatus(remoteFileUri);

            return new JobResource
            {
                Name = localizedName ?? Path.GetFileName(filePath),
                LastModificationUnixTimestamp = DateTimeToUnixTimestamp(fileStatus.ModificationTime),
                RemoteUploadPath = _urlConverter.ConvertToLocalUrl(remoteFileUri),
                ResourceSize = fileStatus.LengthBytes,
                ResourceType = resourceType
            };
        }
开发者ID:beomyeol,项目名称:reef,代码行数:27,代码来源:FileSystemJobResourceUploader.cs

示例5: AddResourceGroup

        private IInMemoryConfigurer AddResourceGroup(string name, Action<IResourceElementGroupConfigurer> registration, ResourceType resourceType)
        {
            if (name == null)
            {
                throw new ArgumentNullException("name");
            }
            if (registration == null)
            {
                throw new ArgumentNullException("registration");
            }

            ResourceElementGroup resourceElementGroup = new ResourceElementGroup {ResourceType = resourceType};
            ResourceElementGroupConfigurer resourceElementGroupConfigurer = new ResourceElementGroupConfigurer(resourceElementGroup);
            registration(resourceElementGroupConfigurer);

            if (resourceType == ResourceType.Js)
            {
                m_WebResources.JavascriptResources.ResourceGroups.Add(resourceElementGroup);                
            }
            else if (resourceType == ResourceType.Css)
            {
                m_WebResources.CssResources.ResourceGroups.Add(resourceElementGroup);                
            }
            return this;
        }
开发者ID:LaboFoundation,项目名称:Labo.WebSiteOptimizer,代码行数:25,代码来源:InMemoryConfigurer.cs

示例6: Resource

 /// <summary>
 /// 
 /// </summary>
 /// <param name="rt">Tipo de recurso</param>
 /// <param name="qtd">Quantidade do recurso</param>
 public Resource(ResourceType rt, int qtd, Texture2D img)
 {
     Type = rt;
     Quantity = qtd;
     Image = img;
     Name = Enum.GetName(typeof(ResourceType), Type);
 }
开发者ID:renannprado,项目名称:xnastrategygame,代码行数:12,代码来源:Resource.cs

示例7: ProcessResources

        /// <summary>
        /// Performs any transforms on the web <paramref name="resources" /> passed in and returns the new list.
        /// </summary>
        /// <param name="resources">List of web resources to process.</param>
        /// <param name="resourceType">Web resource types being processed.</param>
        /// <returns>
        /// Transformed list of web resources.
        /// </returns>
        public override IEnumerable<string> ProcessResources(IEnumerable<string> resources, ResourceType resourceType)
        {
            var result = base.ProcessResources(resources, resourceType);

            return ResourceType.HasFlag(resourceType)
                ? result.Distinct() : result;
        }
开发者ID:kellystuard,项目名称:mvcassetmanager,代码行数:15,代码来源:ConcatenationTransform.cs

示例8: GetResourceData

 public static void GetResourceData(Stream stream, out uint flags, out ResourceType type)
 {
     var rh = new ResourceHeader();
     rh.Read(new BinaryReader(stream));
     flags = rh.Flags;
     type = rh.Type;
 }
开发者ID:tjhorner,项目名称:gtaivtools,代码行数:7,代码来源:ResourceUtil.cs

示例9: NativeObjectSecurity

		protected NativeObjectSecurity (bool isContainer,
						ResourceType resourceType,
						ExceptionFromErrorCode exceptionFromErrorCode,
						object exceptionContext)
			: this (isContainer, resourceType)
		{
		}
开发者ID:runefs,项目名称:Marvin,代码行数:7,代码来源:NativeObjectSecurity.cs

示例10: RegisterResources

        private static MvcHtmlString RegisterResources(this HtmlHelper helper, SimpleCompressionConfiguration configuration, string[] files, ResourceType resourceType)
        {
            configuration = configuration ?? SimpleCompressionConfiguration.DefaulConfiguration;

            Func<string, string> printFunc = resourceType == ResourceType.Css
                                                 ? (Func<string,string>)TagHelper.PrintCssTag
                                                 : TagHelper.PrintJavascriptTag;

            string tagString = string.Empty;
            if (configuration.Disable)
            {
                foreach (var file in files)
                {
                    tagString += helper.PrintTag(file, printFunc);
                }
            }
            else
            {

                var fileResources = CreateResources(files, configuration);

                var hashCode = fileResources.GetHashCode();
                string extension = resourceType == ResourceType.Css ? ".css" : ".js";
                string fileName = configuration.ClientVersionPrefix + "_" + hashCode + extension;
                string filePath = "~/" + configuration.FolderForCachedResources + fileName;
                ResourceCacheManager.Instance.AddResourcesToCache(fileName, new Tuple<List<FileResource>, SimpleCompressionConfiguration>(fileResources, configuration));
                tagString = helper.PrintTag(filePath, printFunc);
            }
            return new MvcHtmlString(tagString);
        }
开发者ID:mastoj,项目名称:SimpleCompression,代码行数:30,代码来源:SimpleCompressionHelpers.cs

示例11: Start

 protected override void Start()
 {
     base.Start();
     amountLeft = capacity;
     resourceType = ResourceType.Unknown;
     worldObjectType = WorldObjectType.Resource;
 }
开发者ID:sentonnes,项目名称:RTS-Framework,代码行数:7,代码来源:Resource.cs

示例12: IncResource

 private void IncResource(ResourceType resource, int amount)
 {
     // make sure we have under the limit
     if (this.resourceLimits [resource] > (this.resources [resource] + amount)) {
         this.resources [resource] += amount;
     }
 }
开发者ID:devend711,项目名称:game-tutorial,代码行数:7,代码来源:Player.cs

示例13: CacheSetting

 public CacheSetting(Guid id, ResourceType resourceType, DateTime? lastRefreshedDateUtc, int cacheValidDurationInSeconds)
 {
     this.Id = id;
     this.ResourceType = resourceType;
     this.LastRefreshedDateUtc = lastRefreshedDateUtc;
     this.CacheValidDurationInSeconds = cacheValidDurationInSeconds;
 }
开发者ID:CodeObsessed,项目名称:drumbleapp,代码行数:7,代码来源:CacheSetting.cs

示例14: HandleResource

        public void HandleResource(HttpContextBase httpContext, ResourceType resourceType, string resourceGroupName)
        {
            CompressionType compressionType;
            ProcessedResourceGroupInfo resourceInfo = ProcessResource(httpContext, resourceType, resourceGroupName, out compressionType);

            HandleResource(httpContext, resourceType, compressionType, resourceInfo);
        }
开发者ID:LaboFoundation,项目名称:Labo.WebSiteOptimizer,代码行数:7,代码来源:ResourceHandler.cs

示例15: AutoDiscoveryResult

 public AutoDiscoveryResult (Uri ressourceUrl, bool wasCancelled, ResourceType resourceType)
     : this()
 {
   _wasCancelled = wasCancelled;
   _ressourceUrl = ressourceUrl;
   _resourceType = resourceType;
 }
开发者ID:rjani,项目名称:outlookcaldavsynchronizer,代码行数:7,代码来源:AutoDiscoveryResult.cs


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