コード例 #1
0
        private void cmdUpload_Click(object sender, EventArgs e)
        {
            if (cmbFiletype.Properties.GetIndexByKeyValue(cmbFiletype.EditValue) < 0)
            {
                BaseMessages.ShowWarningMessage("Chưa chọn loại file!");
                return;
            }

            if (txtFileName.Text == "")
            {
                BaseMessages.ShowWarningMessage("Chưa chọn file upload!");
                return;
            }

            System.IO.FileInfo fileInfo = new System.IO.FileInfo(txtFileName.Text.Trim());

            SplashForm.ShowSplashScreen();
            if (FTP_FilesManager.UpLoad_TaiLieu(m_PhanMem, (FTP_FilesManager.FTP_FileType)((Int16)cmbFiletype.EditValue), m_sFileIdentity, fileInfo.DirectoryName, fileInfo.Name, txtGhiChu.Text.Trim()))
            {
                SplashForm.CloseForm();
                BaseMessages.ShowInformationMessage("Upload file thành công!");
                Close();
                //txtGhiChu.Text = "";
                //txtFileName.Text = "";
                IsUpload = true;
            }
            else
            {
                SplashForm.CloseForm();
            }
        }
コード例 #2
0
        public static bool OpenFile_TaiLieuDinhKem(int ID_Files, string FilePath, string FileName)
        {
            var bReturn     = false;
            var sFolderSave = ThuMucDownload + @"\" + FilePath;

            if (IsFileInUse(sFolderSave, FileName))
            {
                BaseMessages.ShowWarningMessage("File đang sử dụng!");
                return(false);
            }

            if (File.Exists(sFolderSave + @"\" + FileName))
            {
                var fl = new FileInfo(sFolderSave + @"\" + FileName);
                if (fl.CreationTime == fl.LastWriteTime)
                {
                    return(OpenFile(FilePath, FileName));
                }
                File.Delete(sFolderSave + @"\" + FileName);
            }

            if (!Directory.Exists(sFolderSave))
            {
                Directory.CreateDirectory(sFolderSave);
            }

            SplashForm.ShowSplashScreen();
            if (Download_TaiLieuDinhKem(ID_Files, sFolderSave, FileName, true))
            {
                bReturn = OpenFile(FilePath, FileName);
            }
            SplashForm.CloseForm();
            return(bReturn);
        }
コード例 #3
0
        /// <summary>
        /// Executed when a version is selected in the dropdown. Loads the version selected
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        void barButtonItemVersionList_ItemClick(object sender, ItemClickEventArgs e)
        {
            SplashForm.ShowSplashScreen();
            bool   success   = false;
            string selName   = "";
            string selection = "";

            try
            {
                BarManager barManager = sender as BarManager;
                selection = barManager.PressedLink.Item.Caption;
                selName   = barManager.PressedLink.Item.Name;

                success = form1.LoadRiotDataFromFile(selName);
                if (!success)
                {
                    success = form1.DataCollection(selName);
                }
            }
            catch (Exception ex)
            {
                XtraMessageBox.Show(ex.ToString());
            }

            if (success)
            {
                //Performs the update to all tabes
                form1.UpdateFormWithData(false);                 //Won't recreate the version drop down list

                ClearSelectionsFromOldVersion();


                //Update dropdown
                dropDownButtonRiotVersion.Text = selection;
            }
            SplashForm.CloseForm();
        }
コード例 #4
0
        public LeagueBuildStatsForm()
        {
            SplashForm.ShowSplashScreen();


            InitializeComponent();
            this.WindowState = FormWindowState.Minimized;


            string assemblyVersion = Assembly.GetExecutingAssembly().GetName().Version.ToString();

            this.Text = "League Build Stats " + assemblyVersion + " - For League of Legends (LoL)";

            this.BackColor = panelCtlMainTopBar.BackColor;

            if (CreateFolders())
            {
                LogWriter writer = LogWriter.Instance;
                writer.WriteToLog("Start");
                LoadControls();

                bool success = LoadRiotDataFromFile();

                if (!success)
                {
                    success = InitializeDataCollection();
                }
                if (success)
                {
                    writer = LogWriter.Instance;
                    writer.WriteToLog("Execute UpdateFormWithData()");
                    UpdateFormWithData();
                    mainTopBar.InitializeGoldImage();
                }
                else
                {
                    MessageBox.Show("Failed to load or download data!");
                }
                LogWriter writer2 = LogWriter.Instance;
                string    elapsed = (DateTime.Now - LogTimeStart).ToString(@"hh\:mm\:ss\.fff");
                writer2.WriteToLog("Finish (time elapsed = " + elapsed + ")");
            }


            xtraTabControl.Selecting += xtraTabControl_Selecting;


            //This is part of the requirments to make you scroll what you mouse over
            Application.AddMessageFilter(this);

            this.DoubleBuffered = true;
            SetStyle(ControlStyles.OptimizedDoubleBuffer | ControlStyles.AllPaintingInWmPaint, true);

            SplashForm.CloseForm();
            //this.TopMost = true;
            //this.Focus();
            //this.BringToFront();
            //this.TopMost = false;
            this.Activate();
            //this.ShowDialog();
            this.WindowState = FormWindowState.Normal;

            //This timer is used to show a dragging image
            //0.002 second
            _timer1.Interval = 2;
            _timer1.Tick    += _timer1_Tick;
            _timer1.Start();
        }