本文整理汇总了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);
}
}
示例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);
}
示例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}");
}
}
示例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);
}
示例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;
}
示例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;
}
示例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);
}
示例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");
}
}
示例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;
}
示例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();
}
示例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);
}
示例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;
}
示例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);
}
}
}
示例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);
}
示例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") }
};
}