本文整理汇总了C#中TemplateType类的典型用法代码示例。如果您正苦于以下问题:C# TemplateType类的具体用法?C# TemplateType怎么用?C# TemplateType使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
TemplateType类属于命名空间,在下文中一共展示了TemplateType类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GetTemplatesForAnyOrganization
public static IList<DocTemplate> GetTemplatesForAnyOrganization(IUnitOfWork uow, TemplateType type)
{
return uow.Session.QueryOver<DocTemplate> ()
.Where(x => x.TemplateType == type)
.Where(x => x.Organization == null)
.List<DocTemplate> ();
}
示例2: GetTemplatesOnlyForOrganization
public static IList<DocTemplate> GetTemplatesOnlyForOrganization(IUnitOfWork uow, TemplateType type, Organization org)
{
return uow.Session.QueryOver<DocTemplate> ()
.Where(x => x.TemplateType == type)
.Where(x => x.Organization == org)
.List<DocTemplate> ();
}
示例3: BuildEmail
private async Task<Email> BuildEmail(IUserDto user, TemplateType templateType, string token)
{
var email = new Email { Subject = String.Empty };
var bodyBuilder = new StringBuilder(200);
using (StreamReader reader = _templateProvider.GetTemplate(templateType))
{
string line = await reader.ReadLineAsync();
for (int i = 0; line != null; i++)
{
if (i == 0)
{
email.Subject = ReplaceMetaTagsWithUserData(line, user, token);
}
else
{
bodyBuilder.AppendLine(ReplaceMetaTagsWithUserData(line, user, token));
}
line = await reader.ReadLineAsync();
}
}
email.Body = bodyBuilder.ToString();
return email;
}
示例4: TemplatePage
protected TemplatePage()
: base()
{
templateClasses = TemplateClasses.U;
templateType = TemplateType.U;
templateGuid = "";
}
示例5: UninstallAction
/// <summary>
/// Constructor to handle the creation of an uninstall action with all information passed in.
/// </summary>
/// <param name="os"></param>
/// <param name="template"></param>
/// <param name="arch"></param>
/// <param name="productcode"></param>
/// <param name="wixobj"></param>
public UninstallAction(ICollection<OperatingSystemConfiguration> os, TemplateType template, ICollection<ArchitectureConfiguration> arch, string productcode, WixObjectType wixobj)
{
Template = template;
Architectures = arch;
ProductCode = productcode;
WixObject = wixobj;
OS = os;
}
示例6: FindDefaultTemplate
public static ICodeTemplate FindDefaultTemplate(TemplateType templateType, Session session, Type codeTemplateType, CodeDomProvider codeDomProvider){
const ICodeTemplate template = null;
var binaryOperator = new BinaryOperator(template.GetPropertyName(x => x.TemplateType),templateType);
var isDefault = new BinaryOperator(template.GetPropertyName(x => x.IsDefault),true);
var provider = new BinaryOperator(template.GetPropertyName(x => x.CodeDomProvider),codeDomProvider);
return session.FindObject(PersistentCriteriaEvaluationBehavior.InTransaction,
codeTemplateType, new GroupOperator(binaryOperator, isDefault,provider))
as ICodeTemplate;
}
示例7: CreateClassInfo
public IPersistentClassInfo CreateClassInfo(string name, TemplateType templateType = TemplateType.Class) {
var persistentClassInfo = _objectSpace.CreateWCObject<IPersistentClassInfo>();
_persistentAssemblyInfo.PersistentClassInfos.Add(persistentClassInfo);
persistentClassInfo.SetDefaultTemplate(templateType);
persistentClassInfo.Name = GetTableName(name);
persistentClassInfo.PersistentAssemblyInfo = _persistentAssemblyInfo;
persistentClassInfo.BaseType = typeof(XPLiteObject);
return persistentClassInfo;
}
示例8: GridViewAuditActionTemplate
internal GridViewAuditActionTemplate(
TemplateType type,
string columnName,
string headerText)
{
_columnName = columnName;
_headerText = headerText;
_type = type;
}
示例9: TemplateKey
/// <summary> Constructor (called by derived classes only) </summary>
protected TemplateKey(TemplateType templateType, object dataType)
{
Exception ex = ValidateDataType(dataType, "dataType");
if (ex != null)
throw ex;
_dataType = dataType;
_templateType = templateType;
}
示例10: GetTemplate
/// <summary>
/// Получаем первый подходящий шаболон документа по указанным критериям.
/// </summary>
public static DocTemplate GetTemplate(IUnitOfWork uow, TemplateType type, Organization org)
{
var forOrg = GetTemplatesOnlyForOrganization(uow, type, org);
if (forOrg.Count > 0)
return forOrg.First();
var any = GetTemplatesForAnyOrganization(uow, type);
return any.FirstOrDefault();
}
示例11: SetDefaultTemplate
public static void SetDefaultTemplate(this IPersistentMemberInfo persistentMemberInfo, TemplateType templateType)
{
persistentMemberInfo.CodeTemplateInfo =
(ICodeTemplateInfo)Activator.CreateInstance(TypesInfo.Instance.CodeTemplateInfoType, persistentMemberInfo.Session);
ICodeTemplate defaultTemplate = CodeTemplateBuilder.CreateDefaultTemplate(templateType, persistentMemberInfo.Session,
TypesInfo.Instance.CodeTemplateType,
persistentMemberInfo.Owner.PersistentAssemblyInfo.CodeDomProvider);
persistentMemberInfo.CodeTemplateInfo.CodeTemplate = defaultTemplate;
}
示例12: CreateMembersCore
IEnumerable<MemberGeneratorInfo> CreateMembersCore(IEnumerable<DBColumn> dbColumns, IPersistentClassInfo persistentClassInfo = null, TemplateType coreTemplateType = TemplateType.XPReadWritePropertyMember, TemplateType refTemplateType = TemplateType.XPReadWritePropertyMember) {
return dbColumns.SelectMany(dbColumn => {
var memberGeneratorInfos = new List<MemberGeneratorInfo>();
if (IsOneToOneOnTheKey(dbColumn) && coreTemplateType != TemplateType.ReadWriteMember) {
memberGeneratorInfos.Add(CreateFkMember(dbColumn, persistentClassInfo, coreTemplateType, TemplateType.XPOneToOneReadOnlyPropertyMember));
}
memberGeneratorInfos.Add(CreateMember(dbColumn, persistentClassInfo, coreTemplateType, refTemplateType));
return memberGeneratorInfos;
}).Where(info => info.PersistentMemberInfo != null);
}
示例13: SetDefaultTemplate
public static void SetDefaultTemplate(this IPersistentTemplatedTypeInfo persistentMemberInfo, TemplateType templateType) {
var objectSpace = ObjectSpace.FindObjectSpaceByObject(persistentMemberInfo);
persistentMemberInfo.CodeTemplateInfo = objectSpace.CreateWCObject<ICodeTemplateInfo>();
ICodeTemplate defaultTemplate = CodeTemplateBuilder.CreateDefaultTemplate(templateType, persistentMemberInfo.Session,
WCTypesInfo.Instance.FindBussinessObjectType<ICodeTemplate>(),
GetProvider(persistentMemberInfo));
persistentMemberInfo.CodeTemplateInfo.CodeTemplate = defaultTemplate;
persistentMemberInfo.CodeTemplateInfo.CloneProperties();
}
示例14: SetDefaultTemplate
public static void SetDefaultTemplate(this IPersistentTemplatedTypeInfo persistentMemberInfo, TemplateType templateType) {
var objectType = WCTypesInfo.Instance.FindBussinessObjectType<ICodeTemplateInfo>();
persistentMemberInfo.CodeTemplateInfo = (ICodeTemplateInfo)objectType.CreateInstance(new object[] { persistentMemberInfo.Session });
var defaultTemplate = CodeTemplateBuilder.CreateDefaultTemplate(templateType, persistentMemberInfo.Session,
WCTypesInfo.Instance.FindBussinessObjectType<ICodeTemplate>(),
GetProvider(persistentMemberInfo));
persistentMemberInfo.CodeTemplateInfo.CodeTemplate = defaultTemplate;
persistentMemberInfo.CodeTemplateInfo.CloneProperties();
}
示例15: Init
public void Init(string columnName, TemplateType ttype, string guideColumns, QuestColumnType columnType)
{
strQuestColumnName = columnName;
nQuestColumnValue = 0;
type = ttype;
strGuideColumnNames = guideColumns;
strGuideColumnValues = string.Empty;
emQuestColumnType = columnType;
}