Exemple #1
0
        static public bool CloneAttributeList(IAttributeListContainer From, IAttributeListContainer To, string ListName, bool Initialize)
        {
            IAttributeList toAdd = null;

            if (From != null)
            {
                toAdd = From.GetList(ListName);
                if (toAdd != null)
                {
                    toAdd = toAdd.Clone();
                }
            }
            if (toAdd == null)
            {
                switch (ListName)
                {
                case "ColorList":
                    toAdd = new ColorList();
                    break;

                case "LayerList":
                    toAdd = new LayerList();
                    break;

                case "HatchStyleList":
                    toAdd = new HatchStyleList();
                    break;

                case "DimensionStyleList":
                    toAdd = new DimensionStyleList();
                    break;

                case "LineWidthList":
                    toAdd = new LineWidthList();
                    break;

                case "LinePatternList":
                    toAdd = new LinePatternList();
                    break;

                case "StyleList":
                    toAdd = new StyleList();
                    break;

                default:
                    return(false);
                }
                if (Initialize)
                {
                    toAdd.Initialize();
                }
            }
            To.Add(ListName, toAdd);
            return(true);
        }