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


C# Import类代码示例

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


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

示例1: Import

        public virtual void Import(Import import)
        {
            if (Parser == null)
                throw new InvalidOperationException("Parser cannot be null.");

            var file = paths.Concat(new[] { import.Path }).Aggregate("", Path.Combine);

            file = Path.Combine(Path.GetDirectoryName(file), Path.GetFileName(file));

            var contents = FileReader.GetFileContents(file);

            paths.Add(Path.GetDirectoryName(import.Path));

            try
            {
                Imports.Add(file);
                import.InnerRoot = Parser().Parse(contents, file);
            }
            catch
            {
                Imports.Remove(file);
                throw;
            }
            finally
            {
                paths.RemoveAt(paths.Count - 1);
            }
        }
开发者ID:ayoung,项目名称:dotless,代码行数:28,代码来源:Importer.cs

示例2: GetAggregateVersionsFromFile

        public List<AggregateView> GetAggregateVersionsFromFile()
        {
            var import = new Import();
            var allText = File.ReadAllText(HostingEnvironment.MapPath(import.YouTrackJsonFile));

            return new JavaScriptSerializer().Deserialize<List<AggregateView>>(allText);
        }
开发者ID:Aaen,项目名称:OurUmbraco,代码行数:7,代码来源:Versions.cs

示例3: PrintInfo

 private void PrintInfo(Import import) {
     Log($"Wait ended because import #{import.Id} completed.");
     if (Dictionary.Any())
         Log("\nCurrent Status of Tasks:");
     foreach (var kvp in Dictionary) {
         Log($"Import {kvp.Key}: {kvp.Value.Status}");
     }
 }
开发者ID:SorrowAureus,项目名称:OrchGretchin,代码行数:8,代码来源:OrchService.cs

示例4: HTMLLog

 internal HTMLLog(Import.DAImport.Common.DIImportFileType importType, int totalTimperiod, int totalSource, int totalData,
     DataTable indicatorLogInfoTable, DataTable unitLogInfoTable, DataTable subgroupLogInfoTable,
     DataTable areaLogInfoTable, DataTable duplicateRecordsInfoTable, DataTable skippedIUSInfoTable, DataTable skippedFiles)
 {
     this.SetBasicValues(importType, totalTimperiod, totalSource, totalData,
     indicatorLogInfoTable, unitLogInfoTable, subgroupLogInfoTable,
     areaLogInfoTable, duplicateRecordsInfoTable, skippedIUSInfoTable, skippedFiles);
 }
开发者ID:SDRC-India,项目名称:sdrcdevinfo,代码行数:8,代码来源:HTMLLog+.cs

示例5: EmployeeViewModel

 /// <summary>
 /// Employee View Model Constructor. 
 /// Will load all employees from excel
 /// </summary>
 public EmployeeViewModel()
 {
     RMA_Roots.AppConfig.LoadAppConfiguration("EmployeeOverview");
     _sitzplanSource = new BitmapImage(new Uri(@"D:\sitzplan.png"));
     var import = new Import();
     _employees = import.Employees;
     _employees = _employees.OrderBy(f => f.Vorname).ToList();
     _showSeatingVisibility = Visibility.Hidden;
 }
开发者ID:tsbrzesny,项目名称:rma-alzheimer,代码行数:13,代码来源:EmployeeViewModel.cs

示例6: ScrubbingService

 public ScrubbingService(IInvoicingService invoicingService, IContractRepository contractRepository,                                
     Import.ICallDataImportManager importManager, IAccountRepository accountRepository,
     IInvoiceRepository invoiceRepository)
 {
     _invoicingService = invoicingService;
     _contractRepository = contractRepository;
     _importManager = importManager;
     _accountRepository = accountRepository;
     _invoiceRepository = invoiceRepository;
 }
开发者ID:robgray,项目名称:Tucana,代码行数:10,代码来源:ScrubbingService.cs

示例7: ReadExcel_CaiWuExcel_ReturnDataTable

 public void ReadExcel_CaiWuExcel_ReturnDataTable()
 {
     //arrange
     var filePath = @"D:\Codes\10月对账\10月财务\1.XLS";
     var excelImport = new Import(filePath, 4);
     //act
     var actual = excelImport.ReadCaiWu<CaiWuItem>();
     //assert
     Assert.IsTrue(actual.Count() > 1);
 }
开发者ID:meng004,项目名称:JournalVoucherAudit,代码行数:10,代码来源:ExcelImportTests.cs

示例8: Create

        public ActionResult Create(Import import)
        {
            if (Session["login_status"] != null)
            {
                int[] z = (int[])Session["function_id"];
                if (z.Contains(11))
                {
                    var importer_name = "";
                    var importer_name1 = from i in db.Importers
                                         where i.importer_id == import.importer_id
                                         select i;
                    foreach (var item in importer_name1)
                    {
                        importer_name = item.importer_first_name + " " + item.importer_middle_name + " " + item.importer_last_name;
                    }
                    if (ModelState.IsValid)
                    {
                        var is_exist = (from i in db.Imports
                                        join ir in db.Importers on i.importer_id equals ir.importer_id
                                        join it in db.Importer_Type on ir.importer_type_id equals it.importer_type_id
                                        where i.importer_id == import.importer_id && i.ship_arrival_id == import.ship_arrival_id && it.is_multiple_allowed != true select i).Count();
                        if (is_exist > 0)
                        {
                            TempData["errorMessage"] = "This Import Already Exist";
                        }
                        else
                        {
                            import.payment_id = 1;
                            import.import_code = importer_name;
                            import.importing_status_id = 1;
                            import.created_date = Convert.ToDateTime(DateTime.Now.ToString()).ToString("yyyy-MM-dd");
                            import.updated_date = Convert.ToDateTime(DateTime.Now.ToString()).ToString("yyyy-MM-dd");
                            db.Imports.Add(import);
                            db.SaveChanges();
                            import.import_code = import.import_code + "000" + import.import_id;
                            db.Entry(import).State = EntityState.Modified;
                            db.SaveChanges();
                            TempData["errorMessage"] = "Import Added Successfully";
                        }
                        return RedirectToAction("Index");
                    }

                    return View(import);

                }
                else
                {
                    return RedirectToAction("../Home/Dashboard");
                }
            }
            else
            {
                return RedirectToAction("../Home");
            }
        }
开发者ID:BTEEMRIYAS,项目名称:TestProject,代码行数:55,代码来源:Manage_ImportController.cs

示例9: GetAllReleaseFromFile

        public static List<AggregateView> GetAllReleaseFromFile()
        {
            var import = new Import();
            if (File.Exists(HttpContext.Current.Server.MapPath(import.YouTrackJsonFile)) == false)
                import.SaveAllToFile();

            var allText = File.ReadAllText(HttpContext.Current.Server.MapPath(import.YouTrackJsonFile));

            var data = new JavaScriptSerializer().Deserialize<List<AggregateView>>(allText);

            return data;
        }
开发者ID:ClaytonWang,项目名称:OurUmbraco,代码行数:12,代码来源:Release.cs

示例10: Main

        static void Main(string[] args)
        {
            Import im = new Import();
            Console.WriteLine("文本URL:");
            string path = Console.ReadLine();
            im.readFromTxt(path);

            ExcelProcess exlP = new ExcelProcess(path.Substring(0, path.Count() - 5));

            exlP.ImportExcel(im.GetContent());
            Console.WriteLine("导入成功!");
            Console.Read();
        }
开发者ID:272489711,项目名称:SV_AIO_WinForm,代码行数:13,代码来源:Program.cs

示例11: Form1

 public Form1()
 {
     syn = SynchronizationContext.Current;
     //MessageBox.Show();
     import = new Import(ConfigurationManager.ConnectionStrings["Default"].ConnectionString);
     InitializeComponent();
     worker = new BackgroundWorker();
     worker.DoWork += new DoWorkEventHandler(ThreadFunction);
     worker1 = new BackgroundWorker();
     worker1.DoWork += new DoWorkEventHandler(ThreadCount);
     //worker.WorkerReportsProgress = true;
     //worker.ProgressChanged += (WorkerForChanged);
 }
开发者ID:272489711,项目名称:SV_AIO_WinForm,代码行数:13,代码来源:Form1.cs

示例12: GetRoadmapReleasesFromFile

        public static IEnumerable<AggregateView> GetRoadmapReleasesFromFile()
        {
            var import = new Import();
            if (File.Exists(HttpContext.Current.Server.MapPath(import.YouTrackJsonFile)) == false)
                import.SaveAllToFile();

            var allText = File.ReadAllText(HttpContext.Current.Server.MapPath(import.YouTrackJsonFile));

            var data = new JavaScriptSerializer().Deserialize<List<AggregateView>>(allText);
            var result = data.Where(x => x.released == false && x.isPatch == false);

            return result;
        }
开发者ID:QuangDang212,项目名称:OurUmbraco,代码行数:13,代码来源:Roadmap.cs

示例13: Start

 public static void Start()
 {
     using (DisposableTimer.DebugDuration<YouTrackSync>(() => "YouTrack import executing", () => "YouTrack import complete"))
     {
         try
         {
             var import = new Import();
             import.SaveAllToFile();
         }
         catch (Exception ex)
         {
             LogHelper.Error<YouTrackSync>("Error importing from YouTrack", ex);
         }
     }
 }
开发者ID:larrynPL,项目名称:OurUmbraco,代码行数:15,代码来源:YouTrackSync.cs

示例14: BuilderVisitorShouldBuildImport

        public void BuilderVisitorShouldBuildImport()
        {
            #region Arrange Package Node Input

            var root = new RootNode();
            var import = new Node(NodeType.Import, "import");
            var type = new Node(NodeType.ImportModifier, "public");
            var otherMessage = new Node(NodeType.StringLiteral, "other.message");
            import.AddChildren(type, otherMessage);
            root.AddChild(import);

            #endregion Arrange Package Node Input

            var expected = new Import("public", "other.message");
            var sut = new BuilderVisitor();
            root.Accept(sut);

            sut.FileDescriptor.Imports.First().Should().Be(expected);
        }
开发者ID:mholo65,项目名称:ProtobufGenerator,代码行数:19,代码来源:VisitorTests.cs

示例15: MakeModule

        public Declr MakeModule(String moduleName, IReadOnlyList<IClassItem> moduleItems, bool importPrelude = true)
        {
            IReadOnlyList<IClassItem> modItems;
            if (importPrelude)
                modItems = new Import
                {
                    QualifiedIdent = new Ident("prelude", IdentCategory.Value)
                }.Append(moduleItems).ToList();
            else
                modItems = moduleItems;

            return new Declr(
                new Ident(moduleName, IdentCategory.Value),
                null,
                new New(new Class(modItems)))
            {
                IsVar = true,
                Attributes = new List<Ident> { new Ident("public") }
            };
        }
开发者ID:michal-minich,项目名称:Efekt-CS,代码行数:20,代码来源:Rewriter.cs


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