Example #1
0
        private void ok_Click(object sender, RoutedEventArgs e)
        {
            SVConfig config = SVConfig.instance();

            config.SaveInterval = Int32.Parse(this.textBox.Text);
            config.saveConfig();
            this.Close();
        }
Example #2
0
        public static SVConfig instance()
        {
            if (_instance == null)
            {
                _instance = new SVConfig();
            }

            return(_instance);
        }
Example #3
0
        public SVSettingWindow()
        {
            InitializeComponent();

            SVConfig config = SVConfig.instance();

            config.loadConfig();

            this.textBox2.Text = config.SaveInterval.ToString();
        }
Example #4
0
        private void okBtn_Click(object sender, EventArgs e)
        {
            SVConfig config = SVConfig.instance();

            //config.RectCount = Int32.Parse(this.textBox1.Text);
            config.SaveInterval = Int32.Parse(this.textBox2.Text);
            config.saveConfig();

            DialogResult = System.Windows.Forms.DialogResult.Yes;
        }
Example #5
0
        //通过文件名来打开一个工程
        public Boolean openProject(String path, String name)
        {
            String vPath    = Path.Combine(path, name);
            String fileName = Path.Combine(vPath, name + ".svduproj");

            if (!File.Exists(fileName))
            {
                return(false);
            }

            //获取绝对路径
            vPath    = Path.GetFullPath(vPath);
            fileName = Path.GetFullPath(fileName);

            SVProData.FullProPath  = fileName;
            SVProData.ProPath      = vPath;
            SVProData.ProName      = Path.GetFileNameWithoutExtension(fileName);
            SVProData.TemplatePath = Path.Combine(vPath, "Template");
            SVProData.IconPath     = Path.Combine(vPath, "Icon");
            SVProData.LogPath      = Path.Combine(vPath, "Log");
            SVProData.version      = "1.1.7";

            SVUniqueID idObj = SVUniqueID.instance();

            idObj.UniqueFile = Path.Combine(SVProData.ProPath, "config");
            idObj.loadFile();

            ///初始化日志
            SVTextTraceListenter textListener = new SVTextTraceListenter(SVProData.LogPath);

            SVLog.TextLog.Listeners().Add(textListener);
            SVLog.WinLog.Listeners().Add(textListener);

            _sqlDataBase.connect(SVProData.dbIp, SVProData.ProName, SVProData.user, SVProData.passwd);
            //_sqlDataBase.connect(SVProData.dbIp, "tmp", SVProData.user, SVProData.passwd);
            //SVProData.DownLoadFile = _sqlDataBase.getProPath();
            ///先不从数据库中获取下装文件生成的路径
            SVProData.DownLoadFile = Path.Combine(SVProData.ProPath, "Download");
            if (String.IsNullOrEmpty(SVProData.DownLoadFile))
            {
                SVLog.WinLog.Warning("获取工程路径出错");
            }

            //从工程文件中加载信息
            linqFromFile(fileName);

            SVConfig.instance().addRectFilesItem(fileName);

            return(true);
        }