当前位置: 首页>>代码示例>>C#>>正文


C# ProgressMonitor.setProgress方法代码示例

本文整理汇总了C#中ProgressMonitor.setProgress方法的典型用法代码示例。如果您正苦于以下问题:C# ProgressMonitor.setProgress方法的具体用法?C# ProgressMonitor.setProgress怎么用?C# ProgressMonitor.setProgress使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在ProgressMonitor的用法示例。


在下文中一共展示了ProgressMonitor.setProgress方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: main

    public static void main(string[] args)
    {
      Exception exception1;
      try
      {
        SwingUtilities.invokeAndWait((Runnable) new main\u00241());
        goto label_5;
      }
      catch (Exception ex)
      {
        int num = 0;
        M0 m0 = ByteCodeHelper.MapException<Exception>(ex, (ByteCodeHelper.MapFlags) num);
        if (m0 == null)
          throw;
        else
          exception1 = (Exception) m0;
      }
      Throwable.instancehelper_printStackTrace((Exception) exception1);
      System.exit(2);
label_5:
      ProgressMonitor monitor = new ProgressMonitor((Component) null, (object) "Loading SmartDashboard", "Initializing internal code...", 0, 1000);
      FileSniffer.findExtensions(monitor, 0, 490);
      string[] args1 = args;
      int num1 = 1;
      int num2 = 1;
      string[] valueArgs = new string[1];
      int index = 0;
      string str1 = "ip";
      valueArgs[index] = str1;
      ArgParser argParser = new ArgParser(args1, num1 != 0, num2 != 0, valueArgs);
      main.inCompetition = argParser.hasFlag("competition");
      Exception exception2;
      try
      {
        SwingUtilities.invokeAndWait((Runnable) new main\u00242());
        goto label_11;
      }
      catch (Exception ex)
      {
        int num3 = 0;
        M0 m0 = ByteCodeHelper.MapException<Exception>(ex, (ByteCodeHelper.MapFlags) num3);
        if (m0 == null)
          throw;
        else
          exception2 = (Exception) m0;
      }
      Throwable.instancehelper_printStackTrace((Exception) exception2);
      System.exit(2);
label_11:
      IntegerProperty integerProperty = main.frame.getPrefs().__\u003C\u003Eteam;
      if (argParser.hasValue("ip"))
      {
        monitor.setProgress(650);
        monitor.setNote(new StringBuilder().append("Connecting to robot at: ").append(argParser.getValue("ip")).toString());
        Robot.setHost(argParser.getValue("ip"));
      }
      else
      {
        monitor.setProgress(600);
        monitor.setNote("Getting Team Number");
        int num3 = integerProperty.getValue().intValue();
        while (num3 <= 0)
        {
          string str2;
          try
          {
            str2 = JOptionPane.showInputDialog((object) "Input Team Number");
            if (str2 == null)
            {
              num3 = 0;
              break;
            }
            else
              goto label_20;
          }
          catch (Exception ex)
          {
            int num4 = 2;
            if (ByteCodeHelper.MapException<Exception>(ex, (ByteCodeHelper.MapFlags) num4) == null)
              throw;
          }
          // ISSUE: variable of the null type
          __Null local = null;
          goto label_24;
label_20:
          try
          {
            num3 = Integer.parseInt(str2);
            continue;
          }
          catch (Exception ex)
          {
            int num4 = 2;
            if (ByteCodeHelper.MapException<Exception>(ex, (ByteCodeHelper.MapFlags) num4) == null)
              throw;
          }
          local = null;
label_24:;
        }
        monitor.setProgress(650);
//.........这里部分代码省略.........
开发者ID:NALSS,项目名称:SmartDashboard.NET,代码行数:101,代码来源:main.cs

示例2: findExtensions

    public static void findExtensions(ProgressMonitor monitor, int min, int max)
    {
      monitor.setNote("Loading Extensions");
      File file1 = new File("./extensions");
      File file2 = new File("./lib");
      File file3 = new File("./extensions/lib");
      URLClassLoader urlClassLoader1 = (URLClassLoader) ClassLoader.getSystemClassLoader(FileSniffer.__\u003CGetCallerID\u003E());
      Class class1 = (Class) ClassLiteral<URLClassLoader>.Value;
      Method declaredMethod;
      Exception exception1;
      try
      {
        Class class2 = class1;
        string str = "addURL";
        Class[] classArray = new Class[1];
        int index = 0;
        // ISSUE: variable of the null type
        __Null local = ClassLiteral<URL>.Value;
        classArray[index] = (Class) local;
        CallerID callerId = FileSniffer.__\u003CGetCallerID\u003E();
        declaredMethod = class2.getDeclaredMethod(str, classArray, callerId);
        ((AccessibleObject) declaredMethod).setAccessible(true);
        goto label_6;
      }
      catch (Exception ex)
      {
        int num = 0;
        M0 m0 = ByteCodeHelper.MapException<Exception>(ex, (ByteCodeHelper.MapFlags) num);
        if (m0 == null)
          throw;
        else
          exception1 = (Exception) m0;
      }
      Throwable.instancehelper_printStackTrace((Exception) exception1);
      monitor.setProgress(max);
      return;
label_6:
      File[] fileArray1 = new File[3];
      int index1 = 0;
      File file4 = file2;
      fileArray1[index1] = file4;
      int index2 = 1;
      File file5 = file3;
      fileArray1[index2] = file5;
      int index3 = 2;
      File file6 = file1;
      fileArray1[index3] = file6;
      File[] fileArray2 = fileArray1;
      int length1 = fileArray2.Length;
      for (int index4 = 0; index4 < length1; ++index4)
      {
        File file7 = fileArray2[index4];
        if (!file7.exists())
        {
          monitor.setProgress(min + (max - min) / 5);
        }
        else
        {
          System.get_out().println(new StringBuilder().append("Searching Folder:").append((object) file7).toString());
          monitor.setNote(new StringBuilder().append("Searching Folder:").append((object) file7).toString());
          File[] fileArray3 = file7.listFiles((FilenameFilter) new FileSniffer\u00241());
          if (fileArray3 == null)
          {
            monitor.setProgress(min + (max - min) / 5);
          }
          else
          {
            File[] fileArray4 = fileArray3;
            int length2 = fileArray4.Length;
            for (int index5 = 0; index5 < length2; ++index5)
            {
              File file8 = fileArray4[index5];
              System.get_out().println(new StringBuilder().append("Adding Jar:").append((object) file8).toString());
              Exception exception2;
              try
              {
                Method method = declaredMethod;
                URLClassLoader urlClassLoader2 = urlClassLoader1;
                object[] objArray = new object[1];
                int index6 = 0;
                URL url = file8.toURI().toURL();
                objArray[index6] = (object) url;
                CallerID callerId = FileSniffer.__\u003CGetCallerID\u003E();
                method.invoke((object) urlClassLoader2, objArray, callerId);
                continue;
              }
              catch (Exception ex)
              {
                int num = 0;
                M0 m0 = ByteCodeHelper.MapException<Exception>(ex, (ByteCodeHelper.MapFlags) num);
                if (m0 == null)
                  throw;
                else
                  exception2 = (Exception) m0;
              }
              Throwable.instancehelper_printStackTrace((Exception) exception2);
            }
            monitor.setProgress(min + (max - min) / 5);
          }
        }
//.........这里部分代码省略.........
开发者ID:NALSS,项目名称:SmartDashboard.NET,代码行数:101,代码来源:FileSniffer.cs


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