예제 #1
0
        public void Display(DesignDimension dimension)
        {
            throwEvent = false;

            this.Clear();
            this.Dimension = dimension;
            int index = 1;

            if (Dimension == null)
            {
                this.Dimension       = GetNewDimension();
                this.ActiveLineField = new LineField(index);
                Add(this.ActiveLineField);
                return;
            }
            foreach (DesignDimensionLine line in Dimension.lineListChangeHandler.Items)
            {
                LineField filed = new LineField(line);
                Add(filed);
                this.ActiveLineField = filed;
                index++;
            }

            if (Dimension.lineListChangeHandler.Items.Count == 0)
            {
                LineField field = AddNewLine();
                this.Dimension.AddLine(field.Line);
            }

            throwEvent = true;
        }
예제 #2
0
        private void OnActivated(object item)
        {
            LineField field = (LineField)item;

            this.ActiveLineField = field;
            if (throwEvent && Activated != null)
            {
                Activated(this);
            }
        }
예제 #3
0
        private void OnAdded(object item)
        {
            LineField field = (LineField)item;

            if (this.Dimension == null)
            {
                this.Dimension = GetNewDimension();
            }
            this.Dimension.AddLine(field.Line);
        }
예제 #4
0
        private void activateField(LineField activeLineField)
        {
            foreach (object pan in Panel.Children)
            {
                ((LineField)pan).Background      = Brushes.White;
                ((LineField)pan).BorderBrush     = Brushes.LightBlue;
                ((LineField)pan).BorderThickness = new Thickness(1);
            }

            if (activeLineField != null)
            {
                activeLineField.Background      = Brushes.White;
                activeLineField.BorderBrush     = Brushes.Gray;
                activeLineField.BorderThickness = new Thickness(2);
            }
        }
예제 #5
0
        private void OnUpdated(object item)
        {
            LineField field = (LineField)item;

            if (this.Dimension == null)
            {
                this.Dimension = GetNewDimension();
            }
            this.Dimension.UpdateLine(field.Line);
            if (field.Line.itemListChangeHandler.Items.Count == 0 && !IsCentral && Dimension.lineListChangeHandler.Items.Count > 1)
            {
                Remove(field);
            }
            else if (throwEvent && Updated != null)
            {
                Updated(this);
            }
        }
예제 #6
0
        public void Remove(LineField field)
        {
            Panel.Children.Remove(field);
            if (this.Dimension == null)
            {
                this.Dimension = GetNewDimension();
            }
            this.Dimension.RemoveLine(field.Line);
            int index = 1;

            foreach (object pan in Panel.Children)
            {
                ((LineField)pan).Index = index++;
            }
            if (throwEvent && Updated != null)
            {
                Updated(this);
            }
        }
예제 #7
0
 public void Add(LineField field)
 {
     field.Added     += OnAdded;
     field.Updated   += OnUpdated;
     field.Activated += OnActivated;
     Panel.Children.Add(field);
     if (this.Dimension == null)
     {
         this.Dimension = GetNewDimension();
     }
     if (throwEvent)
     {
         this.Dimension.AddLine(field.Line);
     }
     if (throwEvent && Added != null)
     {
         Updated(this);
     }
 }
예제 #8
0
        public void Add(DesignDimensionLine line)
        {
            LineField field = new LineField(line);

            this.Add(field);
        }