예제 #1
0
		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);
		}
예제 #2
0
		/// <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;
		}
예제 #3
0
		public SearchTypeVM(SearchType searchType, string name, string toolTip, ImageReference imageReference, VisibleMembersFlags flags) {
			SearchType = searchType;
			Name = name;
			ToolTip = toolTip;
			Image = imageReference;
			Flags = flags;
		}
예제 #4
0
 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;
		}
예제 #6
0
		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;
		}
예제 #7
0
 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;
 }
예제 #8
0
		public MessageNodeImpl(ITreeNodeGroup treeNodeGroup, Guid guid, ImageReference imgRef, string msg) {
			TreeNodeGroup = treeNodeGroup;
			Guid = guid;
			this.imgRef = imgRef;
			Message = msg;
		}
예제 #9
0
		/// <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;
		}
예제 #10
0
 internal object GetIcon(ImageReference imgRef)
 {
     return imageManager.GetImage(imgRef.Assembly, imgRef.Name, BackgroundType.TreeNode);
 }
예제 #11
0
			public BreakpointMarkerInfo(ImageReference? imageReference, string markerTypeName, string selectedMarkerTypeName, IClassificationType classificationType, int zIndex) {
				ImageReference = imageReference;
				MarkerTypeName = markerTypeName;
				SelectedMarkerTypeName = selectedMarkerTypeName;
				ClassificationType = classificationType;
				ZIndex = zIndex;
			}
예제 #12
0
		void Add(SearchType searchType, string name, ImageReference icon, string toolTip, VisibleMembersFlags flags) =>
			SearchTypeVMs.Add(new SearchTypeVM(searchType, name, toolTip, icon, flags));
예제 #13
0
		public CompilerDiagnosticVM(CompilerDiagnostic diag, ImageReference imageReference) {
			Diagnostic = diag;
			ImageReference = imageReference;
		}
예제 #14
0
		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;
		}
예제 #15
0
		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;
		}
예제 #16
0
		/// <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;
		}
예제 #17
0
		static bool ImageReference_Equals(ImageReference a, ImageReference b) => a.Assembly == b.Assembly && a.Name == b.Name;
예제 #18
0
 object GetIcon(ImageReference imgRef)
 {
     bool b = imgRef.Assembly != null && imgRef.Name != null;
     Debug.Assert(b);
     if (!b)
         return null;
     return treeNodeImpl.TreeView.GetIcon(imgRef);
 }