摘要: 创建扩展 public static class ContentCreateExtensions { /* Item creation extension methods */ public static T New<T>(this IContentManager manager, string contentType) where T : class, ICo... 阅读全文
posted @ 2012-08-17 13:04 commanderss 阅读(285) 评论(0) 推荐(0) 编辑
摘要: /// 动态创建查询ContentItem public interface IHqlQuery { IContentManager ContentManager { get; } /// <summary> /// Add content type constraints to the query. /// </su... 阅读全文
posted @ 2012-08-17 13:01 commanderss 阅读(460) 评论(0) 推荐(0) 编辑
摘要: public interface IContentQuery { IContentManager ContentManager { get; } IContentQuery<TPart> ForPart<TPart>() where TPart : IContent; } public interface IContentQuery<T... 阅读全文
posted @ 2012-08-17 12:59 commanderss 阅读(296) 评论(0) 推荐(0) 编辑
摘要: 这是Orchard管理Content的接口,定义了下面接口: IEnumerable<ContentTypeDefinition> GetContentTypeDefinitions(); ContentItem New(string contentType); 新建一个未持久化的ContentItem void Create(ContentItem contentI... 阅读全文
posted @ 2012-08-17 12:24 commanderss 阅读(707) 评论(0) 推荐(0) 编辑
摘要: Core modulesCommon此模块定义了3个Part和一个Field,它们是Common Part, Body Part, Identity Part, and Text Field. Common Part: 定义了Content Item创建、发布、修改的时间及所有者IDBody Part: 定义了富文本编辑器,可以通过设置来选择使用哪种编辑器,默认是html编辑器TinymceIdentity Part: 是一个GUID标识,使用这个part是为了使用Import/Export Widget Item,通常在定义Widget时都会加上这个Part.Text Field: 就是一文 阅读全文
posted @ 2012-07-24 14:50 commanderss 阅读(1261) 评论(0) 推荐(0) 编辑
摘要: GC类 它可以通过编程使用一个静态的成员集合与垃圾回收器进行交互。 一般只有使用那托管代码是才需要用到System.GC类 垃圾回收由以下步骤组成: 1. 垃圾回收器搜索托管代码中引用的托管对象。 2. 垃圾回收器尝试完成没有被引用的对象。 3. 垃圾回收器释放没有被引用的对象并回收它们的内存。 Guid类 表示全局唯一标识符 (GUID)。 这个类园子里讨论比较火热。 大家可以看看... 阅读全文
posted @ 2012-05-31 09:01 commanderss 阅读(206) 评论(0) 推荐(0) 编辑
摘要: 系统类 Type类,Object类,String类, Arrary类,Console类, Exception类,GC类, MarshalByRefObject类, Math类。 DateTime结构,Guid 结构, ICloneable接口,IComparable接口,IConvertible接口, IDisposable类, 集合类 ICollection接口,IComparer接口,ID... 阅读全文
posted @ 2012-05-31 08:59 commanderss 阅读(219) 评论(0) 推荐(0) 编辑
摘要: 1.不要使用相对路径 常常会看到: 1require_once('../../lib/some_class.php'); 该方法有很多缺点: 它首先查找指定的php包含路径, 然后查找当前目录. 因此会检查过多路径. 如果该脚本被另一目录的脚本包含, 它的基本目录变成了另一脚本所在的目录. 另一问题, 当定时任务运行该脚本, 它的上级目录可能就不是工作目录了. 因此最佳选择是使用绝对路径: 1de... 阅读全文
posted @ 2012-04-10 10:15 commanderss 阅读(200) 评论(0) 推荐(0) 编辑
摘要: What's new? Orchard1.4 修正了一些bugs,提升了性能并增加了下面特性: Autoroute: Set-up token-based patterns for your URLs. Projector: 创建随意的网站内容查询,在projection pages和widgets上显示结果。 Fields: Orchard自带了一些新field类型:Boolean,Date/... 阅读全文
posted @ 2012-03-27 15:42 commanderss 阅读(420) 评论(0) 推荐(0) 编辑
摘要: Introduction做为可组装的CMS,Orchard能在运行时装载一组随意的模块.Orchard像任何ASP.NET MVC程序一样,支持使用VS将模块编译成程序集,Orchard也提供一个定制模块装载策略,例如:允许装载关于模块的程序集(不用部署到bin文件夹).除此之外,Orchard支持仅部署源代码的模块的动态编译,这比部署二进制文件更具灵活性,使一些有趣的场景,如”in place"不用使用VS进行代码定制,这有点像ASP.NET App_Code目录,除了Orchard独立地支持多”logical folder”(通常每个模块一个).High Level Overvi 阅读全文
posted @ 2012-03-26 11:20 commanderss 阅读(655) 评论(1) 推荐(2) 编辑