本文整理汇总了C#中SearchWindow类的典型用法代码示例。如果您正苦于以下问题:C# SearchWindow类的具体用法?C# SearchWindow怎么用?C# SearchWindow使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
SearchWindow类属于命名空间,在下文中一共展示了SearchWindow类的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: FindFileOnClick
public void FindFileOnClick(object sender, EventArgs e)
{
string selectedItem;
using (var searchWindow = new SearchWindow<string>(FindFileMatches)
{
Owner = this
})
{
searchWindow.ShowDialog(this);
selectedItem = searchWindow.SelectedItem;
}
if (string.IsNullOrEmpty(selectedItem))
{
return;
}
string[] items = selectedItem.Split(new[] { '/' });
TreeNodeCollection nodes = GitTree.Nodes;
for (int i = 0; i < items.Length - 1; i++)
{
TreeNode selectedNode = Find(nodes, items[i]);
if (selectedNode == null)
{
return; //Item does not exist in the tree
}
selectedNode.Expand();
nodes = selectedNode.Nodes;
}
var lastItem = Find(nodes, items[items.Length - 1]);
if (lastItem != null)
{
GitTree.SelectedNode = lastItem;
}
}
示例2: RunSearchFileCommand
private void RunSearchFileCommand()
{
var searchWindow = new SearchWindow<string>(FindFileMatches);
Application.Run(searchWindow);
if (searchWindow.SelectedItem != null)
//We need to return the file that has been found, the visual studio plugin uses the return value
//to open the selected file.
Console.WriteLine(Path.Combine(Module.WorkingDir, searchWindow.SelectedItem));
}
示例3: RunSearchFileCommand
private void RunSearchFileCommand()
{
var searchWindow = new SearchWindow<string>(FindFileMatches);
Application.Run(searchWindow);
if (searchWindow.SelectedItem != null)
Console.WriteLine(Module.WorkingDir + searchWindow.SelectedItem);
}
示例4: findInDiffToolStripMenuItem_Click
private void findInDiffToolStripMenuItem_Click(object sender, EventArgs e)
{
var candidates = DiffFiles.GitItemStatuses;
Func<string, IList<GitItemStatus>> FindDiffFilesMatches = (string name) =>
{
string nameAsLower = name.ToLower();
return candidates.Where(item =>
{
return item.Name != null && item.Name.ToLower().Contains(nameAsLower)
|| item.OldName != null && item.OldName.ToLower().Contains(nameAsLower);
}
).ToList();
};
GitItemStatus selectedItem;
using (var searchWindow = new SearchWindow<GitItemStatus>(FindDiffFilesMatches)
{
Owner = this
})
{
searchWindow.ShowDialog(this);
selectedItem = searchWindow.SelectedItem;
}
if (selectedItem != null)
{
DiffFiles.SelectedItem = selectedItem;
}
}
示例5: findInDiffToolStripMenuItem_Click
private void findInDiffToolStripMenuItem_Click(object sender, EventArgs e)
{
var searchWindow = new SearchWindow<GitItemStatus>(FindDiffFilesMatches)
{
Owner = this
};
searchWindow.ShowDialog(this);
GitItemStatus selectedItem = searchWindow.SelectedItem;
if (selectedItem != null)
{
DiffFiles.SelectedItem = selectedItem;
}
}
示例6: RunSearchFileCommand
private static void RunSearchFileCommand()
{
var searchWindow = new SearchWindow<string>(FindFileMatches);
Application.Run(searchWindow);
Console.WriteLine(Settings.WorkingDir + searchWindow.SelectedItem);
}
示例7: Execute
public void Execute()
{
var searchWindow = new SearchWindow<string>(FindFileMatches);
Application.Run(searchWindow);
Console.WriteLine(Settings.WorkingDir + searchWindow.SelectedItem);
}
示例8: MainForm
//.........这里部分代码省略.........
//and sendMeta.value in (@2)");
// args.Add("VisitNumber");
// args.Add(numbers);
// }
// sql = string.Concat(sql, Environment.NewLine, @"order by mi.CreationDate desc");
// Console.WriteLine("{0}: {1}", key, sql.Replace(Environment.NewLine, Environment.NewLine + "\t"));
// return await db.FetchAsync<dynamic>(sql, args.ToArray());
// }
// });
// patientsByVisitNumbersQueries.Add(key, async (numbers) =>
// {
// return await visitsByNumbersQueries[key](numbers);
// });
// visitDetailsByVisitNumbersQuery.Add(key, async (numbers) =>
// {
// return await visitsByNumbersQueries[key](numbers);
// });
// doctorsByNumbersQuery.Add(key, async (numbers) =>
// {
// using (var db = new Database(key))
// {
// var sql = string.Format(@"select top 1000 mi.CreationDate, mi.SendTransportType, mi.ReceivePortName, mi.ReceiveMessageName,
// (select top 1 value from {0}.BizTalk.Metadata where [key] = 'SubType' and MessageId = mi.SendMessageid) as SubType,
// (select top 1 value from {0}.BizTalk.Metadata where [key] = 'PatientNumber' and MessageId = mi.SendMessageid) as PatientNumber,
// (select top 1 value from {0}.BizTalk.Metadata where [key] = 'VisitNumber' and MessageId = mi.SendMessageid) as VisitNumber,
// (select top 1 value from {0}.BizTalk.Metadata where [key] = 'StaffNumber' and MessageId = mi.SendMessageid) as StaffNumber,
// sendMessage.Content as Message
//FROM {0}.BizTalk.MessageInstance mi with (nolock)
//inner join {0}.BizTalk.Message sendMessage on sendMessage.MessageId = mi.SendMessageid
//left outer join {0}.BizTalk.Metadata sendMeta on sendMeta.MessageId = mi.SendMessageid
//where mi.sendPortname = @0", key == "Biztalk" ? "Messagebox054" : "Messagebox_Beta");
// var args = new List<object>() { biztalk };
// if (!showOnlyLast100BiztalkHL7s)
// {
// sql = string.Concat(sql, Environment.NewLine, @"and sendMeta.[key] = @1
//and sendMeta.value in (@2)");
// args.Add("StaffNumber");
// args.Add(numbers);
// }
// sql = string.Concat(sql, Environment.NewLine, @"order by mi.CreationDate desc");
// Console.WriteLine("{0}: {1}", key, sql.Replace(Environment.NewLine, Environment.NewLine + "\t"));
// return await db.FetchAsync<dynamic>(sql, args.ToArray());
// }
// });
// break;
}
treeWindows.Add(key, new HL7TreeWindow());
treeWindows[key].Text = key + " Tree";
menuItem = new MenuItem();
menuItem.Text = key + " Tree";
menuItem.Click += new EventHandler(menuItemViewWindow_Click);
this.menuItemView.MenuItems.Add(menuItem);
menuItem.Index = menuItemViewIndex++;
syntaxHighlightingWindows.Add(key, new SyntaxHighlightingWindow(key));
syntaxHighlightingWindows[key].Text = key + " Message";
syntaxHighlightingWindows[key].SearchPatientId += new HHR.HL7.Search.SyntaxHighlightingWindow.SearchPatientIdEventHandler(SearchPatientId);
syntaxHighlightingWindows[key].SearchVisitNumber += new HHR.HL7.Search.SyntaxHighlightingWindow.SearchVisitNumberEventHandler(SearchVisitNumber);
menuItem = new MenuItem();
menuItem.Text = key + " Message";
menuItem.Click += new EventHandler(menuItemViewWindow_Click);
this.menuItemView.MenuItems.Add(menuItem);
menuItem.Index = menuItemViewIndex++;
listWindows.Add(key, new ListWindow());
listWindows[key].Text = key + " HL7 Result";
listWindows[key].List += new HHR.HL7.Search.ListWindow.ListEventHandler(m_listWindow_List);
listWindows[key].SearchPatientId += new HHR.HL7.Search.ListWindow.SearchPatientIdEventHandler(SearchPatientId);
listWindows[key].SearchVisitNumber += new HHR.HL7.Search.ListWindow.SearchVisitNumberEventHandler(SearchVisitNumber);
menuItem = new MenuItem();
menuItem.Text = key + " Result";
menuItem.Click += new EventHandler(menuItemViewWindow_Click);
this.menuItemView.MenuItems.Add(menuItem);
menuItem.Index = menuItemViewIndex++;
}
m_searchWindow = new SearchWindow(patientByIdQueries.Keys.ToList());
m_searchHL7ADTWindow = new SearchHL7ADTWindow(hl7Versions);
m_searchHL7MFNWindow = new SearchHL7MFNWindow(hl7Versions);
m_outputWindow = new OutputWindow();
m_exportHL7Form = new ExportHL7Form(hl7Versions);
dockPanel.AllowEndUserDocking = false;
m_deserializeDockContent = new DeserializeDockContent(GetContentFromPersistString);
//dockable panels settings
m_searchWindow.SearchByPatientName += new HHR.HL7.Search.SearchWindow.SearchByPatientNameEventHandler(m_searchWindow_SearchByPatientName);
m_searchWindow.SearchByPatientId += new HHR.HL7.Search.SearchWindow.SearchByPatientIdEventHandler(m_searchWindow_SearchByPatientId);
m_searchWindow.SearchByVisitNumbers += new HHR.HL7.Search.SearchWindow.SearchByVisitNumbersEventHandler(m_searchWindow_SearchByVisitNumbers);
m_searchWindow.SearchByDoctorNumbers += new HHR.HL7.Search.SearchWindow.SearchByDoctorNumbersEventHandler(m_searchWindow_SearchByDoctorNumbers);
m_searchWindow.SearchByWardIds += m_searchWindow_SearchByWardIds;
m_searchWindow.DalChecked += m_searchWindow_DalChecked;
m_searchHL7ADTWindow.Search += new HHR.HL7.Search.SearchHL7ADTWindow.SearchEventHandler(m_searchHL7ADTWindow_Search);
m_searchHL7MFNWindow.Search += new HHR.HL7.Search.SearchHL7MFNWindow.SearchEventHandler(m_searchHL7MFNWindow_Search);
}
示例9: RunCommand
//.........这里部分代码省略.........
if (args.Length > 2)
{
//Remove working dir from filename. This is to prevent filenames that are too
//long while there is room left when the workingdir was not in the path.
string fileName = args[2].Replace(Settings.WorkingDir, "").Replace('\\', '/');
GitUICommands.Instance.StartFileHistoryDialog(fileName);
}
else
MessageBox.Show("Cannot open file history, there is no file selected.", "File history");
return;
case "fileeditor":
if (args.Length > 2)
{
using (var formEditor = new FormEditor(args[2]))
{
if (formEditor.ShowDialog() == DialogResult.Cancel)
System.Environment.ExitCode = -1;
}
}
else
MessageBox.Show("Cannot open file editor, there is no file selected.", "File editor");
return;
case "formatpatch":
GitUICommands.Instance.StartFormatPatchDialog();
return;
case "pull":
Pull(arguments);
return;
case "push":
Push(arguments);
return;
case "settings":
GitUICommands.Instance.StartSettingsDialog();
return;
case "searchfile":
var searchWindow = new SearchWindow<string>(FindFileMatches);
Application.Run(searchWindow);
Console.WriteLine(Settings.WorkingDir + searchWindow.SelectedItem);
return;
case "viewdiff":
GitUICommands.Instance.StartCompareRevisionsDialog();
return;
case "rebase":
{
string branch = null;
if (arguments.ContainsKey("branch"))
branch = arguments["branch"];
GitUICommands.Instance.StartRebaseDialog(branch);
return;
}
case "merge":
{
string branch = null;
if (arguments.ContainsKey("branch"))
branch = arguments["branch"];
GitUICommands.Instance.StartMergeBranchDialog(branch);
return;
}
case "cherry":
GitUICommands.Instance.StartCherryPickDialog();
return;
case "revert":
Application.Run(new FormRevert(args[2]));
return;
case "tag":
GitUICommands.Instance.StartCreateTagDialog();
return;
case "about":
Application.Run(new AboutBox());
return;
case "stash":
GitUICommands.Instance.StartStashDialog();
return;
case "synchronize":
Commit(arguments);
Pull(arguments);
Push(arguments);
return;
case "openrepo":
if (args.Length > 2)
{
if (File.Exists(args[2]))
{
string path = File.ReadAllText(args[2]);
if (Directory.Exists(path))
{
Settings.WorkingDir = path;
}
}
}
GitUICommands.Instance.StartBrowseDialog();
return;
default:
Application.Run(new FormCommandlineHelp());
return;
}
}
}