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


C# Driver类代码示例

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


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

示例1: MarshalContext

 public MarshalContext(Driver driver)
 {
     Driver = driver;
     SupportBefore = new TextGenerator();
     Return = new TextGenerator();
     MarshalVarPrefix = string.Empty;
 }
开发者ID:kitsilanosoftware,项目名称:CppSharp,代码行数:7,代码来源:Marshal.cs

示例2: LearnAndTransmitACode

        private static void LearnAndTransmitACode()
        {
            using (var driver = new Driver())
            {
                Console.WriteLine(Driver.GetVersion(driver).ToString());

                Console.WriteLine("Receiving...");
                var receiver = new Receiver(driver);
                receiver.GenerateLegacyCodes = false;
                receiver.Received += OnReceive;

                var learner = new Learner(driver);
                learner.Learning += OnLearning;
                Console.WriteLine("Learning...");
                var result = learner.Learn();
                Console.WriteLine("Learned code: " + result);

                Console.WriteLine("Hit enter to Transmit");
                Console.ReadLine();
                var transmitter = new Transmitter(driver);
                transmitter.TransmitCompleted += OnTransmitComplete;
                transmitter.TransmitAsync(result, emitter: Emitter.Internal)
                    .ContinueWith(t => Console.WriteLine(t.Exception == null
                                        ? "Transmit Complete - from task"
                                        : t.Exception.ToString()));
            }
        }
开发者ID:JordanZaerr,项目名称:Usb-Uirt-managed-wrapper,代码行数:27,代码来源:Program.cs

示例3: SetupPasses

 public override void SetupPasses(Driver driver)
 {
     driver.Options.GenerateInterfacesForMultipleInheritance = true;
     driver.Options.GenerateProperties = true;
     driver.Options.GenerateVirtualTables = true;
     driver.TranslationUnitPasses.AddPass(new TestAttributesPass());
 }
开发者ID:jijamw,项目名称:CppSharp,代码行数:7,代码来源:CSharpTemp.cs

示例4: Main

        static void Main(string[] args)
        {
            Car car= new Car("Lada", "D");
            car.Color= Color.Brown;

            try
            {
                Console.WriteLine(car.CarPassport.Owner.Name);
            }
            catch (NullReferenceException)
            {
                Console.WriteLine("Водитель не назначен");
            }

            Driver dr= new Driver(new DateTime(1998, 11, 22), "Voldemar");
            dr.Category= new List<string>() {"B", "C"};
            try
            {
                car.ChangeOwner(dr, "o777oo");
            }
            catch (NoCategoryException ex)
            {

                Console.WriteLine(ex.Message);
            }

            dr.Category.Add("D");
            car.ChangeOwner(dr, "o777oo");
            Console.WriteLine(dr.Car.CarNumber);
            Console.WriteLine(car.CarPassport.Owner.Name);

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

示例5: SetupPasses

 public override void SetupPasses(Driver driver)
 {
     driver.Options.GenerateCopyConstructors = true;
     driver.Options.MarshalCharAsManagedChar = true;
     driver.Options.GenerateProperties = true;
     driver.Options.GenerateConversionOperators = true;
 }
开发者ID:xistoso,项目名称:CppSharp,代码行数:7,代码来源:TypeMaps.cs

示例6: Setup

        public virtual void Setup(Driver driver)
        {
            var options = driver.Options;
            options.LibraryName = name;
            options.GeneratorKind = kind;
            options.OutputDir = Path.Combine(GetOutputDirectory(), "gen", name);
            options.SharedLibraryName = name + ".Native";
            options.Quiet = true;
            options.IgnoreParseWarnings = true;

            driver.Diagnostics.Message("");
            driver.Diagnostics.Message("Generating bindings for {0} ({1})",
                options.LibraryName, options.GeneratorKind.ToString());

            // Workaround for CLR which does not check for .dll if the
            // name already has a dot.
            if (!Platform.IsMono)
                options.SharedLibraryName += ".dll";

            var parserOptions = driver.ParserOptions;
            if (Platform.IsMacOS)
                parserOptions.TargetTriple = Environment.Is64BitProcess ? "x86_64-apple-darwin" : "i686-apple-darwin";

            var path = Path.GetFullPath(GetTestsDirectory(name));
            parserOptions.AddIncludeDirs(path);

            driver.Diagnostics.Message("Looking for tests in: {0}", path);
            var files = Directory.EnumerateFiles(path, "*.h");
            foreach (var file in files)
                options.Headers.Add(Path.GetFileName(file));
        }
开发者ID:ddobrev,项目名称:CppSharp,代码行数:31,代码来源:GeneratorTest.cs

示例7: Add

        public void Add(Driver driver)
        {
            if (_list.Exists(item => item == driver))
                return;

            _list.Add(driver);
        }
开发者ID:NextStalker,项目名称:BBAuto,代码行数:7,代码来源:DriverList.cs

示例8: SetupPasses

 public override void SetupPasses(Driver driver)
 {
     driver.Options.MarshalCharAsManagedChar = true;
     driver.Options.GenerateProperties = true;
     driver.Options.GenerateConversionOperators = true;
     driver.Options.GenerateDefaultValuesForArguments = true;
 }
开发者ID:tritao,项目名称:CppSharp,代码行数:7,代码来源:Common.cs

示例9: Car

 public Car(string name, int numberOfOccupant, string model, Driver driver)
 {
     Name = name;
     NumberOfOccupant = numberOfOccupant;
     Model = model;
     Driver = driver;
 }
开发者ID:spolnik,项目名称:ndatabase,代码行数:7,代码来源:Car.cs

示例10: Main

        static void Main(string[] args)
        {
            var firstCar = new Car("Лада", 'D')
            {
                Color = Color.BlueViolet
            };
            Console.WriteLine("Приобретена машина {0}, " +
                  "категории: {1}, цвет: {2}",
                  firstCar.Model, firstCar.Category, firstCar.Color);
            try
            {
                Console.WriteLine("Имя владельца: " + firstCar.CarPassport.Owner.Name);
            }
            catch (Exception)
            {
                Console.WriteLine("Ошибка! У владельца отсутствует имя");
            }

            var firstDriver = new Driver(new DateTime(2014, 7, 15), "Вольдемар")
            {
                Category = new [] {'B', 'C'}
            };

            firstCar.ChangeOwner(firstDriver, "oo777o");
            firstDriver.Category = new [] {'B','C','D'};
            firstCar.ChangeOwner(firstDriver, "oo777o");
            Console.WriteLine("Номер машины: " + firstCar.CarNumber);
            Console.WriteLine("Имя водителя Лады: " + firstDriver.Name);
            Console.ReadKey();
        }
开发者ID:atenyaev,项目名称:HomeWork2,代码行数:30,代码来源:Program.cs

示例11: isCarsDriver

 internal bool isCarsDriver(Driver driver, DateTime date)
 {
     if ((date >= DateTime.Today) && (dateEnd == DateTime.Today))
         return driver.ID == Driver.ID && date >= dateBegin;
     else
         return driver.ID == Driver.ID && date >= dateBegin && date < dateEnd;
 }
开发者ID:NextStalker,项目名称:BBAuto,代码行数:7,代码来源:DriverCar.cs

示例12: Edit

 public void Edit(Driver entity)
 {
     _context.Drivers.Attach(entity);
     var entry = _context.Entry(entity);
     entry.State = EntityState.Modified;
     _context.SaveChanges();
 }
开发者ID:juliancemTI-142,项目名称:Iulian-Cemirtan,代码行数:7,代码来源:EFDriverRepository.cs

示例13: btnEndAdd_Click

 private void btnEndAdd_Click(object sender, EventArgs e)
 {
     Form1 mainForm = this.Owner as Form1;
     if (rbTransport.Checked)
     {
         if (tbTNumber.Text != "" && tbTRoute.Text != "" && tbTModel.Text != "")
         {
             try
             {
                 Transport currTransport = new Transport(tbTNumber.Text, Convert.ToInt32(tbTRoute.Text), tbTModel.Text);
                 mainForm.transports.Add(currTransport); // Добавления нового транспортного средства в основной список
                 this.Close();
             }
             catch (Exception ex)
             {
                 MessageBox.Show(ex.Message);
             }
         }
         else
             MessageBox.Show("Все поля обязательны для заполнения");
     }
     else if (rbDriver.Checked)
     {
         if (tbDFio.Text != "" && tbDCategory.Text != "")
         {
             try
             {
                 Driver currDriver = new Driver(tbDFio.Text, tbDCategory.Text);
                 mainForm.drivers.Add(currDriver); // Добавления нового водителя в основной список
                 this.Close();
             }
             catch (Exception ex)
             {
                 MessageBox.Show(ex.Message);
             }
         }
         else
             MessageBox.Show("Все поля обязательны для заполнения");
     }
     else if (rbCompany.Checked)
     {
         if (tbCName.Text != "")
         {
             try
             {
                 Company currCompany = new Company(tbCName.Text);
                 mainForm.companies.Add(currCompany);
                 this.Close();
             }
             catch (Exception ex)
             {
                 MessageBox.Show(ex.Message);
             }
         }
         else
             MessageBox.Show("Все поля обязательны для заполнения");
     }
     else
         MessageBox.Show("Выберите режим добавления");
 }
开发者ID:OpenSourceMyIKIT,项目名称:SoftEngineering,代码行数:60,代码来源:AddPatient.cs

示例14: Setup

        public override void Setup(Driver driver)
        {
            base.Setup(driver);

            driver.Options.OutputNamespace = "CommonTest";
            driver.Options.UnityBuild = true;
        }
开发者ID:ddobrev,项目名称:CppSharp,代码行数:7,代码来源:Common.cs

示例15: Main

 static void Main(string[] args)
 {
     Car car = new Car("Lada", "D") { Color = Color.DarkMagenta };
     try
     {
         Console.WriteLine(car.CarPassport.Owner.Name);
     }
     catch (NullReferenceException)
     {
         Console.WriteLine("Нет имени владельца");
     }
     Driver driver = new Driver(new DateTime(1990, 10, 10), "Вольдемар") { Category = "BC" };
     try
     {
         car.ChangeOwner(driver, "о777оо");
     }
     catch (CarException carException)
     {
         Console.WriteLine(carException.Message);
     }
     driver.Category = driver.Category.Insert(2, "D");
     car.ChangeOwner(driver, "о777оо");
     Console.WriteLine(driver.Car.CarNumber);
     Console.WriteLine(car.CarPassport.Owner.Name);
     Console.ReadKey();
 }
开发者ID:egolodnikov,项目名称:HomeWork-2,代码行数:26,代码来源:Program.cs


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