public ToolBarButtonVM(ICommand command, IInputElement commandTarget, string header, string toolTip, ImageReference? imageReference) { Command = command; CommandTarget = commandTarget; Header = string.IsNullOrEmpty(header) ? null : header; ToolTip = string.IsNullOrEmpty(toolTip) ? null : toolTip; ImageReference = imageReference ?? default(ImageReference); }
/// <summary> /// Parses a string and tries to create an <see cref="ImageReference"/> /// </summary> /// <param name="value">String to parse</param> /// <param name="result">Result</param> /// <returns></returns> public static bool TryParse(string value, out ImageReference result) { result = default(ImageReference); if (value == null) return false; if (value == string.Empty) return true; if (value.StartsWith("/", StringComparison.OrdinalIgnoreCase) || value.StartsWith("pack:", StringComparison.OrdinalIgnoreCase) || value.StartsWith("file:", StringComparison.OrdinalIgnoreCase)) { result = new ImageReference(null, value); return true; } int index = value.IndexOf(','); if (index < 0) { result = new ImageReference(null, value); return true; } var asmName = value.Substring(0, index).Trim(); var name = value.Substring(index + 1).Trim(); Assembly asm; try { asm = Assembly.Load(asmName); } catch { return false; } result = new ImageReference(asm, name); return true; }
public SearchTypeVM(SearchType searchType, string name, string toolTip, ImageReference imageReference, VisibleMembersFlags flags) { SearchType = searchType; Name = name; ToolTip = toolTip; Image = imageReference; Flags = flags; }
public MessageNode(ITreeNodeGroup treeNodeGroup, Guid guid, ImageReference imgRef, string msg) { this.treeNodeGroup = treeNodeGroup; this.guid = guid; this.imgRef = imgRef; this.msg = msg; }
public RoslynIntellisenseFilter(IImageMonikerService imageMonikerService, ImageReference imageReference, string toolTip, string accessKey, params string[] tags) : base(imageMonikerService.ToImageMoniker(imageReference), toolTip, accessKey, automationText: null, initialIsChecked: false, initialIsEnabled: true) { if (tags == null) throw new ArgumentNullException(nameof(tags)); if (tags.Length == 0) throw new ArgumentOutOfRangeException(nameof(tags)); Tags = tags; }
public FilterVM(IIntellisenseFilter filter, CompletionPresenter owner, ImageReference imageReference) { if (filter == null) throw new ArgumentNullException(nameof(filter)); if (owner == null) throw new ArgumentNullException(nameof(owner)); this.filter = filter; this.owner = owner; ImageReference = imageReference; }
public SearchTypeVM(IImageManager imageManager, SearchType searchType, string name, string toolTip, string imageName, VisibleMembersFlags flags) { this.imageManager = imageManager; this.searchType = searchType; this.name = name; this.toolTip = toolTip; this.imageReference = new ImageReference(GetType().Assembly, imageName); this.flags = flags; }
public MessageNodeImpl(ITreeNodeGroup treeNodeGroup, Guid guid, ImageReference imgRef, string msg) { TreeNodeGroup = treeNodeGroup; Guid = guid; this.imgRef = imgRef; Message = msg; }
/// <summary> /// Constructor /// </summary> /// <param name="imageReference">Image reference</param> /// <param name="zIndex">Z-index, eg. <see cref="HexMarkerServiceZIndexes.CurrentValue"/></param> public HexImageReferenceTag(ImageReference imageReference, int zIndex) { ImageReference = imageReference; ZIndex = zIndex; }
internal object GetIcon(ImageReference imgRef) { return imageManager.GetImage(imgRef.Assembly, imgRef.Name, BackgroundType.TreeNode); }
public BreakpointMarkerInfo(ImageReference? imageReference, string markerTypeName, string selectedMarkerTypeName, IClassificationType classificationType, int zIndex) { ImageReference = imageReference; MarkerTypeName = markerTypeName; SelectedMarkerTypeName = selectedMarkerTypeName; ClassificationType = classificationType; ZIndex = zIndex; }
void Add(SearchType searchType, string name, ImageReference icon, string toolTip, VisibleMembersFlags flags) => SearchTypeVMs.Add(new SearchTypeVM(searchType, name, toolTip, icon, flags));
public CompilerDiagnosticVM(CompilerDiagnostic diag, ImageReference imageReference) { Diagnostic = diag; ImageReference = imageReference; }
object CreateToggleButton(Binding binding, ICommand command, IInputElement commandTarget, string header, string toolTip, ImageReference imgRef) { var sp = new StackPanel(); sp.Orientation = Orientation.Horizontal; if (!imgRef.IsDefault) sp.Children.Add(new DsImage { ImageReference = imgRef }); if (!string.IsNullOrEmpty(header)) { sp.Children.Add(new TextBlock { Text = header, Margin = new Thickness(5, 0, 5, 0), }); } var checkBox = new CheckBox { Content = sp }; Debug.Assert(binding != null); if (binding != null) checkBox.SetBinding(ToggleButton.IsCheckedProperty, binding); if (!string.IsNullOrEmpty(toolTip)) checkBox.ToolTip = toolTip; checkBox.FocusVisualStyle = null; return checkBox; }
static void Add16x16Image(MenuItem menuItem, ImageReference imageReference, bool? enable = null) { var image = new DsImage { ImageReference = imageReference }; menuItem.Icon = image; if (enable == false) image.Opacity = 0.3; }
/// <summary> /// Constructor /// </summary> /// <param name="imageReference">Image reference (<see cref="IGlyphTextMarker.GlyphImageReference"/>)</param> /// <param name="zIndex">Z-index (<see cref="IGlyphTextMarker.ZIndex"/>)</param> public GlyphTextMarkerGlyphTag(ImageReference imageReference, int zIndex) { ImageReference = imageReference; ZIndex = zIndex; }
static bool ImageReference_Equals(ImageReference a, ImageReference b) => a.Assembly == b.Assembly && a.Name == b.Name;
object GetIcon(ImageReference imgRef) { bool b = imgRef.Assembly != null && imgRef.Name != null; Debug.Assert(b); if (!b) return null; return treeNodeImpl.TreeView.GetIcon(imgRef); }