Exemple #1
0
        internal CommitedFileItemViewModel(CommitModel.CommitFileModel file, Action <CommitedFileItemViewModel> gotoAction)
        {
            Name     = System.IO.Path.GetFileName(file.Filename);
            RootPath = System.IO.Path.GetPathRoot(file.Filename);
//            var name = y.Filename.Substring(y.Filename.LastIndexOf("/", StringComparison.Ordinal) + 1);
            GoToCommand = ReactiveCommand.Create().WithSubscription(_ => gotoAction(this));
        }
		protected override async Task Load(bool forceCacheInvalidation)
		{
			//Make sure we have this information. If not, go get it
			if (_commitFileModel == null)
			{
				var data = await this.GetApplication().Client.ExecuteAsync(this.GetApplication().Client.Users[Username].Repositories[Repository].Commits[Branch].Get());
				_commitFileModel = data.Data.Files.First(x => string.Equals(x.Filename, Filename));
			}

			FilePath = CreatePlainContentFile(_commitFileModel.Patch, _actualFilename);
			await Comments.SimpleCollectionLoad(this.GetApplication().Client.Users[Username].Repositories[Repository].Commits[Branch].Comments.GetAll(), forceCacheInvalidation);
		}
Exemple #3
0
        protected override async Task Load(bool forceCacheInvalidation)
        {
            //Make sure we have this information. If not, go get it
            if (_commitFileModel == null)
            {
                var data = await this.GetApplication().Client.ExecuteAsync(this.GetApplication().Client.Users[Username].Repositories[Repository].Commits[Branch].Get());

                _commitFileModel = data.Data.Files.First(x => string.Equals(x.Filename, Filename));
            }

            FilePath = CreatePlainContentFile(_commitFileModel.Patch, _actualFilename);
            await Comments.SimpleCollectionLoad(this.GetApplication().Client.Users[Username].Repositories[Repository].Commits[Branch].Comments.GetAll(), forceCacheInvalidation);
        }
		public void Init(NavObject navObject)
        {
			Username = navObject.Username;
			Repository = navObject.Repository;
			Branch = navObject.Branch;
			Filename = navObject.Filename;

			_actualFilename = System.IO.Path.GetFileName(Filename);
			if (_actualFilename == null)
				_actualFilename = Filename.Substring(Filename.LastIndexOf('/') + 1);

			Title = _actualFilename;

			_commitFileModel = Mvx.Resolve<IViewModelTxService>().Get() as CommitModel.CommitFileModel;
        }
Exemple #5
0
        public ChangesetDiffViewController(string user, string slug, string branch, CommitModel.CommitFileModel commit)
        {
            _commit = commit;
            _user   = user;
            _slug   = slug;
            _branch = branch;

            //Create the filename
            var fileName = System.IO.Path.GetFileName(commit.Filename);

            if (fileName == null)
            {
                fileName = commit.Filename.Substring(commit.Filename.LastIndexOf('/') + 1);
            }
            Title = fileName;
        }
Exemple #6
0
        public void Init(NavObject navObject)
        {
            Username   = navObject.Username;
            Repository = navObject.Repository;
            Branch     = navObject.Branch;
            Filename   = navObject.Filename;

            _actualFilename = System.IO.Path.GetFileName(Filename);
            if (_actualFilename == null)
            {
                _actualFilename = Filename.Substring(Filename.LastIndexOf('/') + 1);
            }

            Title = _actualFilename;

            _commitFileModel = Mvx.Resolve <IViewModelTxService>().Get() as CommitModel.CommitFileModel;
        }