FormManager.cs 3.3 KB
using OnlineStore.DeviceLibrary;
using System;
using System.Collections.Generic;
using System.Drawing;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace OnlineStore.TinPasteStore
{
   public class FormManager
    {


        //#03A9F4
        public static Color buttonColor = System.Drawing.Color.FromArgb(((int)(((byte)(128)))), ((int)(((byte)(128)))), ((int)(((byte)(255)))));
        //public static Color buttonColor = System.Drawing.SystemColors.ActiveCaption;
        //public static Color buttonColor = System.Drawing.Color.FromArgb(((int)((0x00))), ((int)((0x66))), ((int)(0xFF)));
        //private static string skinFileName = Application.StartupPath + @"\Skins\Wave.ssk";
        private static string skinFileName = Application.StartupPath + @"\Skins\DiamondBlue.ssk";

        public static string SkinFileName
        {
            set
            {
            }
            get
            {
                if (SkinsList.Count <= 0)
                {
                    SkinsList = GetSkinList();
                }
                if (SkinsList.Count > 0 && index >= 0)
                {
                    return SkinsList[index];
                }
                return skinFileName;
            }
        }
        private static int index = -1;
        public static void DefaultSkin()
        {
            index = -1;
        }
        public static void NextSkin()
        {
            index++;
            if (index >= SkinsList.Count)
            {
                index = 0;
            }
        }
        public static List<string> SkinsList = new List<string>();
        private static List<string> GetSkinList()
        {
            List<string> returnList = new System.Collections.Generic.List<string>();
            string[] fileList = Directory.GetFiles(Application.StartupPath + @"\Skins");
            foreach (string sr in fileList)
            {
                if (sr.Contains(".ssk"))
                {
                    returnList.Add(sr);
                }
            }
            return returnList;
        } 

        //private static FrmAxisDebug debug = null;
        //public static void ShowAxisDebug(VerticalStoreBean store)
        //{
        //    if (debug == null)
        //    {
        //        debug = new FrmAxisDebug(store);
        //        debug.Show();
        //    }
        //    else
        //    { 
        //        if (debug.IsDisposed)
        //        {
        //            debug = new FrmAxisDebug(store);
        //            debug.Show();
        //        }
        //        else
        //        {
        //            debug.Activate();
        //        }
        //    }
        //}
        private static FrmIOStatus frmIo = null;
        public static void ShowIOShow(VerticalStoreBean store)
        {
            if (frmIo == null)
            {
                frmIo = new FrmIOStatus(store);
                frmIo.Show();
            }
            else
            {
                if (frmIo.IsDisposed)
                {
                    frmIo = new FrmIOStatus(store);
                    frmIo.Show();
                }
                else
                {
                    frmIo.Activate();
                }
            }
        }
    }
}