• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C# ResourceType类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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


示例16: ToTypeString

        /// <summary>
        /// Converts the given resource type to a studio resource type string (WorkflowService, Service, Source, ReservedService, or *).
        /// </summary>
        /// <param name="resourceType">The type of the resource to be converted.</param>
        /// <returns>A studio resource type string.</returns>
        public static string ToTypeString(ResourceType resourceType)
        {
            switch(resourceType)
            {
                case ResourceType.Server:
                case ResourceType.DbSource:
                case ResourceType.PluginSource:
                case ResourceType.EmailSource:
                case ResourceType.WebSource:
                case ResourceType.ServerSource:
                case ResourceType.SharepointServerSource:
                case ResourceType.OauthSource:
                    return TypeSource;

                case ResourceType.PluginService:
                case ResourceType.DbService:
                case ResourceType.WebService:
                    return TypeService;

                case ResourceType.WorkflowService:
                    return TypeWorkflowService;

                case ResourceType.ReservedService:
                    return TypeReservedService;
                default:
                    return TypeWildcard;
            }
        }
开发者ID:Robin--,项目名称:Warewolf,代码行数:33,代码来源:ResourceTypeConverter.cs


示例17: ClearRegistrations

 public static void ClearRegistrations(ResourceType resourceType)
 {
     if (_transformerRegistrations.ContainsKey(resourceType))
     {
         _transformerRegistrations[resourceType].Clear();
     }
 }
开发者ID:Romhein,项目名称:Rejuicer,代码行数:7,代码来源:FileTransformerRegistry.cs


示例18: NativeObjectSecurity

		internal NativeObjectSecurity (CommonSecurityDescriptor securityDescriptor, ResourceType resourceType)
			: base (securityDescriptor)
		{
#if !MOBILE			
			resource_type = resourceType;
#endif
		}
开发者ID:ItsVeryWindy,项目名称:mono,代码行数:7,代码来源:NativeObjectSecurity.cs


示例19: ResourceStat

 public ResourceStat(Resource resource, string info = "")
 {
     Type = resource.ResourceType;
     Version = resource.Version;
     Count = 1;
     Info = info;
 }
开发者ID:githubron726,项目名称:ValveResourceFormat,代码行数:7,代码来源:ResourceStat.cs


示例20: DynamicallyCompiledIndividualResourceHandler

 public DynamicallyCompiledIndividualResourceHandler(string physicalPathToResource,
     ResourceType resourceType,
     ContentFilterPipeline contentFilterPipeline,
     ContentFilterContext contentFilterContext)
     : this(physicalPathToResource, resourceType, contentFilterPipeline, contentFilterContext, new FileAccessWrapper())
 {
 }
开发者ID:andyalm,项目名称:assman,代码行数:7,代码来源:DynamicallyCompiledIndividualResourceHandler.cs



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# Resources类代码示例发布时间:2022-05-24
下一篇:
C# ResourcePath类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap