Пример #1
0
        public static ImageSource GetIcon(TypeDefinition type)
        {
            TypeIcon          typeIcon    = GetTypeIcon(type);
            AccessOverlayIcon overlayIcon = GetOverlayIcon(type);

            return(Images.GetIcon(typeIcon, overlayIcon));
        }
Пример #2
0
 public static ImageSource GetIcon(TypeIcon icon, AccessOverlayIcon overlay)
 {
     lock (typeIconCache)
     {
         return(typeIconCache.GetIcon(icon, overlay, false));
     }
 }
Пример #3
0
        internal ImageSource GetOverlayedImage(TypeDefinition typeDef)
        {
            TypeIcon icon = TypeIcon.Class;

            if (typeDef.IsEnum)
            {
                icon = TypeIcon.Enum;
            }
            if (typeDef.IsValueType)
            {
                icon = TypeIcon.Struct;
            }
            if (typeDef.IsInterface)
            {
                icon = TypeIcon.Interface;
            }
            if (typeDef.BaseType.FullName == "System.MulticastDelegate" || typeDef.BaseType.FullName == "System.Delegate")
            {
                icon = TypeIcon.Delegate;
            }

            bool isStatic = false;
            AccessOverlayIcon overlayIcon = AccessOverlayIcon.Private;

            if (typeDef.IsNestedPrivate)
            {
                overlayIcon = AccessOverlayIcon.Public;
            }
            else if (typeDef.IsNestedAssembly || typeDef.IsNestedFamilyAndAssembly || typeDef.IsNotPublic)
            {
                overlayIcon = AccessOverlayIcon.Internal;
            }
            else if (typeDef.IsNestedFamily)
            {
                overlayIcon = AccessOverlayIcon.Protected;
            }
            else if (typeDef.IsNestedFamilyOrAssembly)
            {
                overlayIcon = AccessOverlayIcon.ProtectedInternal;
            }
            else if (typeDef.IsPublic || typeDef.IsNestedPublic)
            {
                overlayIcon = AccessOverlayIcon.Public;
            }

            if (typeDef.IsAbstract && typeDef.IsSealed)
            {
                isStatic = true;
            }

            return(Images.GetIcon(icon, overlayIcon, isStatic));
        }
Пример #4
0
        ImageSource GetTypeOverlayedImage(AttributedNode attrNode, TypeIcon icon)
        {
            switch (attrNode.Modifiers & Modifiers.VisibilityMask)
            {
            case Modifiers.Protected:
                return(Images.GetIcon(icon, AccessOverlayIcon.Protected));

            case Modifiers.Private:
                return(Images.GetIcon(icon, AccessOverlayIcon.Private));

            case Modifiers.Internal:
                return(Images.GetIcon(icon, AccessOverlayIcon.Internal));
            }

            return(Images.GetIcon(icon, AccessOverlayIcon.Public));
        }
Пример #5
0
        public static void setStatusGUI(TypeIcon typeIcon)
        {
            // return;
            try
            {
                String text      = "";
                Bitmap theBitmap = new Bitmap("RemoteDesktopIcon.ico");
                switch (typeIcon)
                {
                case TypeIcon.begin:
                    text      = "Waiting to become target of the master...";
                    theBitmap = new Bitmap("RemoteDesktopIcon.ico");
                    //_form_slave.notifyIcon1.Icon = new Icon("RemoteDesktopIcon.ico");
                    //_form_slave.Icon = new Icon("RemoteDesktopIcon.ico");
                    break;

                case TypeIcon.connectedFocus:
                    text      = "Connected - Focused";
                    theBitmap = new Bitmap("RemoteDesktopIconGreen.ico");
                    //_form_slave.notifyIcon1.Icon = new Icon("RemoteDesktopIconGreen.ico");
                    //_form_slave.Icon = new Icon("RemoteDesktopIconGreen.ico");
                    break;

                case TypeIcon.connectedInactive:
                    text      = "Connected - Inactive";
                    theBitmap = new Bitmap("RemoteDesktopIconOrange.ico");
                    //_form_slave.notifyIcon1.Icon = new Icon("RemoteDesktopIconOrange.ico");
                    //_form_slave.Icon = new Icon("RemoteDesktopIconOrange.ico");
                    break;
                }
                IntPtr Hicon   = theBitmap.GetHicon();// Get an Hicon for myBitmap.
                Icon   newIcon = Icon.FromHandle(Hicon);
                Form1.getForm().BeginInvoke((Action)(() =>
                {
                    _form_slave.label2.Text = text;
                    _form_slave.notifyIcon1.Icon = newIcon;
                    _form_slave.Icon = newIcon;
                }));
            }
            catch (Exception exp)
            {
                exp = exp;
            }
        }
Пример #6
0
        internal static ImageInfo GetImageInfo(TypeIcon typeIcon, BackgroundType bgType)
        {
            switch (typeIcon)
            {
            case TypeIcon.StaticClass:                              return(new ImageInfo("StaticClass", bgType));

            case TypeIcon.Class:                                    return(new ImageInfo("Class", bgType));

            case TypeIcon.ClassPrivate:                             return(new ImageInfo("ClassPrivate", bgType));

            case TypeIcon.ClassProtected:                   return(new ImageInfo("ClassProtected", bgType));

            case TypeIcon.ClassInternal:                    return(new ImageInfo("ClassInternal", bgType));

            case TypeIcon.ClassProtectedInternal:   return(new ImageInfo("ClassProtectedInternal", bgType));

            case TypeIcon.Enum:                                             return(new ImageInfo("Enum", bgType));

            case TypeIcon.EnumPrivate:                              return(new ImageInfo("EnumPrivate", bgType));

            case TypeIcon.EnumProtected:                    return(new ImageInfo("EnumProtected", bgType));

            case TypeIcon.EnumInternal:                             return(new ImageInfo("EnumInternal", bgType));

            case TypeIcon.EnumProtectedInternal:    return(new ImageInfo("EnumProtectedInternal", bgType));

            case TypeIcon.Struct:                                   return(new ImageInfo("Struct", bgType));

            case TypeIcon.StructPrivate:                    return(new ImageInfo("StructPrivate", bgType));

            case TypeIcon.StructProtected:                  return(new ImageInfo("StructProtected", bgType));

            case TypeIcon.StructInternal:                   return(new ImageInfo("StructInternal", bgType));

            case TypeIcon.StructProtectedInternal:  return(new ImageInfo("StructProtectedInternal", bgType));

            case TypeIcon.Interface:                                return(new ImageInfo("Interface", bgType));

            case TypeIcon.InterfacePrivate:                 return(new ImageInfo("InterfacePrivate", bgType));

            case TypeIcon.InterfaceProtected:               return(new ImageInfo("InterfaceProtected", bgType));

            case TypeIcon.InterfaceInternal:                return(new ImageInfo("InterfaceInternal", bgType));

            case TypeIcon.InterfaceProtectedInternal: return(new ImageInfo("InterfaceProtectedInternal", bgType));

            case TypeIcon.Delegate:                                 return(new ImageInfo("Delegate", bgType));

            case TypeIcon.DelegatePrivate:                  return(new ImageInfo("DelegatePrivate", bgType));

            case TypeIcon.DelegateProtected:                return(new ImageInfo("DelegateProtected", bgType));

            case TypeIcon.DelegateInternal:                 return(new ImageInfo("DelegateInternal", bgType));

            case TypeIcon.DelegateProtectedInternal: return(new ImageInfo("DelegateProtectedInternal", bgType));

            case TypeIcon.Exception:                                return(new ImageInfo("Exception", bgType));

            case TypeIcon.ExceptionPrivate:                 return(new ImageInfo("ExceptionPrivate", bgType));

            case TypeIcon.ExceptionProtected:               return(new ImageInfo("ExceptionProtected", bgType));

            case TypeIcon.ExceptionInternal:                return(new ImageInfo("ExceptionInternal", bgType));

            case TypeIcon.ExceptionProtectedInternal: return(new ImageInfo("ExceptionProtectedInternal", bgType));

            case TypeIcon.Generic:                                  return(new ImageInfo("Generic", bgType));

            case TypeIcon.GenericPrivate:                   return(new ImageInfo("GenericPrivate", bgType));

            case TypeIcon.GenericProtected:                 return(new ImageInfo("GenericProtected", bgType));

            case TypeIcon.GenericInternal:                  return(new ImageInfo("GenericInternal", bgType));

            case TypeIcon.GenericProtectedInternal: return(new ImageInfo("GenericProtectedInternal", bgType));

            default:
                Debug.Fail("Unknown type");
                goto case TypeIcon.Class;
            }
        }
Пример #7
0
 internal static ImageSource GetIcon(TypeIcon typeIcon, BackgroundType bgType)
 {
     return(ImageCache.Instance.GetImage(GetImageInfo(typeIcon, bgType)));
 }
Пример #8
0
 public static ImageSource GetIcon(TypeIcon icon, BackgroundType bgType)
 {
     return(TypeTreeNode.GetIcon(icon, bgType));
 }
Пример #9
0
		internal static ImageInfo GetImageInfo(TypeIcon typeIcon, BackgroundType bgType)
		{
			switch (typeIcon) {
			case TypeIcon.StaticClass:				return new ImageInfo("StaticClass", bgType);
			case TypeIcon.Class:					return new ImageInfo("Class", bgType);
			case TypeIcon.ClassPrivate:				return new ImageInfo("ClassPrivate", bgType);
			case TypeIcon.ClassProtected:			return new ImageInfo("ClassProtected", bgType);
			case TypeIcon.ClassInternal:			return new ImageInfo("ClassInternal", bgType);
			case TypeIcon.ClassProtectedInternal:	return new ImageInfo("ClassProtectedInternal", bgType);
			case TypeIcon.Enum:						return new ImageInfo("Enum", bgType);
			case TypeIcon.EnumPrivate:				return new ImageInfo("EnumPrivate", bgType);
			case TypeIcon.EnumProtected:			return new ImageInfo("EnumProtected", bgType);
			case TypeIcon.EnumInternal:				return new ImageInfo("EnumInternal", bgType);
			case TypeIcon.EnumProtectedInternal:	return new ImageInfo("EnumProtectedInternal", bgType);
			case TypeIcon.Struct:					return new ImageInfo("Struct", bgType);
			case TypeIcon.StructPrivate:			return new ImageInfo("StructPrivate", bgType);
			case TypeIcon.StructProtected:			return new ImageInfo("StructProtected", bgType);
			case TypeIcon.StructInternal:			return new ImageInfo("StructInternal", bgType);
			case TypeIcon.StructProtectedInternal:	return new ImageInfo("StructProtectedInternal", bgType);
			case TypeIcon.Interface:				return new ImageInfo("Interface", bgType);
			case TypeIcon.InterfacePrivate:			return new ImageInfo("InterfacePrivate", bgType);
			case TypeIcon.InterfaceProtected:		return new ImageInfo("InterfaceProtected", bgType);
			case TypeIcon.InterfaceInternal:		return new ImageInfo("InterfaceInternal", bgType);
			case TypeIcon.InterfaceProtectedInternal:return new ImageInfo("InterfaceProtectedInternal", bgType);
			case TypeIcon.Delegate:					return new ImageInfo("Delegate", bgType);
			case TypeIcon.DelegatePrivate:			return new ImageInfo("DelegatePrivate", bgType);
			case TypeIcon.DelegateProtected:		return new ImageInfo("DelegateProtected", bgType);
			case TypeIcon.DelegateInternal:			return new ImageInfo("DelegateInternal", bgType);
			case TypeIcon.DelegateProtectedInternal:return new ImageInfo("DelegateProtectedInternal", bgType);
			case TypeIcon.Exception:				return new ImageInfo("Exception", bgType);
			case TypeIcon.ExceptionPrivate:			return new ImageInfo("ExceptionPrivate", bgType);
			case TypeIcon.ExceptionProtected:		return new ImageInfo("ExceptionProtected", bgType);
			case TypeIcon.ExceptionInternal:		return new ImageInfo("ExceptionInternal", bgType);
			case TypeIcon.ExceptionProtectedInternal:return new ImageInfo("ExceptionProtectedInternal", bgType);
			case TypeIcon.Generic:					return new ImageInfo("Generic", bgType);
			case TypeIcon.GenericPrivate:			return new ImageInfo("GenericPrivate", bgType);
			case TypeIcon.GenericProtected:			return new ImageInfo("GenericProtected", bgType);
			case TypeIcon.GenericInternal:			return new ImageInfo("GenericInternal", bgType);
			case TypeIcon.GenericProtectedInternal:	return new ImageInfo("GenericProtectedInternal", bgType);
			default:
				Debug.Fail("Unknown type");
				goto case TypeIcon.Class;
			}
		}
Пример #10
0
		internal static ImageSource GetIcon(TypeIcon typeIcon, BackgroundType bgType)
		{
			return ImageCache.Instance.GetImage(GetImageInfo(typeIcon, bgType));
		}
Пример #11
0
 public static ImageSource GetIcon(TypeIcon icon, AccessOverlayIcon overlay, bool isStatic = false)
 {
     lock (typeIconCache)
         return(typeIconCache.GetIcon(icon, overlay, isStatic));
 }
Пример #12
0
		ImageSource GetTypeOverlayedImage(AttributedNode attrNode, TypeIcon icon)
		{
			switch (attrNode.Modifiers & Modifiers.VisibilityMask) {
				case Modifiers.Protected:
					return Images.GetIcon(icon, AccessOverlayIcon.Protected);
				case Modifiers.Private:
					return Images.GetIcon(icon, AccessOverlayIcon.Private);
				case Modifiers.Internal:
					return Images.GetIcon(icon, AccessOverlayIcon.Internal);
			}
			
			return Images.GetIcon(icon, AccessOverlayIcon.Public);
		}
Пример #13
0
 public static ImageSource GetIcon(TypeIcon icon, BackgroundType bgType)
 {
     return TreeNodes.TypeTreeNode.GetIcon(icon, bgType);
 }
Пример #14
0
 /// <summary>
 /// Umwandlung in eine CSS-Klasse
 /// </summary>
 /// <param name="icon">Das Icon, welches umgewandelt werden soll</param>
 /// <returns>Die zum Icon gehörende CSS-KLasse</returns>
 public static string ToClass(this TypeIcon icon)
 {
     return(icon switch
     {
         TypeIcon.AlignCenter => "fas fa-align-center",
         TypeIcon.AlignJustify => "fas fa-align-justify",
         TypeIcon.AlignLeft => "fas fa-align-left",
         TypeIcon.AlignRight => "fas fa-align-right",
         TypeIcon.At => "fas fa-at",
         TypeIcon.Bars => "fas fa-bars",
         TypeIcon.Bold => "fas fa-bold",
         TypeIcon.Bolt => "fas fa-bolt",
         TypeIcon.Bomb => "fas fa-bomb",
         TypeIcon.Book => "fas fa-book",
         TypeIcon.Bug => "fas fa-bug",
         TypeIcon.Building => "fas fa-building",
         TypeIcon.Calendar => "fas fa-calendar",
         TypeIcon.CalendarMinus => "fas fa-calendar-minus",
         TypeIcon.CalendarPlus => "fas fa-calendar-plus",
         TypeIcon.Car => "fas fa-car",
         TypeIcon.ChartBar => "fas fa-chart-bar",
         TypeIcon.City => "fas fa-city",
         TypeIcon.Clock => "fas fa-clock",
         TypeIcon.Clone => "fas fa-clone",
         TypeIcon.Code => "fas fa-code",
         TypeIcon.Cog => "fas fa-cog",
         TypeIcon.Copy => "fas fa-copy",
         TypeIcon.Comment => "fas fa-comment",
         TypeIcon.CommentAlt => "fas fa-comment-alt",
         TypeIcon.Cubes => "fas fa-cubes",
         TypeIcon.Door => "fas fa-door-closed",
         TypeIcon.DoorOpen => "fas fa-door-open",
         TypeIcon.Download => "fas fa-upload",
         TypeIcon.Edit => "fas fa-edit",
         TypeIcon.EuroSign => "fas fa-euro-sign",
         TypeIcon.ExclamationTriangle => "fas fa-exclamation-triangle",
         TypeIcon.Fire => "fas fa-fire",
         TypeIcon.Folder => "fas fa-folder",
         TypeIcon.FolderOpen => "fas fa-folder-open",
         TypeIcon.Font => "fas fa-font",
         TypeIcon.Forward => "fas fa-forward",
         TypeIcon.GraduationCap => "fas fa-graduation-cap",
         TypeIcon.Hashtag => "fas fa-hashtag",
         TypeIcon.Hdd => "fas fa-hdd",
         TypeIcon.Home => "fas fa-home",
         TypeIcon.InfoCircle => "fas fa-info-circle",
         TypeIcon.Image => "fas fa-image",
         TypeIcon.Industry => "fas fa-industry",
         TypeIcon.Info => "fas fa-info",
         TypeIcon.Key => "fas fa-key",
         TypeIcon.LayerGroup => "fas fa-layer-group",
         TypeIcon.Lightbulb => "fas fa-lightbulb",
         TypeIcon.Link => "fas fa-link",
         TypeIcon.Map => "fas fa-map",
         TypeIcon.MapMarker => "fas fa-map-marker",
         TypeIcon.Microchip => "fas fa-microchip",
         TypeIcon.PaperPlane => "fas fa-paper-plane",
         TypeIcon.PlayCircle => "fas fa-play-circle",
         TypeIcon.Plus => "fas fa-plus",
         TypeIcon.PowerOff => "fas fa-power-off",
         TypeIcon.Print => "fas fa-print",
         TypeIcon.Road => "fas fa-road",
         TypeIcon.Save => "fas fa-save",
         TypeIcon.ShoppingBag => "fas fa-shopping-bag",
         TypeIcon.Star => "fas fa-star",
         TypeIcon.StopCircle => "fas fa-stop-circle",
         TypeIcon.Stopwatch => "fas fa-stopwatch",
         TypeIcon.Sun => "fas fa-sun",
         TypeIcon.TachometerAlt => "fas fa-tachometer-alt",
         TypeIcon.Tag => "fas fa-tag",
         TypeIcon.Tags => "fas fa-tags",
         TypeIcon.ThermometerQuarter => "fas fa-thermometer-quarter",
         TypeIcon.Times => "fas fa-times",
         TypeIcon.Trash => "fas fa-trash",
         TypeIcon.TrashAlt => "fas fa-trash-alt",
         TypeIcon.Truck => "fas fa-truck",
         TypeIcon.ThumbsUp => "fas fa-thumbs-up",
         TypeIcon.Undo => "fas fa-undo",
         TypeIcon.Upload => "fas fa-download",
         TypeIcon.Users => "fas fa-users",
         _ => string.Empty,
     });
Пример #15
0
        public Alerts(string LabelTitle, string LabelSubTitle, string LabelText, byte QuantityButtons = 3, string Button1 = "", string Button2 = "", string Button3 = "OK", TypeIcon Option = TypeIcon.Info)
        {
            InitializeComponent();
            ArrayButton             = new Button[] { ButtonYes, ButtonNo, ButtonCancel };
            this.QuantityButtons    = QuantityButtons;
            this.LabelTitle.Text    = LabelTitle;
            this.LabelSubTitle.Text = LabelSubTitle;
            this.LabelText.Text     = LabelText;
            ButtonYes.Text          = Button1.Trim();
            ButtonNo.Text           = Button2.Trim();
            ButtonCancel.Text       = Button3.Trim();
            switch (Option)
            {
            case TypeIcon.Info:
            default:
            {
                PictureBoxIcon.Image = Resources.InformationWhite;
                break;
            }

            case TypeIcon.Warning:
            {
                PictureBoxIcon.Image = Resources.WarningWhite;
                break;
            }

            case TypeIcon.Danger:
            {
                PictureBoxIcon.Image = Resources.BugWhite;
                break;
            }
            }
            switch (QuantityButtons)
            {
            case 1:
            {
                ButtonYes.Hide();
                ButtonNo.Hide();
                ButtonCancel.Show();
                ButtonCancel.DialogResult = DialogResult.OK;
                break;
            }

            case 2:
            {
                ButtonYes.Hide();
                ButtonNo.Show();
                ButtonNo.DialogResult = DialogResult.Yes;
                ButtonCancel.Show();
                ButtonCancel.DialogResult = DialogResult.No;
                break;
            }

            case 3:
            default:
            {
                ButtonYes.Show();
                ButtonYes.DialogResult = DialogResult.Yes;
                ButtonNo.Show();
                ButtonNo.DialogResult = DialogResult.No;
                ButtonCancel.Show();
                ButtonCancel.DialogResult = DialogResult.Cancel;
            }
            break;
            }
        } //Clave de Método: Alerts-C
Пример #16
0
 /// <summary>
 /// Konstruktor
 /// </summary>
 /// <param name="icon">Das System-Icon</param>
 public PropertyIcon(TypeIcon icon)
 {
     SystemIcon = icon;
 }