示例#1
0
        /// <summary> 检测当前体检项目初始化 获取数据 取消等操作 </summary>
        public async Task <bool> CheckAndRunMeasure(LinkActionEntity current)
        {
            bool result = false;

            //  Message:初始化设备
            if (await current.BeginInit())
            {
                if (current.IsCancel)
                {
                    return(false);
                }

                //  Message:开始测量
                var value = await current.Start();

                if (current.IsCancel)
                {
                    return(false);
                }

                //  Do :没有取消操作
                if (value != null)
                {
                    if (this.IsLast())
                    {
                        this.RunSumitEngine = true;
                    }
                    else
                    {
                        this.RunNextEngine = true;
                    }

                    return(true);
                }
                else
                {
                    this.RunReMeasureEngine = true;
                }
            }
            else
            {
                if (current.IsCancel)
                {
                    return(false);
                }

                this.RunReMeasureEngine = true;
            }

            return(result);
        }
        public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
        {
            ObservableCollection <LinkActionEntity> LinkActions = value as ObservableCollection <LinkActionEntity>;

            LinkActionEntity select = parameter as LinkActionEntity;

            if (LinkActions == null)
            {
                return(Visibility.Collapsed);
            }

            if (parameter == null)
            {
                return(Visibility.Visible);
            }

            return(LinkActions.LastOrDefault() == parameter ? Visibility.Collapsed : Visibility.Visible);
        }