Esempio n. 1
0
        private void rootFile_Progress(object sender, ProgressEventArgs args)
        {
            this.progressPanel.MainMessage = args.MainMessage;
            this.progressPanel.SetMainMaximum(args.MainMaximum);
            this.progressPanel.SetMainValue(args.MainValue);

            this.progressPanel.SubMessage = args.SubMessage;
            this.progressPanel.SetSubMaximum(args.SubMaximum);
            this.progressPanel.SetSubValue(args.SubValue);
        }
Esempio n. 2
0
        /// <summary>
        /// 触发Progress事件
        /// </summary>
        /// <param name="codeFile">当前正在处理的文件对象</param>
        protected void OnProgress(AbstractCodeFile codeFile)
        {
            if (null != this.Progress)
            {
                ProgressEventArgs args = new ProgressEventArgs();
                AbstractCodeFile subFile = codeFile.Parent;
                if (null == subFile)
                {
                    args.MainMessage = Path.GetFileName(codeFile.File);
                }
                else
                {
                    AbstractCodeFile mainFile = subFile.Parent;
                    if (null == mainFile)
                    {
                        args.MainMessage = Path.GetFileName(codeFile.File);
                        args.MainMaximum = subFile.IncludeFiles.Count;
                        args.MainValue = subFile.IncludeFiles.IndexOf(codeFile) + 1;
                    }
                    else
                    {
                        args.SubMessage = Path.GetFileName(codeFile.File);
                        args.SubMaximum = subFile.IncludeFiles.Count;
                        args.SubValue = subFile.IncludeFiles.IndexOf(codeFile) + 1;

                        args.MainMessage = Path.GetFileName(subFile.File);
                        args.MainMaximum = mainFile.IncludeFiles.Count;
                        args.MainValue = mainFile.IncludeFiles.IndexOf(subFile) + 1;
                    }
                }
                Progress(codeFile, args);
            }
        }