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

C# Importer类代码示例

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

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



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

示例1: CreateDevirtualizedAttribute

		/// <summary>
		/// Create the DevirtualizedAttribute TypeDef, with a "default .ctor" that
		/// calls the base type's .ctor (System.Attribute).
		/// </summary>
		/// <returns>TypeDef</returns>
		TypeDef CreateDevirtualizedAttribute()
		{
			var importer = new Importer(this.Module);
			var attributeRef = this.Module.CorLibTypes.GetTypeRef("System", "Attribute");
			var attributeCtorRef = importer.Import(attributeRef.ResolveTypeDefThrow().FindMethod(".ctor"));

			var devirtualizedAttr = new TypeDefUser(
				"eazdevirt.Injected", "DevirtualizedAttribute", attributeRef);
			//devirtualizedAttr.Attributes = TypeAttributes.Public | TypeAttributes.AutoLayout
			//	| TypeAttributes.Class | TypeAttributes.AnsiClass;

			var emptyCtor = new MethodDefUser(".ctor", MethodSig.CreateInstance(this.Module.CorLibTypes.Void),
				MethodImplAttributes.IL | MethodImplAttributes.Managed,
				MethodAttributes.Public | MethodAttributes.SpecialName | MethodAttributes.RTSpecialName |
				MethodAttributes.ReuseSlot | MethodAttributes.HideBySig);

			var instructions = new List<Instruction>();
			instructions.Add(OpCodes.Ldarg_0.ToInstruction());
			instructions.Add(OpCodes.Call.ToInstruction(attributeCtorRef)); // Call the constructor .ctor
			instructions.Add(OpCodes.Ret.ToInstruction());
			emptyCtor.Body = new CilBody(false, instructions, new List<ExceptionHandler>(), new List<Local>());

			devirtualizedAttr.Methods.Add(emptyCtor);

			return devirtualizedAttr;
		}
开发者ID:misharcrack,项目名称:eazdevirt,代码行数:31,代码来源:AttributeInjector.cs


示例2: foreach

        internal static bool ScanMediaDirectories
            (
            string[] mediaFolders, 
            ref IList<string> extensionsToIgnore, 
            string[] filmLocations, string[] tvShowsLocations,string[] musicLocations,
            string[] videoExtensions, string[] audioExtensions,
            IEnumerable<string> combinedSceneTags,
            IEnumerable<string> videoExtensionsCommon, Importer importer 
            )
        {


            string pluginpath = Debugger.GetPluginPath();

            foreach (string importRootFolder in mediaFolders)

                if (
                    !CalculateExaminationtimeAndScanMediaFolder
                    (MediaSectionsAllocator.MoviesSection,
                    MediaSectionsAllocator.TvEpisodesSection,
                    MediaSectionsAllocator.MusicSection,
                    ref extensionsToIgnore, filmLocations, 
                    tvShowsLocations,  musicLocations,
                    videoExtensions, audioExtensions,
                    importRootFolder, pluginpath, combinedSceneTags,
                    videoExtensionsCommon )
                    )
                    return false;
            

            return true;
        }
开发者ID:stavrossk,项目名称:MeediFier_for_MeediOS,代码行数:32,代码来源:DirectoryScanner.cs


示例3: Load

 public static ImportNotificationOverview Load(ImportNotification notification,
     ImportNotificationAssessment assessment,
     Exporter exporter,
     Importer importer,
     Producer producer,
     FacilityCollection facilities,
     Shipment shipment,
     TransportRoute transportRoute,
     WasteOperation wasteOperation,
     WasteType wasteType)
 {
     return new ImportNotificationOverview
     {
         Notification = notification,
         Assessment = assessment,
         Exporter = exporter,
         Importer = importer,
         Producer = producer,
         Facilities = facilities,
         Shipment = shipment,
         TransportRoute = transportRoute,
         WasteOperation = wasteOperation,
         WasteType = wasteType
     };
 }
开发者ID:EnvironmentAgency,项目名称:prsd-iws,代码行数:25,代码来源:ImportNotificationOverview.cs


示例4: BinaryTreeMustSortTheSameAsSortedDictionary

        public void BinaryTreeMustSortTheSameAsSortedDictionary()
        {
            // Arrange
            var asm = Assembly.GetExecutingAssembly();
            var importer = new Importer(asm.GetManifestResourceStream("ClientImport.Tests.records.txt"), ',');
            var dictionary = new SortedDictionary<string, IPerson>();
            var tree = new BinarySearchTree<string, IPerson>();

            //Act
            importer.Data
                           .ToList()
                           .ForEach(record =>
                           {
                               var person = new Person
                               {
                                   FirstName = record.FirstName,
                                   Surname = record.Surname,
                                   Age = Convert.ToInt16(record.Age)
                               };
                               var key = PersonRepository.BuildKey(person, SortKey.SurnameFirstNameAge);
                               if (tree.Find(key) == null)
                                   tree.Add(key, person);
                           }
                              );

            tree
                .ToList()
                .Shuffle() //Shuffle result from binary tree, to test sorting
                .ForEach(r => dictionary.Add(PersonRepository.BuildKey(r.KeyValue.Value, SortKey.SurnameFirstNameAge), r.KeyValue.Value));

            var expected = dictionary.Select(r => r.Value).ToList();
            var actual = tree.Select(n => n.KeyValue.Value).ToList();
            // Assert
            CollectionAssert.AreEqual(expected, actual);
        }
开发者ID:Romiko,项目名称:Dev2,代码行数:35,代码来源:BinaryTreeTests.cs


示例5: Inform

        ///////////////////////////////////////////////////////////////////////////////////////////
        ///////////////////////////////////////////////////////////////////////////////////////////
        ///////////////////////////////////////////////////////////////////////////////////////////
        /// <summary>
        /// Showes process results with details in message window.
        /// </summary>
        /// <param name="importer">Importer object.</param>
        /// <param name="geocoder">Geocoder object (can be NULL).</param>
        /// <param name="storage">Storage object</param>
        /// <param name="status">Status text.</param>
        public void Inform(Importer importer, Geocoder geocoder, Storage storage, string status)
        {
            Debug.Assert(!string.IsNullOrEmpty(status)); // not empty
            Debug.Assert(null != importer); // created
            Debug.Assert(null != storage); // created

            var details = new List<MessageDetail>();

            // add statistic
            string statistic = _CreateStatistic(importer, geocoder, storage);
            Debug.Assert(!string.IsNullOrEmpty(statistic));
            var statisticDetail = new MessageDetail(MessageType.Information, statistic);
            details.Add(statisticDetail);

            // add geocoder exception
            if ((null != geocoder) &&
                (null != geocoder.Exception))
            {
                details.Add(_GetServiceMessage(geocoder.Exception));
            }

            // add steps deatils
            details.AddRange(importer.Details);
            if (null != geocoder)
                details.AddRange(geocoder.Details);
            details.AddRange(storage.Details);

            // show status with details
            App.Current.Messenger.AddMessage(status, details);
        }
开发者ID:erindm,项目名称:route-planner-csharp,代码行数:40,代码来源:Informer.cs


示例6: Parser

 public Parser(int optimization, IStylizer stylizer, Importer importer, bool noCache = false)
 {
     Stylizer = stylizer;
     Importer = importer;
     Tokenizer = new Tokenizer(optimization);
     NoCache = noCache;
 }
开发者ID:NickCraver,项目名称:dotless,代码行数:7,代码来源:Parser.cs


示例7: StandardExportInterfacesShouldWork

        public void StandardExportInterfacesShouldWork()
        {
            // Export all interfaces except IDisposable, Export contracts on types without interfaces. except for disposable types
            var builder = new ConventionBuilder();
            builder.ForTypesMatching((t) => true).ExportInterfaces();
            builder.ForTypesMatching((t) => t.GetTypeInfo().ImplementedInterfaces.Where((iface) => iface != typeof(System.IDisposable)).Count() == 0).Export();

            var container = new ContainerConfiguration()
                .WithPart<Standard>(builder)
                .WithPart<Dippy>(builder)
                .WithPart<Derived>(builder)
                .WithPart<BareClass>(builder)
                .CreateContainer();

            var importer = new Importer();
            container.SatisfyImports(importer);

            Assert.NotNull(importer.First);
            Assert.True(importer.First.Count() == 3);
            Assert.NotNull(importer.Second);
            Assert.True(importer.Second.Count() == 3);
            Assert.NotNull(importer.Third);
            Assert.True(importer.Third.Count() == 3);
            Assert.NotNull(importer.Fourth);
            Assert.True(importer.Fourth.Count() == 3);
            Assert.NotNull(importer.Fifth);
            Assert.True(importer.Fifth.Count() == 3);

            Assert.Null(importer.Base);
            Assert.Null(importer.Derived);
            Assert.Null(importer.Dippy);
            Assert.Null(importer.Standard);
            Assert.Null(importer.Disposable);
            Assert.NotNull(importer.BareClass);
        }
开发者ID:Rayislandstyle,项目名称:corefx,代码行数:35,代码来源:PartBuilderInterfaceTests.cs


示例8: Main

        static void Main(string[] args)
        {
            string source;
            string destination;
            Options options = new Options();

            if (CommandLine.Parser.Default.ParseArguments(args, options))
            {
                source = options.Source;
                destination = options.Destination;
            }
            else
            {
                Console.WriteLine("Source: ");
                source = Console.ReadLine();
                Console.WriteLine("Destination: ");
                destination = Console.ReadLine();
            }

            Importer importer = new Importer();
            importer.ImportFiles(source, destination);

            Console.WriteLine("Press any key to exit...");
            Console.ReadLine();
        }
开发者ID:bmalicoat,项目名称:ImageImporter,代码行数:25,代码来源:Program.cs


示例9: btnAddExampleContent_Click

        /// <summary>
        /// 
        /// </summary>
        protected void btnAddExampleContent_Click(object sender, EventArgs e)
        {
            Importer z = new Importer();
            // z.ExportContentTree(1068, "HelpandExample.content");
            z.ImportContentTree("HelpandExample.content");

            importMessage.Text = "Example Content Imported - You should see this on the content node.";
        }
开发者ID:KevinJump,项目名称:LocalGovStarterKit,代码行数:11,代码来源:dashboard.ascx.cs


示例10: ImporterViewModel

 public ImporterViewModel(Importer importer)
 {
     Address = new AddressViewModel(importer.Address);
     BusinessName = importer.BusinessName;
     Contact = new ContactViewModel(importer.Contact);
     RegistrationNumber = importer.RegistrationNumber;
     Type = importer.Type;
 }
开发者ID:EnvironmentAgency,项目名称:prsd-iws,代码行数:8,代码来源:ImporterViewModel.cs


示例11: ImporterCallsConverterOnce

        public void ImporterCallsConverterOnce()
        {
            var importer = new Importer(_source, _converter, _destination);

            importer.Run();

            _converter.Received(1).ConvertData(Arg.Any<DataTable>());
        }
开发者ID:benjaminramey,项目名称:GoodlyFere.Import,代码行数:8,代码来源:ImporterTests.cs


示例12: ImporterViewModel

 public ImporterViewModel(Importer importer)
 {
     Name = importer.Business.Name;
     address = new AddressViewModel(importer.Address);
     ContactPerson = importer.Contact.FullName;
     Telephone = importer.Contact.Telephone.ToFormattedContact();
     Fax = importer.Contact.Fax.ToFormattedContact();
     Email = importer.Contact.Email;
     RegistrationNumber = importer.Business.RegistrationNumber;
 }
开发者ID:EnvironmentAgency,项目名称:prsd-iws,代码行数:10,代码来源:ImporterViewModel.cs


示例13: CanCreateImporter

        public void CanCreateImporter()
        {
            var business = ObjectFactory.CreateEmptyBusiness();
            var address = ObjectFactory.CreateDefaultAddress();
            var contact = ObjectFactory.CreateEmptyContact();

            var importer = new Importer(Guid.NewGuid(), address, business, contact);

            Assert.NotNull(importer);
        }
开发者ID:EnvironmentAgency,项目名称:prsd-iws,代码行数:10,代码来源:NotificationImporterTests.cs


示例14: Import

        private Import(string path, Importer importer)
        {
            Importer = importer;
            var regex = new Regex(@"\.(le|c)ss$");

            Path = regex.IsMatch(path) ? path : path + ".less";

            Css = Path.EndsWith("css");

            if(!Css)
                Importer.Import(this);
        }
开发者ID:Tigraine,项目名称:dotless,代码行数:12,代码来源:Import.cs


示例15: DestinationReceivesConvertedData

        public void DestinationReceivesConvertedData()
        {
            DataTable originalData = new DataTable("table1");
            DataTable convertedData = new DataTable("table2");
            _source.GetData().Returns(originalData);
            _converter.ConvertData(originalData).Returns(convertedData);

            var importer = new Importer(_source, _converter, _destination);
            importer.Run();

            Assert.NotEqual(originalData, convertedData);
            _destination.Received(1).Receive(convertedData);
        }
开发者ID:benjaminramey,项目名称:GoodlyFere.Import,代码行数:13,代码来源:ImporterTests.cs


示例16: AllDataIsLoadedFromTextFileIntoPersonBinaryTree

        public void AllDataIsLoadedFromTextFileIntoPersonBinaryTree()
        {
            // Arrange
            var repository = new PersonRepository(SortKey.SurnameFirstName);
            var asm = Assembly.GetExecutingAssembly();
            var importer = new Importer(asm.GetManifestResourceStream("ClientImport.Tests.records.txt"), Delimiter);

            //Act
            repository.Import(importer.Data);

            // Assert
            Assert.AreEqual(49817, repository.Count());
        }
开发者ID:Romiko,项目名称:Dev2,代码行数:13,代码来源:PersonRepositoryTests.cs


示例17: ShouldLoadTextFileDataEvenWhenFileLayoutIsChanged

        public void ShouldLoadTextFileDataEvenWhenFileLayoutIsChanged()
        {
            //Arrange
            var asm = Assembly.GetExecutingAssembly();

            //Act
            var importer = new Importer(asm.GetManifestResourceStream("ClientImport.Tests.recordsColumnChange.txt"), Delimiter);

            //Assert
            var data = importer.Data.ToList();

            Assert.AreEqual("Adrie", data.First().FirstName);
            Assert.AreEqual("Ballingall", data.First().Surname);
            Assert.AreEqual("111", data.First().Age);
        }
开发者ID:Romiko,项目名称:Dev2,代码行数:15,代码来源:ImporterTests.cs


示例18: Main

        static void Main(string[] args)
        {
            using (SPSite site = new SPSite(@"http://ashwinmsft:5643/sites/ContentTypeHub2"))
            {
                TaxonomySession session = new TaxonomySession(site);

                string text = File.ReadAllText(@"C:\taxonomy.xml");

                XElement termStoreCollectionElement = XElement.Parse(text);

                Importer importer = new Importer();
                XElement termStoreElement = termStoreCollectionElement.Elements().First();
                importer.ImportTermStore(session.TermStores, termStoreElement , true);

            }
        }
开发者ID:ashwnacharya,项目名称:SPMetadataManager,代码行数:16,代码来源:Program.cs


示例19: UpdateImporterReplacesFirst

        public void UpdateImporterReplacesFirst()
        {
            var business = Business.CreateBusiness("first", BusinessType.SoleTrader, "123", "456");
            var address = ObjectFactory.CreateDefaultAddress();
            var contact = ObjectFactory.CreateEmptyContact();

            var importer = new Importer(Guid.NewGuid(), address, business, contact);

            var newBusiness = Business.CreateBusiness("second", BusinessType.SoleTrader, "123", "456");
            var newAddress = ObjectFactory.CreateDefaultAddress();
            var newContact = ObjectFactory.CreateEmptyContact();

            importer.Update(newAddress, newBusiness, newContact);

            Assert.Equal("second", importer.Business.Name);
        }
开发者ID:EnvironmentAgency,项目名称:prsd-iws,代码行数:16,代码来源:NotificationImporterTests.cs


示例20: ImportValues

        public void ImportValues()
        {
            var container = ContainerFactory.Create();
            Importer importer = new Importer();
            Exporter exporter42 = new Exporter(42);

            CompositionBatch batch = new CompositionBatch();
            batch.AddPart(importer);
            batch.AddPart(exporter42);

            CompositionAssert.ThrowsError(ErrorId.ImportEngine_PartCannotSetImport,
                                          ErrorId.ReflectionModel_ImportNotAssignableFromExport, RetryMode.DoNotRetry, () =>
            {
                container.Compose(batch);
            });            
        }
开发者ID:JackFong,项目名称:FreeRadical,代码行数:16,代码来源:CompositionContainerImportTests.cs



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

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