Пример #1
0
        public static float GetTimeParam(TimeProperty code)
        {
            long value = 0;

            ENgettimeparam((int)code, ref value);
            return(value);
        }
Пример #2
0
        public bool Equals(TestClassWithLists other)
        {
            if (ReferenceEquals(null, other))
            {
                return(false);
            }

            if (ReferenceEquals(this, other))
            {
                return(true);
            }

            return(numbers.SequenceEqual(other.numbers) && time.Equals(other.time) &&
                   NumbersProperty.SequenceEqual(other.NumbersProperty) && TimeProperty.Equals(other.TimeProperty) &&
                   times.SequenceEqual(other.times) && TimesProperty.SequenceEqual(other.TimesProperty));
            //floats.SequenceEqual(other.floats) && FloatsProperties.SequenceEqual(other.FloatsProperties);
        }
Пример #3
0
 set => SetValue(TimeProperty, value);
Пример #4
0
 set => this.SetValue(TimeProperty, value);
Пример #5
0
        public object Convert(object[] values, Type targetType, object parameter, System.Globalization.CultureInfo culture)
        {
            if (values != null)
            {
                try
                {
                    string       property = (string)values[0];
                    TimeProperty min      = (TimeProperty)values[1];
                    TimeProperty max      = (TimeProperty)values[2];
                    switch (property)
                    {
                    case "Days":
                        if (max == TimeProperty.Days)
                        {
                            return(Visibility.Visible);
                        }
                        return(Visibility.Collapsed);

                    case "Hours":
                        if ((max == TimeProperty.Hours || max == TimeProperty.Days) && min != TimeProperty.Days)
                        {
                            return(Visibility.Visible);
                        }
                        return(Visibility.Collapsed);

                    case "Minutes":
                        if ((max != TimeProperty.Seconds && max != TimeProperty.Milliseconds) &&
                            (min == TimeProperty.Minutes || min == TimeProperty.Seconds || min == TimeProperty.Milliseconds))
                        {
                            return(Visibility.Visible);
                        }
                        return(Visibility.Collapsed);

                    case "Seconds":
                        if (max != TimeProperty.Milliseconds && (min == TimeProperty.Milliseconds || min == TimeProperty.Seconds))
                        {
                            return(Visibility.Visible);
                        }
                        return(Visibility.Collapsed);

                    case "Milliseconds":
                        if (min == TimeProperty.Milliseconds)
                        {
                            return(Visibility.Visible);
                        }
                        return(Visibility.Collapsed);

                    case "DaysMark":
                        if (max == TimeProperty.Days && min != TimeProperty.Days)
                        {
                            return(Visibility.Visible);
                        }
                        return(Visibility.Collapsed);

                    case "HoursMark":
                        if ((max == TimeProperty.Hours || max == TimeProperty.Days) && (min != TimeProperty.Days && min != TimeProperty.Hours))
                        {
                            return(Visibility.Visible);
                        }
                        return(Visibility.Collapsed);

                    case "MinutesMark":
                        if ((max != TimeProperty.Seconds && max != TimeProperty.Milliseconds) &&
                            (min == TimeProperty.Seconds || min == TimeProperty.Milliseconds))
                        {
                            return(Visibility.Visible);
                        }
                        return(Visibility.Collapsed);

                    case "SecondsMark":
                        if (max != TimeProperty.Milliseconds && min == TimeProperty.Milliseconds)
                        {
                            return(Visibility.Visible);
                        }
                        return(Visibility.Collapsed);

                    default:
                        break;
                    }
                }
                catch
                { throw new ArgumentNullException(); }
            }
            return(Visibility.Collapsed);
        }
Пример #6
0
        public object Convert(object[] values, Type targetType, object parameter, System.Globalization.CultureInfo culture)
        {
            if (values != null)
            {
                try
                {
                    string       property  = (string)values[0];
                    TimeSpan     toConvert = (TimeSpan)values[1];
                    TimeProperty max       = (TimeProperty)values[2];
                    switch (property)
                    {
                    case "Days":
                        return(toConvert.Days.ToString("D1"));

                    case "Hours":
                        if (max == TimeProperty.Hours)
                        {
                            return((toConvert.Days * 24 + toConvert.Hours).ToString("D2"));
                        }
                        else
                        {
                            return(toConvert.Hours.ToString("D2"));
                        }

                    case "Minutes":
                        if (max == TimeProperty.Minutes)
                        {
                            return((toConvert.Days * 24 * 60 + toConvert.Hours * 60 + toConvert.Minutes).ToString("D2"));
                        }
                        else
                        {
                            return(toConvert.Minutes.ToString("D2"));
                        }

                    case "Seconds":
                        if (max == TimeProperty.Seconds)
                        {
                            return((toConvert.Days * 24 * 60 * 60 + toConvert.Hours * 60 * 60 + toConvert.Minutes * 60 + toConvert.Seconds).ToString("D2"));
                        }
                        else
                        {
                            return(toConvert.Seconds.ToString("D2"));
                        }

                    case "Milliseconds":
                        if (max == TimeProperty.Milliseconds)
                        {
                            return((toConvert.Days * 24 * 60 * 60 * 1000 + toConvert.Hours * 60 * 60 * 1000 + toConvert.Minutes * 60 * 1000 + toConvert.Seconds * 1000).ToString("D3"));
                        }
                        else
                        {
                            return(toConvert.Milliseconds.ToString("D1"));
                        }

                    default:
                        return("0");
                    }
                }
                catch
                { return("0"); }
            }
            return("0");
        }
Пример #7
0
 public static void SetTimeParam(TimeProperty code, float value)
 {
     ENsettimeparam((int)code, value);
 }