• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C# Progress类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中Progress的典型用法代码示例。如果您正苦于以下问题:C# Progress类的具体用法?C# Progress怎么用?C# Progress使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



Progress类属于命名空间,在下文中一共展示了Progress类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: Read

        public void Read(SnpCollection snps, CancellationToken cancel, Progress progress) {
            if (this.filename == null) throw new ArgumentNullException("filename cannot be null.");
            if (String.IsNullOrWhiteSpace(filename)) throw new ArgumentOutOfRangeException("filename cannot be empty.");

            string ext = Path.GetExtension(filename);
            if (ext.EndsWith("csv", StringComparison.InvariantCultureIgnoreCase)) {
                try {
                    Read(Genome.GenomeType.Ftdna, snps, cancel, progress);
                    return;
                }
                catch (Exception) { }
                genome.Clear();
                try {
                    Read(Genome.GenomeType.MeAnd23v2, snps, cancel, progress);
                    return;
                }
                catch (Exception) { }
            } else {
                try {
                    Read(Genome.GenomeType.MeAnd23v2, snps, cancel, progress);
                    return;
                }
                catch (Exception) { }
                genome.Clear();
                try {
                    Read(Genome.GenomeType.Ftdna, snps, cancel, progress);
                    return;
                }
                catch (Exception) { }
            }
            throw new ApplicationException("Could not read as either format.");
        }
开发者ID:Bert6623,项目名称:Gedcom.Net,代码行数:32,代码来源:GenomeFile.cs


示例2: Main

    static void Main(string[] args)
    {
        Application.EnableVisualStyles();

        if (args.Length == 0) {
            Application.Run(new About());
        } else if (args.Length > 1 && args[0] == "--map") {
            if (File.Exists(SFMpq.DLL))
            {
                parsing = new Progress();
                parsing = new Progress();
                parsing.Visible = true;
                parsing.SetMapPath(args[1]);
                map = new Map(Application.StartupPath, args[1]);
                parsing.SetProgress(20, "comments and empty lines...");
                Preprocessor.SplitComments(map.script);
                map.script = Format.SplitEmptyLines(map.script);
                parsing.SetProgress(20, "comments and empty lines... DONE!");
                parsing.SetProgress(40, "user functions...");
                Analyzer.FindUserFunctions(map.script);
                Analyzer.GetGlobals(map.script);
                parsing.SetProgress(40, "user functions and structs... DONE!");
                parsing.SetProgress(60, "\"//! jasp\" blocks...");
                Preprocessor.ParseJaspBlock(map.script);
                parsing.SetProgress(60, "\"//! jasp\" blocks... DONE!");
                parsing.SetProgress(80, "Rebuilding parsed script...");
                map.script = Format.StringsToString(map.script).Split('\n');
                parsing.SetProgress(80, "Rebuilding parsed script... DONE!");
                parsing.SetProgress(100, "errors...");
                Preprocessor.SearchErrors(map.script);
            } else
                MessageBox.Show("File \"SFMpq.dll\" isn't exists.\nSorry :(", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
        }
    }
开发者ID:Ty3uK,项目名称:JASP,代码行数:34,代码来源:Main.cs


示例3: PrintPagesVoid

    public void PrintPagesVoid()
    {
        CommandLineInterpreter oCLI = new CommandLineInterpreter();
        ActionCallingContext acc = new ActionCallingContext();

        string strPages = string.Empty;
        acc.AddParameter("TYPE", "PAGES");
        oCLI.Execute("selectionset", acc);
        acc.GetParameter("PAGES", ref strPages);

        Progress oProgress = new Progress("SimpleProgress");
        oProgress.SetAllowCancel(true);
        oProgress.SetAskOnCancel(true);
        oProgress.SetNeededSteps(3);
        oProgress.SetTitle("Drucken");
        oProgress.ShowImmediately();

        foreach (string Page in strPages.Split(';'))
        {
            if (!oProgress.Canceled())
            {
                acc.AddParameter("PAGENAME", Page);
                oCLI.Execute("print", acc);
            }
            else
            {
                break;
            }
        }
        oProgress.EndPart(true);

        return;
    }
开发者ID:nai-r-olf,项目名称:EplanScriptingProjectBySuplanus,代码行数:33,代码来源:PrintPages.cs


示例4: Read

        /// <summary>
        /// Read data into the specified SnpCollection from the SnpCollection
        /// file having the specified filename (which may include a path). 
        /// The specified CancellationToken can be used to abort the read. 
        /// The progress parameter will be updated by this method with a 
        /// value of 0-100 to reflect the percent progress of the read.
        /// </summary>
        /// <param name="snps">The SnpCollection to receive the read data.</param>
        /// <param name="filename">The path and filename of the SnpCollection file.</param>
        /// <param name="cancel">The CancellationToken that can be used to abort the read.</param>
        /// <param name="progress">The progress parameter that will be updated to reflect 
        /// the percent progress of the read.</param>
        public static void Read(SnpCollection snps, string filename, CancellationToken cancel, Progress progress) {
            if (snps == null) throw new ArgumentNullException("The SnpCollection cannot be null.");
            if (filename == null) throw new ArgumentNullException("filename cannot be null.");
            if (String.IsNullOrWhiteSpace(filename)) throw new ArgumentOutOfRangeException("filename cannot be empty.");

            using (StreamReader reader = new StreamReader(filename)) {
                long length = 0;
                if (progress != null) length = reader.BaseStream.Length;
                string[] columns = new string[6];
                string line;
                while ((line = reader.ReadLine()) != null) {
                    cancel.ThrowIfCancellationRequested();
                    line.FastSplit(',', columns);
                    byte chr = Convert.ToByte(columns[2]);
                    if (chr == 0) chr = 23; // handles legacy use of 0 for X 
                    Snp snp;
                    if ((!String.IsNullOrWhiteSpace(columns[3]) && Char.IsDigit(columns[3][0]))) {
                        // new format snp file
                        snp = new Snp(columns[0], chr, Convert.ToInt32(columns[3]), Convert.ToSingle(columns[4]), columns[1], columns[5]);
                    } else {
                        // old SnpMap format snp file
                        snp = new Snp(columns[0], chr, -1, -1, columns[1], columns[3]);
                    }
                    snps.Add(snp);
                    if (progress != null) progress.Set(reader.BaseStream.Position, length);

                }
            }
        }
开发者ID:Bert6623,项目名称:Gedcom.Net,代码行数:41,代码来源:SnpFile.cs


示例5: ProgressViewModel

        public ProgressViewModel()
        {
            this.Bookmarks = new ObservableCollection<Bookmark>();
            this.Bookmarks.CollectionChanged += Bookmarks_CollectionChanged;

            this.progress = new Progress();
        }
开发者ID:zyq524,项目名称:Readgress,代码行数:7,代码来源:ProgressViewModel.cs


示例6: btn_list_Click

        void btn_list_Click(object sender, EventArgs e)
        {
            string RecievedData=null;
            names.Clear();
            ips.Clear();
            using (Client client = new Client())
            {
                Thread t = new Thread(() => RecievedData = client.Retrieve(Player.Name));
                t.Start();
                Progress p = new Progress();
                p.ShowDialog();
                string name = RecievedData.Substring(0, RecievedData.IndexOf('&'));
                string ip = RecievedData.Substring(RecievedData.IndexOf('&') + 1);

                for (int startindx = 0, length = name.IndexOf('*'), prv = length; startindx < name.Length; )
                {
                    names.Add(name.Substring(startindx, length));
                    startindx = prv + 1;
                    prv = name.IndexOf('*', startindx);
                    length = prv - startindx;

                }

                for (int startindx = 0, length = ip.IndexOf('*'), prv = length; prv != -1; )
                {
                    ips.Add(ip.Substring(startindx, length));
                    startindx = prv + 1;
                    prv = ip.IndexOf('*', startindx);
                    length = prv - startindx;

                }
                foreach (string s in names)
                    AvailablePlayers.Items.Add(s);
            }
        }
开发者ID:umar-qureshi2,项目名称:UG-Courses,代码行数:35,代码来源:LanLobby.cs


示例7: DownloadViewModel

 public DownloadViewModel()
 {
     if (IsInDesignMode)
     {
         Progress = new Progress() { Saved = 50, Total = 100 };
     }
 }
开发者ID:wpdu,项目名称:ControlTest,代码行数:7,代码来源:DownloadViewModel.cs


示例8: OnProcess

        protected override Image3D OnProcess(Image3D image, Progress progress)
        {
            if (cache == null)
            {
                if (!CombineFilesToSlices)
                {
                    using (var reader = new DicomReader(Path))
                    {
                        cache = reader.ReadImage3D(progress);
                        cache.Minimum = reader.MinValue;
                        cache.Maximum = reader.MaxValue;
                    }
                }
                else
                {
                    using (var reader = new FileToSliceDicomReader(Path))
                    {
                        cache = reader.ReadImage3D(progress);
                        cache.Minimum = reader.MinValue;
                        cache.Maximum = reader.MaxValue;
                    }
                }

                Log.I("Image loaded. min: " + cache.Minimum + "; max: " + cache.Maximum);
            }

            return cache;
        }
开发者ID:xa17d,项目名称:vmd2,代码行数:28,代码来源:ImageLoader.cs


示例9: Progress

        internal Progress(int pluginNumber, Progress.Callback progress)
        {
            if (progress == null) throw new ArgumentNullException("progress");

            this.pluginNumber = pluginNumber;
            this.progress = progress;
        }
开发者ID:AkechiNEET,项目名称:totalcommander-plugin-donnet,代码行数:7,代码来源:Progress.cs


示例10: button_backup_Click

        private void button_backup_Click(object sender, EventArgs e)
        {
            FolderBrowserDialog fbd = new FolderBrowserDialog();
            DialogResult result = fbd.ShowDialog();
            if (result == DialogResult.OK)
            {
                int lastFoo = (int)Enum.GetValues(typeof(ECRComms.program)).Cast<ECRComms.program>().Last();

                for (int p = 0; p <= lastFoo; p++)
                {
                    Progress pr = new Progress(Program.ecr);
                    pr.Show();

                    string  name = ((ECRComms.program)p).ToString();
                    data = Program.ecr.getprogram((ECRComms.program)p);

                    pr.Close();

                    try
                    {
                        writedata(data.ToArray(),  Path.Combine(fbd.SelectedPath, name + ".dat"));
                    }
                    catch (Exception _Exception)
                    {
                        Console.WriteLine("Exception caught saving file{0}", _Exception.ToString());
                    }

                }
            }
        }
开发者ID:robincornelius,项目名称:ECRComms,代码行数:30,代码来源:Form3.cs


示例11: BuilderVisitor

 /// <summary>
 /// Instantiates a <c>BuilderVisitor</c> object.
 /// </summary>
 /// <param name="filter">The list of filters to pass in.</param>
 /// <param name="typeConflicts">A list to keep track of invalid type conflicts.</param>
 /// <param name="progress">A progress object to keep track of the progress.</param>
 public BuilderVisitor(List<Filter> filter, List<string> typeConflicts, Progress progress)
 {
     _filter = filter;
     _filterChain = new FilterChain();
     _typeConflicts = typeConflicts;
     _progress = progress;
 }
开发者ID:sr3dna,项目名称:big5sync,代码行数:13,代码来源:BuilderVisitor.cs


示例12: ContainerForm

		public ContainerForm(CleanerController controller)
			: base(WorkshareFormUtility.DialogLevel.Primary, WorkshareFormUtility.BrandType.Protect, "Batch Clean")
		{
			InitializeComponent();
			TopMost = true;

			m_controller = controller;
			m_controller.CleanProcessComplete += OnCleanProcessComplete;
			m_controller.CleanProcessCancelled += OnCleanProcessCancelled;
			m_controller.ProcessComplete += OnProcessComplete;

			m_optionCtl = new Options(controller);
			m_progessCtl = new Progress(controller);
			m_reportCtl = new Report(controller);

			m_optionCtl.Visible = true;
			m_optionCtl.ShowSavingGroupBox(true);
			m_progessCtl.Visible = false;
			m_reportCtl.Visible = false;

			pnlDetail.Controls.Add(m_optionCtl);
			pnlDetail.Controls.Add(m_progessCtl);
			pnlDetail.Controls.Add(m_reportCtl);

			if (!m_optionCtl.HasValidFiles())
				btnClean_Click(this, new EventArgs());
		}
开发者ID:killbug2004,项目名称:WSProf,代码行数:27,代码来源:ContainerForm.cs


示例13: Application_Startup

        private void Application_Startup(object sender, StartupEventArgs e)
        {
            // create a loader page
            Progress loader = new Progress();

            // set the visual root to loader page
            this.RootVisual = loader;

            // Debug helper -> make sure we have html params!
            if (e.InitParams.Count == 0)
            {
                MessageBox.Show("Error: You must tell your loader what files to load in your web page(init params) or manually in the code!", "Loader Error Message", MessageBoxButton.OK);
                //throw new Exception("Loader init params error");
                return;
            }
            // create package download manager and start the download process using html supplied InitParams
            // note the last param sets a 100KB max download speed for debuging and simulation mode!
            PackageDownloadManager pdm = new PackageDownloadManager(loader, e.InitParams, 0);

            // another option is to use a hand coded list ->
            //List<Uri> myDownloadList = new List<Uri>();
            //myDownloadList.Add(new Uri("ClientBin/Beegger.xap", UriKind.RelativeOrAbsolute));
            //ParamUtil.fixRelativeLinks(ref myDownloadList);
            //PackageDownloadManager pdm = new PackageDownloadManager(loader, myDownloadList, 50);
        }
开发者ID:SleeplessByte,项目名称:playwithyourpeas,代码行数:25,代码来源:App.xaml.cs


示例14: WriteMessage

 private static void WriteMessage(string message, Progress progress, MessageType type)
 {
     var c = Control;
     if (c!= null)
     {
         c.Write(message, progress, type);
     }
 }
开发者ID:xa17d,项目名称:vmd2,代码行数:8,代码来源:Log.cs


示例15: GSImage

        private Rectangle _rectangle; // mask bounds

        #endregion Fields

        #region Constructors

        /// <summary>
        /// Create a GSImage backed with an existing Drawable.
        /// </summary>
        /// <param name="drawable"></param>
        public GSImage(Drawable drawable)
        {
            _image = drawable.Image;
            _drawable = drawable;
            _rectangle = _drawable.MaskBounds;
            Tile.CacheDefault(_drawable);
            Progress = new Progress("Halftone Laboratory");
        }
开发者ID:bzamecnik,项目名称:HalftoneLab,代码行数:18,代码来源:GSImage.cs


示例16: WriteProgressIndicator

        static void WriteProgressIndicator(Progress? progress)
        {
            if (progress == null)
                return;

            Console.ForegroundColor = ConsoleColor.Green;
            Console.Write("({0}) ", progress.Value);
        }
开发者ID:tomaskovarik,项目名称:chalk,代码行数:8,代码来源:ConsoleLoggerWithProgressIndicator.cs


示例17: Game

        private Game()
        {
            m_graphics = new GraphicsDeviceManager(this);
            Content.RootDirectory = "Content";
            IsMouseVisible = true;

            m_progress = new Progress("fin");
        }
开发者ID:Yuma-Shi,项目名称:GLhf,代码行数:8,代码来源:Game.cs


示例18: ProgressWorker

        public ProgressWorker(Progress window, int total)
        {
            this.total = total;
            this.window = window;
            this.WorkerReportsProgress = true;
            this.WorkerSupportsCancellation = true;

            ReportProgress(0);
        }
开发者ID:ahorn,项目名称:z3test,代码行数:9,代码来源:ProgressWorker.cs


示例19: Decode

        public static BindingList<DataItem> Decode(string[] toDecode)
        {
            BatchInsert.toDecode = toDecode;

            Progress p = new Progress(0, 100, "Decoding..", "starting..", Decoding, null, null, true, true);
            p.StartWorker();

            return decodedDS;
        }
开发者ID:mkoscak,项目名称:koberce,代码行数:9,代码来源:BatchInsert.cs


示例20: Function

    public void Function()
    {
        string strProjectpath =
            PathMap.SubstitutePath("$(PROJECTPATH)");
        string strProjectname = PathMap.SubstitutePath("$(PROJECTNAME)");
        string strFullProjectname = PathMap.SubstitutePath("$(P)");

        string strDate = DateTime.Now.ToString("yyyy-MM-dd");
        string strTime = DateTime.Now.ToString("hh-mm-ss");
        string strBackupDirectory = strProjectpath + @"\Backup\";
        string strBackupFilename = strProjectname + "_Backup_"
            + strDate + "_" + strTime;

        if (!System.IO.Directory.Exists(strBackupDirectory))
        {
            System.IO.Directory.CreateDirectory(strBackupDirectory);
        }

        Progress oProgress = new Progress("SimpleProgress");
        oProgress.SetAllowCancel(true);
        oProgress.SetAskOnCancel(true);
        oProgress.BeginPart(100, "");
        oProgress.SetTitle("Backup");
        oProgress.ShowImmediately();

        if (!oProgress.Canceled())
        {
            CommandLineInterpreter oCLI = new CommandLineInterpreter();
            ActionCallingContext acc = new ActionCallingContext();

            acc.AddParameter("BACKUPMEDIA", "DISK");
            acc.AddParameter("ARCHIVENAME", strBackupFilename);
            acc.AddParameter("BACKUPMETHOD", "BACKUP");
            acc.AddParameter("COMPRESSPRJ", "1");
            acc.AddParameter("INCLEXTDOCS", "1");
            acc.AddParameter("BACKUPAMOUNT", "BACKUPAMOUNT_ALL");
            acc.AddParameter("INCLIMAGES", "1");
            acc.AddParameter("LogMsgActionDone", "true");
            acc.AddParameter("DESTINATIONPATH", strBackupDirectory);
            acc.AddParameter("PROJECTNAME", strFullProjectname);
            acc.AddParameter("TYPE", "PROJECT");

            oCLI.Execute("backup", acc);
        }

        oProgress.EndPart(true);

        MessageBox.Show(
            "Backup wurde erfolgreich erstellt:\n"
            + strBackupFilename,
            "Hinweis",
            MessageBoxButtons.OK,
            MessageBoxIcon.Information
            );

        return;
    }
开发者ID:Suplanus,项目名称:EplanElectricP8Automatisieren,代码行数:57,代码来源:11_Projekt_Backup.cs



注:本文中的Progress类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# ProgressBar类代码示例发布时间:2022-05-24
下一篇:
C# ProgramClassParser类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap