本文整理汇总了C#中IClassDef类的典型用法代码示例。如果您正苦于以下问题:C# IClassDef类的具体用法?C# IClassDef怎么用?C# IClassDef使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
IClassDef类属于命名空间,在下文中一共展示了IClassDef类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: InitialiseGrid
/// <summary>
/// Initialises the grid with a specified alternate UI definition for the class,
/// as provided in the ClassDef
/// </summary>
/// <param name="classDef">The Classdef used to initialise the grid</param>
/// <param name="uiDefName">The name of the UI definition</param>
public void InitialiseGrid(IClassDef classDef, string uiDefName)
{
if (classDef == null) throw new ArgumentNullException("classDef");
if (uiDefName == null) throw new ArgumentNullException("uiDefName");
IUIGrid gridDef = GetGridDef((ClassDef) classDef, uiDefName);
InitialiseGrid(classDef, gridDef, uiDefName);
}
开发者ID:Chillisoft,项目名称:habanero.faces,代码行数:13,代码来源:GridInitialiser.cs
示例2: createSuperClassDMXml
private static void createSuperClassDMXml(XmlElement classDMElement, IClassDef DMClass)
{
ISuperClassDef superClassDef = DMClass.SuperClassDef;
if (superClassDef == null) return;
//if (!inheritanceRelationship.HasSuperClass) return;
IClassDef superClassClassDef = superClassDef.SuperClassClassDef;
if (superClassClassDef == null) return;
XmlElement SuperClassDMElement = XmlUtilities.createXmlElement(classDMElement, "superClass");
XmlUtilities.setXmlAttribute(SuperClassDMElement, "class", superClassClassDef.ClassName);
XmlUtilities.setXmlAttribute(SuperClassDMElement, "assembly", superClassClassDef.AssemblyName);
XmlUtilities.setXmlAttribute(SuperClassDMElement, "orMapping", superClassDef.ORMapping,
ORMapping.ClassTableInheritance);
switch (superClassDef.ORMapping)
{
case ORMapping.ClassTableInheritance:
XmlUtilities.setXmlAttribute(SuperClassDMElement, "discriminator", superClassDef.Discriminator, "");
XmlUtilities.setXmlAttribute(SuperClassDMElement, "id", superClassDef.ID, "");
break;
case ORMapping.SingleTableInheritance:
XmlUtilities.setXmlAttribute(SuperClassDMElement, "discriminator", superClassDef.Discriminator, "");
break;
case ORMapping.ConcreteTableInheritance:
break;
default:
throw new ArgumentOutOfRangeException();
}
}
开发者ID:Chillisoft,项目名称:habanero.smooth,代码行数:27,代码来源:ClassDefXmlWriter.cs
示例3: GetGridColumnStub
private IUIGridColumn GetGridColumnStub(IClassDef classDef)
{
IUIGridColumn gridColumn = MockRepository.GenerateStub<IUIGridColumn>();
gridColumn.PropertyName = RandomValueGen.GetRandomString();
gridColumn.Stub(column => column.ClassDef).Return(classDef);
return gridColumn;
}
开发者ID:Chillisoft,项目名称:habanero.binding,代码行数:7,代码来源:TestPropertyDescriptorRelatedPropDef.cs
示例4: GetPropDefByPropName
/// <summary>
/// Finds the property definition with the given name for the specified
/// class definition. This method will search through an inheritance
/// structure or relationship if needed.
/// </summary>
/// <param name="classDef">The class definition containing either the property
/// or containing inheritance or relationship structures that might hold
/// the property</param>
/// <param name="propertyName">The name of the property. A related property can
/// be described by "RelationshipName.PropertyName".</param>
/// <returns></returns>
public static IPropDef GetPropDefByPropName(IClassDef classDef, string propertyName)
{
if (classDef == null || IsReflectiveProperty(propertyName))
{
return null;
}
/* if (IsRelatedProperty(propertyName))
{
string relationshipName = propertyName.Substring(0, propertyName.IndexOf("."));
propertyName = propertyName.Remove(0, propertyName.IndexOf(".") + 1);
List<string> relNames = new List<string>();
relNames.AddRange(relationshipName.Split(new[]{"|"}, StringSplitOptions.RemoveEmptyEntries));
IRelationshipDefCol relationshipDefCol = classDef.RelationshipDefCol;
IPropDef propDef = null;
foreach (string relName in relNames)
{
if (relationshipDefCol.Contains(relName))
{
IRelationshipDef relationshipDef = relationshipDefCol[relName];
IClassDef relatedClassDef = relationshipDef.RelatedObjectClassDef;
propDef = GetPropDefByPropName(relatedClassDef, propertyName);
}
if (propDef != null)
{
return propDef;
}
}
return null;
}*/
return classDef.GetPropDef(propertyName, false);
}
开发者ID:kevinbosman,项目名称:habanero,代码行数:42,代码来源:ClassDefHelper.cs
示例5: CreateEditorControl
protected override IBOPanelEditorControl CreateEditorControl(IClassDef classDef)
{
if (classDef.ClassName == "OrganisationTestBO")
{
return new BOEditorControlVWG<OrganisationTestBO>();
}
return new BOEditorControlVWG<ContactPersonTestBO>();
}
开发者ID:Chillisoft,项目名称:habanero.faces,代码行数:8,代码来源:TestBOEditorControlVWG.cs
示例6:
protected override IBOPanelEditorControl CreateEditorControl
(IControlFactory controlFactory, IClassDef classDef, string uiDefName)
{
if (classDef.ClassName == "OrganisationTestBO")
{
return new BOEditorControlVWG<OrganisationTestBO>(controlFactory, uiDefName);
}
return new BOEditorControlVWG<ContactPersonTestBO>(controlFactory, uiDefName);
}
开发者ID:Chillisoft,项目名称:habanero.faces,代码行数:9,代码来源:TestBOEditorControlVWG.cs
示例7: BOEditorControlWin
///<summary>
/// The Constructor for the <see cref="BOEditorControlWin"/> which passes in the
/// <paramref name="classDef"/> for the <see cref="IBusinessObject"/> and the <paramref name="uiDefName"/> that
/// is used to defined the User Interface for the <see cref="IBusinessObject"/>
///</summary>
///<param name="controlFactory">The control factory which is used to create the Controls on this form.</param>
///<param name="classDef">The <see cref="IClassDef"/> for the <see cref="IBusinessObject"/> that will be edited by this control</param>
///<param name="uiDefName">The user interface defined in the <see cref="IClassDef"/> that will be used to Build this control</param>
public BOEditorControlWin(IControlFactory controlFactory, IClassDef classDef, string uiDefName)
{
if (controlFactory == null) throw new ArgumentNullException("controlFactory");
if (classDef == null) throw new ArgumentNullException("classDef");
if (uiDefName == null) throw new ArgumentNullException("uiDefName");
_panelInfo = BOEditorControlUtils.CreatePanelInfo(controlFactory, classDef, uiDefName, this);
SetEnableState();
}
开发者ID:Chillisoft,项目名称:habanero.faces,代码行数:17,代码来源:BOEditorControlWin.cs
示例8: CreateUIFilter
public IFilterDef CreateUIFilter(IClassDef classDef)
{
if (classDef==null) throw new ArgumentNullException("classDef");
var filterPropertyDefs = new List<IFilterPropertyDef>();
foreach (var propDef in classDef.PropDefcol)
{
if (propDef.IsPartOfObjectIdentity()) continue;
if (propDef.IsPropForeignKey()) continue;
filterPropertyDefs.Add(CreateUIFilterProperty(propDef));
}
IFilterDef filterDef = _factory.CreateFilterDef(filterPropertyDefs);
return filterDef;
}
开发者ID:Chillisoft,项目名称:habanero.smooth,代码行数:13,代码来源:UIFilterCreator.cs
示例9: AddAllPropsToQuery
private static void AddAllPropsToQuery(IClassDef classDef, SelectQuery selectQuery)
{
foreach (IPropDef propDef in classDef.PropDefColIncludingInheritance.ToList())
{
if (propDef.Persistable)
{
IClassDef fieldClassDef = classDef;
if (!((ClassDef)classDef).IsUsingConcreteTableInheritance())
fieldClassDef = propDef.ClassDef;
QueryField queryField = CreateQueryField(fieldClassDef, propDef);
selectQuery.Fields.Add(propDef.PropertyName, queryField);
}
}
}
开发者ID:Celtic691,项目名称:habanero,代码行数:14,代码来源:QueryBuilder.cs
示例10: GetDefaultUIDef
public IUIDef GetDefaultUIDef(IClassDef classDef)
{
if (classDef == null) throw new ArgumentNullException("classDef");
if (classDef.UIDefCol.Contains("default"))
{
return classDef.UIDefCol["default"];
}
IUIForm uiForm = CreateUIForm(classDef);
var uiGrid = CreateUIGrid(classDef);
var uiDef = _factory.CreateUIDef("default", uiForm, uiGrid);
uiDef.ClassDef = classDef;
return uiDef;
}
开发者ID:Chillisoft,项目名称:habanero.smooth,代码行数:14,代码来源:UIViewCreator.cs
示例11: GetPropsToInclude
/// <summary>
/// Builds a collection of properties to include in the insertion,
/// depending on the inheritance type.
/// </summary>
protected virtual IBOPropCol GetPropsToInclude(IClassDef currentClassDef)
{
IBOPropCol propsToIncludeTemp = currentClassDef.PropDefcol.CreateBOPropertyCol(true);
IBOPropCol propsToInclude = new BOPropCol();
AddPersistableProps(propsToInclude, propsToIncludeTemp);
while (((ClassDef)currentClassDef).IsUsingSingleTableInheritance() ||
((ClassDef)currentClassDef).IsUsingConcreteTableInheritance())
{
var boPropertyCol = currentClassDef.SuperClassClassDef.PropDefcol.CreateBOPropertyCol(true);
AddPersistableProps(propsToInclude, boPropertyCol);
currentClassDef = currentClassDef.SuperClassClassDef;
}
return propsToInclude;
}
开发者ID:kevinbosman,项目名称:habanero,代码行数:22,代码来源:ModifyStatementGenerator.cs
示例12: CreateUIGrid
public IUIGrid CreateUIGrid(IClassDef classDef)
{
IUIGrid uiGrid = _factory.CreateUIGridDef();
//The Properties are loaded in the ordinal position order
// that they occur in the XML ClassDef so this will be the
// correct order they should be shown in the UI.
foreach (var propDef in classDef.PropDefcol)
{
if (propDef.IsPartOfObjectIdentity()) continue;
if (propDef.IsPropForeignKey()) continue;
uiGrid.Add(GetUIGridColumn(propDef));
}
var uiFilterCreator = new UIFilterCreator(_factory);
uiGrid.FilterDef = uiFilterCreator.CreateUIFilter(classDef);
return uiGrid;
}
开发者ID:Chillisoft,项目名称:habanero.smooth,代码行数:18,代码来源:UIGridCreator.cs
示例13: LoadClassDef
public static IClassDef LoadClassDef()
{
XmlClassLoader itsLoader = new XmlClassLoader(new DtdLoader(), new DefClassFactory());
_newClassDef = itsLoader.LoadClass(@"
<class name=""MultiPropBO"" assembly=""Habanero.Test"">
<property name=""MultiPropBOID"" type=""Guid"" />
<property name=""DateTimeProp"" type=""DateTime"" />
<property name=""StringProp"" />
<property name=""IntProp"" type=""int"" />
<property name=""GuidProp"" type=""Guid"" />
<property name=""DoubleProp"" type=""double"" />
<property name=""SingleProp"" type=""Single"" />
<property name=""TimeSpanProp"" type=""TimeSpan"" />
<primaryKey>
<prop name=""MultiPropBOID"" />
</primaryKey>
</class>
");
ClassDef.ClassDefs.Add(_newClassDef);
return _newClassDef;
}
开发者ID:kevinbosman,项目名称:habanero,代码行数:21,代码来源:MultiPropBO.cs
示例14: CreateUIForm
public IUIForm CreateUIForm(IClassDef classDef)
{
var uiForm = _factory.CreateUIFormDef();
uiForm.Title = classDef.DisplayName + " Form";
var uiFormTab = _factory.CreateUIFormTab();
uiFormTab.Name = "default";
var uiFormColumn = _factory.CreateUIFormColumn();
//The Properties are loaded in the ordinal position order
// that they occur in the XML ClassDef so this will be the
// correct order they should be shown in the UI.
foreach (var propDef in classDef.PropDefcol)
{
if (propDef.IsPartOfObjectIdentity()) continue;
if (propDef.IsPropForeignKey()) continue;
uiFormColumn.Add(GetUIFormField(propDef));
}
uiFormTab.Add(uiFormColumn);
uiForm.Add(uiFormTab);
return uiForm;
}
开发者ID:Chillisoft,项目名称:habanero.smooth,代码行数:22,代码来源:UIFormCreator.cs
示例15: CreateXml
public static void CreateXml(IClassDef classDef, XmlElement parentElement)
{
XmlElement classDMElement = XmlUtilities.createXmlElement(parentElement, "class");
XmlUtilities.setXmlAttribute(classDMElement, "name", classDef.ClassName);
XmlUtilities.setXmlAttribute(classDMElement, "assembly", classDef.AssemblyName);
XmlUtilities.setXmlAttribute(classDMElement, "table", classDef.TableName, classDef.ClassName);
XmlUtilities.setXmlAttribute(classDMElement, "displayName", classDef.DisplayName); //, DMClass.GetDisplayNameFromClassName(classDef.ClassName));
createSuperClassDMXml(classDMElement, classDef);
foreach (IPropDef propDef in classDef.PropDefcol)
{
createPropertyDMXml(classDMElement, propDef);
}
createKeyDMXml(classDMElement, classDef);
createPrimaryKeyXml(classDMElement, classDef);
foreach (IRelationshipDef relationshipDef in classDef.RelationshipDefCol)
{
createRelationshipXml(classDMElement, relationshipDef);
}
}
开发者ID:Chillisoft,项目名称:habanero.smooth,代码行数:24,代码来源:ClassDefXmlWriter.cs
示例16: CreateSelectQuery
/// <summary>
/// Creates a SelectQuery using the given classdef with the given Criteria. All information in the ClassDef will be taken into account
/// (such as inheritance structures).
/// </summary>
/// <param name="classDef">The <see cref="ClassDef" /> to create the SelectQuery for.</param>
/// <param name="criteria">The criteria to be set on the SelectQuery</param>
/// <returns>A SelectQuery that can be used to load objects of the type the given ClassDef represents</returns>
public static ISelectQuery CreateSelectQuery(IClassDef classDef, Criteria criteria)
{
if (classDef == null) throw new ArgumentNullException("classDef");
SelectQuery selectQuery = new SelectQuery();
AddAllPropsToQuery(classDef, selectQuery);
//Add discriminator Criteria for Inheritance (e.g. single table Inheritance).
Criteria discriminatorCriteria = null;
AddDiscriminatorFields(selectQuery, classDef, ref discriminatorCriteria);
selectQuery.DiscriminatorCriteria = discriminatorCriteria;
Source source = null;
PrepareSource(classDef, ref source);
selectQuery.Source = source;
//foreach (var queryField in selectQuery.Fields)
//{
// //if (queryField.Value.Source.Name == classDef.ClassName)
// queryField.Value.Source = source;
//}
PrepareCriteria(classDef, criteria);
PrepareDiscriminatorCriteria(classDef, discriminatorCriteria);
selectQuery.Criteria = criteria;
selectQuery.ClassDef = classDef;
return selectQuery;
}
开发者ID:Celtic691,项目名称:habanero,代码行数:31,代码来源:QueryBuilder.cs
示例17: GetPropDef
private static IPropDef GetPropDef(IClassDef classDef, IUIGridColumn gridColumn)
{
/* IPropDef propDef = null;
if (classDef.PropDefColIncludingInheritance.Contains(gridColumn.PropertyName))
{
propDef = classDef.PropDefColIncludingInheritance[gridColumn.PropertyName];
}*/
return classDef.GetPropDef(gridColumn.PropertyName, false);
}
开发者ID:Chillisoft,项目名称:habanero.faces,代码行数:10,代码来源:TestGridInitialiser.cs
示例18: GetPropsToInclude
/// <summary>
/// Builds a collection of properties to include in the insertion,
/// depending on the inheritance type.
/// </summary>
protected override IBOPropCol GetPropsToInclude(IClassDef currentClassDef)
{
var propsToInclude = base.GetPropsToInclude(currentClassDef);
if (currentClassDef.IsUsingClassTableInheritance())
{
AddParentID(propsToInclude);
}
return propsToInclude;
}
开发者ID:kevinbosman,项目名称:habanero,代码行数:14,代码来源:InsertStatementGenerator.cs
示例19: SetClassDef
public void SetClassDef(IClassDef classDef)
{
_classDef = classDef;
}
开发者ID:Chillisoft,项目名称:habanero.faces,代码行数:4,代码来源:TestPanelBuilder.cs
示例20: GetBusinessObjectForProp
internal IBusinessObject GetBusinessObjectForProp(IClassDef classDef)
{
var businessObject = ((PropDef) this.PropDef).GetlookupBusinessObjectFromObjectManager(this.Value);
if (businessObject != null) return businessObject;
try
{
businessObject = BORegistry.DataAccessor.BusinessObjectLoader.GetBusinessObjectByValue
(classDef, this.Value);
}
catch (BusObjDeleteConcurrencyControlException ex)
{
_logger.Log(ex);
return null;
}
return businessObject;
}
开发者ID:kevinbosman,项目名称:habanero,代码行数:16,代码来源:BOPropLookupList.cs
注:本文中的IClassDef类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论