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

C# Program类代码示例

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

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



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

示例1: Main

        static void Main(string[] args)
        {
            var program = new Program();
            Mapper.CreateMap<Customer, CustomerViewItem>();

            Stopwatch watch = new Stopwatch();

            for (int x = 1; x <= 100000; x *= 10)
            {
                program.PopulateCustomers(x);

                watch.Start();
                program.RunMapper(x);
                watch.Stop();
                Console.WriteLine(string.Format("AutoMapper with {0}: {1}", x, watch.ElapsedMilliseconds));

                watch.Reset();

                watch.Start();
                program.RunManual(x);
                watch.Stop();
                Console.WriteLine(string.Format("Manual Map with {0}: {1}", x, watch.ElapsedMilliseconds));
            }

            Console.ReadLine();
        }
开发者ID:endyourif,项目名称:AutomapperPerformance,代码行数:26,代码来源:Program.cs


示例2: DisassemblyTextModel

 public DisassemblyTextModel(Program program)
 {
     if (program == null)
         throw new ArgumentNullException("program");
     this.program = program;
     this.position = program.Image.BaseAddress;
 }
开发者ID:gh0std4ncer,项目名称:reko,代码行数:7,代码来源:DisassemblyTextModel.cs


示例3: DeleteProgram

 public bool DeleteProgram(Program program)
 {
     if (program == null) return false;
     _unitOfWork.ProgramRepository.Delete(program);
     _unitOfWork.Save();
     return true;
 }
开发者ID:edgecomputing,项目名称:cats,代码行数:7,代码来源:ProgramService.cs


示例4: SendData

 ///<summary>Launches the program using a combination of command line characters and the patient.Cur data.</summary>
 public static void SendData(Program ProgramCur,Patient pat)
 {
     //Example CerPI.exe -<patNum>;<fname>;<lname>;<birthday DD.MM.YYYY>; (Date format specified in the windows Regional Settings)
     if(pat==null) {
         try {
             Process.Start(ProgramCur.Path);//should start Cerec without bringing up a pt.
         }
         catch {
             MessageBox.Show(ProgramCur.Path+" is not available.");
         }
         return;
     }
     string info= " -" ;
     if(ProgramProperties.GetPropVal(ProgramCur.ProgramNum,"Enter 0 to use PatientNum, or 1 to use ChartNum")=="0") {
         info+=pat.PatNum.ToString()+";";
     }
     else {
         info+=pat.ChartNumber.ToString()+";";
     }
     info+=pat.FName+";"+pat.LName+";"+pat.Birthdate.ToShortDateString()+";";
     try {
         Process.Start(ProgramCur.Path,info);
     }
     catch {
         MessageBox.Show(ProgramCur.Path+" is not available, or there is an error in the command line options.");
     }
 }
开发者ID:nampn,项目名称:ODental,代码行数:28,代码来源:Cerec.cs


示例5: SendData

		///<summary></summary>
		public static void SendData(Program ProgramCur,Patient pat) {
			_path=Programs.GetProgramPath(Programs.GetCur(ProgramName.DemandForce));
			if(!File.Exists(_path)) {
				MessageBox.Show(_path+" could not be found.");
				return;
			}
			if(MessageBox.Show(Lan.g("DemandForce","This may take 20 minutes or longer")+".  "+Lan.g("DemandForce","Continue")+"?","",MessageBoxButtons.OKCancel)!=DialogResult.OK) {
				return;
			}
			_formProg=new FormProgress();
			_formProg.MaxVal=100;
			_formProg.NumberMultiplication=1;
			_formProg.DisplayText="";
			_formProg.NumberFormat="F";//Show whole percentages, not fractional percentages.
			Thread workerThread=new Thread(new ThreadStart(InstanceBridgeExport));
			workerThread.Start();
			if(_formProg.ShowDialog()==DialogResult.Cancel) {
				workerThread.Abort();
				MessageBox.Show(Lan.g("DemandForce","Export cancelled")+". "+Lan.g("DemandForce","Partially created file has been deleted")+".");
				CheckCreatedFile(CodeBase.ODFileUtils.CombinePaths(Path.GetDirectoryName(_path),"extract.xml"));
				_formProg.Dispose();
				return;
			}
			MessageBox.Show(Lan.g("DemandForce","Export complete")+". "+Lan.g("DemandForce","Press OK to launch DemandForce")+".");
			try {
				Process.Start(_path);//We might have to add extract.xml to launch command in the future.
			}
			catch {
				MessageBox.Show(_path+" is not available.");
			}
			_formProg.Dispose();
		}
开发者ID:mnisl,项目名称:OD,代码行数:33,代码来源:DemandForce.cs


示例6: Main

        /// <summary>
        /// Start the console server.
        /// </summary>
        /// <param name="args">These are optional arguments.Pass the local ip address of the server as the first argument and the local port as the second argument.</param>
        public static void Main(string[] args)
        {
            var progDomain = new Program {_clients = new List<ClientManager>()};

            if (args.Length == 0)
            {
                progDomain._serverPort = 8000;
                progDomain._serverIp = IPAddress.Any;
            }
            if (args.Length == 1)
            {
                progDomain._serverIp = IPAddress.Parse(args[0]);
                progDomain._serverPort = 8000;
            }
            if (args.Length == 2)
            {
                progDomain._serverIp = IPAddress.Parse(args[0]);
                progDomain._serverPort = int.Parse(args[1]);
            }

            progDomain._bwListener = new BackgroundWorker {WorkerSupportsCancellation = true};
            progDomain._bwListener.DoWork += progDomain.StartToListen;
            progDomain._bwListener.RunWorkerAsync();

            Console.WriteLine("*** Listening on port {0}{1}{2} started.Press ENTER to shutdown server. ***\n", progDomain._serverIp, ":", progDomain._serverPort);

            Console.ReadLine();

            progDomain.DisconnectServer();
        }
开发者ID:tirvoenka,项目名称:LaserGesture,代码行数:34,代码来源:Program.cs


示例7: Main

 static void Main(string[] args)
 {
     var p = new Program();
     p.UseIdentityMonad();
     p.UseMaybeMonad();
     Console.ReadLine();
 }
开发者ID:paulomouat,项目名称:spikes,代码行数:7,代码来源:Program.cs


示例8: Main

 private static void Main(string[] args)
 {
     Program p = new Program();
     string userSelectedOption = "";
     do
     {
         userSelectedOption = p.GetUserInput();
         switch (userSelectedOption)
         {
             case "1":
                 p.DisplayOrders();
                 break;
             case "2":
                 p.AddAnOrder();
                 break;
             case "3":
                 p.EditAnOrder();
                 break;
             case "4":
                 p.RemoveAnOrder();
                 break;
             case "5":
                 break;
             default:
                 Console.Clear();
                 Console.WriteLine("Thats not a valid choice. Please select again");
                 Console.WriteLine("");
                 break;
         }
     } while (userSelectedOption != "5");
 }
开发者ID:JaminTc,项目名称:Mystuff,代码行数:31,代码来源:Program.cs


示例9: init

        public void init(int programID, AxMapControl mc, AxToolbarControl tc, MainWindow mw)
        {
            inited = true;

            program = new Program();
            program.id = programID;
            program.select();

            mapControl = mc;
            toolbarControl = tc;
            mainWindow = mw;
            mainRoadList = program.getAllRelatedMainRoad();
            if (mainRoadList == null)
                mainRoadList = new ObservableCollection<MainRoad>();

            foreach (MainRoad mainRoad in mainRoadList)
            {
                GisUtil.DrawPolylineElement(mainRoad.lineElement, mapControl);   
            }

            valid = isValid();
            dirty = false;

            mapControlMouseDown = null;
            MainRoadListBox.ItemsSource = mainRoadList;
        }
开发者ID:Leooonard,项目名称:CGXM,代码行数:26,代码来源:SelectMainRoadUserControl.xaml.cs


示例10: MainState

        public MainState(Program handle)
            : base(handle,TypeState.Normal)
        {
            _arrayState = new State[9];
            string disconnect = "(disconnect)";
            _menu = new Menu(MainHandle.Display_N18);
            _menu.Title = "SDK Gadgeteer";
            _menu.Lines[0] = "On/off Button led";
            _menu.Lines[1] = "Demo Joystick";
            _menu.Lines[2] = "Demo Timer";
            _menu.Lines[3] = "Demo SDCard";
            _menu.Lines[4] = "Demo Tunes";
            _menu.Lines[5] = "Demo Led Strip";
            _menu.Lines[6] = "Demo Screen";
            _menu.Lines[7] = "Item7";
            _menu.Lines[8] = "Infos,versions,...";

            if (MainHandle.Tunes == null)
                _menu.Lines[4] += disconnect;

            if (MainHandle.LED_Strip == null)
                _menu.Lines[5] += disconnect;

            _menu.Draw();
        }
开发者ID:Rhesos,项目名称:SDKGadgeteer,代码行数:25,代码来源:MainState.cs


示例11: Main

        static void Main(string[] args)
        {
            System.Console.WriteLine("OMGHAI!");

            var app = new Program()
                          {
                              Items = new List<Item>
                                          {
                                              new Item {Name = "+5 Dexterity Vest", SellIn = 10, Quality = 20},
                                              new Item {Name = "Aged Brie", SellIn = 2, Quality = 0},
                                              new Item {Name = "Elixir of the Mongoose", SellIn = 5, Quality = 7},
                                              new Item {Name = "Sulfuras, Hand of Ragnaros", SellIn = 0, Quality = 80},
                                              new Item
                                                  {
                                                      Name = "Backstage passes to a TAFKAL80ETC concert",
                                                      SellIn = 15,
                                                      Quality = 20
                                                  },
                                              new Item {Name = "Conjured Mana Cake", SellIn = 3, Quality = 6}
                                          }

                          };

            app.UpdateQuality();

            System.Console.ReadKey();
        }
开发者ID:fgsahoward,项目名称:AHoward-GildedRose,代码行数:27,代码来源:Program.cs


示例12: RunTest

        protected override void RunTest(Program program, string outputFile)
        {
            var eventListener = new FakeDecompilerEventListener();
            using (FileUnitTester fut = new FileUnitTester(outputFile))
            {
                fut.TextWriter.WriteLine("// Before ///////");
                DumpProgram(program, fut.TextWriter);

                SetupPreStages(program);
                aen.Transform(program);
                eqb.Build(program);
                var coll = new TypeCollector(program.TypeFactory, program.TypeStore, program,eventListener);
                coll.CollectTypes();
                program.TypeStore.BuildEquivalenceClassDataTypes(program.TypeFactory);
                tvr.ReplaceTypeVariables();
                trans.Transform();
                ctn.RenameAllTypes(program.TypeStore);
                ter = new TypedExpressionRewriter(program, eventListener);
                try
                {
                    ter.RewriteProgram(program);
                }
                catch (Exception ex)
                {
                    fut.TextWriter.WriteLine("** Exception **");
                    fut.TextWriter.WriteLine(ex);
                }
                finally
                {
                    fut.TextWriter.WriteLine("// After ///////");
                    DumpProgAndStore(program, fut);
                }
            }
        }
开发者ID:relaxar,项目名称:reko,代码行数:34,代码来源:TypedExpressionRewriterTests.cs


示例13: Main

        static void Main()
        {
            var generator = new Program();

            generator.RebuildGitParser();
            generator.RebuildGitNumstatParser();
        }
开发者ID:lysannschlegel,项目名称:sharpdiff,代码行数:7,代码来源:Generator.cs


示例14: Main

        static void Main(string[] args)
        {
            var program = new Program();
            Dictionary<string, bool[]> dados = new Dictionary<string, bool[]>
            {
                {"peixe", new[]{true,false,false,false}},
                {"cachorro", new[]{false,false,true,false}},
                {"cobra", new[]{false,false,false,true}},
                {"tucano", new[]{false,true,false,false}},
                {"batima", new[]{false,true,true,false}},
            };

            var perguntas = new[]
            {
                "Ele nada?",
                "Ele voa?",
                "É um mamífero?",
                "É um reptil?",
            };

            Console.WriteLine("Pense em um animal e tecle alguma coisa...");
            Console.ReadKey();

            bool[] respostas = program.ColetaRespostas(perguntas);

            var animal = program.DescobrirAnimal(dados, respostas);

            Console.WriteLine(animal);

            Console.ReadKey();
        }
开发者ID:thailakadre,项目名称:CodingDojoPI,代码行数:31,代码来源:Program.cs


示例15: Translate

        public static List<Error> Translate(Source source)
        {
            var err = new List<Error>();
            var prg = new Program();
            try
            {
                var input = new ANTLRStringStream(source.GetSourceData());
                var lexer = new PascalLexer(input);
                var tokens = new CommonTokenStream(lexer);
                var parser = new PascalParser(tokens);
                prg = parser.program();
                prg.SetSourceIdentifier(source.GetSourceIdentifier());
            }
            catch (RecognitionException e)
            {
                err.Add(new Error(FormatRecognitionException(e, source.GetSourceIdentifier())));
            }
            if (err.Count != 0)
                return err;

            var val = new Validator();
            err = val.Validate(prg);
            Root = prg;
            return err;
        }
开发者ID:BooMWax,项目名称:ifmo,代码行数:25,代码来源:Translator.cs


示例16: Visit

		public void Visit(Program expression)
		{
			foreach (var statement in expression.Statements)
			{
				statement.Accept(this);
			}
		}
开发者ID:925coder,项目名称:ravendb,代码行数:7,代码来源:JsCodeVisitor.cs


示例17: Main

        private static void Main(string[] args)
        {
#if DEBUG
            if (Convert.ToBoolean(ConfigurationManager.AppSettings["debugBreak"]))
            {
                Debugger.Launch();
            }
#endif
            XmlConfigurator.Configure();

            var program = new Program();
            if (Environment.UserInteractive || args.Contains("--console") || args.Contains("-c"))
            {
                program.OnStart(args);

                Console.WriteLine("\r\nPress any key to stop...\r\n");
                Console.ReadKey();

                program.OnStop();
            }
            else
            {
                Run(program);
            }
        }
开发者ID:vipwan,项目名称:CommunityServer,代码行数:25,代码来源:Program.cs


示例18: Main

        /// <summary>
        /// Main method for the sample.
        /// </summary>
        /// <param name="args">command line arguments.</param>
        public static void Main(string[] args)
        {
            try
            {
                using (var client = new DocumentClient(new Uri(EndpointUrl), AuthorizationKey, ConnectionPolicy))
                {
                    var program = new Program(client);
                    program.RunAsync().Wait();
                    Console.WriteLine("Samples completed successfully.");
                }
            }
#if !DEBUG
            catch (Exception e)
            {
                // If the Exception is a DocumentClientException, the "StatusCode" value might help identity 
                // the source of the problem. 
                Console.WriteLine("Samples failed with exception:{0}", e);
            }
#endif
            finally
            {
                Console.WriteLine("End of samples, press any key to exit.");
                Console.ReadKey();
            }
        }
开发者ID:taolin123,项目名称:azure-documentdb-dotnet,代码行数:29,代码来源:Program.cs


示例19: Main

 static void Main(string[] args)
 {
     Program app = new Program();
     app.dowork();
     Console.Out.WriteLine("Press Enter to Finish");
     Console.ReadLine();
 }
开发者ID:charvey45,项目名称:Counter,代码行数:7,代码来源:Program.cs


示例20: Main

        static void Main(string[] args)
        {
            //// 0 1 2
            //TreeNode root = new TreeNode(0);
            //TreeNode left = new TreeNode(1);
            //TreeNode right = new TreeNode(2);

            //[5,3,6,1,4,null,null,null,2]
            //node with value 4
            //node with value 2
            TreeNode root = new TreeNode(5);
            TreeNode n1 = new TreeNode(3);
            TreeNode n2 = new TreeNode(6);
            root.left = n1;
            root.right = n2;
            TreeNode n3 = new TreeNode(1);
            TreeNode n4 = new TreeNode(4);
            TreeNode n7 = new TreeNode(2);
            n1.left = n3;
            n1.right = n4;
            n4.right = n7;

            //root.left = left;
            //left.right = right;

            Program p = new Program();

            Console.WriteLine(p.LowestCommonAncestor(root, n4, n7).val);
            Console.ReadKey();
        }
开发者ID:XUMINSHENG,项目名称:LeetCodePractice,代码行数:30,代码来源:Program.cs



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
C# ProgramClassParser类代码示例发布时间:2022-05-24
下一篇:
C# Profiler类代码示例发布时间: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