本文整理汇总了C#中IClassMap.GetFullName方法的典型用法代码示例。如果您正苦于以下问题:C# IClassMap.GetFullName方法的具体用法?C# IClassMap.GetFullName怎么用?C# IClassMap.GetFullName使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IClassMap
的用法示例。
在下文中一共展示了IClassMap.GetFullName方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GetTypeFromClassMap
public virtual Type GetTypeFromClassMap(IClassMap classMap)
{
Type type;
type = Type.GetType(classMap.GetFullName() + ", " + classMap.GetAssemblyName());
if (type == null)
{
foreach (Assembly asm in m_LoadedAssemblies.Values)
{
type = asm.GetType(classMap.GetFullName());
if (type != null)
{
break;
}
}
}
return type;
}
示例2: LoadObjectsPerObject
protected virtual void LoadObjectsPerObject(Type type, RefreshBehaviorType refreshBehavior, IList listToFill, IClassMap classMap)
{
string directory = GetDirectoryForClass(classMap);
string className = classMap.GetFullName().ToLower();
foreach (string fileName in Directory.GetFiles(directory))
{
FileInfo file = new FileInfo(fileName);
if (file.Extension.ToLower() == ".xml")
{
if (file.Name.Length > className.Length)
{
if (file.Name.Substring(0, className.Length).ToLower() == className)
{
string xml = LoadFile(type, fileName);
if (xml != "")
DeserializeObject(type, listToFill, classMap, xml);
}
}
}
}
}
示例3: GetFileNamePerObject
protected virtual string GetFileNamePerObject(object obj, IClassMap classMap)
{
IObjectManager om = this.Context.ObjectManager;
string directory = GetDirectoryForClass(classMap);
string fileName = directory + @"\" + classMap.GetFullName() + "." + om.GetObjectIdentity(obj) + ".xml";
return fileName;
}
示例4: GetDirectoryForDomain
protected virtual string GetDirectoryForDomain(IClassMap classMap)
{
ISourceMap sourceMap = classMap.GetDocSourceMap();
if (sourceMap == null)
throw new MappingException("Can't find Document Source Map for '" + classMap.GetFullName() + "' in the npersist xml mapping file!"); // do not localize
string directory = sourceMap.DocPath;
if (!(Directory.Exists(directory)))
throw new NPersistException("Can't find directory: " + directory); // do not localize
return directory;
}
示例5: GetDirectoryForClass
protected virtual string GetDirectoryForClass(IClassMap classMap)
{
ISourceMap sourceMap = classMap.GetDocSourceMap();
if (sourceMap == null)
throw new MappingException("Can't find Document Source Map for '" + classMap.GetFullName() + "' in the npersist xml mapping file!"); // do not localize
string directory = sourceMap.DocPath;
if (!(Directory.Exists(directory)))
throw new NPersistException("Can't find directory: " + directory); // do not localize
directory += @"\" + classMap.GetFullName();
if (!(Directory.Exists(directory)))
{
try
{
Directory.CreateDirectory(directory);
}
catch (Exception ex)
{
throw new NPersistException("Could not create directory '" + directory + "': " + ex.Message, ex); // do not localize
}
}
return directory;
}
示例6: SerializeObject
protected virtual void SerializeObject(XmlNode xmlObject, object obj, IClassMap classMap, bool creating, bool specifyClass)
{
if (specifyClass)
SetAttributeValue(xmlObject, "class", classMap.GetFullName() );
foreach (IPropertyMap propertyMap in classMap.GetAllPropertyMaps())
{
if (propertyMap.ReferenceType == ReferenceType.None)
{
if (propertyMap.IsCollection)
{
;
}
else
{
SerializeInlineProperty(xmlObject, obj, classMap, propertyMap, creating);
}
}
else
{
//if (propertyMap.DocPropertyMapMode == DocPropertyMapMode.Default || propertyMap.DocPropertyMapMode == DocPropertyMapMode.Inline)
if (propertyMap.DocPropertyMapMode == DocPropertyMapMode.Inline)
{
if (propertyMap.IsCollection)
{
SerializeInlineObjectList(xmlObject, obj, classMap, propertyMap, creating);
}
else
{
SerializeInlineObject(xmlObject, obj, classMap, propertyMap, creating);
}
}
else
{
if (propertyMap.IsCollection)
{
SerializeInlineReferenceList(xmlObject, obj, classMap, propertyMap, creating);
}
else
{
SerializeInlineReference(xmlObject, obj, classMap, propertyMap, creating);
}
}
}
}
}