private static IEnumerable <DevicePropertyValueModel> ApplyDevicePropertyOrdering(IEnumerable <DevicePropertyValueModel> devicePropertyModels)
        {
            Debug.Assert(
                devicePropertyModels != null,
                "devicePropertyModels is a null reference.");

            return(devicePropertyModels.OrderByDescending(
                       t => DeviceDisplayHelper.GetIsCopyControlPropertyName(
                           t.Name)).ThenBy(u => u.DisplayOrder).ThenBy(
                       v => v.Name));
        }
예제 #2
0
        public void GetIsCopyControlPropertyNameTest()
        {
            var res = DeviceDisplayHelper.GetIsCopyControlPropertyName("deviceId");

            Assert.Equal(res, true);
            res = DeviceDisplayHelper.GetIsCopyControlPropertyName("hostname");
            Assert.Equal(res, true);
            res = DeviceDisplayHelper.GetIsCopyControlPropertyName(null);
            Assert.Equal(res, false);
            res = DeviceDisplayHelper.GetIsCopyControlPropertyName("abc");
            Assert.Equal(res, false);
        }