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

C# Import类代码示例

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

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



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


示例16: Import

        /// <summary>
        ///  Imports the file inside the import as a dot-less file.
        /// </summary>
        /// <param name="import"></param>
        /// <returns> Whether the file was found - so false if it cannot be found</returns>
        public virtual bool Import(Import import)
        {
            if (Parser == null)
                throw new InvalidOperationException("Parser cannot be null.");

            var file = Paths.Concat(new[] { import.Path }).AggregatePaths(CurrentDirectory);

            if (!FileReader.DoesFileExist(file) && !file.EndsWith(".less"))
            {
                file = file + ".less";
            }

            if (!FileReader.DoesFileExist(file))
            {
                return false;
            }

            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);
            }

            return true;
        }
开发者ID:nlerikheemskerk,项目名称:cassette,代码行数:43,代码来源:Importer.cs


示例17: Create

        public ActionResult Create(Import import)
        {
            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 where i.importer_id == import.importer_id && i.ship_arrival_id == import.ship_arrival_id 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);
        }
开发者ID:BTEEMRIYAS,项目名称:TestProject,代码行数:36,代码来源:Manage_ImportController.cs


示例18: ImportEmbeddedCssContents

 /// <summary>
 ///  Imports a css file from an embedded resource and puts the contents into the import node
 /// </summary>
 /// <param name="file"></param>
 /// <param name="import"></param>
 /// <returns></returns>
 private bool ImportEmbeddedCssContents(string file, Import import)
 {
     string content = ResourceLoader.GetResource(file, FileReader);
     if (content == null) return false;
     import.InnerContent = content;
     return true;
 }
开发者ID:brettveenstra,项目名称:dotless,代码行数:13,代码来源:Importer.cs


示例19: ImportLessFile

        /// <summary>
        ///  Imports a less file and puts the root into the import node
        /// </summary>
        protected bool ImportLessFile(string file, Import import)
        {
            string contents;
            if (IsEmbeddedResource(file))
            {
                contents = ResourceLoader.GetResource(file, FileReader);
                if (contents == null) return false;
            }
            else
            {
                if (!FileReader.DoesFileExist(file) && !file.EndsWith(".less"))
                {
                    file = file + ".less";
                }

                if (!FileReader.DoesFileExist(file))
                {
                    return false;
                }

                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);
            }

            return true;
        }
开发者ID:brettveenstra,项目名称:dotless,代码行数:45,代码来源:Importer.cs


示例20: ImportCssFileContents

        /// <summary>
        ///  Imports a css file and puts the contents into the import node
        /// </summary>
        protected bool ImportCssFileContents(string file, Import import)
        {
            if (!FileReader.DoesFileExist(file))
            {
                return false;
            }

            import.InnerContent = FileReader.GetFileContents(file);

            return true;
        }
开发者ID:brettveenstra,项目名称:dotless,代码行数:14,代码来源:Importer.cs



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

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