当前位置: 首页>>代码示例>>C#>>正文


C# SourceType类代码示例

本文整理汇总了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);
        }
开发者ID:JulianR,项目名称:ThisMember,代码行数:30,代码来源:RecursiveMapTests.cs

示例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;
        }
开发者ID:huayumeng,项目名称:ytoo.service,代码行数:25,代码来源:FavoriteDataService.cs

示例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);
        }
开发者ID:JulianR,项目名称:ThisMember,代码行数:28,代码来源:ProposedMapMutationTests.cs

示例4: CompatibilitySourceToDispPair

 protected internal CompatibilitySourceToDispPair(DisplayType disp, SourceType source,
                                                  Func<Mapping, SourceType, bool> linkPredicate,
                                                  Func<Mapping> createMappingFunc)
     : base(disp, source, linkPredicate, createMappingFunc)
 {
     _jupiterIn = null;
 }
开发者ID:AlexSneg,项目名称:VIRD-1.0,代码行数:7,代码来源:CompatibilitySourceToDispPair.cs

示例5: DtsTask

 public DtsTask(SourceType sourceType, string sourceName, TargetType targetType, ITarget target)
 {
     SourceType = sourceType;
     SourceName = sourceName;
     TargetType = targetType;
     Target = target;
 }
开发者ID:suh786,项目名称:dts.server,代码行数:7,代码来源:DtsTask.cs

示例6: CreateMapping

        public override Mapping CreateMapping(SourceType source)
        {
            // На видеопанеле можно показывать только аппаратные источники
            if (!source.IsHardware) return null;

            return new Mapping() {Source = source};
        }
开发者ID:AlexSneg,项目名称:VIRD-1.0,代码行数:7,代码来源:MonitorDisplayConfig.cs

示例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);
        }
开发者ID:JulianR,项目名称:ThisMember,代码行数:28,代码来源:MemberMapperTests.cs

示例8: Source

 internal Source(string name, SourceType type, string code)
 {
     _name = name;
     _type = type;
     _code = code;
     _tokens = Lexer.GenerateTokens(code);
 }
开发者ID:2hp,项目名称:Processus,代码行数:7,代码来源:Source.cs

示例9: LoadDfs2

    public void LoadDfs2(string FileName)
    {
      _st = SourceType.DFS2;
      Dfs2File  = FileName;
      DFSdem = new DFS2(_dfs2File);

    }
开发者ID:XiBeichuan,项目名称:hydronumerics,代码行数:7,代码来源:DEMSourceConfiguration.cs

示例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);
                }

            }
        }
开发者ID:ragsden,项目名称:src,代码行数:35,代码来源:UserResource.cs

示例11: CreateMapping

        public override Mapping CreateMapping(SourceType source)
        {
            // На обычном компе нельзя показывать аппаратные источники
            if (source.IsHardware) return null;

            return new Mapping() { Source = source };
        }
开发者ID:AlexSneg,项目名称:VIRD-1.0,代码行数:7,代码来源:ComputerDisplayConfig.cs

示例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];
            }
        }
开发者ID:huayumeng,项目名称:ytoo.service,代码行数:36,代码来源:ResourceService.cs

示例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);
        }
开发者ID:huayumeng,项目名称:ytoo.service,代码行数:28,代码来源:ResourceController.cs

示例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;
 }
开发者ID:Kinderril,项目名称:p3,代码行数:7,代码来源:DeathInfo.cs

示例15: AttachmentNew

        public static Attachment AttachmentNew(int sourceId, SourceType sourceType)
        {
            var attachment = AttachmentRepository.AttachmentNew(sourceId, sourceType);

            attachment.Name = DataHelper.RandomString(50);

            return attachment;
        }
开发者ID:mattruma,项目名称:epiworx-csla,代码行数:8,代码来源:AttachmentTestHelper.cs


注:本文中的SourceType类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。