本文整理汇总了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";
}
}
示例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;
}
示例3: NativeObjectSecurity
protected NativeObjectSecurity (bool isContainer,
ResourceType resourceType,
SafeHandle handle,
AccessControlSections includeSections)
: this (isContainer, resourceType, handle, includeSections, null, null)
{
}
示例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
};
}
示例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;
}
示例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);
}
示例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;
}
示例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;
}
示例9: NativeObjectSecurity
protected NativeObjectSecurity (bool isContainer,
ResourceType resourceType,
ExceptionFromErrorCode exceptionFromErrorCode,
object exceptionContext)
: this (isContainer, resourceType)
{
}
示例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);
}
示例11: Start
protected override void Start()
{
base.Start();
amountLeft = capacity;
resourceType = ResourceType.Unknown;
worldObjectType = WorldObjectType.Resource;
}
示例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;
}
}
示例13: CacheSetting
public CacheSetting(Guid id, ResourceType resourceType, DateTime? lastRefreshedDateUtc, int cacheValidDurationInSeconds)
{
this.Id = id;
this.ResourceType = resourceType;
this.LastRefreshedDateUtc = lastRefreshedDateUtc;
this.CacheValidDurationInSeconds = cacheValidDurationInSeconds;
}
示例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);
}
示例15: AutoDiscoveryResult
public AutoDiscoveryResult (Uri ressourceUrl, bool wasCancelled, ResourceType resourceType)
: this()
{
_wasCancelled = wasCancelled;
_ressourceUrl = ressourceUrl;
_resourceType = resourceType;
}