예제 #1
0
        public void LoadData(string xmlFile)
        {
            //Empty Load
            if (xmlFile == "")
            {
                mSolution      = new DeploySolution();
                mSolution.Main = this;
                Logger.Log("Empty Solution Loaded", LogSeverities.Info);
            }
            else
            {
                string status = Solution.Load(xmlFile);

                if (status != "")
                {
                    ErrorBox(status, "Open Error");
                }
                else
                {
                    Logger.Log("Solution loaded successfully from " + Solution.Path, LogSeverities.Info);
                }
            }

            deployerUCtrl1.Source = mSolution;
            toolsUCtrl1.Source    = mSolution;
        }
예제 #2
0
        private void UpdateDeploys(DeploySolution mSource)
        {
            BindingSource source = new BindingSource();

            source.DataSource = mSource.Deploys;
            source.AllowNew   = true;

            DeploysDataGrid.DataSource = source;
        }
예제 #3
0
        public string Load(string inPath)
        {
            mPath = inPath;

            string         status = "";
            StreamReader   reader = null;
            DeploySolution read   = null;

            try
            {
                XmlSerializer ser = new XmlSerializer(typeof(DeploySolution));

                reader = new StreamReader(inPath);
                read   = (DeploySolution)ser.Deserialize(reader);

                //Resolve
                foreach (Deployment deploy in read.Deploys)
                {
                    List <Tool> resolvedTools = new List <Tool>();
                    foreach (Tool tool in deploy.Tools)
                    {
                        //Find in Tools
                        foreach (Tool realTool in read.Tools)
                        {
                            if (realTool.Name == tool.Name)
                            {
                                resolvedTools.Add(realTool);
                            }
                        }
                    }

                    deploy.Tools = resolvedTools;
                }
            }
            catch (Exception e) { status = e.Message; }

            if (reader != null)
            {
                reader.Close();
            }

            if (read != null)
            {
                mDeploys = read.Deploys;
                mTools   = read.Tools;
                mPath    = read.Path;
            }

            return(status);
        }