Esempio n. 1
0
        public void Setup(string stencilPath, Config.AddProjectHandler addProject, Config.AddProjectAnywayHandler addProjectAnyway)
        {
            this.addProject       = addProject;
            this.addProjectAnyway = addProjectAnyway;

            {
                //int iStencil = 0;
                //LogNote("Srvr : 0 : ModelStencils:");
                String[] files = Directory.GetFiles(stencilPath, "*.modelstencil");
                for (int i = 0; i < files.GetLength(0); i++)
                {
                    String fullpath = files[i];

                    //try
                    //{
                    ModelStencil modelStencil = ModelStencil.Deserialize(fullpath);

                    if (ConfirmModelStencil(modelStencil))
                    {
                        TrimAnchorPoints(modelStencil);
                        ModelStencils.Add(modelStencil.Tag, modelStencil);
                    }

                    //Console.WriteLine("  {0}] {1}", iStencil++, Path.GetFileNameWithoutExtension(fullpath));
                    //LogNote("Srvr : 0 : " + iStencil++ + " : " + System.IO.Path.GetFileNameWithoutExtension(fullpath));
                    //}
                    //catch (Exception)
                    //{
                    //  int asdf = 0;
                    //  //Message("Error '" + e.Message + "' loading ModelStencil: " + fullpath, MessageType.Error);
                    //}
                }

                Console.WriteLine("\n");
            }

            {
                //int iStencil = 0;
                //LogNote("Srvr : 0 : GraphicStencils:");
                String[] files = Directory.GetFiles(stencilPath, "*.graphicstencil");
                for (int i = 0; i < files.GetLength(0); i++)
                {
                    String fullpath = files[i];

                    //try
                    //{
                    GraphicStencil graphicStencil = GraphicStencil.Deserialize(fullpath);

                    foreach (String tag in graphicStencil.Tags)
                    {
                        GraphicStencils.Add(tag, graphicStencil);
                    }
                    //}
                    //catch
                    //{
                    //  int adsf = 0;
                    //  //logNote("Config : Error loading GraphicStencil " + fullpath);
                    //}
                }
            }
        }