Browse Source

Fixed formatting/indentation.

pull/661/head
Andreas Weizel 11 years ago
parent
commit
e20fdc9571
  1. 23
      src/Main/Base/Project/Src/Gui/Dialogs/ReferenceDialog/ProjectReferencePanel.cs

23
src/Main/Base/Project/Src/Gui/Dialogs/ReferenceDialog/ProjectReferencePanel.cs

@ -52,13 +52,17 @@ namespace ICSharpCode.SharpDevelop.Gui @@ -52,13 +52,17 @@ namespace ICSharpCode.SharpDevelop.Gui
this.Dock = DockStyle.Fill;
this.Controls.Add(listView);
listView.ItemActivate += delegate { AddReference(); };
listView.ItemActivate += delegate {
AddReference();
};
PopulateListView();
Panel upperPanel = new Panel { Dock = DockStyle.Top, Height = 20 };
filterTextBox = new TextBox { Width = 150, Dock = DockStyle.Right };
filterTextBox.TextChanged += delegate { Search(); };
filterTextBox.TextChanged += delegate {
Search();
};
upperPanel.Controls.Add(filterTextBox);
@ -67,8 +71,7 @@ namespace ICSharpCode.SharpDevelop.Gui @@ -67,8 +71,7 @@ namespace ICSharpCode.SharpDevelop.Gui
public void AddReference()
{
foreach (ListViewItem item in listView.SelectedItems)
{
foreach (ListViewItem item in listView.SelectedItems) {
IProject project = (IProject)item.Tag;
selectDialog.AddReference(
@ -94,11 +97,10 @@ namespace ICSharpCode.SharpDevelop.Gui @@ -94,11 +97,10 @@ namespace ICSharpCode.SharpDevelop.Gui
static bool ContainsAnyOfTokens(string bigText, string[] tokens)
{
if(tokens.Length==0)
if (tokens.Length == 0)
return true;
foreach(var token in tokens)
{
if(bigText.IndexOf(token, StringComparison.OrdinalIgnoreCase)<0)
foreach (var token in tokens) {
if (bigText.IndexOf(token, StringComparison.OrdinalIgnoreCase) < 0)
return false;
}
return true;
@ -107,12 +109,11 @@ namespace ICSharpCode.SharpDevelop.Gui @@ -107,12 +109,11 @@ namespace ICSharpCode.SharpDevelop.Gui
void Search()
{
listView.Items.Clear();
var tokens = filterTextBox.Text.Split(new []{' '}, StringSplitOptions.RemoveEmptyEntries);
var tokens = filterTextBox.Text.Split(new []{ ' ' }, StringSplitOptions.RemoveEmptyEntries);
foreach (IProject project in ProjectService.OpenSolution.Projects.
Where(pr=>ContainsAnyOfTokens(pr.Name, tokens))
.OrderBy(p => p.Name, StringComparer.OrdinalIgnoreCase)
) {
.OrderBy(p => p.Name, StringComparer.OrdinalIgnoreCase)) {
ListViewItem newItem = new ListViewItem(new string[] { project.Name, project.Directory });
newItem.Tag = project;
listView.Items.Add(newItem);

Loading…
Cancel
Save