예제 #1
0
        public SvnApiTest()
        {
            // works only if shadow copying in unit tests is disabled, because otherwise the relative path is wrong
            string repository = "file:///" + Path.GetFullPath(Path.Combine(Environment.CurrentDirectory, @"..\..\..\..\test_repository"));

            api = new SharpSvnApi(repository);
        }
예제 #2
0
 public void ShowLogMessage(ISvnApi svn)
 {
     try
     {
         MessageBox.Show(svn.GetLogMessage(Revision), "Log Message");
     }
     catch (Exception x)
     {
         MessageBox.Show(Dump.ExceptionMessage(x), "Could not get log message", MessageBoxButton.OK, MessageBoxImage.Warning);
     }
 }
예제 #3
0
        public Indexer(IndexerArgs args)
        {
            WriteLogo();
            WriteArgs();

            _args            = args;
            _indexDirectory  = FSDirectory.GetDirectory(args.IndexPath);
            _indexQueueLimit = new Semaphore(args.MaxThreads * 4, args.MaxThreads * 4);
            ThreadPool.SetMaxThreads(args.MaxThreads, 1000);
            ThreadPool.SetMinThreads(args.MaxThreads / 2, Environment.ProcessorCount);

            _contentField   = new Field(FieldName.Content, _contentTokenStream);
            _pathField      = new Field(FieldName.Path, _pathTokenStream);
            _externalsField = new Field(FieldName.Externals, _externalsTokenStream);
            _messageField   = new Field(FieldName.Message, _messageTokenStream);

            _svn = new SharpSvnApi(args.RepositoryLocalUri, args.Credentials.User, args.Credentials.Password);
        }
예제 #4
0
        public void ShowContent(ISvnApi svn)
        {
            if (Path[0] == '$')
            {
                ShowLogMessage(svn);
                return;
            }

            try
            {
                string path = GetTempPath();
                IOFile.WriteAllText(path, svn.GetPathContent(Path, Revision, SizeInBytes));
                Process.Start(Settings.Default.ViewWith, '"' + path + '"');
                Thread.Sleep(500); // starting the viewer application could take a while, therefore we display the wait cursor for at least half a second
            }
            catch (Exception x)
            {
                MessageBox.Show(Dump.ExceptionMessage(x), "Could not open file", MessageBoxButton.OK, MessageBoxImage.Warning);
            }
        }
예제 #5
0
 public SimpleHighlight(ISvnApi svn, int maxNumFragments, string separator, int fragmentSize) : base(svn)
 {
     this.maxNumFragments = maxNumFragments;
     this.separator       = separator;
     this.fragmentSize    = fragmentSize;
 }
예제 #6
0
 public SimpleHighlight(ISvnApi svn, int maxNumFragments)
     : this(svn, maxNumFragments, SEPARATOR, FRAGMENT_SIZE)
 {
 }
예제 #7
0
 public SimpleHighlight(ISvnApi svn, int maxNumFragments, string separator)
     : this(svn, maxNumFragments, separator, FRAGMENT_SIZE)
 {
 }
예제 #8
0
 public SimpleHighlight(ISvnApi svn)
     : this(svn, NUM_FRAGMENTS, SEPARATOR, FRAGMENT_SIZE)
 {
 }
예제 #9
0
 public Highlight(ISvnApi svn)
 {
     Svn = svn;
 }
예제 #10
0
 public LineHighlight(ISvnApi svn, int maxNumFragments, int contextLines) : base(svn)
 {
     this.maxNumFragments = maxNumFragments;
     this.contextLines    = contextLines;
 }
예제 #11
0
 public LineHighlight(ISvnApi svn, int maxNumFragments) : this(svn, maxNumFragments, CONTEXT_LINES)
 {
 }
예제 #12
0
 public LineHighlight(ISvnApi svn) : this(svn, NUM_FRAGMENTS, CONTEXT_LINES)
 {
 }