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


C# ILocation.GetParts方法代码示例

本文整理汇总了C#中ILocation.GetParts方法的典型用法代码示例。如果您正苦于以下问题:C# ILocation.GetParts方法的具体用法?C# ILocation.GetParts怎么用?C# ILocation.GetParts使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在ILocation的用法示例。


在下文中一共展示了ILocation.GetParts方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: CalculateCloseness

        public static int? CalculateCloseness(this ILocation locationA, ILocation locationB, StringComparison comparisonType = StringComparison.InvariantCultureIgnoreCase)
        {
            var sequenceA = locationA.GetParts();
            var sequenceB = locationB.GetParts();

            return sequenceA.CalculateCloseness(sequenceB, comparisonType);
        }
开发者ID:Mavtak,项目名称:roomie,代码行数:7,代码来源:LocationExtensions.cs

示例2: CompareByParts

        public static int CompareByParts(this ILocation location1, ILocation location2)
        {
            var location1Parts = (location1 == null) ? (new string[0]) : (location1.GetParts().ToArray());
            var location2Parts = (location2 == null) ? (new string[0]) : (location2.GetParts().ToArray());

            for (var i = 0; i < location1Parts.Length && i < location2Parts.Length; i++)
            {
                var location1Part = location1Parts[i];
                var location2Part = location2Parts[i];

                var result = string.Compare(location1Part, location2Part, StringComparison.InvariantCultureIgnoreCase);

                if (result != 0)
                {
                    return result;
                }
            }

            if (location1Parts.Length < location2Parts.Length)
            {
                return -1;
            }
            else if (location1Parts.Length > location2Parts.Length)
            {
                return 1;
            }

            return 0;
        }
开发者ID:Mavtak,项目名称:roomie,代码行数:29,代码来源:LocationModelExtensions.cs

示例3: Equals

        public static bool Equals(this ILocation a, ILocation b)
        {
            if (a == null && b == null)
            {
                return true;
            }

            if ((a == null) ^ (b == null))
            {
                return false;
            }

            var result = a.GetParts().SequenceEqual(b.GetParts());

            return result;
        }
开发者ID:Mavtak,项目名称:roomie,代码行数:16,代码来源:LocationExtensions.cs

示例4: Update

 public static void Update(this ILocation destination, ILocation source)
 {
     destination.Update(source.GetParts());
 }
开发者ID:Mavtak,项目名称:roomie,代码行数:4,代码来源:LocationExtensions.cs


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