Exemplo n.º 1
0
        /// <summary>
        /// update based on 'things happening' via svn
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void SvnManagerOnSvnStatusUpdatedEvent(object sender, SvnStatusUpdatedEventArgs e)
        {
            var status = _svnManager.Status(e.FullFilePath);

            if (status.IsFile)
            {
                var existingItem = FileStatus.FirstOrDefault(x => x.Path == e.FullFilePath);
                if (null != existingItem)
                {
                    if (status.IsAdded || status.IsModified)
                    {
                        existingItem.Status = status.Status.CombinedStatus.ToString();
                    }
                    else
                    {
                        FileStatus.Remove(existingItem);
                    }
                }
                else
                {
                    if (status.IsAdded || status.IsModified)
                    {
                        FileStatus.Add(new PendingChange()
                        {
                            Path   = status.FullPath,
                            Status = status.Status.CombinedStatus.ToString()
                        });
                    }
                }
            }
        }
Exemplo n.º 2
0
        /// <summary>
        /// Grab all items svn manager knows about to populate pending changes
        /// </summary>
        private void InitialLoad()
        {
            var mappings = _svnManager.GetMappings();

            foreach (var status in mappings)
            {
                if (status.Value.IsFile && status.Value.IsAdded || status.Value.IsModified)
                {
                    FileStatus.Add(new PendingChange()
                    {
                        Path   = status.Value.FullPath,
                        Status = status.Value.Status.CombinedStatus.ToString()
                    });
                }
            }
        }