CSLA.NET 5.4.2
CSLA .NET is a software development framework that helps you build a reusable, maintainable object-oriented business layer for your app.
AssemblyNameTranslator.cs
Go to the documentation of this file.
1//-----------------------------------------------------------------------
2// <copyright file="AssemblyNameTranslator.cs" company="Marimer LLC">
3// Copyright (c) Marimer LLC. All rights reserved.
4// Website: https://cslanet.com
5// </copyright>
6// <summary>Translates assembly names to and from short</summary>
7//-----------------------------------------------------------------------
8using System;
9
11{
16 public static class AssemblyNameTranslator
17 {
18 private static string _coreLibAssembly = null;
19 private static string CoreLibAssembly
20 {
21 get
22 {
23 if (_coreLibAssembly == null)
24 {
25 _coreLibAssembly = typeof(object).AssemblyQualifiedName;
26 _coreLibAssembly = _coreLibAssembly.Substring(_coreLibAssembly.IndexOf(", ") + 2);
27 }
28 return _coreLibAssembly;
29 }
30 }
31 private static string _cslaLibAssembly = null;
32 private static string CslaLibAssembly
33 {
34 get
35 {
36 if (_cslaLibAssembly == null)
37 {
38 _cslaLibAssembly = typeof(Csla.Serialization.Mobile.NullPlaceholder).AssemblyQualifiedName;
39 _cslaLibAssembly = _cslaLibAssembly.Substring(_cslaLibAssembly.IndexOf(", ") + 2);
40 }
41 return _cslaLibAssembly;
42 }
43 }
44
45 private static readonly string CORELIB = "/n";
46 private static readonly string CSLALIB = "/c";
47
55 public static string GetAssemblyQualifiedName(Type type)
56 {
57 var result = type.AssemblyQualifiedName;
58 result = result.Replace(CoreLibAssembly, CORELIB);
59 result = result.Replace(CslaLibAssembly, CSLALIB);
60 return result;
61 }
62
70 public static string GetAssemblyQualifiedName(string typeName)
71 {
72 var result = typeName;
73 result = result.Replace(CORELIB, CoreLibAssembly);
74 result = result.Replace(CSLALIB, CslaLibAssembly);
75 return result;
76 }
77 }
78}
Placeholder for null child objects.