Example #1
0
        /// <summary>
        /// Form Loading
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void frmMain_Load(object sender, EventArgs e)
        {
            //DevExpress.LookAndFeel.UserLookAndFeel.Default.SetSkinStyle(UserInfo.SkinName);
            //Init Plugin
            try
            {
                //Init Component
                AppPlugin.InitPlugin();
                //AppCulture.InitCulture();

                if ((DateTime.Now.Day == 24 || DateTime.Now.Day == 25) && DateTime.Now.Month == 12)
                {
                    DevExpress.LookAndFeel.UserLookAndFeel.Default.SetSkinStyle("Xmax 2008 Blue");
                }
                else if (DateTime.Now.Month == 1 || (DateTime.Now.Day < 14 && DateTime.Now.Month == 2))
                {
                    DevExpress.LookAndFeel.UserLookAndFeel.Default.SetSkinStyle("Springtime");
                }
                else if (DateTime.Now.Day == 14 && DateTime.Now.Month == 2)
                {
                    DevExpress.LookAndFeel.UserLookAndFeel.Default.SetSkinStyle("Valentine");
                }
                else if (DateTime.Now.Day == 31 && DateTime.Now.Month == 10)
                {
                    DevExpress.LookAndFeel.UserLookAndFeel.Default.SetSkinStyle("Pumbkin");
                }

                string tendangnhap = string.Empty, matkhau = string.Empty;
                //DataServices.TaiKhoan.GetMapTaiKhoanUis(PMS.BLL.UserInfo._UserID, ref tendangnhap, ref matkhau);
                //if (tendangnhap != null && tendangnhap != "")
                //{
                //    var ok = DangNhap(tendangnhap, matkhau);
                //    if (!ok)
                //    {
                frmDangNhap frm = new frmDangNhap {
                    MdiParent = this
                };
                frm.Show();
                //    }
                //}
                //else
                //{
                //    frmDangNhap frm = new frmDangNhap { MdiParent = this };
                //    frm.Show();
                //}
            }
            catch (Exception ex)
            {
                XtraMessageBox.Show(ex.Message, "Message", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
Example #2
0
        public ActionResult Index()
        {
            List <AppPlugin> plugins = new List <AppPlugin>();
            Dictionary <string, AppAssembly> asses = new Dictionary <string, AppAssembly>();

            BaseMvcPluginApplication app = BaseMvcPluginApplication.Instance;

            foreach (Lazy <IMvcPlugin, IMvcPluginData> plugin in app.Plugins)
            {
                AppPlugin p;
                plugins.Add(p = new AppPlugin()
                {
                    Id          = plugin.Metadata.Id,
                    Name        = plugin.Metadata.Name,
                    ParentId    = plugin.Metadata.ParentId,
                    Description = plugin.Metadata.Description,
                    Plugin      = plugin.Value
                });

                if (!string.IsNullOrWhiteSpace(p.ParentId))
                {
                    AppPlugin parent = findPlugin(plugins, p.ParentId);
                    if (parent != null)
                    {
                        parent.Children.Add(p);
                    }
                }

                if (plugin.Value != null)
                {
                    AppAssembly apass = null;
                    Assembly    a     = plugin.Value.GetType().Assembly;
                    string      key   = a.CodeBase;
                    if (!asses.ContainsKey(key))
                    {
                        DateTime lastModified = DateTime.Now;
                        try
                        {
                            System.IO.FileInfo fileInfo = new System.IO.FileInfo(a.Location);
                            lastModified = fileInfo.LastWriteTime;
                        }
                        catch (Exception)
                        {
                        }

                        asses[key] = apass = new AppAssembly()
                        {
                            Name = a.ManifestModule.Name, CodeBase = a.CodeBase, Version = a.GetName().Version.ToString(), Date = lastModified.ToString()
                        };
                    }
                    else
                    {
                        apass = asses[key];
                    }

                    p.AssemblyInfo = apass;
                }
            }

            return(View(plugins));
        }