Exemplo n.º 1
0
 public GenRoller()
 {
     InitializeComponent();
     _genRoller = new General_Roller();
     rdoCVSSrc.Checked = true;
     LoadDefaults();
     this.txtCVSBranch.Text = "HEAD";
     this.txtCVSSvr.Text = "CVS";
     this.txtCVSUser.Text = ((BusinessIdentity)System.Threading.Thread.CurrentPrincipal.Identity).UserName;
 }
Exemplo n.º 2
0
Arquivo: Roller.cs Projeto: jhogan/qed
		public GeneralRollDest(General_Roller genRoller){
			_genRoller = genRoller;
			_src = _genRoller.GeneralRollSource;
		}
Exemplo n.º 3
0
Arquivo: Roller.cs Projeto: jhogan/qed
		public GeneralRollDests(General_Roller genRoller){
			_genRoller = genRoller;
		}
Exemplo n.º 4
0
Arquivo: Roller.cs Projeto: jhogan/qed
		public GeneralRollSrc(General_Roller genRoller){
			_genRoller = genRoller;
		}
Exemplo n.º 5
0
        public void ReFillRoller()
        {
            try{
                bool gettingTag = false; bool waitingfForPath = false; string tag = ""; string path = "";int i;
                string l;
                _genRoller = new General_Roller();
                //_genRoller.Clear();
                GeneralRollSrc genRollerSrc = _genRoller.GeneralRollSource;
                // Source
                if(rdoCVSSrc.Checked) {
                    genRollerSrc.SourceType =  SourceType.CVS;
                    genRollerSrc.Branch = this.txtCVSBranch.Text;
                    genRollerSrc.CVSExportRoot = new DirectoryInfo(this.txtExportRoot.Text);
                    genRollerSrc.CVSModule = this.cboCVSMod.Text;
                    genRollerSrc.CVSPath = this.cboCVSRepos.Text;
                    genRollerSrc.CVSServer = this.txtCVSSvr.Text;
                    genRollerSrc.CVSUser = this.txtCVSUser.Text;

                }else{
                    genRollerSrc.SourceType =  SourceType.Directory;
                    genRollerSrc.BaseDir = new DirectoryInfo(this.cboSrcDir.Text);
                }
                foreach(string line in txtFSOList.Lines){
                    l = line.Trim();
                    if (l == "") continue;
                    genRollerSrc.AddSourceFileSystemInfo(l);
                }
                // Dest
                GeneralRollDest rollDest = null;
                bool lineWaitForBK = true;	bool lineWaitForDest = false; //These will be immediatly negated in loop
                foreach(string line in txtDest.Lines){
                    l = line.Trim();
                    char[] chs = l.ToCharArray();
                    if (l == "") continue;
                    lineWaitForBK = !lineWaitForBK; lineWaitForDest = !lineWaitForDest;
                    i=0; gettingTag = false; waitingfForPath = false; tag = ""; path = "";
                    foreach(char ch in chs){
                        if (i++ == 0) gettingTag = true;
                        if (gettingTag && ch == ' '){
                            gettingTag = false;
                            waitingfForPath = true;
                        }
                        if (gettingTag){
                            tag += ch.ToString();
                        }
                        if (waitingfForPath && ch != ' ')
                            waitingfForPath = false;

                        if (!gettingTag &&  !waitingfForPath){
                            path += ch.ToString();
                        }
                    }
                    switch (tag.ToUpper()){
                        case "BK:":
                            if (rollDest.BaseDir != null && lineWaitForBK)
                                rollDest.BackupDir = new DirectoryInfo(path);
                            else
                                throw new Exception("Destination text box is in the wrong format. Found at " + line);
                            break;
                        case "PATH:":
                            if (lineWaitForDest){
                                rollDest = _genRoller.GeneralRollDestinations.CreateNew();
                                rollDest.BaseDir = new DirectoryInfo(path);
                            }else{
                                throw new Exception("Destination text box is in the wrong format. Found at " + line);
                             }
                            break;
                        default:
                            throw new Exception("In the \"Destination\" textbox, the tag \""+ tag +"\" is invalid. Did you forget the \":\".");
                    }
                }
                if (!lineWaitForBK){
                    throw new Exception("Destination text box is in the wrong format. Must end with BK directory");
                }
            }
            catch(Exception ex){
                MessageBox.Show(this, "An error was encounter. See the \"Plan\" text box for more information." + n + ex.Message, "QED");
            }
        }