Exemplo n.º 1
0
        private List <Border> getAngularEndpoints(BorderCollection inputList)
        {
            List <Border> rawList = new List <Border>();

            foreach (Border b in inputList)
            {
                foreach (BorderNumberPair bnp in b.Endpoints)
                {
                    if (bnp.coordinate2 == null)
                    {
                        rawList.Add(b);
                    }
                }
            }


            List <Border> retVal = new List <Border>();

            foreach (Border b in rawList)
            {
                if (b.Endpoints.Count == 1)
                {
                    inputList.Remove(b);
                    retVal.Add(b);
                }
                else
                {
                    //creating new border with endpoint which don't have null values
                    Border nb = b.GetNewBorder(true);
                    inputList.Remove(b);
                    inputList.Add(nb);

                    //getting the border with only the endpoint that have a null value
                    nb = b.GetNewBorder(false);
                    retVal.Add(nb);
                }
            }


            return(retVal);
        }
Exemplo n.º 2
0
        private void loadBorderCollections(List <ColoBox> staticBoxes)
        {
            foreach (ColoBox box in staticBoxes)
            {
                foreach (RawBorder rb in box.Borders)
                {
                    switch (rb.BorderType)
                    {
                    case Orientation.Horizontal:
                        horizontalY.Add(new Border(rb, box));
                        break;

                    case Orientation.Vertical:
                        verticalX.Add(new Border(rb, box));
                        break;

                    default:
                        tilted.Add(new TiltBorder(rb, box));
                        break;
                    }
                }
            }
        }