예제 #1
0
 public static Image GetIcon(IVirtualItem item, Size size, IconStyle style)
 {
     IVirtualItemUI mui = item as IVirtualItemUI;
     if (mui != null)
     {
         if ((mui.Highlighter != null) && (mui.Highlighter.IconType == HighlighterIconType.HighlighterIcon))
         {
             return mui.Highlighter.GetIcon(size);
         }
         return mui.GetIcon(size, style);
     }
     return null;
 }
예제 #2
0
        public void TestCloneIcon()
        {
            // This is an oddball case because there are two Kml <icon>'s
            var link  = new IconStyle.IconLink(new Uri("link", UriKind.Relative));
            var clone = link.Clone();

            Assert.That(clone.Href, Is.EqualTo(link.Href));
            Assert.That(link.Parent, Is.Null);
            Assert.That(clone.Parent, Is.Null);

            IconStyle iconStyle = new IconStyle();

            iconStyle.Icon = link;
            clone          = iconStyle.Icon.Clone();
            Assert.That(clone.Href, Is.EqualTo(iconStyle.Icon.Href));

            Icon icon = new Icon();

            icon.Id = "icon";
            var iconClone = icon.Clone();

            Assert.That(iconClone.Id, Is.EqualTo(icon.Id));
        }
        private string Write205_IconStyle(IconStyle v)
        {
            switch (v)
            {
                case IconStyle.DefaultIcon:
                    return "DefaultIcon";

                case IconStyle.CanUseDelayedExtract:
                    return "CanUseDelayedExtract";

                case IconStyle.CanUseAlphaBlending:
                    return "CanUseAlphaBlending";
            }
            return XmlSerializationWriter.FromEnum((long) v, new string[] { "DefaultIcon", "CanUseDelayedExtract", "CanUseAlphaBlending" }, new long[] { 1L, 2L, 4L }, "Nomad.FileSystem.Virtual.IconStyle");
        }
예제 #4
0
 public static Image GetIcon(IconStyle style, string name)
 {
     // TODO: Handle possible exceptions
     // TODO: Cache loaded icons
     return(Image.FromFile($"./resources/icons/{style.ToString ().ToLowerInvariant ()}/{name}{GetIconExtension ()}"));
 }
예제 #5
0
 public abstract string GetStyleName(IconStyle iconStyle);
        public static Func <ExportContext, SharpKml.Dom.Style> CreateFromSharpmapStyle(IStyle sharpmapStyle)
        {
            if (sharpmapStyle == null)
            {
                throw new ArgumentNullException("sharpmapStyle");
            }

            var vectorStyle = sharpmapStyle as VectorStyle;

            if (vectorStyle == null)
            {
                return(null);
            }

            SharpKml.Dom.Style style = null;

            var install = new Action <ExportContext>(context =>
            {
                style = new SharpKml.Dom.Style
                {
                    Id = sharpmapStyle.GetHashCode().ToString(CultureInfo.InvariantCulture)
                };

                if (vectorStyle.Line != null)
                {
                    var lineStyle = new LineStyle();
                    style.Line    = lineStyle;

                    var color           = vectorStyle.Line.Color;
                    lineStyle.Color     = new Color32(color.A, color.B, color.G, color.R);
                    lineStyle.ColorMode = ColorMode.Normal;
                    lineStyle.Width     = vectorStyle.Line.Width;
                }

                var solidColor = ConvertToColor32(vectorStyle.Fill);
                if (solidColor != null)
                {
                    var polygonStyle = new PolygonStyle();
                    style.Polygon    = polygonStyle;

                    polygonStyle.Fill  = true;
                    polygonStyle.Color = solidColor;
                }

                if (vectorStyle.Symbol == null)
                {
                    if (vectorStyle.PointSize > 0)
                    {
                        var iconStyle = new IconStyle();

                        var pointColor = vectorStyle.PointColor != null
                            ? ConvertToColor32(vectorStyle.PointColor) ?? new Color32(255, 0, 0, 0)
                            : new Color32(255, 0, 0, 0);

                        iconStyle.Color     = pointColor;
                        iconStyle.ColorMode = ColorMode.Normal;
                        iconStyle.Icon      = new IconStyle.IconLink(Pushpins.ShadedDot);
                        iconStyle.Scale     = vectorStyle.PointSize / 6;

                        style.Icon = iconStyle;
                    }
                }
                else
                {
                    var additionalFile = SaveImagetoDisk(vectorStyle.Symbol);
                    Debug.Assert(additionalFile != null, "additionalFile != null");

                    context.AdditionalFiles.Add(additionalFile);

                    var iconStyle = new IconStyle
                    {
                        Icon  = new IconStyle.IconLink(new Uri(context.IsKmz ? Path.GetFileName(additionalFile) : additionalFile, UriKind.Relative)),
                        Scale = vectorStyle.SymbolScale
                    };

                    style.Icon = iconStyle;
                }
            });

            EventHandler endedHandler = delegate { style = null; };

            return(context =>
            {
                if (style == null && sharpmapStyle.Enabled)
                {
                    install(context);

                    context.Exporter.Ended -= endedHandler;
                    context.Exporter.Ended += endedHandler;
                }

                return style;
            });
        }
예제 #7
0
        public MinimapIcon(GameObject trackedObject, GameObject uiElement, GameObject uiPointer, IconStyle style)
        {
            rotation    = true;
            this.style  = style;
            obj         = trackedObject.transform;
            uiRect      = uiElement.GetComponent <RectTransform>();
            pointerRect = uiPointer.GetComponent <RectTransform>();
            CatchDestroy component = obj.GetComponent <CatchDestroy>();

            if (component == null)
            {
                obj.gameObject.AddComponent <CatchDestroy>().target = uiElement;
            }
            else if (component.target != null && component.target != uiElement)
            {
                UnityEngine.Object.Destroy(component.target);
            }
            else
            {
                component.target = uiElement;
            }
        }
예제 #8
0
        public static MinimapIcon CreateWithRotation(RectTransform parent, GameObject trackedObject, IconStyle style, float pointerDist)
        {
            UnityEngine.Sprite spriteForStyle = GetSpriteForStyle(style);
            GameObject         gameObject     = new GameObject("MinimapIcon");
            RectTransform      rectTransform  = gameObject.AddComponent <RectTransform>();
            Vector2            vector3        = rectTransform.anchorMin = (rectTransform.anchorMax = new Vector3(0.5f, 0.5f));

            rectTransform.sizeDelta = new Vector2(spriteForStyle.texture.width, spriteForStyle.texture.height);
            Image image = gameObject.AddComponent <Image>();

            image.sprite = spriteForStyle;
            image.type   = Image.Type.Simple;
            gameObject.transform.SetParent(parent, worldPositionStays: false);
            GameObject    gameObject2    = new GameObject("IconPointer");
            RectTransform rectTransform2 = gameObject2.AddComponent <RectTransform>();

            vector3 = (rectTransform2.anchorMin = (rectTransform2.anchorMax = rectTransform.anchorMin));
            rectTransform2.sizeDelta = new Vector2(pointerSprite.texture.width, pointerSprite.texture.height);
            Image image2 = gameObject2.AddComponent <Image>();

            image2.sprite = pointerSprite;
            image2.type   = Image.Type.Simple;
            gameObject2.transform.SetParent(rectTransform, worldPositionStays: false);
            rectTransform2.anchoredPosition = new Vector2(0f, pointerDist);
            return(new MinimapIcon(trackedObject, gameObject, gameObject2, style));
        }
예제 #9
0
        public static int ShowWTSMessageBox(int sessionId, string text, string caption, IconStyle style)
        {
            switch (style)
            {
            case IconStyle.Information:
                return(SafeWTSApi.WTSSendMessageInformation(sessionId, text, caption));

            case IconStyle.Warining:
                return(SafeWTSApi.WTSSendMessageWarning(sessionId, text, caption));

            case IconStyle.Error:
            default:
                return(0);
            }
        }
예제 #10
0
    public void TrackGameObjectOnMinimap(GameObject objToTrack, Color iconColor, bool trackOrientation, bool depthAboveAll = false, IconStyle iconStyle = 0)
    {
        if (minimap != null)
        {
            MinimapIcon icon;
            if (trackOrientation)
            {
                icon = MinimapIcon.CreateWithRotation(minimap, objToTrack, iconStyle, MINIMAP_POINTER_DIST);
            }
            else
            {
                icon = MinimapIcon.Create(minimap, objToTrack, iconStyle);
            }

            icon.SetColor(iconColor);
            icon.SetDepth(depthAboveAll);
            var sizeForStyle = GetSizeForStyle(iconStyle);
            if (maximized)
            {
                icon.SetSize(sizeForStyle);
                if (icon.rotation)
                {
                    icon.SetPointerSize(MINIMAP_POINTER_SIZE, MINIMAP_POINTER_DIST);
                }
            }
            else
            {
                var num = 1f - (MINIMAP_SIZE - MINIMAP_CORNER_SIZE) / MINIMAP_SIZE;
                sizeForStyle.x = Mathf.Max(sizeForStyle.x * num, sizeForStyle.x * 0.5f);
                sizeForStyle.y = Mathf.Max(sizeForStyle.y * num, sizeForStyle.y * 0.5f);
                icon.SetSize(sizeForStyle);
                if (icon.rotation)
                {
                    var a = MINIMAP_POINTER_SIZE * num;
                    a = Mathf.Max(a, MINIMAP_POINTER_SIZE * 0.5f);
                    var originDistance = (MINIMAP_POINTER_SIZE - a) / MINIMAP_POINTER_SIZE;
                    originDistance = MINIMAP_POINTER_DIST * originDistance;
                    icon.SetPointerSize(a, originDistance);
                }
            }

            if (minimapIcons == null)
            {
                minimapIcons = new[] { icon };
            }
            else
            {
                var iconArray2 = new MinimapIcon[minimapIcons.Length + 1];
                for (var i = 0; i < minimapIcons.Length; i++)
                {
                    iconArray2[i] = minimapIcons[i];
                }

                iconArray2[iconArray2.Length - 1] = icon;
                minimapIcons = iconArray2;
            }
        }
    }
예제 #11
0
        public override string GetIconName(IconName iconName, IconStyle iconStyle)
        {
            names.TryGetValue(iconName, out var name);

            return(name);
        }
예제 #12
0
        private void InitializeIcons(IconStyle iconStyle)
        {
            InitIconIndex();
            // Load icon bitmaps
            switch (iconStyle)
            {
            case IconStyle.Lines:
                if (m_bAeroSupport)
                {
                    m_iconNet      = Properties.Resources._01_Net___Aero;
                    m_iconNetDown  = Properties.Resources._01_NetDown___Aero;
                    m_iconReceived = new Icon[] {
                        Properties.Resources._01_NetIn0___Aero,
                        Properties.Resources._01_NetIn1___Aero,
                        Properties.Resources._01_NetIn2___Aero,
                        Properties.Resources._01_NetIn3___Aero,
                        Properties.Resources._01_NetIn4___Aero
                    };
                    m_iconSent = new Icon[] {
                        Properties.Resources._01_NetOut0___Aero,
                        Properties.Resources._01_NetOut1___Aero,
                        Properties.Resources._01_NetOut2___Aero,
                        Properties.Resources._01_NetOut3___Aero,
                        Properties.Resources._01_NetOut4___Aero
                    };
                    m_iconSentReceived = new Icon[] {
                        Properties.Resources._01_NetInOut0___Aero,
                        Properties.Resources._01_NetInOut1___Aero,
                        Properties.Resources._01_NetInOut2___Aero,
                        Properties.Resources._01_NetInOut3___Aero,
                        Properties.Resources._01_NetInOut4___Aero
                    };
                }
                else     // Not Aero
                {
                    m_iconNet      = Properties.Resources._01_Net;
                    m_iconNetDown  = Properties.Resources._01_NetDown;
                    m_iconReceived = new Icon[] {
                        Properties.Resources._01_NetIn0,
                        Properties.Resources._01_NetIn1,
                        Properties.Resources._01_NetIn2,
                        Properties.Resources._01_NetIn3,
                        Properties.Resources._01_NetIn4
                    };
                    m_iconSent = new Icon[] {
                        Properties.Resources._01_NetOut0,
                        Properties.Resources._01_NetOut1,
                        Properties.Resources._01_NetOut2,
                        Properties.Resources._01_NetOut3,
                        Properties.Resources._01_NetOut4
                    };
                    m_iconSentReceived = new Icon[] {
                        Properties.Resources._01_NetInOut0,
                        Properties.Resources._01_NetInOut1,
                        Properties.Resources._01_NetInOut2,
                        Properties.Resources._01_NetInOut3,
                        Properties.Resources._01_NetInOut4
                    };
                }
                break;

            case IconStyle.Grow:
                if (m_bAeroSupport)
                {
                    m_iconNet      = Properties.Resources._02_Net___Aero;
                    m_iconNetDown  = Properties.Resources._02_NetDown___Aero;
                    m_iconReceived = new Icon[] {
                        Properties.Resources._02_NetIn0___Aero,
                        Properties.Resources._02_NetIn1___Aero,
                        Properties.Resources._02_NetIn2___Aero,
                        Properties.Resources._02_NetIn3___Aero,
                        Properties.Resources._02_NetIn4___Aero
                    };
                    m_iconSent = new Icon[] {
                        Properties.Resources._02_NetOut0___Aero,
                        Properties.Resources._02_NetOut1___Aero,
                        Properties.Resources._02_NetOut2___Aero,
                        Properties.Resources._02_NetOut3___Aero,
                        Properties.Resources._02_NetOut4___Aero
                    };
                    m_iconSentReceived = new Icon[] {
                        Properties.Resources._02_NetInOut0___Aero,
                        Properties.Resources._02_NetInOut1___Aero,
                        Properties.Resources._02_NetInOut2___Aero,
                        Properties.Resources._02_NetInOut3___Aero,
                        Properties.Resources._02_NetInOut4___Aero
                    };
                }
                else     // Not Aero
                {
                    m_iconNet      = Properties.Resources._02_Net;
                    m_iconNetDown  = Properties.Resources._02_NetDown;
                    m_iconReceived = new Icon[] {
                        Properties.Resources._02_NetIn0,
                        Properties.Resources._02_NetIn1,
                        Properties.Resources._02_NetIn2,
                        Properties.Resources._02_NetIn3,
                        Properties.Resources._02_NetIn4
                    };
                    m_iconSent = new Icon[] {
                        Properties.Resources._02_NetOut0,
                        Properties.Resources._02_NetOut1,
                        Properties.Resources._02_NetOut2,
                        Properties.Resources._02_NetOut3,
                        Properties.Resources._02_NetOut4
                    };
                    m_iconSentReceived = new Icon[] {
                        Properties.Resources._02_NetInOut0,
                        Properties.Resources._02_NetInOut1,
                        Properties.Resources._02_NetInOut2,
                        Properties.Resources._02_NetInOut3,
                        Properties.Resources._02_NetInOut4
                    };
                }
                break;

            default:
                break;
            }
        }
예제 #13
0
 public NetIconImage(IconStyle iconStyle)
 {
     m_bAeroSupport = AeroSupport.IsAero();
     InitializeIcons(iconStyle);
 }
 public OverwritePromtDialog()
 {
     this.InitializeComponent();
     base.LocalizeForm();
     this.btnOverwrite.Tag = OverwriteDialogResult.Overwrite;
     this.btnAppend.Tag = OverwriteDialogResult.Append;
     this.btnResume.Tag = OverwriteDialogResult.Resume;
     this.btnSkip.Tag = OverwriteDialogResult.Skip;
     this.btnRename.Tag = OverwriteDialogResult.Rename;
     ResourceManager manager = new SettingsManager.LocalizedResourceManager(typeof(OverwritePromtDialog));
     this.AlreadyExistsFormat = manager.GetString("lblAlreadyExists.Text");
     this.ItemLastWriteTimeFormat = manager.GetString("lblSourceLastWriteTime.Text");
     this.ItemSizeFormat = manager.GetString("lblSourceSize.Text");
     if (CopySettings.Default.ShowThumbnailInOverwriteDialog)
     {
         base.SuspendLayout();
         this.tlpBack.SuspendLayout();
         this.imgSourceIcon.Scalable = false;
         this.imgSourceIcon.Size = CopySettings.Default.ThumbnailSize;
         this.imgSourceIcon.Paint += new PaintEventHandler(this.imgSourceIcon_Paint);
         this.imgDestIcon.Scalable = false;
         this.imgDestIcon.Size = CopySettings.Default.ThumbnailSize;
         this.imgDestIcon.Paint += new PaintEventHandler(this.imgSourceIcon_Paint);
         this.btnOverwrite.Width = Math.Max(this.btnOverwrite.Width, 90);
         this.btnAppend.Width = Math.Max(this.btnAppend.Width, 90);
         this.btnSkip.Width = Math.Max(this.btnSkip.Width, 90);
         this.btnCancel.Width = Math.Max(this.btnCancel.Width, 90);
         this.tlpBack.ResumeLayout();
         base.ResumeLayout();
         this.DefaultIconStyle = IconStyle.DefaultIcon;
         base.Shown += new EventHandler(this.ShowThumnails);
     }
 }
예제 #15
0
        public static int ShowDlgMsg(string Msg, IconStyle IcStyle, string[] Buttons, string Title, int DefButton)
        {
            MsgBoxVN objMsg = new MsgBoxVN();

            // Title
            objMsg.Text = Title;

            // Icon
            PictureBox pic = new PictureBox();
            pic.Parent = objMsg;
            pic.Left = 10;
            pic.Top = 10;
            pic.SizeMode = PictureBoxSizeMode.AutoSize;
            try
            {
                pic.Image = objMsg.imgList.Images[(int)IcStyle];
            }
            catch
            {
                pic.Image = null;
                pic.Visible = false;
            }

            // Msg
            Label lblMsg = new Label();
            lblMsg.Parent = objMsg;
            lblMsg.AutoSize = true;
            lblMsg.Top = 10;
            lblMsg.Left = (pic.Image == null) ? 20 : pic.Left + pic.Width + 15;
            lblMsg.Text = Msg;

            // Xac dinh cac nut lenh
            int iMax = 0;
            objMsg.Btns = new Button[Buttons.Length];

            for (int i = 0; i < objMsg.Btns.Length; i++)
            {
                objMsg.Btns[i] = new Button();
                objMsg.Btns[i].Name = i.ToString();
                objMsg.Btns[i].Parent = objMsg;
                objMsg.Btns[i].AutoSize = true;
                objMsg.Btns[i].Text = Buttons[i];
                objMsg.Btns[i].BackColor = SystemColors.Control;
                objMsg.Btns[i].UseVisualStyleBackColor = true;
                objMsg.Btns[i].Visible = true;
                if (iMax < objMsg.Btns[i].Width) { iMax = objMsg.Btns[i].Width; }
                objMsg.Btns[i].Click += new System.EventHandler(objMsg.btn_Click);
            }

            if (iMax < 77) iMax = 77;

            foreach (Button objBtn in objMsg.Btns)
            {
                objBtn.Width = iMax;
                objBtn.Height = objBtn.Height + 4;
                objBtn.Top =lblMsg.Top + (((pic.Image == null) || (lblMsg.Height>pic.Height)) ? lblMsg.Height : pic.Height) + 20;
            }

            int WMsg = lblMsg.Left + lblMsg.Width + 20;
            int WBtns = objMsg.Btns.Length * iMax + 15 * (objMsg.Btns.Length - 1) + 4 * 15;

            objMsg.Width = WMsg > WBtns ? WMsg : WBtns;
            objMsg.Height = objMsg.Btns[0].Top + objMsg.Btns[0].Height + (Title == "" ? 15:40);

            // Canh lai cac nut
            objMsg.Btns[0].Left = (objMsg.ClientSize.Width - WBtns + 4 * 15) / 2;
            for (int i = 1; i < objMsg.Btns.Length; i++)
            {
                objMsg.Btns[i].Left = objMsg.Btns[i - 1].Left + iMax + 15;
            }

            objMsg.yLine = objMsg.Btns[0].Top - 10;
            objMsg.xLine = 10;
            objMsg.DefButton = DefButton;

            objMsg.ShowDialog();

            return objMsg.iBtn;
        }
예제 #16
0
 public static void TrackGameObjectOnMinimap(GameObject objToTrack, Color iconColor, bool trackOrientation, bool depthAboveAll = false, IconStyle iconStyle = IconStyle.Circle)
 {
     if (instance != null)
     {
         instance.TrackGameObject(objToTrack, iconColor, trackOrientation, depthAboveAll, iconStyle);
     }
 }
예제 #17
0
        public static MinimapIcon Create(RectTransform parent, GameObject trackedObject, IconStyle style)
        {
            var spriteForStyle = GetSpriteForStyle(style);
            var uiElement      = new GameObject("MinimapIcon");
            var transform      = uiElement.AddComponent <RectTransform>();

            transform.anchorMin = transform.anchorMax = new Vector3(0.5f, 0.5f);
            transform.sizeDelta = new Vector2(spriteForStyle.texture.width, spriteForStyle.texture.height);
            var image = uiElement.AddComponent <Image>();

            image.sprite = spriteForStyle;
            image.type   = Image.Type.Simple;
            uiElement.transform.SetParent(parent, false);
            return(new MinimapIcon(trackedObject, uiElement, style));
        }
예제 #18
0
        public static MinimapIcon Create(RectTransform parent, GameObject trackedObject, IconStyle style)
        {
            UnityEngine.Sprite spriteForStyle = GetSpriteForStyle(style);
            GameObject         gameObject     = new GameObject("MinimapIcon");
            RectTransform      rectTransform  = gameObject.AddComponent <RectTransform>();
            Vector2            vector3        = rectTransform.anchorMin = (rectTransform.anchorMax = new Vector3(0.5f, 0.5f));

            rectTransform.sizeDelta = new Vector2(spriteForStyle.texture.width, spriteForStyle.texture.height);
            Image image = gameObject.AddComponent <Image>();

            image.sprite = spriteForStyle;
            image.type   = Image.Type.Simple;
            gameObject.transform.SetParent(parent, worldPositionStays: false);
            return(new MinimapIcon(trackedObject, gameObject, style));
        }
예제 #19
0
        public static MinimapIcon CreateWithRotation(RectTransform parent, GameObject trackedObject, IconStyle style, float pointerDist)
        {
            var spriteForStyle = GetSpriteForStyle(style);
            var uiElement      = new GameObject("MinimapIcon");
            var transform      = uiElement.AddComponent <RectTransform>();

            transform.anchorMin = transform.anchorMax = new Vector3(0.5f, 0.5f);
            transform.sizeDelta = new Vector2(spriteForStyle.texture.width, spriteForStyle.texture.height);
            var image = uiElement.AddComponent <Image>();

            image.sprite = spriteForStyle;
            image.type   = Image.Type.Simple;
            uiElement.transform.SetParent(parent, false);
            var uiPointer  = new GameObject("IconPointer");
            var transform2 = uiPointer.AddComponent <RectTransform>();

            transform2.anchorMin = transform2.anchorMax = transform.anchorMin;
            transform2.sizeDelta = new Vector2(pointerSprite.texture.width, pointerSprite.texture.height);
            var image2 = uiPointer.AddComponent <Image>();

            image2.sprite = pointerSprite;
            image2.type   = Image.Type.Simple;
            uiPointer.transform.SetParent(transform, false);
            transform2.anchoredPosition = new Vector2(0f, pointerDist);
            return(new MinimapIcon(trackedObject, uiElement, uiPointer, style));
        }
예제 #20
0
    public void TrackGameObjectOnMinimap(GameObject objToTrack, Color iconColor, bool trackOrientation, bool depthAboveAll = false, IconStyle iconStyle = IconStyle.CIRCLE)
    {
        if (!(minimap != null))
        {
            return;
        }
        MinimapIcon minimapIcon = (!trackOrientation) ? MinimapIcon.Create(minimap, objToTrack, iconStyle) : MinimapIcon.CreateWithRotation(minimap, objToTrack, iconStyle, MINIMAP_POINTER_DIST);

        minimapIcon.SetColor(iconColor);
        minimapIcon.SetDepth(depthAboveAll);
        Vector2 sizeForStyle = GetSizeForStyle(iconStyle);

        if (maximized)
        {
            minimapIcon.SetSize(sizeForStyle);
            if (minimapIcon.rotation)
            {
                minimapIcon.SetPointerSize(MINIMAP_POINTER_SIZE, MINIMAP_POINTER_DIST);
            }
        }
        else
        {
            float num = 1f - ((float)MINIMAP_SIZE - MINIMAP_CORNER_SIZE) / (float)MINIMAP_SIZE;
            sizeForStyle.x = Mathf.Max(sizeForStyle.x * num, sizeForStyle.x * 0.5f);
            sizeForStyle.y = Mathf.Max(sizeForStyle.y * num, sizeForStyle.y * 0.5f);
            minimapIcon.SetSize(sizeForStyle);
            if (minimapIcon.rotation)
            {
                float a = MINIMAP_POINTER_SIZE * num;
                a = Mathf.Max(a, MINIMAP_POINTER_SIZE * 0.5f);
                float num2 = (MINIMAP_POINTER_SIZE - a) / MINIMAP_POINTER_SIZE;
                num2 = MINIMAP_POINTER_DIST * num2;
                minimapIcon.SetPointerSize(a, num2);
            }
        }
        if (minimapIcons == null)
        {
            minimapIcons = new MinimapIcon[1]
            {
                minimapIcon
            };
            return;
        }
        MinimapIcon[] array = new MinimapIcon[minimapIcons.Length + 1];
        for (int i = 0; i < minimapIcons.Length; i++)
        {
            array[i] = minimapIcons[i];
        }
        array[array.Length - 1] = minimapIcon;
        minimapIcons            = array;
    }
예제 #21
0
 public KmlStyle(string id, string href)
 {
     ID        = id;
     iconStyle = new IconStyle(href);
 }
 public FontAwesomeAttribute(IconStyle iconStyle, string name)
 {
     IconStyle = iconStyle;
     Name      = name;
 }
예제 #23
0
 private void GetUserConfig()
 {
     IconStyle = _coreInvoker.UserSettings.IconStyle;
 }
예제 #24
0
        public static void WriteEmpyFolderEntry(string name, bool visibility, XmlTextWriter tw)
        {
            tw.WriteStartElement("Folder");
            tw.WriteElementString("name", name);
            if (!visibility)
                tw.WriteElementString("visibility", "0");
            LabelStyle lab = new LabelStyle("00000000", ColorMode.normal, 0.0);
            IconStyle ic = new IconStyle("00000000", ColorMode.normal, 0.0, new Icon(null, RefreshMode.once, 3600, 0, 0, 0, 0));
            List<ASubStyle> styles = new List<ASubStyle>();
            styles.Add(lab);
            styles.Add(ic);
            Style s = new Style(null, styles);

            tw.WriteStartElement("Placemark");
            tw.WriteElementString("name", "");
            tw.WriteElementString("Snippet", "");
            s.WriteTo(tw);
            new Point(AltitudeMode.clampToGround, 0.0, 0.0, 0.0).WriteTo(tw);

            tw.WriteEndElement();//Placemark
            tw.WriteEndElement();//Folder
        }
예제 #25
0
 public static int ShowDlgMsg(string Msg, IconStyle IcStyle, string[] Buttons, int DefButton)
 {
     return ShowDlgMsg(Msg, IcStyle, Buttons, Application.ProductName, DefButton);
 }
예제 #26
0
        public NotificationForm(string message = "", int duration = 10000, IconStyle style = IconStyle.Notification)
        {
            this.Size = new System.Drawing.Size(400, 70);

            this.FormBorderStyle = FormBorderStyle.None;
            this.Font            = new System.Drawing.Font("Calibri", 13, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel);
            this.BackColor       = System.Drawing.Color.FromArgb(42, 42, 42);
            this.ForeColor       = System.Drawing.Color.White;
            //Positionnement
            Rectangle workingArea = Screen.PrimaryScreen.WorkingArea;

            this.ClientSize = this.Size;
            int left = workingArea.Width - this.Width - _lastX;
            int top  = workingArea.Height - _lastY;

            _openedFormPosition.Add(this);
            _lastY += this.Height + MARGIN_TOP;
            if (_lastY >= (workingArea.Height - this.Height))
            {
                _lastY  = 0;
                _lastX += this.Width + MARGIN_TOP;
            }
            if (_lastX + this.Width >= workingArea.Width)
            {
                _lastX = 0;
            }
            this.StartPosition = FormStartPosition.Manual;
            this.Location      = new Point(left, top);
            this.ShowInTaskbar = false;
            this.ShowIcon      = false;
            this.MinimizeBox   = false;
            this.MaximizeBox   = false;
            this.Text          = "Notification";
            this.TopMost       = true;
            this.Shown        += new EventHandler(this.frm_Shown);

            //Left panel
            _leftPanel                       = new Panel();
            _leftPanel.Size                  = new Size(70, 70);
            _leftPanel.BackColor             = Color.Transparent;
            _leftPanel.Dock                  = DockStyle.Left;
            _leftPanel.BackgroundImageLayout = ImageLayout.Stretch;
            _leftPanel.BackgroundImage       = getIconImage(style);
            this.Controls.Add(_leftPanel);

            #region Right Panel
            //Right Panel
            _rightPanel           = new Panel();
            _rightPanel.Size      = new System.Drawing.Size(this.Width - _leftPanel.Width, this.Height);
            _rightPanel.BackColor = System.Drawing.Color.Transparent;
            _rightPanel.Dock      = DockStyle.Right;
            this.Controls.Add(_rightPanel);
            //Label MessageContainer
            _MessageContainer              = new Label();
            _MessageContainer.Text         = message;
            _MessageContainer.Dock         = DockStyle.Fill;
            _MessageContainer.TextAlign    = System.Drawing.ContentAlignment.MiddleLeft;
            _MessageContainer.Padding      = new Padding(20, 20, 10, 10);
            _MessageContainer.AutoEllipsis = true;
            _rightPanel.Controls.Add(_MessageContainer);
            #endregion

            //Close Label
            _lblClose           = new Label();
            _lblClose.Text      = "x";
            _lblClose.ForeColor = System.Drawing.Color.White;
            _lblClose.Click    += new EventHandler(this.lblClose_Click);
            _lblClose.BackColor = System.Drawing.Color.Transparent;

            _MessageContainer.Controls.Add(_lblClose);
            _lblClose.Location = new System.Drawing.Point(_MessageContainer.Width - 20, 0);
            //Timer
            _opacityChanger          = new Timer();
            _opacityChanger.Interval = 100;
            _opacityChanger.Enabled  = false;
            _opacityChanger.Tick    += new EventHandler(this.opacityChanger_Tick);

            _displayer          = new Timer();
            _displayer.Interval = 2;
            _displayer.Enabled  = false;
            _displayer.Tick    += new EventHandler(this.displayer_Tick);

            //Duration setting
            InitialDuration = duration;//in millisecond
            CurrentDuration = InitialDuration;
            //Form Moving
            _MessageContainer.MouseDown += new MouseEventHandler(frm_mouseDown);
            _MessageContainer.MouseMove += new MouseEventHandler(frm_mouseMove);
            //Mouse hoving on the form
            _MessageContainer.MouseHover += new EventHandler(this.frm_mouseHover);
            _rightPanel.MouseHover       += new EventHandler(this.frm_mouseHover);
            _MessageContainer.MouseLeave += new EventHandler(this.frm_mouseLeave);
            _rightPanel.MouseLeave       += new EventHandler(this.frm_mouseLeave);
        }
예제 #27
0
 public static int ShowDlgMsg(string Msg, IconStyle IcStyle, string[] Buttons, string Title)
 {
     return ShowDlgMsg(Msg, IcStyle, Buttons, Title, 0);
 }
예제 #28
0
파일: Minimap.cs 프로젝트: rnetiks/FoxMod
 public void TrackGameObjectOnMinimap(GameObject objToTrack, Color iconColor, bool trackOrientation, bool depthAboveAll = false, IconStyle iconStyle = 0)
 {
     if (this.minimap != null)
     {
         MinimapIcon icon;
         if (trackOrientation)
         {
             icon = MinimapIcon.CreateWithRotation(this.minimap, objToTrack, iconStyle, this.MINIMAP_POINTER_DIST);
         }
         else
         {
             icon = MinimapIcon.Create(this.minimap, objToTrack, iconStyle);
         }
         icon.SetColor(iconColor);
         icon.SetDepth(depthAboveAll);
         Vector2 sizeForStyle = this.GetSizeForStyle(iconStyle);
         if (this.maximized)
         {
             icon.SetSize(sizeForStyle);
             if (icon.rotation)
             {
                 icon.SetPointerSize(this.MINIMAP_POINTER_SIZE, this.MINIMAP_POINTER_DIST);
             }
         }
         else
         {
             float num = 1f - ((this.MINIMAP_SIZE - this.MINIMAP_CORNER_SIZE) / ((float)this.MINIMAP_SIZE));
             sizeForStyle.x = Mathf.Max((float)(sizeForStyle.x * num), (float)(sizeForStyle.x * 0.5f));
             sizeForStyle.y = Mathf.Max((float)(sizeForStyle.y * num), (float)(sizeForStyle.y * 0.5f));
             icon.SetSize(sizeForStyle);
             if (icon.rotation)
             {
                 float a = this.MINIMAP_POINTER_SIZE * num;
                 a = Mathf.Max(a, this.MINIMAP_POINTER_SIZE * 0.5f);
                 float originDistance = (this.MINIMAP_POINTER_SIZE - a) / this.MINIMAP_POINTER_SIZE;
                 originDistance = this.MINIMAP_POINTER_DIST * originDistance;
                 icon.SetPointerSize(a, originDistance);
             }
         }
         if (this.minimapIcons == null)
         {
             this.minimapIcons = new MinimapIcon[] { icon };
         }
         else
         {
             MinimapIcon[] iconArray2 = new MinimapIcon[this.minimapIcons.Length + 1];
             for (int i = 0; i < this.minimapIcons.Length; i++)
             {
                 iconArray2[i] = this.minimapIcons[i];
             }
             iconArray2[iconArray2.Length - 1] = icon;
             this.minimapIcons = iconArray2;
         }
     }
 }
예제 #29
0
 public abstract string GetIconName(IconName name, IconStyle style);