Shuxia Ning
2024-10-23 5dd7ab9852c9a5659cc916e9ed986b5099efeaf8
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
namespace HStation.WinFrmUI
{
    public partial class XhsProjectSimulationAnalysisCtrl : DevExpress.XtraEditors.XtraUserControl
    {
        public XhsProjectSimulationAnalysisCtrl()
        {
            InitializeComponent();
        }
 
        private List<XhsProjectSimulationAnalysisViewModel> _allBindingList;
 
        public void SetBindingData(Model.RevitModel revitModel)
        {
            _allBindingList = new List<XhsProjectSimulationAnalysisViewModel>();
            this.xhsProjectSimulationAnalysisViewModelBindingSource.DataSource = _allBindingList;
            var allRevitParterList = revitModel.GetAllParters();
            foreach (var revitParter in allRevitParterList)
            {
                if (revitParter.PropStatusList != null && revitParter.PropStatusList.Count > 0)
                {
                    foreach (var revitParterPropStatus in revitParter.PropStatusList)
                    {
                        if (revitParterPropStatus.PropStatus == HStation.Revit.ePropStatus.Error)
                        {
                            //  hasRevitPropError = true;
                        }
                        switch (revitParterPropStatus.PropStatus)
                        {
                            case Revit.ePropStatus.Error:
                                {
                                    _allBindingList.Add(new XhsProjectSimulationAnalysisViewModel { Type = revitParter.Catalog, Code = revitParter.Code, Name = revitParter.Name, Description = revitParterPropStatus.StatusInfo });
                                }
                                break;
 
                            case Revit.ePropStatus.Lack:
                                {
                                    _allBindingList.Add(new XhsProjectSimulationAnalysisViewModel { Type = revitParter.Catalog, Code = revitParter.Code, Name = revitParterPropStatus.PropName, Description = revitParterPropStatus.StatusInfo });
                                }
                                break;
 
                            case Revit.ePropStatus.Abnormal:
                                {
                                    _allBindingList.Add(new XhsProjectSimulationAnalysisViewModel { Type = revitParter.Catalog, Code = revitParter.Code, Name = revitParterPropStatus.PropName, Description = revitParterPropStatus.StatusInfo });
                                }
                                break;
 
                            default: break;
                        }
                    }
                }
            }
            this.xhsProjectSimulationAnalysisViewModelBindingSource.ResetBindings(false);
        }
    }
}