• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C# Destination类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中Destination的典型用法代码示例。如果您正苦于以下问题:C# Destination类的具体用法?C# Destination怎么用?C# Destination使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



Destination类属于命名空间,在下文中一共展示了Destination类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: GetChildren

        public List<Destination> GetChildren(string atlasId)
        {
            var childList = new List<Destination>();
            _stream.Seek(0,0);
            var element = XElement.Load(_stream);
            var targetElement = element.Descendants("node").FirstOrDefault(n => n.Attribute("atlas_node_id") != null && n.Attribute("atlas_node_id").Value == atlasId);
            if (targetElement != null)
            {
                var childNodeTags = targetElement.Elements("node");
                foreach (var childNodeTag in childNodeTags)
                {
                    var desination = new Destination();

                    var atlasIdAttribute = childNodeTag.Attribute("atlas_node_id");
                    if (atlasIdAttribute != null)
                    {
                        desination.AtlasId = atlasIdAttribute.Value;
                    }

                    var nameElement = childNodeTag.Element("node_name");
                    if(nameElement != null)
                    {
                        desination.Title = nameElement.Value;
                    }

                    childList.Add(desination);
                }
            }
            return childList;
        }
开发者ID:holmesjr,项目名称:LPXMLParser,代码行数:30,代码来源:TaxonomyParser.cs


示例2: AnnualPolicy

 public AnnualPolicy(Age age, Sex gender, Destination destination, Tax tax)
 {
     this.age = age;
     this.gender = gender;
     this.destination = destination;
     this.tax = tax;
 }
开发者ID:mwinder,项目名称:kata-insurance-november2013,代码行数:7,代码来源:AnnualPolicy.cs


示例3: ShouldBeAbleToMapNullableNullToItsNotNullable

 public void ShouldBeAbleToMapNullableNullToItsNotNullable()
 {
     Mapper.CreateMap<Destination, Source>();
     var source = new Destination();
     Source destination = Mapper.Map<Destination, Source>(source);
     Assert.Equal(0, destination.Property);
 }
开发者ID:erkanmaras,项目名称:OoMapper,代码行数:7,代码来源:NullableConversionsFacts.cs


示例4: Write_navigation_for_a_destination

        public void Write_navigation_for_a_destination()
        {
            const string parentAtlasId = "3";
            const string parentTitle = "ParentDestination";
            const string childAtlasId1 = "4";
            const string childTitle1 = "ChildDestination1";
            const string childAtlasId2 = "5";
            const string childTitle2 = "ChildDestination2";

            var destination = new Destination
            {
                AssetId = "1",
                AtlasId = "2",
                Title = "title",
                TitleAscii = "title2",
                IntroductionOverview = "Intro"
            };

            var taxonomyParser = Substitute.For<ITaxonomyParser>();
            taxonomyParser.GetParent(destination.AtlasId).Returns(new Destination { AtlasId = parentAtlasId, Title = parentTitle});
            taxonomyParser.GetChildren(destination.AtlasId).Returns(new List<Destination> { new Destination { AtlasId = childAtlasId1, Title = childTitle1 }, new Destination { AtlasId = childAtlasId2, Title = childTitle2 } });

            var templateLoader = Substitute.For<ITemplateLoader>();

            var writer = new HTMLFileWriter(templateLoader, taxonomyParser);
            var navHTML = writer.GetNavigation(destination.AtlasId);

            Assert.That(navHTML, Is
                .StringContaining(@"<ul><li><a href=""./" + parentAtlasId + @".html"">" + parentTitle + "</a></li></ul>")
                .And.ContainsSubstring(@"<ul><li><a href=""./" + childAtlasId1 + @".html"">" + childTitle1 + @"</a></li><li><a href=""./" + childAtlasId2 + @".html"">" + childTitle2 + "</a></li></ul>"));
        }
开发者ID:holmesjr,项目名称:LPXMLParser,代码行数:31,代码来源:HTMLFileWriterTests.cs


示例5: Because_of

 protected override void Because_of()
 {
     var source = new Source
     {
     };
     _destination = Mapper.Map<Source, Destination>(source);
 }
开发者ID:284247028,项目名称:AutoMapper,代码行数:7,代码来源:NullableIntToNullableDecimal.cs


示例6: Populate_a_template_file_with_info_from_a_destination

        public void Populate_a_template_file_with_info_from_a_destination()
        {
            var destination = new Destination
            {
                AssetId = "1",
                AtlasId = "2",
                Title = "title",
                TitleAscii = "title2",
                IntroductionOverview = "Intro"
            };

            var template = File.ReadAllText("Resources/template_file.txt");
            var templateLoader = Substitute.For<ITemplateLoader>();
            templateLoader.Template.Returns(template);

            var taxonomyParser = Substitute.For<ITaxonomyParser>();
            taxonomyParser.GetParent(Arg.Any<string>()).Returns(new Destination());
            taxonomyParser.GetChildren(Arg.Any<string>()).Returns(new List<Destination>());

            var writer = new HTMLFileWriter(templateLoader, taxonomyParser);
            var output = writer.Generate(destination);

            Assert.That(output, Is
                .StringContaining("<h1>Lonely Planet: title</h1>")
                .And.ContainsSubstring(@"<div class=""inner"">Intro</div>")
                .And.Not.ContainsSubstring("{NAVIGATION}"));
            var assert = templateLoader.Received().Template;
        }
开发者ID:holmesjr,项目名称:LPXMLParser,代码行数:28,代码来源:HTMLFileWriterTests.cs


示例7: LocationURL

        private static string LocationURL(Destination which)
        {
            if (formatLocationURL == null)
            {
                // look for "OverrideUpdateLocation" registry entry. This allows for testing a new release (in a temp location)
                // before making the new release public.
                using (RegistryKey regKey = Registry.CurrentUser.OpenSubKey(Program.RegistryRootPath, false))
                {
                    object obj = regKey.GetValue("OverrideUpdateLocation");
                    if (obj != null && (obj is string))
                    {
                        formatLocationURL = (string)obj;
                    }
                }

                if (string.IsNullOrEmpty(formatLocationURL))
                {
                    formatLocationURL = DefaultUpdateURLRoot;
                }
            }

            string url = string.Format(formatLocationURL, hostname);

            return url;
        }
开发者ID:potrebic,项目名称:smokesignal.net,代码行数:25,代码来源:UpdateAvailable.cs


示例8: GetParent

        public Destination GetParent(string atlasId)
        {
            _stream.Seek(0, 0);
            var element = XElement.Load(_stream);
            var targetElement = element.Descendants("node").FirstOrDefault(n => n.Attribute("atlas_node_id") != null && n.Attribute("atlas_node_id").Value == atlasId);
            var returnDestination = new Destination();
            if (targetElement != null)
            {
                if (targetElement.Parent != null)
                {
                    var parentAltasIDAttribute = targetElement.Parent.Attribute("atlas_node_id");
                    if (parentAltasIDAttribute != null)
                    {
                        returnDestination.AtlasId = parentAltasIDAttribute.Value;
                    }

                    var parentNameElement = targetElement.Parent.Element("node_name");
                    if (parentNameElement != null)
                    {
                        returnDestination.Title = parentNameElement.Value;
                    }

                    return returnDestination;
                }
            }
            return null;
        }
开发者ID:holmesjr,项目名称:LPXMLParser,代码行数:27,代码来源:TaxonomyParser.cs


示例9: Should_dynamically_map_the_two_types

			public void Should_dynamically_map_the_two_types()
			{
				_resultWithGenerics = Mapper.Map<Source, Destination>(new Source {Value = 5});
				_resultWithoutGenerics = (Destination) Mapper.Map(new Source {Value = 5}, typeof(Source), typeof(Destination));
				_resultWithGenerics.Value.ShouldEqual(5);
				_resultWithoutGenerics.Value.ShouldEqual(5);
			}
开发者ID:jbogard,项目名称:AutoMapper,代码行数:7,代码来源:DynamicMapping.cs


示例10: SingleTripPolicy

 public SingleTripPolicy(Age age, Sex gender, Destination destination, PeriodOfTravel duration, Tax tax)
 {
     this.age = age;
     this.gender = gender;
     this.destination = destination;
     this.duration = duration;
     this.tax = tax;
 }
开发者ID:mwinder,项目名称:kata-insurance-november2013,代码行数:8,代码来源:SingleTripPolicy.cs


示例11: create_map

        protected override void create_map()
        {
            MicroMapper.CreateMap<Source, Destination>();
            MicroMapper.Init();

            _source = new Source() { Value1 = 4, Value2 = "hello" };
            _destination = MicroMapper.Map<Source, Destination>(_source);
        }
开发者ID:jaimalchohan,项目名称:MicroMapper,代码行数:8,代码来源:ValueTypes.cs


示例12: Because_of

 protected override void Because_of()
 {
     var dest = new Destination
     {
         Value = 10
     };
     _source = Mapper.Map<Destination, Source>(dest);
 }
开发者ID:mwpowellhtx,项目名称:MicroMapper,代码行数:8,代码来源:NonGenericReverseMapping.cs


示例13: AddCodeSpan

 internal void AddCodeSpan( Destination dest, LexSpan span ) {
     if (!span.IsInitialized) return;
     switch (dest) {
         case Destination.codeIncl: CodeIncl.Add( span ); break;
         case Destination.scanProlog: Prolog.Add( span ); break;
         case Destination.scanEpilog: Epilog.Add( span ); break;
     }
 }
开发者ID:pomma89,项目名称:GardenPoints.T4,代码行数:8,代码来源:AAST.cs


示例14: Edit

 public void Edit(string name, decimal cost, List<Question> questions, Color color, Destination sendTo)
 {
     this.name = name;
     this.cost = cost;
     this.color = color;
     this.questions = questions;
     this.sendTo = sendTo;
 }
开发者ID:ekaprayugo,项目名称:NgopiClasses,代码行数:8,代码来源:Item.cs


示例15: Because_of

 protected override void Because_of()
 {
     _destination = new Destination
     {
         ArrayOfItems = new string[] { "Red Fish", "Blue Fish" },
     };
     Mapper.Map(new Source(), _destination);
 }
开发者ID:garora,项目名称:AutoMapper,代码行数:8,代码来源:AllowNullCollectionsAssignableArray.cs


示例16: WindowsService

 public WindowsService()
 {
     InitializeComponent();
     var source = new Source();
     var destination = new Destination(ConfigurationManager.AppSettings["ArbServiceBaseAddress"]);
     var log = new Log();
     var integrator = new Integrator(source, destination, log);
     _scheduler = new IntegratorScheduler(integrator);
 }
开发者ID:Cognite-Soft,项目名称:ARB_2016_V2,代码行数:9,代码来源:WindowsService.cs


示例17: Item

 public Item(string name, decimal cost, List<Question> questions, Color color, int buttonPos, Destination sendTo)
 {
     this.name = name;
     this.cost = cost;
     this.color = color;
     this.questions = questions;
     this.buttonPosition = buttonPos;
     this.sendTo = sendTo;
 }
开发者ID:ekaprayugo,项目名称:NgopiClasses,代码行数:9,代码来源:Item.cs


示例18: Because_of

 protected override void Because_of()
 {
     var source = new Source
                      {
                          Values = new[] {1, 2, 3, 4},
                          Values2 = new[] {5, 6},
                      };
     _destination = Mapper.Map<Source, Destination>(source);
 }
开发者ID:mwpowellhtx,项目名称:MicroMapper,代码行数:9,代码来源:MappingToAReadOnlyCollection.cs


示例19: Should_call_ctor_once

            public void Should_call_ctor_once()
            {
                var source = new Source {Value = 5};
                var dest = new Destination {Value = 7};

                Mapper.Map(source, dest, opt => opt.CreateMissingTypeMaps = true);

                Destination.CallCount.ShouldEqual(1);
            }
开发者ID:mwpowellhtx,项目名称:MicroMapper,代码行数:9,代码来源:DestinationCtorCalledTwice.cs


示例20: Because_of

 protected override void Because_of()
 {
     _source = new Source
     {
         Value = 10,
     };
     _originalDest = new Destination { Value = 1111 };
     _dest = Mapper.Map<Source, Destination>(_source, _originalDest);
 }
开发者ID:ouyh18,项目名称:LtePlatform,代码行数:9,代码来源:FillingExistingDestination.cs



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# DestructorDeclaration类代码示例发布时间:2022-05-24
下一篇:
C# DesignXmlDraw类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap