Ejemplo n.º 1
0
        public static List <RemoteInfo> Parse(List <string> lines)
        {
            List <RemoteInfo> output = new List <RemoteInfo>();

            foreach (string line in lines)
            {
                RemoteInfo RemoteInfo = ParseLine(line);
                output.Add(RemoteInfo);
            }
            return(output);
        }
Ejemplo n.º 2
0
        public static RemoteInfo ParseLine(string line)
        {
            Regex      regex      = new Regex(@"(\S+)\s+(\S+)\s+(\S+)");
            RemoteInfo RemoteInfo = new RemoteInfo();

            Match match = regex.Match(line);

            if (match.Success == false)
            {
                return(null);
            }
            RemoteInfo.Name   = match.Groups[1].Value;
            RemoteInfo.Url    = match.Groups[2].Value;
            RemoteInfo.Mirror = match.Groups[3].Value;

            return(RemoteInfo);
        }
        public object Convert(object[] values, Type targetType, object parameter, CultureInfo culture)
        {
            if (values == null)
            {
                return("");
            }
            RemoteTabViewModel remoteTabViewModel = (RemoteTabViewModel)values[0];
            RemoteInfo         selectedRemoteInfo = (RemoteInfo)values[1];

            if (selectedRemoteInfo == null)
            {
                return("");
            }
            string        cmd   = GitCommandCreator.GetRemoteDetail(selectedRemoteInfo.Name);
            List <string> lines = remoteTabViewModel.GitRepo.CreateGitRunner().Run(cmd);

            return(string.Join(Environment.NewLine, lines));
        }