资源简介
C# asp.net雪碧图制作工具 雪碧图制作原理
代码片段和文件信息
namespace SpriteImage
{
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Globalization;
///
/// Generates the selector and the classname based on the filename.
/// We follow the CSS grammar. Spaces are not allowed.
///
internal static class CssNameHelper
{
///
/// Generates the selector based on the filename.
///
/// Filename to transform
/// Transformed filename for selector usage
internal static string GenerateSelector(string filename)
{
if (filename != null)
{
// Few more space for the capacity for special characters.
StringBuilder selector = new StringBuilder(filename.Length + 5);
// We do not accept space at all
filename = filename.Replace(‘ ‘ ‘-‘);
char? nextCharacter = null;
if (filename.Length > 1)
{
nextCharacter = filename[1];
}
selector.Append(GetStartingCharacter(filename[0] nextCharacter));
for (var i = 1; i < filename.Length; i++)
{
nextCharacter = null;
if (i + 1 < filename.Length)
{
nextCharacter = filename[i + 1];
}
selector.Append(GetCharacter(filename[i] nextCharacter));
}
return selector.ToString();
}
return null;
}
///
/// Generates the class name based on the filename.
///
/// Filename to transform
/// Transformed filename for class name usage
internal static string GenerateClassName(string filename)
{
if (filename != null)
{
return filename.Replace(‘ ‘ ‘-‘);
}
return null;
}
private static string GetStartingCharacter(char c char? nextCharacter = null)
{
if (c == ‘-‘ || c == ‘_‘ || (c >= ‘a‘ && c <= ‘z‘) || (c >= ‘A‘ && c <= ‘Z‘) || (c >= 128 && c <= 255))
{
return c.ToString(CultureInfo.InvariantCulture);
}
return GetSimpleEscape(c) ?? GetUnicode(c nextCharacter);
}
private static string GetCharacter(char c char? nextCharacter = null)
{
if (c == ‘-‘ || c == ‘_‘ || (c >= ‘a‘ && c <= ‘z‘) || (c >= ‘A‘ && c <= ‘Z‘) || (c >= ‘0‘ && c <= ‘9‘) || (c >= 128 && c <= 255))
{
return c.ToString(CultureInfo.InvariantCulture);
}
ret
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 10240 2012-07-07 11:51 SpriteImage\SpriteImage\bin\Debug\SpriteImage.dll
文件 22016 2012-07-07 11:51 SpriteImage\SpriteImage\bin\Debug\SpriteImage.pdb
文件 3979 2012-07-06 20:28 SpriteImage\SpriteImage\CssNameHelper.cs
文件 8948 2012-07-07 11:51 SpriteImage\SpriteImage\ImageOptimizations.cs
文件 1018 2012-07-07 09:24 SpriteImage\SpriteImage\ImageSettings.cs
文件 5153 2012-07-07 18:04 SpriteImage\SpriteImage\obj\Debug\DesignTimeResolveAssemblyReferencesInput.cache
文件 4613 2012-07-06 23:17 SpriteImage\SpriteImage\obj\Debug\ResolveAssemblyReference.cache
文件 540 2012-07-07 10:40 SpriteImage\SpriteImage\obj\Debug\SpriteImage.csproj.FileListAbsolute.txt
文件 10240 2012-07-07 11:51 SpriteImage\SpriteImage\obj\Debug\SpriteImage.dll
文件 22016 2012-07-07 11:51 SpriteImage\SpriteImage\obj\Debug\SpriteImage.pdb
文件 1452 2012-07-06 20:21 SpriteImage\SpriteImage\Properties\AssemblyInfo.cs
文件 2251 2012-07-07 10:41 SpriteImage\SpriteImage\SpriteImage.csproj
文件 3607 2012-07-07 18:10 SpriteImage\SpriteImage.sln
..A..H. 50688 2012-07-07 18:10 SpriteImage\SpriteImage.suo
文件 3699120 2012-07-07 11:52 SpriteImage\SpriteImageCreate\bin\Debug\img\20120707115240.png
文件 3699120 2012-07-07 11:54 SpriteImage\SpriteImageCreate\bin\Debug\img\20120707115427.png
文件 3699120 2012-07-07 11:55 SpriteImage\SpriteImageCreate\bin\Debug\img\20120707115517.png
文件 5855443 2012-07-07 13:41 SpriteImage\SpriteImageCreate\bin\Debug\img\20120707134145.png
文件 5402 2012-07-07 19:07 SpriteImage\SpriteImageCreate\bin\Debug\img\20120707190745.png
文件 10240 2012-07-07 11:51 SpriteImage\SpriteImageCreate\bin\Debug\SpriteImage.dll
文件 22016 2012-07-07 11:51 SpriteImage\SpriteImageCreate\bin\Debug\SpriteImage.pdb
文件 13312 2012-07-07 18:07 SpriteImage\SpriteImageCreate\bin\Debug\SpriteImageCreate.exe
文件 28160 2012-07-07 18:07 SpriteImage\SpriteImageCreate\bin\Debug\SpriteImageCreate.pdb
文件 11608 2012-07-07 19:05 SpriteImage\SpriteImageCreate\bin\Debug\SpriteImageCreate.vshost.exe
文件 490 2010-03-17 22:39 SpriteImage\SpriteImageCreate\bin\Debug\SpriteImageCreate.vshost.exe.manifest
文件 2544 2012-07-07 18:07 SpriteImage\SpriteImageCreate\Form1.cs
文件 10139 2012-07-07 11:55 SpriteImage\SpriteImageCreate\Form1.Designer.cs
文件 6189 2012-07-07 11:55 SpriteImage\SpriteImageCreate\Form1.resx
文件 5549 2012-07-07 18:07 SpriteImage\SpriteImageCreate\obj\x86\Debug\DesignTimeResolveAssemblyReferencesInput.cache
文件 4014 2012-07-07 11:55 SpriteImage\SpriteImageCreate\obj\x86\Debug\ResGen.read.1.tlog
............此处省略80个文件信息
相关资源
- C# 大学项目 仓库管理系统源码+数据库
- DotSpatial下添加栅格并进行渲染处理
- 图片帧转换mp4格式视频.zip
- C#程序设计基础入门教程-传智播客高
- C#winform sql数据库源码(员工考勤系统
- C# ABB PC SDK参考代码.zip
- OPC&Snap7;.zip
- c# winform大全(198个经典Csharp WinForm)
- 基于Skyline的C#创建管线加载3D模型
- C# Winform 视频流添加透明控件
- C# 电梯人机交互界面设计
- CefSharp 49.0.0.1 C#中的Google浏览器控件
- ASP.NET SignalR编程实战(附书中完整D
- C# 购物网站源码
- C#入门经典(第7版) C# 6.0 & Visual St
- C#写的全格式播放器-基于vlc含源码
- halcon联合C#实现实时显示源码
- C#写的组态软件--简单版
- C# 摄像头 时间戳 64位
- 学生成绩管理系统项目
- [源代码] ASP.NET 3.5 商用社交网站开发
- STK仿真,包含C#VCVB
- C#余弦算法比较文章相似度
- C#、js如何调用qq互联api实现第三方登
- C#数字华容道小游戏
-
C#xm
l入门经典 C#编程人员必备的x - C#简单人事管理系统
- c#winfrom超市管理系统
- c#web应用程序入门经典PDF版
- C#图书管理262234
评论
共有 条评论