Ejemplo n.º 1
0
 public LogDetailWindow(SVNLog svnLog)
 {
     InitializeComponent();
     this.DataContext = svnLog;
 }
Ejemplo n.º 2
0
        private void AddRecord(List <string> lines, ref ObservableCollection <SVNLog> svnLogList, ref int _CurrentLine)
        {
            SVNLog SVNData;
            string _Line;

            _Line = lines[_CurrentLine++];
            if (string.IsNullOrWhiteSpace(_Line))
            {
                return;
            }

            SVNData = new SVNLog();
            string[] revisionLine = _Line.Split(':');
            {
                SVNData.Revision = Convert.ToInt32(revisionLine[1].Trim());
            }

            _Line = lines[_CurrentLine++];
            string[] authorLine = _Line.Split(':');
            {
                SVNData.Author = authorLine[1].Trim();
            }

            _Line        = lines[_CurrentLine++];
            SVNData.Date = _Line;


            //discard Message:
            _CurrentLine++;

            _Line = lines[_CurrentLine++];
            while (!_Line.Contains("----"))
            {
                SVNData.Message += _Line + "\n";
                _Line            = lines[_CurrentLine++];
            }

            _Line = lines[_CurrentLine++];
            while (!string.IsNullOrWhiteSpace(_Line))
            {
                SVNData.Actions += _Line + "\n";
                _Line            = lines[_CurrentLine++];
            }

            //Remove Blank Lines
            {
                if (SVNData.Date.Length > 2)
                {
                    SVNData.Date = SVNData.Date.Substring(0, SVNData.Date.Length - 2);
                }

                if (SVNData.Message.Length > 3)
                {
                    SVNData.Message = SVNData.Message.Substring(0, SVNData.Message.Length - 3);
                }

                if (SVNData.Actions.Length > 3)
                {
                    SVNData.Actions = SVNData.Actions.Substring(0, SVNData.Actions.Length - 3);
                }
            }

            svnLogList.Add(SVNData);
        }