Пример #1
0
 public void NavigateForward()
 {
     if (m_positionFuture.Count != 0)
     {
         Log.Debug("NavigateForward");
         m_positionHistory.Push(Position);
         Position = m_positionFuture.Pop();
     }
 }
Пример #2
0
        public void NavigateTo(BlamePositionModel position)
        {
            Log.DebugFormat("NavigateTo({0})", position == null ? "null" : "position");

            if (Position != null)
            {
                m_positionHistory.Push(Position);
            }
            m_positionFuture.Clear();
            Position = position;
        }
Пример #3
0
		protected override async void OnStartup(StartupEventArgs e)
		{
			base.OnStartup(e);

			var sessionStart = m_analyticsClient.SubmitSessionStartAsync();

			foreach (var arg in e.Args)
				Log.InfoFormat("Command-line arg: {0}", arg);

			MainWindowModel mainWindowModel = m_app.MainWindow;
			BlamePositionModel position = null;

			string filePath = e.Args.Length >= 1 ? e.Args[0] : null;
			if (filePath == "/restart" && e.Args.Length == 5)
			{
				position = new BlamePositionModel(e.Args[1], e.Args[2])
				{
					CommitId = e.Args[3] == "null" ? null : e.Args[3],
					LineNumber = int.Parse(e.Args[4]),
				};
			}
			else if (!string.IsNullOrEmpty(filePath) && File.Exists(filePath))
			{
				position = new BlamePositionModel(filePath);

				int lineNumber;
				if (e.Args.Length >= 2 && int.TryParse(e.Args[1], NumberStyles.Integer, CultureInfo.InvariantCulture, out lineNumber))
					position.LineNumber = lineNumber;
			}
			mainWindowModel.NavigateTo(position);

			Window window = new MainWindow(mainWindowModel);
			window.Show();

			await sessionStart;
			await m_analyticsClient.SubmitAppViewAsync("MainWindow");
		}
Пример #4
0
        public void NavigateTo(BlamePositionModel position)
        {
            Log.DebugFormat("NavigateTo({0})", position == null ? "null" : "position");

            if (Position != null)
                m_positionHistory.Push(Position);
            m_positionFuture.Clear();
            Position = position;
        }
Пример #5
0
 private void RunBlame(BlamePositionModel position)
 {
     if (position == null || position.RepoPath == null)
     {
         Blame.ClearBlameResult();
     }
     else
     {
         ProfileOptimization.StartProfile("Blame");
         BlameResult blame = GitWrapper.GetBlameOutput(position.RepoPath, position.FileName, position.CommitId);
         Blame.SetBlameResult(blame, position.LineNumber ?? 1);
     }
 }