Beispiel #1
0
        /// <summary>
        /// 构造函数
        /// </summary>
        /// <param name="text">显示的文本</param>
        /// <param name="icon">显示的图标</param>
        public MyListBoxItem(string text, MyIcons icon)
        {
            MyText = text;
            MyIcon = new BitmapImage();
            MyIcon.BeginInit();
            MyVisialbe = Visibility.Hidden;
            switch (icon)
            {
            case MyIcons.folder:
                MyIcon.StreamSource = new MemoryStream(MyIconResourse.folder);
                break;

            case MyIcons.file:
                MyIcon.StreamSource = new MemoryStream(MyIconResourse.file);
                break;

            case MyIcons.disk:
                MyIcon.StreamSource = new MemoryStream(MyIconResourse.disk);
                break;

            default:
                MyIcon.StreamSource = new MemoryStream(MyIconResourse.file);
                break;
            }
            MyIcon.EndInit();
        }
Beispiel #2
0
    // 弃用
    //public static void ShowMessage(string msg)
    //{
    //    if (!block.isActiveAndEnabled) return;
    //    if (string.IsNullOrEmpty(msg)) return;
    //    StringBuilder builder = new StringBuilder();
    //    if (LinesInPopups < 5)
    //    {
    //        builder.Append(block.text);
    //        builder.AppendLine(msg);
    //        block.text = builder.ToString();
    //    }
    //    else
    //    {
    //        var array = block.text.Split('\n');
    //        for (int i = 1; i < 5; i++)
    //        {
    //            builder.AppendLine(array[i]);
    //        }
    //        builder.AppendLine(msg);
    //    }
    //    MsgtoShow = builder.ToString();
    //    LinesInPopups++;
    //}

    public static void ChangeColor(MyIcons icons, bool light = true)
    {
        string         path     = "Main Camera/GameObject/Canvas_MAIN/Icons/" + icons.ToString() + "_0";
        SpriteRenderer renderer = GameObject.Find(path).GetComponent <SpriteRenderer>();

        renderer.color = light
            ? new Color(255, 255, 255, 255)
            : new Color(104, 104, 104, 255);
    }
Beispiel #3
0
 /// <summary>
 /// 构造函数
 /// </summary>
 /// <param name="text">显示的文本</param>
 /// <param name="icon">显示的图标</param>
 public MyTreeViewItem(string text, MyIcons icon)
 {
     tb             = new TextBlock();
     sp             = new StackPanel();
     sp.Orientation = System.Windows.Controls.Orientation.Horizontal;
     Header         = sp;
     tb.Text        = text;
     HeaderIcon     = icon;
     Expanded      += MyTreeViewItem_Expanded;
 }
Beispiel #4
0
        // Main Admin page
        public IActionResult AdminIndex()
        {
            // If user hacked their way in
            if (HttpContext.Session.GetString("auth") != "true")
            {
                return(RedirectToAction("Login", "Login"));
            }
            //To display different data from tbls
            ViewBag.adminIndexcategories = catManager.dbcategories;
            ViewBag.dbcategories         = catManager.dbcategories;
            ViewBag.dbPinCategories      = pinnedLinkManager;
            ViewBag.dbLinks = linkManager.dblinks;
            // Icons for buttons from custom script
            MyIcons myIcons = new MyIcons();

            ViewData["pencilIcon"] = myIcons.pencilIconD;
            ViewData["garbadeD"]   = myIcons.garbageIcon_D;
            ViewData["garbadeD2"]  = myIcons.garbageIcon_D2;
            ViewData["addIcon"]    = myIcons.addIcon;

            return(View(linkManager));
        }
Beispiel #5
0
        static private void ShowPictureBox(MyIcons mIcons)
        {
            if (mIcons == MyIcons.Information)
            {
                frmIcon = SystemIcons.Information;
            }
            if (mIcons == MyIcons.Question)
            {
                frmIcon = SystemIcons.Question;
            }
            if (mIcons == MyIcons.Warning)
            {
                frmIcon = SystemIcons.Warning;
            }
            if (mIcons == MyIcons.Error)
            {
                frmIcon = SystemIcons.Error;
            }
            if (mIcons == MyIcons.Exclamation)
            {
                frmIcon = SystemIcons.Exclamation;
            }
            if (mIcons == MyIcons.Asterisk)
            {
                frmIcon = SystemIcons.Asterisk;
            }
            if (mIcons == MyIcons.Shield)
            {
                frmIcon = SystemIcons.Shield;
            }
            Image pimage = new Bitmap(frmIcon.ToBitmap());

            newMsgBox.frmpBox.Image = pimage;
            newMsgBox.frmpBox.Left  = (newMsgBox.Width - newMsgBox.frmpBox.Width) / 2;
            newMsgBox.frmpBox.Top   = 15;
        }
Beispiel #6
0
 /// <summary>
 ///
 ///
 /// </summary>
 /// <param name="Message">提示信息</param>
 /// <param name="Title">标题</param>
 /// <param name="frmButton">按钮类型</param>
 /// <param name="frmIcons">消息图标类型</param>
 /// <param name="MsgBoxIcon">窗体系统图标</param>
 /// <returns></returns>
 static public DialogResult ShowDialog(string Message, string Title, MyButtons frmButton, MyIcons frmIcons, bool MsgBoxIcon)
 {
     CreateMsgBox(Title);
     newMsgBox.Width             = 250;
     newMsgBox.Height            = 170;
     newMsgBox.frmMessage.Height = 40;
     newMsgBox.frmpBox.Visible   = true;
     ButtonStatements(frmButton);
     ShowPictureBox(frmIcons);
     ShowMessage(Message);
     ShowMsgBoxIcon(MsgBoxIcon);
     newMsgBox.ShowDialog();
     return(MYReturnButton);
 }