private void Button_Allow_Click(object sender, EventArgs e) { if (m_Base == null) { return; } FileFolderHolder ffh = getFfhFromNode(TreeViewFolders.SelectedNode); if (ffh == null) { return; } string text = "!"; text += ffh.m_RelativePath + ffh.m_Filename; if (!ffh.m_IsFile) { text += "/"; } GitIgnoreLine gil = new GitIgnoreLine(); gil.setLine(text.Replace('\\', '/')); m_GitLines.Add(gil); remakeEverything(); }
private void Ignore_EditLine_Click(object sender, EventArgs e) { if (GitIgnore_Contents.SelectedIndex == -1) { return; } int index = GitIgnore_Contents.SelectedIndex; GitIgnoreLine gil = m_GitLines[index]; string result = m_GitLineEditForm.openForm(gil.m_BaseLine, index); if (result == "") { return; } gil.setLine(result); remakeEverything(); m_RemoveOtherSelectedListBox = false; GitIgnore_Contents.SelectedIndex = index; m_RemoveOtherSelectedListBox = true; }
private bool loadGitFile() { string[] gitIgnore; try { gitIgnore = File.ReadAllLines(m_Dir + "\\.gitignore"); } catch { Label_CurrPath.Text = "Folder does not have .gitignore"; return(false); } m_GitLines = new List <GitIgnoreLine>(); m_GitLines.Capacity = gitIgnore.Length; for (int i = 0; i < gitIgnore.Length; i++) { GitIgnoreLine gil = new GitIgnoreLine(); gil.setLine(gitIgnore[i]); m_GitLines.Add(gil); //if (m_GitIgnore[i].Length >= 2) { // if (m_GitIgnore[i][0] == '/') { // m_GitIgnore[i] = m_GitIgnore[i].Remove(0, 1); // } //} } //add a empty line to the end if (m_GitLines[m_GitLines.Count - 1].m_Type != GitIgnoreLine.LineType.Empty) { GitIgnoreLine gil = new GitIgnoreLine(); gil.setLine(""); m_GitLines.Add(gil); } return(true); }
private void Ignore_NewLine_Click(object sender, EventArgs e) { //if not selected if (GitIgnore_Contents.SelectedIndex == -1) { return; } int index = GitIgnore_Contents.SelectedIndex; GitIgnoreLine gil = new GitIgnoreLine(); gil.setLine(""); m_GitLines.Insert(index, gil); remakeEverything(); m_RemoveOtherSelectedListBox = false; GitIgnore_Contents.SelectedIndex = index; m_RemoveOtherSelectedListBox = true; }