Esempio n. 1
0
 public void Execute(CommitFile commitFile, CommitLine commitLine)
 {
     var newLine = commitFile.GetCommits()
         .FirstOrDefault(x => x.Line == commitLine.Line);
     newLine.SetType(key.ToLineType());
     commitFile.Replace(commitLine, newLine);
 }
Esempio n. 2
0
        public ICommand GetCommand(string key, CommitLine commitLine)
        {
            if (key == null)
                return null;

            if (toggleKeys.Contains(key.ToUpper()))
            {
                var line = BuildLine()(commitLine.Line);
                return new ToggleCommand(key, line);
            }

            return null;
        }
Esempio n. 3
0
 public ToggleCommand(string key, CommitLine newCommitLine)
 {
     this.key = key;
     this.newCommitLine = newCommitLine;
 }
Esempio n. 4
0
 public void Replace(CommitLine old, CommitLine @new)
 {
     var index = lines.IndexOf(old.Line);
     lines.RemoveAt(index);
     lines.Insert(index, @new.Line);
 }