Example #1
0
 public TabViewModelBase(TabType type, IconType icon, string title, bool isVisible = true)
 {
     Key       = type;
     Icon      = icon.ToString();
     Title     = title;
     IsVisible = isVisible;
 }
Example #2
0
        public static void ToastSweetMVC(dynamic ViewBag, IconType iconType, TiposMensajes Mensaje)
        {
            string IconTypeDescripcion = iconType.ToString();
            string MensajeDescripcion  = Mensaje.GetDescription();

            ViewBag.JSF = $"ToastSweetAlert('{IconTypeDescripcion}','{MensajeDescripcion}')";
        }
Example #3
0
    public static bool MessageBox(string title, string message, DialogType dialogType, IconType iconType, bool okDefault)
    {
        string dialog = dialogType.ToString( ).ToLower( );
        string icon   = iconType.ToString( ).ToLower( );

        return(tinyfd_messageBox(title, message, dialog, icon, okDefault ? 1 : 0) == 1);
    }
Example #4
0
    public void Init(ButtonType type, IconType iconType = IconType.None)
    {
        // icon.sprite = Resources.Load ("Icon/" + type.ToString () +"_Icon") as Sprite;
        if (iconType != null && iconType != IconType.None)
        {
            icon.sprite = Resources.Load <Sprite> ("Icon/" + iconType.ToString() + "_Icon");
        }
        m_type = type;

        if (m_callEnterType == CallEnterType.OnInit)
        {
            OnEnter(true);
        }

        if (type == ButtonType.FeedNormalMeat)
        {
            m_pitch.min *= 0.8f;
            m_pitch.max *= 0.8f;
        }
        else if (type == ButtonType.FeedNormalGrass)
        {
            m_pitch.min *= 1.2f;
            m_pitch.max *= 1.2f;
        }
    }
Example #5
0
        public static void SweetAlert(dynamic ViewBag, TipoTitulo Titulo, TiposMensajes Mensaje, IconType iconType)
        {
            string TituloDescripcion   = Titulo.GetDescription();
            string MensajeDescripcion  = Mensaje.GetDescription();
            string iconTypeDescripcion = iconType.ToString();

            ViewBag.JSF = $"sweetalert('{TituloDescripcion}','{MensajeDescripcion}','{iconTypeDescripcion}');";
        }
Example #6
0
        public static void ToastSweet(System.Web.UI.Page page, IconType iconType, TiposMensajes Mensaje)
        {
            string IconTypeDescripcion = iconType.ToString();
            string MensajeDescripcion  = Mensaje.GetDescription();

            ScriptManager.RegisterStartupScript(page, page.GetType(), "alert",
                                                $"ToastSweetAlert('{IconTypeDescripcion}','{MensajeDescripcion}')", true);
        }
Example #7
0
 public ServiceStatusViewModel(WebServiceType type, string title, IconType iconType, string genericErrorMessage, IWebServicesStatus webStatusService)
 {
     Icon  = iconType.ToString();
     Title = title;
     _genericErrorMessage = genericErrorMessage;
     _type             = type;
     _webStatusService = webStatusService;
 }
Example #8
0
        public static void Alerta(System.Web.UI.Page page, TipoTitulo Titulo, TiposMensajes Mensaje, IconType iconType)
        {
            string TituloDescripcion   = Titulo.GetDescription();
            string MensajeDescripcion  = Mensaje.GetDescription();
            string iconTypeDescripcion = iconType.ToString();

            ScriptManager.RegisterStartupScript(page, page.GetType(), "alert",
                                                $"sweetalert('{TituloDescripcion}','{MensajeDescripcion}','{iconTypeDescripcion}')", true);
        }
Example #9
0
        public DialogViewModel(IMessenger messenger, string title, IconType iconType, Action callback = null, bool startInCenter = true)
        {
            _messenger = messenger;
            _callback  = callback;

            Title         = title;
            Icon          = iconType.ToString();
            Guid          = Guid.NewGuid();
            StartInCenter = startInCenter;
        }
 /// <summary>
 /// Show message in a dialog.
 /// </summary>
 /// <returns><c>true</c>, if ok/yes was clicked, <c>false</c> otherwise.</returns>
 /// <param name="title">Title.</param>
 /// <param name="message">Message.</param>
 /// <param name="dialogType">Dialog type.</param>
 /// <param name="iconType">Icon type.</param>
 /// <param name="okIsDefault">If set to <c>true</c>, OK/Yes is the default selected button, otherwise Cancel/No is default.</param>
 public static bool MessageBox(
     string title,
     string message,
     DialogType dialogType = DialogType.ok,
     IconType iconType     = IconType.info,
     bool okIsDefault      = true
     )
 {
     return(0 != tinyfd_messageBox(title, message, dialogType.ToString(), iconType.ToString(), okIsDefault ? 1 : 0));
 }
Example #11
0
        public CommandIcon(IconType icon, string toolTip, Action <CommandIcon> action, bool on = true, IconType?offIcon = null, string offToolTip = null)
        {
            _action     = action;
            _onIcon     = icon.ToString();
            _offIcon    = offIcon.HasValue ? offIcon.Value.ToString() : _onIcon;
            _onToolTip  = toolTip;
            _offToolTip = !string.IsNullOrEmpty(offToolTip) ? offToolTip : _onToolTip;

            Command = new RelayCommand(OnClick);
            On      = on;
        }
Example #12
0
        public EntityClassAttribute(string name = "", string category = "Game", string helper = null, IconType icon = IconType.None, bool hide = false)
        {
            Name       = name;
            EditorPath = category;
            Helper     = helper;
            Hide       = hide;
            //get icon path attribute bounded to the icon path enum (if available)
            var enumType          = icon.GetType();
            var enumMemberInfo    = enumType.GetMember(icon.ToString());
            var iconPathAttribute = (IconPathAttribute)enumMemberInfo[0].GetCustomAttributes(typeof(IconPathAttribute), true)[0];

            Icon = iconPathAttribute == null ? "": iconPathAttribute.Path;
        }
Example #13
0
        internal static string GetIconPath(this IconType source, ThemeTone themeTone)
        {
            var themeSuffix = themeTone switch
            {
                ThemeTone.Lighter => "light",
                ThemeTone.Darker => "dark",
                _ => throw new Exception($"Unknown theme {themeTone}, cannot find image suffix.")
            };

            var fileName = $"{source.ToString().ToLower()}_{themeSuffix}.svg";

            return(Path.Combine(BaseIconPath, fileName));
        }
    }
Example #14
0
        /// <summary>
        /// Used to specify specific parameters for entity components. If a parameter is not set, a default value will be set by the engine.
        /// The <paramref name="icon"/> parameter is not optionally and should be set to a value of <see cref="IconType"/>.
        /// If it is set to <see cref="IconType.None"/> it will still receive an icon in the Sandbox by default.
        /// Default name is the entity component class name.
        /// Default category is General.
        /// Default description will be empty.
        /// Default guid will be retrieved from a GUID-attribute if available. Otherwise it will be generated based on the class's fullname.
        /// </summary>
        /// <param name="icon"></param>
        /// <param name="uiName">The name of the component as it will be shown in the Sandbox.</param>
        /// <param name="category">The category in the Create Object and Add Component menu of the Sandbox that this component will be shown in.</param>
        /// <param name="description">Description of the component that will be shown in tooltips.</param>
        /// <param name="guid">GUID in the format of XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX</param>
        public EntityComponentAttribute(IconType icon, string uiName = "", string category = "", string description = "", string guid = "")
        {
            Name        = uiName;
            Category    = category;
            Description = description;
            Guid        = guid;

            // Get the icon path attribute bounded to the icon path enum (if available)
            var enumType          = icon.GetType();
            var enumMemberInfo    = enumType.GetMember(icon.ToString());
            var iconPathAttribute = (IconPathAttribute)enumMemberInfo[0].GetCustomAttributes(typeof(IconPathAttribute), true)[0];

            Icon = iconPathAttribute == null ? "" : (iconPathAttribute.Path ?? "");
        }
Example #15
0
        private string GetIconPath(IconType iconType, ColorType colorType)
        {
            var path     = "../Resources/Icons/";
            var iconName = iconType.ToString().ToLower();

            if (colorType != ColorType.Gray)
            {
                var fix = colorType.ToString().Substring(0, 1).ToLower();
                iconName = $"{iconName}-{fix}";
            }
            iconName += "-40.png";
            var iconPath = Path.Combine(path, iconName);

            return(iconPath);
        }
Example #16
0
        /// <summary>
        /// 弹出提示窗口
        /// </summary>
        /// <param name="MessageText">消息文本</param>
        /// <param name="Title">消息标题</param>
        /// <param name="iconType">图表类型</param>
        public MyMessageBox(string MessageText, string Title, IconType iconType)
        {
            InitializeComponent();
            CheckForIllegalCrossThreadCalls = false;

            TitleLabel.Text   = Title;
            MessageLabel.Text = MessageText;
            IconLabel.Image   = UnityResource.ResourceManager.GetObject(iconType.ToString()) as Image;
            if (iconType == IconType.Question)
            {
                CancelButton.Left = (this.Width - CancelButton.Width * 2 - 20) / 2;
                OKButton.Left     = CancelButton.Right + 20;
            }
            else
            {
                CancelButton.Hide();
                OKButton.Left = (this.Width - OKButton.Width) / 2;
            }
        }
        public static MvcHtmlString Button(this HtmlHelper helper, string id, IconType iconType, string text = null, bool isSubmit = false)
        {
            var i = new TagBuilder("i");

            i.MergeAttribute("aria-hidden", "true");
            i.MergeAttribute("class", GetCssClass(iconType));

            var button = new TagBuilder("button");

            button.MergeAttribute("id", id);
            button.MergeAttribute("class", "btn btn-default btn-antt");

            if (isSubmit)
            {
                button.MergeAttribute("type", "submit");
            }

            button.InnerHtml = string.Format("{0}&nbsp;{1}", i, text ?? iconType.ToString());

            return(MvcHtmlString.Create(button.ToString()));
        }
Example #18
0
        public static Color ToColor(this IconType iconType)
        {
            switch (iconType)
            {
            case IconType.Default:
                return(Color.LightYellow);

            case IconType.Cyan:
                return(Color.LightCyan);

            case IconType.SmokeWhite:
                return(Color.WhiteSmoke);

            case IconType.Dark:
                return(Color.DarkGray);

            case IconType.Red:
                return(Color.Red);

            case IconType.Orenge:
                return(Color.Orange);

            case IconType.Green:
                return(Color.Green);

            case IconType.SkyBlue:
                return(Color.SkyBlue);

            case IconType.Blue:
                return(Color.Blue);

            case IconType.Purple:
                return(Color.Purple);

            default:
                throw new NotSupportedException($"not support {nameof(IconType)}.{iconType.ToString()}");
            }
        }
Example #19
0
    /// <summary>
    /// 获取mapicon
    /// </summary>
    /// <param name="type">Icontype</param>
    /// <param name="entity">要显示icon的实体</param>
    /// <param name="contaninerParentTransrom">IconContainer的父节点</param>
    /// <returns></returns>
    public GameObject GetIcon(IconType type, IEntity entity, Transform contaninerParentTransrom)
    {
        List <GameObject> gameList;
        string            key = GetStringByType(type);

        if (iconPoolDic.TryGetValue(key, out gameList))
        {
            gameList = iconPoolDic[key];
            if (gameList.Count > 0)
            {
                GameObject go = gameList[0];
                gameList.RemoveAt(0);
                if (go == null)
                {
                    strIconContainer.Remove(0, strIconContainer.Length);
                    strIconContainer.Append("IconContainer/");
                    strIconContainer.Append(type.ToString());
                    Transform iconTrans = contaninerParentTransrom.Find(strIconContainer.ToString());
                    go = GameObject.Instantiate(iconTrans.gameObject);
                }
                go.name = GetIconName(type, entity);
                go.SetActive(true);
                return(go);
            }
            else
            {
                GameObject go = GetIconGameObject(type, entity, contaninerParentTransrom);
                return(go);
            }
        }
        else
        {
            gameList = new List <GameObject>();
            iconPoolDic.Add(key, gameList);
            return(GetIconGameObject(type, entity, contaninerParentTransrom));
        }
    }
        public string CreateSvgContent(IconType iconType, IconNameType iconNameType, Color iconColor, string iconWidth, string iconHeight)
        {
            string wwwrootPath = _hostingEnvironment.WebRootPath;
            var    svgPath     = Path.Combine(wwwrootPath, $@"svgfaicons\{iconType.ToString().ToLower()}\{iconNameType.ToString().ToLower().Replace("_", "-")}.svg");
            var    svgContent  = new HtmlDocument();

            svgContent.Load(svgPath);
            var    svgNode  = svgContent.DocumentNode.SelectSingleNode("//svg");
            string svgStyle = string.Empty;

            if (!iconColor.IsEmpty)
            {
                string color;

                if (iconColor.IsNamedColor && iconColor.IsKnownColor) // like Red
                {
                    color = iconColor.Name;
                }
                else if (iconColor.IsNamedColor && !iconColor.IsKnownColor) // Hex
                {
                    color = $"#{iconColor.Name}";
                }
                else
                {
                    color = $"rgb({iconColor.R}, {iconColor.G}, {iconColor.B})"; // RGB
                }
                svgStyle += $"fill: {color}; ";
            }
            if (!string.IsNullOrWhiteSpace(iconWidth))
            {
                if (!iconWidth.EndsWith("px") && !iconWidth.EndsWith("em")) //15 => 15px
                {
                    iconWidth += "px";
                }
                svgStyle += $"width: {iconWidth}; ";
            }

            if (!string.IsNullOrWhiteSpace(iconHeight))
            {
                if (!iconHeight.EndsWith("px") && !iconHeight.EndsWith("em")) //15 => 15px
                {
                    iconHeight += "px";
                }
                svgStyle += $"height: {iconHeight}; ";
            }

            if (!string.IsNullOrWhiteSpace(IconVerticalAlign))
            {
                if (!IconVerticalAlign.EndsWith("px") && !IconHeight.EndsWith("em"))
                {
                    IconVerticalAlign += "px";
                }
                svgStyle += $"vertical-align: {IconVerticalAlign}; ";
            }

            if (IconFlip)
            {
                svgStyle += $"transform: scaleX(-1);";
            }

            svgNode.Attributes.Add("style", svgStyle);
            if (!string.IsNullOrWhiteSpace(IconClass))
            {
                svgNode.AddClass(IconClass);
            }

            return(svgNode.OuterHtml);
        }
Example #21
0
 public static HtmlString Render(this IconType icon)
 {
     return(new HtmlString($"<i class=\"{icon.ToString()}\"></i>"));
 }
Example #22
0
 public static string ToCssClass(this IconType type)
 {
     return("glyphicon glyphicon-" + type.ToString().Replace('_', '-').ToLowerInvariant());
 }
Example #23
0
 public static string GetIconSvg(IconType iconType)
 {
     return(loadedIcons[iconType.ToString()].ToString());
 }
Example #24
0
        }         // end ()

        static public int GetLockedIcon(string assetName, IconType iconType, MOG_Properties properties)
        {
            try
            {
                // Check to see if we can find this loced icon in our cache
                string             lockedIconKeyName = assetName + "_" + iconType.ToString() + "_locked";
                TstDictionaryEntry assetLocked       = mAssetTypes.Find(lockedIconKeyName);
                if (assetLocked != null)
                {
                    // Yup, return the index
                    return((int)assetLocked.Value);
                }
                else
                {
                    // *******************************************
                    // Nope, We are going to have to create it
                    // *******************************************
                    // We need 3 things:
                    // 1) Lock icon
                    // 2) Asset or class icon
                    // 3) New overlayed icon

                    // Setup some new containers
                    Bitmap myImage    = null;
                    Bitmap lockSource = null;
                    Bitmap source     = null;

                    // 1) Can we find the locked image
                    TstDictionaryEntry nodeLocked = mAssetTypes.Find("locked");
                    if (nodeLocked != null && nodeLocked.IsKey)
                    {
                        // Great, get a copy of that
                        lockSource = (Bitmap)mAssetTypeImages.Images[(int)nodeLocked.Value];

                        // Do we have a valid properties object?
                        if (properties == null)
                        {
                            // If we didn't get anything, we need to load this icon into our array
                            properties = new MOG_Properties(assetName);
                        }

                        // Lets now populate our icon name to load
                        string assetIconName = "";
                        string nodeIconName  = "";

                        // What kind of icon is this?
                        switch (iconType)
                        {
                        case IconType.ASSET:
                            assetIconName = properties.AssetIcon;
                            nodeIconName  = assetName + "_ASSET";
                            break;

                        case IconType.CLASS:
                            assetIconName = properties.ClassIcon;
                            nodeIconName  = assetName + "_CLASS";
                            break;

                        default:
                            return(0);
                        }

                        // 2) Can we find the class icon for this asset
                        TstDictionaryEntry nodeSource = mAssetTypes.Find(nodeIconName);
                        if (nodeSource != null && nodeSource.IsKey)
                        {
                            // Great get a copy of that
                            source = (Bitmap)mAssetTypeImages.Images[(int)nodeSource.Value];
                        }
                        else
                        {
                            // If we didn't get anything, we need to load this icon into our array
                            int newIconIndex = LoadIcon(assetIconName, nodeIconName);
                            source = (Bitmap)mAssetTypeImages.Images[newIconIndex];
                        }

                        // 3) Ok, if we got a lockSource and a class source icon, lets attempt to overlay them
                        if (source != null && lockSource != null)
                        {
                            myImage = BitmapManipulator.OverlayBitmap(source, lockSource, 100, BitmapManipulator.ImageCornerEnum.BottomRight);
                        }

                        // Did the overlay work?
                        if (myImage != null)
                        {
                            //Debug.WriteLine("Requesting icon - " + lockedIconKeyName);
                            return(InternalAddIconToLists(lockedIconKeyName, myImage));
                        }
                    }
                    else
                    {
                        // Try to just turn the source icon red or something
                        string message = "We could not locate the (FileLocked.png)lock icon! Make sure that it is located in one of your images directories within the MOG repository!";
                        MOG_Report.ReportSilent("Load Icon", message, Environment.StackTrace, MOG_ALERT_LEVEL.ERROR);
                    }
                }
            }
            catch (Exception e)
            {
                MOG_Report.ReportSilent("Get Locked Icon", e.Message, e.StackTrace, MOG_ALERT_LEVEL.CRITICAL);
            }

            return(0);
        }
Example #25
0
        /// <summary>
        /// Gets an icon that is one step lower in resolution as the type of the given paremter
        /// </summary>
        private ImageSource GetProtocolIcon_LowerType(IconType currentType)
        {
            switch (currentType)
            {
            case IconType.SMALL:
                throw new ProtocolConfigurationException(beRemoteExInfoPackage.SignificantInformationPackage, "The given icon size is not available: " + currentType.ToString());

            case IconType.MEDIUM:
                return(GetProtocolIcon(IconType.SMALL));

            case IconType.LARGE:
                return(GetProtocolIcon(IconType.MEDIUM));

            case IconType.HIGHDEF:
                return(GetProtocolIcon(IconType.LARGE));

            default:
                throw new ProtocolConfigurationException(beRemoteExInfoPackage.SignificantInformationPackage, "Problem determinig lower type: " + currentType.ToString());
            }
        }
Example #26
0
 /// <summary>
 /// 弹出提示,点击确定后执行脚本
 /// 需要引用 jquery-1.2.6.pack.js
 /// </summary>
 /// <param name="msg">提示消息</param>
 /// <param name="title">提示标题</param>
 /// <param name="callback">回调javascript代码或者方法名称</param>
 public void jAlert(string msg, string title, IconType ico, string callback)
 {
     RegScripts("jquery-easyui/easyloader.js");
     System.Text.StringBuilder build = new System.Text.StringBuilder();
     build.Append("$(document).ready(function() {");
     //build.Append("using(['messager'], function(){");
     build.Append("$.messager.alert('" + title + "','" + msg + "','" + ico.ToString().ToLower() + "',");
     build.Append("function(r){" + callback + "});");
     //build.Append("});");
     build.Append("});");
     Page.ClientScript.RegisterStartupScript(this.GetType(), "jAlert", build.ToString().ToLower(), true);
 }
Example #27
0
 /// <summary>
 /// 防止update里面 tostring 造成的gc
 /// </summary>
 /// <param name="type"></param>
 /// <returns></returns>
 public string GetStringByType(IconType type)
 {
     if (type == IconType.duiyouicon)
     {
         if (string.IsNullOrEmpty(m_duiyouStr))
         {
             m_duiyouStr = type.ToString();
         }
         return(m_duiyouStr);
     }
     else if (type == IconType.mastericon)
     {
         if (string.IsNullOrEmpty(m_masterStr))
         {
             m_masterStr = type.ToString();
         }
         return(m_masterStr);
     }
     else if (type == IconType.npcicon)
     {
         if (string.IsNullOrEmpty(m_npcStr))
         {
             m_npcStr = type.ToString();
         }
         return(m_npcStr);
     }
     else if (type == IconType.otherplayericon)
     {
         if (string.IsNullOrEmpty(m_otherPlayer))
         {
             m_otherPlayer = type.ToString();
         }
         return(m_otherPlayer);
     }
     else if (type == IconType.pathpointicon)
     {
         if (string.IsNullOrEmpty(m_pathStr))
         {
             m_pathStr = type.ToString();
         }
         return(m_pathStr);
     }
     else if (type == IconType.peticon)
     {
         if (string.IsNullOrEmpty(m_petStr))
         {
             m_petStr = type.ToString();
         }
         return(m_petStr);
     }
     else if (type == IconType.playericon)
     {
         if (string.IsNullOrEmpty(m_playerStr))
         {
             m_playerStr = type.ToString();
         }
         return(m_playerStr);
     }
     else if (type == IconType.robot)
     {
         if (string.IsNullOrEmpty(m_robotStr))
         {
             m_robotStr = type.ToString();
         }
         return(m_robotStr);
     }
     else
     {
         Engine.Utility.Log.Error("类型不存在");
     }
     return("");
 }
 /// <summary>
 /// Message Box with name, title and icon
 /// </summary>
 /// <param name="title"></param>
 /// <param name="dialogMsg"></param>
 /// <param name="iconType"></param>
 public BookerStudioMessageBox(string title, string dialogMsg, GuestBookerMessageBoxButtons dialogType, IconType iconType)
     : this(title, dialogMsg, dialogType)
 {
     BookerStudioMessageBoximage.Source = new BitmapImage(new Uri(iconType.ToString(), UriKind.Relative));
 }
Example #29
0
 public static Sprite Get(IconType type)
 => Get($"icon_{type.ToString().ToLower()}");
Example #30
0
 /// <summary>
 /// Gets the icon.
 /// </summary>
 /// <param name="iconType">Type of the icon.</param>
 /// <returns></returns>
 private Icon GetIcon(IconType iconType)
 {
     return(new Icon(GetType(), "icons." + iconType.ToString().ToLower() + ".ico"));
 }