void ShowFileMaskUI() { if (labelFileMask != null) { return; } uint row; if (checkbuttonRecursively != null) { row = TableGetRowForItem(tableFindAndReplace, checkbuttonRecursively) + 1; } else { row = TableGetRowForItem(tableFindAndReplace, labelScope) + 1; } labelFileMask = new Label { LabelProp = GettextCatalog.GetString("_File Mask:"), UseUnderline = true, Xalign = 0f }; labelFileMask.Show(); searchentryFileMask = new SearchEntry() { ForceFilterButtonVisible = false, IsCheckMenu = true, ActiveFilterID = 0, Visible = true, Ready = true, }; var checkMenuItem = searchentryFileMask.AddFilterOption(0, GettextCatalog.GetString("Include binary files")); checkMenuItem.DrawAsRadio = false; checkMenuItem.Active = properties.Get("IncludeBinaryFiles", false); checkMenuItem.Toggled += delegate { properties.Set("IncludeBinaryFiles", checkMenuItem.Active); }; var checkMenuItem1 = searchentryFileMask.AddFilterOption(1, GettextCatalog.GetString("Include hidden files and directories")); checkMenuItem1.DrawAsRadio = false; checkMenuItem1.Active = properties.Get("IncludeHiddenFiles", false); checkMenuItem1.Toggled += delegate { properties.Set("IncludeHiddenFiles", checkMenuItem1.Active); }; searchentryFileMask.Query = properties.Get("MonoDevelop.FindReplaceDialogs.FileMask", ""); searchentryFileMask.Entry.ActivatesDefault = true; searchentryFileMask.Show(); TableAddRow(tableFindAndReplace, row, labelFileMask, searchentryFileMask); }
public override void Initialize() { searchEntry = new SearchEntry(); searchEntry.ForceFilterButtonVisible = true; searchEntry.RoundedShape = true; searchEntry.HasFrame = true; ((WidgetBackend)this).Widget = searchEntry; searchEntry.Show(); }
public async Task <bool> HandleControlKeys(KeyEventArgs context) { switch (context.Key) { case Key.Enter when SelectedFoundItem == null: return(true); case Key.Enter when SelectedFoundItem is SlashCommand slashCommand: await RunSlashCommand(slashCommand); return(true); case Key.Enter: var process = new Process { StartInfo = new ProcessStartInfo { Arguments = SelectedFoundItem.Arguments, FileName = SelectedFoundItem.Path } }; if (!string.IsNullOrWhiteSpace(SelectedFoundItem.WorkingDirectory)) { process.StartInfo.WorkingDirectory = SelectedFoundItem.WorkingDirectory; } ClearSearchAndHide(); process.Start(); return(true); case Key.Down: SelectedFoundItem = FoundItems[Math.Min( FoundItems.Count - 1, Array.IndexOf(FoundItems.ToArray(), SelectedFoundItem) + 1 )]; return(true); case Key.Up: SelectedFoundItem = FoundItems[Math.Max( 0, Array.IndexOf(FoundItems.ToArray(), SelectedFoundItem) - 1 )]; return(true); case Key.Escape: ClearSearchAndHide(); return(true); case Key.PageUp: var windowManager = new WindowManager(); windowManager.ShowDialog(new ScratchpadViewModel()); return(true); default: return(false); } }
/// <summary> /// Gets most prior search entry /// </summary> public static AnimalAsset GetAnimalAsset(string search) { SearchEntry entry = SearchAnimalAssets(search).OrderByDescending(d => d.Priority).FirstOrDefault(); if (entry == null || entry.Priority <= 0) { return(null); } return((AnimalAsset)entry.Asset); }
public SearchEntryTests() { _searchEntry = new SearchEntry() { Id = 1, DateAdded = new DateTime(2016, 1, 1), ObjectState = ObjectState.Unchanged, SearchPhrase = "panty", UserId = "a" }; }
public void Given_User_Name_And_Tweet_Id_Correct_Tweet_Status_Url_Returned() { var entry = new SearchEntry { FromUser = "******", ID = 123 }; var helper = new TwitterSearchEntryHelper(entry); var statusUrl = helper.GetStatusUrl(); Assert.That(statusUrl, Is.EqualTo("https://twitter.com/user/status/123")); }
public void Given_User_Name_Correct_User_Url_Returned() { var entry = new SearchEntry { FromUser = "******", ID = 123 }; var helper = new TwitterSearchEntryHelper(entry); var userUrl = helper.GetUserUrl(); Assert.That(userUrl, Is.EqualTo("https://twitter.com/user")); }
protected override void OnRemoved(Widget widget) { if (widget == filterEntry) { filterEntry = null; } else { base.OnRemoved(widget); } }
public void Given_Tweet_Status_Contains_Hashtag_It_Is_Returned() { var entry = new SearchEntry { Text = "This is #test tweet" }; var helper = new TwitterSearchEntryHelper(entry); var hashtags = helper.GetHashtags(); Assert.That(hashtags.Length, Is.EqualTo(1)); Assert.That(hashtags[0], Is.EqualTo("test")); }
private void MenuItem_OnClicked(object sender, EventArgs e) { if (!_entryVisible) { _entryVisible = true; SearchEntry.Focus(); } else { _entryVisible = false; } }
private async void GetIMG(SearchEntry Ent, string URL) { using (WebClient Web = new WebClient()) { using (MemoryStream MemS = new MemoryStream(Web.DownloadData(URL))) { await Task.Delay(1); Ent.pbArtwork.Image = Image.FromStream(MemS); } } }
/// <inheritdoc/> protected override SearchEntry ExtractSearchEntry(HtmlNode searchEntryElement, List <HtmlNode> searchEntryElements) { HtmlNode citeElement = searchEntryElement.SelectSingleNode($"descendant::cite"); var searchEntry = new SearchEntry(); searchEntry.CreatedAt = DateTime.Now; searchEntry.LastUpdatedAt = DateTime.Now; searchEntry.RankCheckRequestId = RankCheckRequest.Id; searchEntry.RankCheckRequest = RankCheckRequest; searchEntry.Rank = searchEntryElements.IndexOf(searchEntryElement) + 1; searchEntry.Url = citeElement.InnerText; return(searchEntry); }
public CombinedBox() { filterEntry = new SearchEntry(); filterEntry.WidthRequest = 180; filterEntry.Ready = true; filterEntry.ForceFilterButtonVisible = true; filterEntry.Entry.CanFocus = true; filterEntry.EmptyMessage = GettextCatalog.GetString("Search (Control+F)"); filterEntry.RoundedShape = true; filterEntry.HasFrame = true; filterEntry.Parent = this; filterEntry.Show(); }
void HideFileMaskUI() { if (labelFileMask == null) { return; } properties.Set("MonoDevelop.FindReplaceDialogs.FileMask", searchentryFileMask.Query); uint row = TableGetRowForItem(tableFindAndReplace, labelFileMask); TableRemoveRow(tableFindAndReplace, row, labelFileMask, searchentryFileMask, true); searchentryFileMask = null; labelFileMask = null; }
private void searchEntry_FilterChanged(object sender, EventArgs args) { SearchEntry entry = (SearchEntry)sender; int selectedId = entry.ActiveFilterID; if (selectedId == 0) { entry.EmptyMessage = "Search for files"; } else { string network = entry.GetLabelForFilterID(selectedId); entry.EmptyMessage = String.Format("Search '{0}' for files", network); } }
public CombinedBox() { filterEntry = new SearchEntry(); filterEntry.WidthRequest = 180; filterEntry.Ready = true; filterEntry.ForceFilterButtonVisible = true; filterEntry.Entry.CanFocus = true; filterEntry.RoundedShape = true; filterEntry.HasFrame = true; filterEntry.Parent = this; filterEntry.Show(); SearchKeyShortcut = new KeyboardShortcut( Gdk.Key.f, Platform.IsMac? Gdk.ModifierType.MetaMask : Gdk.ModifierType.ControlMask ); }
public void Given_Tweet_Status_Correct_Status_Html_Returned() { var content = "This is #demo tweet to check http://twitter.com /cc @user"; var entry = new SearchEntry { Text = content }; var helper = new TwitterSearchEntryHelper(entry); var status = helper.GetStatusHtml(); var html = "This is <a href=\"https://search.twitter.com/search?q=%23demo\" target=\"_blank\">#demo</a> " + "tweet to check <a href=\"http://twitter.com\" target=\"_blank\">http://twitter.com</a> " + "/cc <a href=\"https://twitter.com/user\" target=\"_blank\">@user</a>"; Assert.That(status, Is.EqualTo(html)); }
public SearchEntryDto AddSearchEntry(SearchEntryDto searchEntryDto) { var searchEntry = new SearchEntry(); searchEntry.FromDto(searchEntryDto); _searchEntryRepository.Insert(searchEntry); var task = _searchEntryRepository.SaveChangesAsync(); task.Wait(); searchEntryDto.DateAdded = searchEntry.DateAdded; searchEntryDto.Id = searchEntry.Id; return(searchEntryDto); }
public async void CopyItem(SearchEntry eventArgs) { if (eventArgs is SlashCommand slashCommand) { var toClipboard = slashCommand.CurrentResult; if (slashCommand.ProcessResultForClipboard != null) { toClipboard = slashCommand.ProcessResultForClipboard(toClipboard); } Clipboard.SetText(toClipboard); } else { Clipboard.SetText(eventArgs.Path); } }
public void SearchEntryTests_IDtoConvertable_Implements() { SearchEntryDto dto = _searchEntry.ToDto(); Assert.Equal(dto.Id, _searchEntry.Id); Assert.Equal(dto.SearchPhrase, _searchEntry.SearchPhrase); Assert.Equal(dto.UserId, _searchEntry.UserId); SearchEntry entry = new SearchEntry(); entry.FromDto(dto); Assert.Equal(dto.SearchPhrase, entry.SearchPhrase); Assert.Equal(dto.UserId, entry.UserId); Assert.Equal(dto.Id, _searchEntry.Id); }
public SearchQueryPage() { this.InitializeComponent(); QueryList = new ObservableCollection <SearchQuery>(); if (SearchModel == null) { SearchModel = new SearchEntry() { StartDate = DateTime.Now.AddMonths(-1), EndDate = DateTime.Today.AddDays(1).AddSeconds(-1), TotalCount = 0, PageIndex = 0, PageSize = 20, } } ; pagingControl.searchModel = SearchModel; }
void ShowFileMaskUI() { if (labelFileMask != null) { return; } uint row; if (checkbuttonRecursively != null) { row = TableGetRowForItem(tableFindAndReplace, checkbuttonRecursively) + 1; } else { row = TableGetRowForItem(tableFindAndReplace, labelScope) + 1; } labelFileMask = new Label { LabelProp = GettextCatalog.GetString("_File Mask:"), UseUnderline = true, Xalign = 0f }; labelFileMask.Show(); searchentryFileMask = new SearchEntry() { ForceFilterButtonVisible = false, IsCheckMenu = true, ActiveFilterID = 0, Visible = true, Ready = true, }; searchentryFileMask.Query = properties.Get("MonoDevelop.FindReplaceDialogs.FileMask", ""); searchentryFileMask.Entry.ActivatesDefault = true; searchentryFileMask.Show(); SetupAccessibilityForSearch(); TableAddRow(tableFindAndReplace, row, labelFileMask, searchentryFileMask); }
protected override void Initialize(IPadWindow window) { var toolbar = window.GetToolbar(DockPositionType.Top); startButton = new Button(new ImageView(Ide.Gui.Stock.RunProgramIcon, IconSize.Menu)); startButton.Clicked += OnStartButtonClicked; startButton.TooltipText = GettextCatalog.GetString("Enable build logging"); toolbar.Add(startButton); stopButton = new Button(new ImageView(Ide.Gui.Stock.Stop, IconSize.Menu)); stopButton.Clicked += OnStopButtonClicked; stopButton.TooltipText = GettextCatalog.GetString("Stop build logging"); stopButton.Sensitive = false; toolbar.Add(stopButton); clearButton = new Button(new ImageView(Ide.Gui.Stock.Broom, IconSize.Menu)); clearButton.Clicked += OnClearButtonClicked; clearButton.TooltipText = GettextCatalog.GetString("Clear"); toolbar.Add(clearButton); string[] buildTypeItems = buildTypes .Select(buildType => GetDisplayText(buildType)) .ToArray(); buildTypeFilterComboBox = new ComboBox(buildTypeItems); buildTypeFilterComboBox.Active = 0; buildTypeFilterComboBox.Changed += BuildTypeFilterComboBoxChanged; toolbar.Add(buildTypeFilterComboBox); var spacer = new HBox(); toolbar.Add(spacer, true); searchEntry = new SearchEntry(); searchEntry.WidthRequest = 200; searchEntry.Visible = true; searchEntry.Entry.Changed += SearchEntryChanged; toolbar.Add(searchEntry); toolbar.ShowAll(); ProjectSystemService.MSBuildTargetStarted += MSBuildTargetStarted; ProjectSystemService.MSBuildTargetFinished += MSBuildTargetFinished; }
public BaseDialog(PlaylistSource queue, string title, string addType) : base(title) { this.queue = queue; VBox.Spacing = 6; HBox filter_box = new HBox(); filter_box.Spacing = 6; Label search_label = new Label("_Search:"); filter_box.PackStart(search_label, false, false, 0); search_entry = new MuinsheeSearchEntry(); search_entry.Show(); search_entry.Changed += OnFilterChanged; search_entry.Ready = true; OnFilterChanged(null, null); filter_box.PackStart(search_entry, true, true, 0); VBox.PackStart(filter_box, false, false, 0); Hyena.Widgets.ScrolledWindow sw = new Hyena.Widgets.ScrolledWindow(); sw.Add(GetItemWidget()); VBox.PackStart(sw, true, true, 0); AddDefaultCloseButton(); Button queue_button = new ImageButton(Catalog.GetString("En_queue"), "gtk-add"); AddActionWidget(queue_button, Gtk.ResponseType.Apply); Button play_button = new ImageButton(Catalog.GetString("_Play"), "media-playback-start"); AddButton(play_button, Gtk.ResponseType.Ok, true); window_controller = new PersistentWindowController(this, String.Format("muinshee.{0}", addType), 500, 475, WindowPersistOptions.Size); window_controller.Restore(); ShowAll(); Response += OnResponse; }
public MainWindow() : base(GetWindowTitle()) { var box = new VBox(); Add(box); searchEntry = new SearchEntry(); searchEntry.Changed += OnSearch; box.PackStart(searchEntry, expand: false, fill: true, padding: 0); clipboardItemListView = new ClipboardItemListView(); clipboardItemListView.ItemsActivatedEvent += OnItemsActivated; box.PackStart(clipboardItemListView, expand: true, fill: true, padding: 0); LoadGeometry(); LoadSettings(); ShowAll(); DeleteEvent += OnDeleteEvent; }
private void QueryMatch(Dictionary <string, SearchEntry> entries, string query, string match, int relevance = 0) { var sw = Engine.FindSwitch(match); if (sw != null) { if (!entries.ContainsKey(match)) { var entry = new SearchEntry { Item = sw }; entries.Add(match, entry); entry.AddRelevance(relevance); } else { entries[match].AddRelevance(10); } } }
public MainWindow() : base(Gtk.WindowType.Toplevel) { Build(); // // Color changes // ModifyBg(StateType.Normal, new Gdk.Color(38, 31, 31)); label1.ModifyFg(StateType.Normal, new Gdk.Color(237, 227, 227)); DatabaseEntry.ModifyBase(StateType.Normal, new Gdk.Color(89, 82, 82)); DatabaseEntry.ModifyText(StateType.Normal, new Gdk.Color(237, 227, 227)); label2.ModifyFg(StateType.Normal, new Gdk.Color(237, 227, 227)); UserNameEntry.ModifyBase(StateType.Normal, new Gdk.Color(89, 82, 82)); UserNameEntry.ModifyText(StateType.Normal, new Gdk.Color(237, 227, 227)); label3.ModifyFg(StateType.Normal, new Gdk.Color(237, 227, 227)); PasswordEntry.ModifyBase(StateType.Normal, new Gdk.Color(89, 82, 82)); PasswordEntry.ModifyText(StateType.Normal, new Gdk.Color(237, 227, 227)); label4.ModifyFg(StateType.Normal, new Gdk.Color(237, 227, 227)); combobox1.ModifyBase(StateType.Normal, new Gdk.Color(89, 82, 82)); label5.ModifyFg(StateType.Normal, new Gdk.Color(237, 227, 227)); SearchEntry.ModifyBase(StateType.Normal, new Gdk.Color(155, 149, 149)); }
/// <summary> /// Invoked when search button is clicked. /// </summary> /// <param name="sender">The Sender</param> /// <param name="e">Event Args</param> private void SearchButton_Clicked(object sender, EventArgs e) { this.SearchBox.IsVisible = true; this.ProfileView.IsVisible = false; if (this.TitleBar != null) { double opacity; // Animating Width of the search box, from 0 to full width when it added to the view. var expandAnimation = new Animation(property => { SearchBox.WidthRequest = property; opacity = property / TitleBar.Width; SearchBox.Opacity = opacity; }, 0, TitleBar.Width, Easing.Linear); expandAnimation.Commit(SearchBox, "Expand", 16, 250, Easing.Linear); } SearchEntry.Focus(); }
private int AddFilesFromDir(string dirname) { int count = 0; foreach (string file in Directory.GetFiles(dirname)) { SearchEntry entry = new SearchEntry(); entry.fullPath = file; entry.key = file.ToLower(); entry.filename = Path.GetFileName(file); m_solutionFiles.Add(entry); count++; } foreach (string dir in Directory.GetDirectories(dirname)) { count += AddFilesFromDir(dir); } return(count); }
private int AddFilesFromDir(string dirname) { int count = 0; foreach(string file in Directory.GetFiles(dirname)) { SearchEntry entry = new SearchEntry(); entry.fullPath = file; entry.key = file.ToLower(); entry.filename = Path.GetFileName(file); m_solutionFiles.Add(entry); count++; } foreach(string dir in Directory.GetDirectories(dirname)) { count += AddFilesFromDir(dir); } return count; }
private void InitializeComponent() { _verticalBox = new VerticalBox { AllowPadding = true }; this.Child = _verticalBox; _horizontalBox = new HorizontalBox { AllowPadding = true }; _verticalBox.Children.Add(_horizontalBox); _button = new Button("Button"); _horizontalBox.Children.Add(_button); _checkBox = new CheckBox("CheckBox"); _horizontalBox.Children.Add(_checkBox); _label = new Label("This is a label. Right now, labels can only span one line."); _verticalBox.Children.Add(_label); _horizontalSeparator = new Separator(); _verticalBox.Children.Add(_horizontalSeparator); _group = new Group("Entries") { AllowMargins = true }; _verticalBox.Children.Add(_group, true); _form = new Form { AllowPadding = true }; _group.Child = _form; _entry = new Entry(); _form.Children.Add("Entry", _entry); _passwordEntry = new PasswordEntry(); _form.Children.Add("Password Entry", _passwordEntry); _searchEntry = new SearchEntry(); _form.Children.Add("Search Entry", _searchEntry); _multilineEntry = new MultilineEntry(); _form.Children.Add("Multiline Entry", _multilineEntry, true); _multilineNoWrappingEntry = new MultilineEntry(false); _form.Children.Add("Multiline Entry No Wrap", _multilineNoWrappingEntry, true); }
public CubanoHeader() : base(0.0f, 0.0f, 1.0f, 0.0f) { var action_service = ServiceManager.Get<InterfaceActionService> (); var table = new Table (2, 3, false) { ColumnSpacing = 20, RowSpacing = 8 }; table.Attach (new Alignment (0.0f, 0.0f, 0.0f, 0.0f) { (SourceBackButton = new ActionLabel () { Text = "\u2190", CurrentFontSizeEm = 2.0, DefaultFontSizeEm = 2.0, FontFamily = "DejaVu Sans" }) }, 0, 1, 0, 1, AttachOptions.Shrink, AttachOptions.Shrink | AttachOptions.Shrink, 0, 0); table.Attach (new Alignment (0.0f, 0.0f, 1.0f, 0.0f) { (SearchEntry = new SearchEntry ()) }, 1, 2, 0, 1, AttachOptions.Expand | AttachOptions.Fill, AttachOptions.Expand, 0, 0); var action_box = new HBox (); var align = new Alignment (0.0f, 0.0f, 0.0f, 0.0f) { action_box }; table.Attach (align, 2, 3, 0, 1, AttachOptions.Shrink, AttachOptions.Fill | AttachOptions.Expand, 0, 0); var import = new ActionLabel () { Text = Banshee.I18n.Catalog.GetString ("banshee-1", "Import") }; import.Activated += (o, e) => action_service.GlobalActions["ImportAction"].Activate (); action_box.PackStart (import, false, false, 0); action_box.PackStart (new ActionLabel () { Text = "|", CanActivate = false }, false, false, 6); var preferences = new ActionLabel () { Text = Banshee.I18n.Catalog.GetString ("banshee-1", "Preferences") }; preferences.Activated += (o, e) => action_service.GlobalActions["PreferencesAction"].Activate (); action_box.PackStart (preferences, false, false, 0); var close = new ActionLabel () { Text = " \u2715", CurrentFontSizeEm = 1.2 }; close.Activated += (o, e) => action_service.GlobalActions["QuitAction"].Activate (); action_box.PackStart (close, false, false, 0); // Second row Toolbar = (Toolbar)action_service.UIManager.GetWidget ("/HeaderToolbar"); Toolbar.ShowArrow = false; Toolbar.ToolbarStyle = ToolbarStyle.BothHoriz; Toolbar.IconSize = IconSize.Menu; // Hide all default toolbar items, we only want the Banshee toolbar // for sources that install action items there... ultimately sucky var children = Toolbar.Children; for (int i = 0; i < children.Length; i++) { children[i].Visible = false; } var box = new HBox (); box.PackStart (new CategorySourceView (), false, false, 0); box.PackEnd (Toolbar, false, false, 0); table.Attach (box, 0, 3, 1, 2, AttachOptions.Expand | AttachOptions.Fill, AttachOptions.Shrink, 0, 0); Add (table); ShowAll (); }
private void AddProjectItems(ProjectItems projectItems) { // HACK: Horrible! But how will we know what not to include in the list? // CPP: {6BB5F8EE-4483-11D3-8BCF-00C04F8EC28C} // H: {6BB5F8EE-4483-11D3-8BCF-00C04F8EC28C} // Folder:{6BB5F8F0-4483-11D3-8BCF-00C04F8EC28C} // // "{5F422961-1EE4-47EB-A53B-777B4164F8DF}" <-- it's a folder ? if(null == projectItems) return; foreach(ProjectItem item in projectItems) { if("{6BB5F8EE-4483-11D3-8BCF-00C04F8EC28C}" == item.Kind) { // Indices starts at 1 ... http://msdn.microsoft.com/en-us/library/envdte.projectitem.filenames.aspx for(short i = 0; i < item.FileCount; i++) { string name = item.get_FileNames((short)i); SearchEntry entry = new SearchEntry(); entry.fullPath = name; entry.key = name.ToLower(); entry.filename = Path.GetFileName(entry.key); m_solutionFiles.Add(entry); } } AddProjectItems(item.ProjectItems); if(item.SubProject != null) { AddProjectItems(item.SubProject.ProjectItems); } } }
protected override Series[] GetSeriesFromSearch(string searchPageHtml) { var searchResult = new SearchEntry[0]; using (var stream = new MemoryStream(Encoding.Unicode.GetBytes(searchPageHtml))) { var serializer = new DataContractJsonSerializer(typeof(SearchEntry[])); searchResult = (SearchEntry[])serializer.ReadObject(stream); } var uriFormatString = "manga/{0}"; var output = searchResult.Select(d => new Series(this, new Uri(RootUri, string.Format(uriFormatString, d.Permalink)), d.MangaName) { Updated = SeriesUpdatedValue }).ToArray(); return output; }
private static void Match( string match, Type[] types, ArrayList results ) { if ( match.Length == 0 ) return; match = match.ToLower(); for ( int i = 0; i < types.Length; ++i ) { Type t = types[i]; if ( (typeofMobile.IsAssignableFrom( t ) || typeofItem.IsAssignableFrom( t )) && t.Name.ToLower().IndexOf( match ) >= 0 && !results.Contains( t ) ) { ConstructorInfo[] ctors = t.GetConstructors(); for ( int j = 0; j < ctors.Length; ++j ) { if ( /*ctors[j].GetParameters().Length == 0 && */ ctors[j].IsDefined( typeof( ConstructableAttribute ), false ) ) { SearchEntry s = new SearchEntry(); s.EntryType = t; s.Parameters = ctors[j].GetParameters(); //results.Add( t ); results.Add( s ); //break; } } } } }