本文整理汇总了C#中SourceType类的典型用法代码示例。如果您正苦于以下问题:C# SourceType类的具体用法?C# SourceType怎么用?C# SourceType使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
SourceType类属于命名空间,在下文中一共展示了SourceType类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: RecursiveRelationshipsAreMappedCorrectly
public void RecursiveRelationshipsAreMappedCorrectly()
{
var map = new MemberMapper();
var source = new SourceType
{
ID = 10,
Children = new List<SourceType>
{
new SourceType
{
ID = 11,
},
new SourceType
{
ID = 12,
Children = new List<SourceType>
{
new SourceType
{
ID = 13
}
}
}
}
};
var result = map.Map<SourceType, DestinationType>(source);
}
示例2: Get
private FavoriteCollectionResponse Get(float version, int userId, PagerRequest pagerRequest, CoordinateInfo coordinate, FavoriteSortOrder sortOrder, SourceType sourceType)
{
FavoriteCollectionResponse response;
int totalCount;
if (version >= 2.1)
{
var entitys = _favoriteRepository.Get(userId, pagerRequest, out totalCount, sortOrder, sourceType);
var list = MappingManager.FavoriteCollectionResponseMapping(entitys, coordinate);
response = new FavoriteCollectionResponse(pagerRequest, totalCount) { Favorites = list };
}
else
{
var entitys = _favoriteRepository.GetPagedList(userId, pagerRequest, out totalCount, sortOrder, sourceType);
response = MappingManager.FavoriteCollectionResponseMapping(entitys, coordinate);
response.Index = pagerRequest.PageIndex;
response.Size = pagerRequest.PageSize;
response.TotalCount = totalCount;
}
return response;
}
示例3: MappingConditionIsRespected
public void MappingConditionIsRespected()
{
var mapper = new MemberMapper();
mapper.CreateMapProposal<SourceType, DestinationType>()
.ForMember(dest => dest.Name).OnlyIf(src => src.ID == 0)
.FinalizeMap();
var source = new SourceType
{
ID = 10,
Name = "X",
Nested = new NestedSourceType
{
Foo = "Bla"
}
};
var result = mapper.Map<SourceType, DestinationType>(source);
Assert.IsNull(result.Name);
source.ID = 0;
result = mapper.Map<SourceType, DestinationType>(source);
Assert.AreEqual("X", result.Name);
}
示例4: CompatibilitySourceToDispPair
protected internal CompatibilitySourceToDispPair(DisplayType disp, SourceType source,
Func<Mapping, SourceType, bool> linkPredicate,
Func<Mapping> createMappingFunc)
: base(disp, source, linkPredicate, createMappingFunc)
{
_jupiterIn = null;
}
示例5: DtsTask
public DtsTask(SourceType sourceType, string sourceName, TargetType targetType, ITarget target)
{
SourceType = sourceType;
SourceName = sourceName;
TargetType = targetType;
Target = target;
}
示例6: CreateMapping
public override Mapping CreateMapping(SourceType source)
{
// На видеопанеле можно показывать только аппаратные источники
if (!source.IsHardware) return null;
return new Mapping() {Source = source};
}
示例7: ClearMapCacheIsRespected
public void ClearMapCacheIsRespected()
{
var mapper = new MemberMapper();
mapper.CreateMap<SourceType, DestinationType>(customMapping: src => new
{
ID = src.ID * 10,
Name = src.Name + src.Name
});
var source = new SourceType
{
ID = 10,
Name = "x"
};
var result = mapper.Map<DestinationType>(source);
Assert.AreEqual(100, result.ID);
Assert.AreEqual("xx", result.Name);
mapper.ClearMapCache();
result = mapper.Map<DestinationType>(source);
Assert.AreEqual(10, result.ID);
Assert.AreEqual("x", result.Name);
}
示例8: Source
internal Source(string name, SourceType type, string code)
{
_name = name;
_type = type;
_code = code;
_tokens = Lexer.GenerateTokens(code);
}
示例9: LoadDfs2
public void LoadDfs2(string FileName)
{
_st = SourceType.DFS2;
Dfs2File = FileName;
DFSdem = new DFS2(_dfs2File);
}
示例10: LoginCreate
public void LoginCreate(string userName, string password, SourceType UserSourceType, string ExternalID, Converter converter, object dataObject)
{
using (DBAccess dbaccess = new DBAccess())
{
SqlParameter parameter1 = new SqlParameter();
parameter1.ParameterName = "@UserName";
parameter1.Value = userName;
parameter1.SqlDbType = SqlDbType.VarChar;
SqlParameter parameter2 = new SqlParameter();
parameter2.ParameterName = "@UserPassword";
parameter2.Value = password;
parameter2.SqlDbType = SqlDbType.VarChar;
SqlParameter parameter3 = new SqlParameter();
parameter3.ParameterName = "@ExternalID";
parameter3.Value = ExternalID;
parameter3.SqlDbType = SqlDbType.NVarChar;
SqlParameter parameter4 = new SqlParameter();
parameter4.ParameterName = "@SourceID";
parameter4.Value = UserSourceType;
parameter4.SqlDbType = SqlDbType.Int;
SqlParameter[] parameters = new SqlParameter[4] { parameter1, parameter2, parameter3, parameter4 };
SqlDataReader reader = dbaccess.ExecuteProcedure("LoginCreate", this.connectionString, parameters);
while (reader.Read())
{
converter(reader, dataObject);
}
}
}
示例11: CreateMapping
public override Mapping CreateMapping(SourceType source)
{
// На обычном компе нельзя показывать аппаратные источники
if (source.IsHardware) return null;
return new Mapping() { Source = source };
}
示例12: GetFolder
/// <summary>
/// 获取指定文件夹
/// </summary>
/// <param name="sourceId"></param>
/// <param name="sourceType"></param>
/// <returns></returns>
private static string[] GetFolder(int sourceId,
SourceType sourceType)
{
switch (sourceType)
{
case SourceType.BrandLogo:
case SourceType.CustomerPortrait:
case SourceType.CustomerThumbBackground:
case SourceType.StoreLogo:
var useridstr = sourceId.ToString(CultureInfo.InvariantCulture);
var n = String.Empty;
if (useridstr.Length < 6)
{
for (var i = 0; i < (6 - useridstr.Length); i++)
{
n += "0";
}
useridstr = n + useridstr;
}
var folders = new string[2];
folders[0] = useridstr.Substring(0, 3);
folders[1] = useridstr.Substring(3, 3);
return folders;
default:
return new string[0];
}
}
示例13: List
public ActionResult List(PagerRequest request, int? sort, SourceType? sourceType, int? sourceId)
{
int totalCount;
var sortOrder = sort ==null?ResourceSortOrder.CreateDate:(ResourceSortOrder)sort.Value;
List<ResourceEntity> data;
if (sourceType == null)
{
data = _resourceRepository.GetPagedList(request, out totalCount, sortOrder);
}
else
{
data = _resourceRepository.GetPagedList(request, out totalCount, sortOrder, sourceType, sourceId);
}
var vo = MappingManager.ResourceViewMapping(data);
var v = new ResourceCollectionViewModel(request, totalCount) { Resources = vo.ToList() };
var dto = new ListDto
{
ResourceCollectionViewModel = v,
Sort = sort,
SourceId = sourceId,
SourceType = sourceType
};
return View("List", dto);
}
示例14: DeathInfo
public DeathInfo(float LastDamage, WeaponType DamageType, SourceType SourceType, Unit Killer = null)
{
this.DamageType = DamageType;
this.LastDamage = LastDamage;
this.SourceType = SourceType;
this.Killer = Killer;
}
示例15: AttachmentNew
public static Attachment AttachmentNew(int sourceId, SourceType sourceType)
{
var attachment = AttachmentRepository.AttachmentNew(sourceId, sourceType);
attachment.Name = DataHelper.RandomString(50);
return attachment;
}