Exemple #1
0
        public void FilterFlowPathways(DiagramFilterCriteria criteria)
        {
            this.m_IsFilterApplied = IsFilterApplied(criteria);

            foreach (FlowPathwayLine l in this.Lines)
            {
                l.IsVisible = criteria.FlowTypes[l.Pathway.FlowTypeId];
            }

            this.Invalidate();
        }
Exemple #2
0
        private static bool IsFilterApplied(DiagramFilterCriteria criteria)
        {
            foreach (bool b in criteria.FlowTypes.Values)
            {
                if (!b)
                {
                    return(true);
                }
            }

            return(false);
        }
Exemple #3
0
        private void SyncronizeFilterCriteria()
        {
            DiagramFilterCriteria cr = new DiagramFilterCriteria();
            DataSheet             ds = this.Project.GetDataSheet(Constants.DATASHEET_FLOW_TYPE_NAME);
            DataTable             dt = ds.GetData();

            foreach (DataRow dr in dt.Rows)
            {
                if (dr.RowState != DataRowState.Deleted)
                {
                    cr.FlowTypes.Add(Convert.ToInt32(dr[ds.ValueMember], CultureInfo.InvariantCulture), true);
                }
            }

            foreach (int tg in this.m_FilterCriteria.FlowTypes.Keys)
            {
                if (cr.FlowTypes.ContainsKey(tg))
                {
                    cr.FlowTypes[tg] = this.m_FilterCriteria.FlowTypes[tg];
                }
            }

            this.m_FilterCriteria = cr;
        }