Esempio n. 1
0
        private static void Initialize()
        {
            files = new Dictionary <Guid, string>();
            tools = new List <DrawingToolGenericPosture>();

            if (!Directory.Exists(Software.CustomToolsDirectory))
            {
                return;
            }

            string[] fileList = Directory.GetFiles(Software.CustomToolsDirectory);
            Array.Sort(fileList, new AlphanumComparator());

            foreach (string f in fileList)
            {
                if (!Path.GetExtension(f).ToLower().Equals(".xml"))
                {
                    continue;
                }

                // Extract icon and name.
                GenericPosture posture = new GenericPosture(f, true, false);
                if (posture == null || posture.Id == Guid.Empty)
                {
                    continue;
                }

                files[posture.Id] = f;

                DrawingToolGenericPosture tool = new DrawingToolGenericPosture();
                tool.SetInfo(posture);
                tools.Add(tool);
            }

            initialized = true;
        }