Esempio n. 1
0
        public LogoForm()
        {
            InitializeComponent();

            #region 加载版本号
            lblVersion.Text = string.Format("版本 {0}", TmoComm.GetAppVersion());
            #endregion

            this.Load += LogoForm_Load;
            InitSkin();                                           //加载皮肤配置
            TmoComm.SyncContext = SynchronizationContext.Current; //获得UI线程同步上下文

            TCPClient.Instance.DataReceived            += Instance_DataReceived;
            TCPClient.Instance.ServerConnectionChanged += Instance_ServerConnectionChanged;
            TCPClient.Instance.StartService(TmoServiceClient.Ip, TmoServiceClient.Port + 1);   //启动TCP服务

            #region 加载自定义Logo画面
            string logoPath = TmoShare.GetRootPath() + "\\Images\\logo.jpg";
            if (!File.Exists(logoPath))
            {
                logoPath = TmoShare.GetRootPath() + "\\Images\\logo.png";
            }
            if (!File.Exists(logoPath))
            {
                return;
            }

            this.BackgroundImage = Image.FromFile(logoPath);
            this.Width           = this.BackgroundImage.Width + 4;
            this.Height          = this.BackgroundImage.Height + 4;
            #endregion
        }
Esempio n. 2
0
        /// <summary>
        /// 打开日志点击事件
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void tsmiLog_Click(object sender, EventArgs e)
        {
            string path = TmoShare.GetRootPath() + @"\Log";

            if (Directory.Exists(path))
            {
                System.Diagnostics.Process.Start(path);
            }
        }
Esempio n. 3
0
        /// <summary>
        /// 获得DAL层实例对象
        /// </summary>
        /// <typeparam name="T"></typeparam>
        /// <param name="t"></param>
        /// <returns></returns>
        public static T GetDALInstance <T>()
        {
            string className = typeof(T).Name.Substring(1);
            string spaceName = GetAllDALClassSpace()[TmoShare.currentDBType];
            string path      = string.Format("{0}.{1}Dal", spaceName, className);
            object instance  = ReflectHelper.GetInstance(TmoShare.GetRootPath() + "\\DBDAL.dll", path);

            return((T)instance);
        }