예제 #1
0
        public void OSFeature_Feature_Get_ReturnsExpected()
        {
            OSFeature feature = OSFeature.Feature;

            Assert.NotNull(feature);
            Assert.Same(feature, OSFeature.Feature);
        }
예제 #2
0
파일: form1.cs 프로젝트: ruo2012/samples-1
//<Snippet2>
        // Gets the caret width based upon the operating system or default value.
        private int GetCaretWidth()
        {
            // Check to see if the operating system supports the caret width metric.
            if (OSFeature.IsPresent(SystemParameter.CaretWidthMetric))
            {
                // If the operating system supports this metric,
                // return the value for the caret width metric.

                return(SystemInformation.CaretWidth);
            }
            else
            {
                // If the operating system does not support this metric,
                // return a custom default value for the caret width.

                return(1);
            }
        }
예제 #3
0
 public void OSFeature_IsPresent_Invoke_ReturnsExpected(SystemParameter feature, bool expected)
 {
     Assert.Equal(expected, OSFeature.IsPresent(feature));
 }