-
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Made server log API list in markdown list format. * LoSetCommand file now external, iCommands searchable * All iCommands contained in file iCommands.txt which user can export, info in wiki * iCommands can be searched * Compile
- Loading branch information
Showing
12 changed files
with
257 additions
and
38 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,84 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Windows.Controls; | ||
using System.Windows.Controls.Primitives; | ||
using System.Windows.Input; | ||
using System.Windows.Media; | ||
using System.Windows.Media.Imaging; | ||
|
||
namespace DCSInsight.Misc | ||
{ | ||
internal static class TextBoxSearchCommon | ||
{ | ||
internal static void SetBackgroundSearchBanner(TextBox textBoxSearch) | ||
{ | ||
try | ||
{ | ||
//new Uri(@"/dcs-insight;component/Images/cue_banner_search.png", UriKind.Relative)), | ||
if (string.IsNullOrEmpty(textBoxSearch.Text)) | ||
{ | ||
// Create an ImageBrush. | ||
var textImageBrush = new ImageBrush | ||
{ | ||
ImageSource = new BitmapImage( | ||
new Uri("pack://application:,,,/dcs-insight;component/Images/cue_banner_search.png", UriKind.RelativeOrAbsolute)), | ||
AlignmentX = AlignmentX.Left, | ||
Stretch = Stretch.Uniform | ||
}; | ||
|
||
// Use the brush to paint the button's background. | ||
textBoxSearch.Background = textImageBrush; | ||
} | ||
else | ||
{ | ||
textBoxSearch.Background = null; | ||
} | ||
} | ||
catch (Exception ex) | ||
{ | ||
Common.ShowErrorMessageBox(ex); | ||
} | ||
} | ||
|
||
internal static void AdjustShownPopupData(TextBox textBoxSearch, Popup popupSearch, DataGrid dataGridValues, IEnumerable<LoSetCommand> loSetCommands) | ||
{ | ||
try | ||
{ | ||
popupSearch.PlacementTarget = textBoxSearch; | ||
popupSearch.Placement = PlacementMode.Bottom; | ||
dataGridValues.Tag = textBoxSearch; | ||
if (!popupSearch.IsOpen) | ||
{ | ||
popupSearch.IsOpen = true; | ||
} | ||
|
||
if (string.IsNullOrEmpty(textBoxSearch.Text)) | ||
{ | ||
dataGridValues.DataContext = loSetCommands; | ||
dataGridValues.ItemsSource = loSetCommands; | ||
dataGridValues.Items.Refresh(); | ||
return; | ||
} | ||
var subList = loSetCommands.Where(loSetCommand => (!string.IsNullOrWhiteSpace(loSetCommand.Description) && | ||
loSetCommand.Description.ToUpper().Contains(textBoxSearch.Text.ToUpper())) | ||
|| (!string.IsNullOrWhiteSpace(loSetCommand.Code) && loSetCommand.Code.ToUpper().Contains(textBoxSearch.Text.ToUpper()))); | ||
dataGridValues.DataContext = subList; | ||
dataGridValues.ItemsSource = subList; | ||
dataGridValues.Items.Refresh(); | ||
} | ||
catch (Exception ex) | ||
{ | ||
Common.ShowErrorMessageBox(ex, "AdjustShownPopupData()"); | ||
} | ||
} | ||
|
||
internal static void HandleFirstSpace(object sender, KeyEventArgs e) | ||
{ | ||
if (e.Key == Key.Space && ((TextBox)sender).Text == "") | ||
{ | ||
e.Handled = true; | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.