Beispiel #1
0
        public void RotateStreamControls(RotationDirection rotationDirection)
        {
            if (this.HasStreamControls)
            {
                ArrayList   toRotateControls = new ArrayList();
                IEnumerator e = this.flowsheet.Controls.GetEnumerator();
                while (e.MoveNext())
                {
                    if (e.Current is ProcessStreamBaseControl)
                    {
                        ProcessStreamBaseControl ctrl = (ProcessStreamBaseControl)e.Current;
                        if (ctrl.IsSelected)
                        {
                            toRotateControls.Add(ctrl);
                        }
                    }
                }

                if (toRotateControls.Count > 0)
                {
                    IEnumerator e2 = toRotateControls.GetEnumerator();
                    while (e2.MoveNext())
                    {
                        ProcessStreamBaseControl ctrl = (ProcessStreamBaseControl)e2.Current;
                        if (rotationDirection.Equals(RotationDirection.Clockwise))
                        {
                            ctrl.RotateClockwise();
                        }
                        else if (rotationDirection.Equals(RotationDirection.Counterclockwise))
                        {
                            ctrl.RotateCounterclockwise();
                        }
                    }
                }
            }
        }