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

C# Address类代码示例

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

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



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

示例1: Relocate

		public override RelocationResults Relocate(Address addrLoad)
		{
			ImageMap imageMap = imgLoadedMap;
			ImageReader rdr = new LeImageReader(exe.RawImage, (uint) exe.e_lfaRelocations);
            var relocations = new RelocationDictionary();
			int i = exe.e_cRelocations;
			while (i != 0)
			{
				uint offset = rdr.ReadLeUInt16();
				ushort segOffset = rdr.ReadLeUInt16();
				offset += segOffset * 0x0010u;

				ushort seg = (ushort) (imgLoaded.ReadLeUInt16(offset) + addrLoad.Selector);
				imgLoaded.WriteLeUInt16(offset, seg);
				relocations.AddSegmentReference(offset, seg);

				imageMap.AddSegment(Address.SegPtr(seg, 0), seg.ToString("X4"), AccessMode.ReadWriteExecute);
				--i;
			}
		
			// Found the start address.

			Address addrStart = Address.SegPtr((ushort)(exe.e_cs + addrLoad.Selector), exe.e_ip);
			imageMap.AddSegment(Address.SegPtr(addrStart.Selector, 0), addrStart.Selector.ToString("X4"), AccessMode.ReadWriteExecute);
            return new RelocationResults(
                new List<EntryPoint> { new EntryPoint(addrStart, arch.CreateProcessorState()) },
                relocations);
		}
开发者ID:killbug2004,项目名称:reko,代码行数:28,代码来源:MsdosImageLoader.cs


示例2: Unsubscribe

 public void Unsubscribe(Type eventType, Address publisherAddress)
 {
     using (var channel = ConnectionManager.GetAdministrationConnection().CreateModel())
     {
         RoutingTopology.TeardownSubscription(channel, eventType, EndpointQueueName);
     }
 }
开发者ID:nagyist,项目名称:NServiceBus.RabbitMQ,代码行数:7,代码来源:RabbitMqSubscriptionManager.cs


示例3: Test

		public void Test()
		{
			int id = -1;
			
			using (ISession s = OpenSession())
			{
				var address1 = new Address("60", "EH3 8BE");
				var address2 = new Address("2", "EH6 6JA");
				s.Save(address1);
				s.Save(address2);
				
				var person1 = new Person("'lil old me");
				person1.AddPercentageToFeeMatrix(0, .20m);
				person1.AddPercentageToFeeMatrix(50, .15m);
				person1.AddPercentageToFeeMatrix(100, .1m);
				person1.RegisterChangeOfAddress(new DateTime(2005, 4, 15), address1);
				person1.RegisterChangeOfAddress(new DateTime(2007, 5, 29), address2);
				
				s.Save(person1);
				s.Flush();
				
				id = person1.Id;
			}
			
			using (ISession s = OpenSession())
			{
				var person1 = s.Load<Person>(id);
				person1.RegisterChangeOfAddress(new DateTime(2008, 3, 23), new Address("8", "SS7 1TT"));
				s.Save(person1);
				s.Flush();
			}
		}
开发者ID:marchlud,项目名称:nhibernate-core,代码行数:32,代码来源:Fixture.cs


示例4: RetrieveByCustomerId

        public IEnumerable<Address> RetrieveByCustomerId(int customerId)
        {
            var addressList = new List<Address>();

            var address = new Address(1)
            {
                AddressType = 1,
                StreetLine1 = "Bad End",
                StreetLine2 = "Bagshot row",
                City = "Hobbiton",
                State = "Shire",
                Country = "Middle Earth",
                PostalCode = "144"
            };
            addressList.Add(address);

            address = new Address(2)
            {
                AddressType = 2,
                StreetLine1 = "Green Dragon",
                City = "Bywater",
                State = "Shire",
                Country = "Middle Earth",
                PostalCode = "144"
            };

            addressList.Add(address);

            return addressList;
        }
开发者ID:Robooto,项目名称:AMC,代码行数:30,代码来源:AddressRepository.cs


示例5: CreateEmptyJoinList

        /// <summary>
        /// Gets or sets the <see cref="IEnumerable{Join}"/> with the specified address.
        /// </summary>
        /// <param name="address">The address.</param>
        /// <returns>IEnumerable&lt;Join&gt;.</returns>
        public IEnumerable<Join> this[Address address]
        {
            get
            {
                List<Join> value;
                if (_joins.TryGetValue(address, out value))
                {
                    return value;
                }
                else
                {
                    return CreateEmptyJoinList();
                }
            }
            set
            {
                List<Join> matchingJoins;
                if (!_joins.TryGetValue(address, out matchingJoins))
                {
                    matchingJoins = new List<Join>();
                    _joins[address] = matchingJoins;
                }

                matchingJoins.AddRange(value);
            }
        }
开发者ID:iancooper,项目名称:Paramore.Contrib,代码行数:31,代码来源:RoutingTable.cs


示例6: AddressOperand

 protected AddressOperand(Address a, PrimitiveType type)
     : base(type)
 {
     if (a == null)
         throw new ArgumentNullException("a");
     Address = a;
 }
开发者ID:nemerle,项目名称:reko,代码行数:7,代码来源:MachineOperand.cs


示例7: Main

        static void Main(string[] args)
        {
            using (ShopContext ctx = new ShopContext())
            {
                Address a = new Address
                {
                    AddressLine1 = "Somewhere 1",
                    AddressLine2 = "At some floor",
                    City = "SomeCity",
                    ZipCode = "1111AA"
                };

                Customer c = new Customer()
                {
                    FirstName = "Willamar",
                    LastName = "Fernandes",
                    BillingAddress = a,
                    ShippingAddress = a
                };

                ctx.Customers.Add(c);
                ctx.SaveChanges();
            }

        }
开发者ID:,项目名称:,代码行数:25,代码来源:


示例8: CreateCustomerBlob

 /// <summary>
 /// Create a new CustomerBlob object.
 /// </summary>
 /// <param name="ID">Initial value of ID.</param>
 /// <param name="address">Initial value of Address.</param>
 public static CustomerBlob CreateCustomerBlob(int ID, Address address)
 {
     CustomerBlob customer = new CustomerBlob();
     customer.ID = ID;
     customer.Address = global::System.Data.Objects.DataClasses.StructuralObject.VerifyComplexObjectIsNotNull(address, "Address");
     return customer;
 }
开发者ID:larsenjo,项目名称:odata.net,代码行数:12,代码来源:CustomBlobWithInheritance.cs


示例9: lbBasicAuth_Click

    protected void lbBasicAuth_Click(object sender, EventArgs e)
    {
        string merchantId = ConfigurationManager.AppSettings["MerchantID"];
        string account = ConfigurationManager.AppSettings["Account"];
        string sharedSecret = ConfigurationManager.AppSettings["SharedSecret"];

        Merchant merchant = new Merchant(merchantId, account, sharedSecret);
        Order order = new Order("GBP", 999);
        //working
        CreditCard card = new CreditCard("MC", "5425232820001308", "0118", "Phil McCracken", "123", 1);
        //invalid
        //CreditCard card = new CreditCard("MC", "1234123412341234", "0118", "Phil McCracken", "123", 1);
        Address address = new Address("", "", "", "", "", "", "", "");
        PhoneNumbers numbers = new PhoneNumbers("", "", "", "");
        Payer payer = new Payer("Business", "test", "", "Phil", "McCracken", "", address, numbers, "", new ArrayList());

        string timestamp = Common.GenerateTimestamp();

        string autoSettle = "1";

        RealAuthTransactionResponse resp = RealAuthorisation.Auth(merchant, order, card, autoSettle, timestamp);

        lblErrorCode.Text = resp.ResultCode.ToString();
        lblResult.Text = resp.ResultMessage;
    }
开发者ID:ryanmcg1,项目名称:RealexWrapper,代码行数:25,代码来源:default.aspx.cs


示例10: Create

        public void Create(Address? address, int peerLimit, int channelLimit, uint incomingBandwidth, uint outgoingBandwidth)
        {
            if (_host != null)
            {
                throw new InvalidOperationException("Already created.");
            }
            if (peerLimit < 0 || peerLimit > Native.ENET_PROTOCOL_MAXIMUM_PEER_ID)
            {
                throw new ArgumentOutOfRangeException("peerLimit");
            }
            CheckChannelLimit(channelLimit);

            if (address != null)
            {
                var nativeAddress = address.Value.NativeData;
                _host = Native.enet_host_create(ref nativeAddress, (IntPtr) peerLimit,
                                                (IntPtr) channelLimit, incomingBandwidth, outgoingBandwidth);
            }
            else
            {
                _host = Native.enet_host_create(null, (IntPtr) peerLimit,
                                                (IntPtr) channelLimit, incomingBandwidth, outgoingBandwidth);
            }
            if (_host == null)
            {
                throw new ENetException(0, "Host creation call failed.");
            }
        }
开发者ID:fholm,项目名称:ENetSharp,代码行数:28,代码来源:Host.cs


示例11: CreateQueueIfNecessary

 public void CreateQueueIfNecessary(Address address, string account)
 {
     foreach (var creator in queueCreators)
     {
         creator.RegisterProjectionsFor(address, account);
     }
 }
开发者ID:eric-swann-q2,项目名称:NServiceBus.EventStore,代码行数:7,代码来源:CompositeQueueCreator.cs


示例12: ShippingEdits

        public void ShippingEdits(object s, RepeaterCommandEventArgs e)
        {
            Address address = new Address();
              Guid selectedAddress = new Guid(e.CommandArgument.ToString());
              _user = new WebProfile().GetProfile(ddlCustomer.SelectedValue);
              address = _user.AddressCollection.Find(delegate(Address addressToFind) {
            return addressToFind.AddressId == selectedAddress && addressToFind.AddressType == AddressType.ShippingAddress;
              });

              if (address.AddressId != Guid.Empty) {
            if (e.CommandName == "Edit") {
              //Do the edit
              pnlBillingAddresses.Visible = false;
              pnlShippingAddresses.Visible = false;
              pnlEditAddress.Visible = true;
              LoadEditPanel(address);
              tcMyAccount.ActiveTab = tpAddresses;
            }
            if (e.CommandName == "Delete") {
              _user.AddressCollection.Remove(address);
              _user.Save();
              LoadAddresses();
              tcMyAccount.ActiveTab = tpAddresses;
            }
              }
        }
开发者ID:dashcommerce,项目名称:dashcommerce-3,代码行数:26,代码来源:customerinformation.aspx.cs


示例13: PassInPrecreatedAddress_GetsDataCorrectly

 public void PassInPrecreatedAddress_GetsDataCorrectly()
 {
     Address bkAddress = CreateCustomer().Address;
     var vm = new AddressVM(bkAddress);
     var toCopy = new Address {HouseNumber = vm.HouseNumber, AddressBody = vm.AddressBody, Postcode = vm.Postcode, PhoneNumber = vm.PhoneNumber, ProofOfAddressPath = vm.ProofOfAddressPath};
     Assert.IsTrue(toCopy.HasMatchingState(bkAddress));
 }
开发者ID:JWroe,项目名称:ScrapTraders,代码行数:7,代码来源:AddressVMTests.cs


示例14: ContractorAddressChanged

 public ContractorAddressChanged(Guid id, DateTime eventTime,string einNumber,Address oldAddress,Address newAddress)
     : base(id, eventTime)
 {
     EinNumber = einNumber;
     OldAddress = oldAddress;
     NewAddress = newAddress;
 }
开发者ID:srivelicheti,项目名称:learning-DDD,代码行数:7,代码来源:ContractorAddressChanged.cs


示例15: Main

        static void Main(string[] args)
        {
            /*
             * Rules
             *
             * External entities are only mapped one way (either to or from)
             * Data entities are mapped both ways
             **/

            AutoMapper.Mapper.AddProfile<MapperProfile>();

            // External Entites
            var addressExternalEntity = new AddressExternalEntity { Id = 1, Line1 = "Line1", Line2 = "Line2", Line3 = "Line3" };
            AutoMapper.Mapper.Map<AddressExternalEntity, Address>(addressExternalEntity);

            var personExternalEntity = new PersonExternalEntity {Id = 10, Name = "Bob"};
            AutoMapper.Mapper.Map<PersonExternalEntity, Person>(personExternalEntity);

            var personStatusResponse = new PersonStatusResponse {PersonId = 324};
            AutoMapper.Mapper.Map<PersonStatusResponse, PersonStatusResponseExternalEntity>(personStatusResponse);

            // Data Entities
            var address = new Address { Id = 1, Line1 = "Line1", Line2 = "Line2", Line3 = "Line3" };
            var addressDataEntity = AutoMapper.Mapper.Map<Address, AddressDataEntity>(address);
            address = AutoMapper.Mapper.Map<AddressDataEntity, Address>(addressDataEntity);

            var person = new Person { Id = 10, Name = "Bob" };
            var personDataEntity = AutoMapper.Mapper.Map<Person, PersonDataEntity>(person);
            person = AutoMapper.Mapper.Map<PersonDataEntity, Person>(personDataEntity);

            Console.ReadKey();
        }
开发者ID:odw1,项目名称:Random-Stuff,代码行数:32,代码来源:Program.cs


示例16: AddExportedEntryPoints

		private void AddExportedEntryPoints(Address addrLoad, ImageMap imageMap, List<EntryPoint> entryPoints)
		{
			ImageReader rdr = imgLoaded.CreateLeReader(rvaExportTable);
			rdr.ReadLeUInt32();	// Characteristics
			rdr.ReadLeUInt32(); // timestamp
			rdr.ReadLeUInt32();	// version.
			rdr.ReadLeUInt32();	// binary name.
			rdr.ReadLeUInt32();	// base ordinal
			int nExports = rdr.ReadLeInt32();
			int nNames = rdr.ReadLeInt32();
			if (nExports != nNames)
				throw new BadImageFormatException("Unexpected discrepancy in PE image.");
			uint rvaApfn = rdr.ReadLeUInt32();
			uint rvaNames = rdr.ReadLeUInt32();

			ImageReader rdrAddrs = imgLoaded.CreateLeReader(rvaApfn);
			ImageReader rdrNames = imgLoaded.CreateLeReader(rvaNames);
			for (int i = 0; i < nNames; ++i)
			{
                EntryPoint ep = LoadEntryPoint(addrLoad, rdrAddrs, rdrNames);
				if (imageMap.IsExecutableAddress(ep.Address))
				{
					entryPoints.Add(ep);
				}
			}
		}
开发者ID:gh0std4ncer,项目名称:reko,代码行数:26,代码来源:PeImageLoader.cs


示例17: Main

        // Precondition:  None
        // Postcondition: Small list of Parcels is created and displayed
        static void Main(string[] args)
        {
            Address a1 = new Address("John Smith", "123 Any St.", "Apt. 45",
                "Louisville", "KY", 40202); // Test Address 1
            Address a2 = new Address("Jane Doe", "987 Main St.", "",
                "Beverly Hills", "CA", 90210); // Test Address 2
            Address a3 = new Address("James Kirk", "654 Roddenberry Way", "Suite 321",
                "El Paso", "TX", 79901); // Test Address 3
            Address a4 = new Address("John Crichton", "678 Pau Place", "Apt. 7",
                "Portland", "ME", 04101); // Test Address 4

            Letter l1 = new Letter(a1, a3, 1.50M); // Test Letter 1
            Letter l2 = new Letter(a2, a4, 1.25M); // Test Letter 2
            Letter l3 = new Letter(a4, a1, 1.75M); // Test Letter 3

            List<Parcel> parcels = new List<Parcel>(); // Test list of parcels

            // Add test data to list
            parcels.Add(l1);
            parcels.Add(l2);
            parcels.Add(l3);

            // Display data
            Console.WriteLine("Program 0 - List of Parcels\n\n");

            foreach (Parcel p in parcels)
            {
                Console.WriteLine(p);
                Console.WriteLine("--------------------");
            }
        }
开发者ID:andreosebastiani,项目名称:Portfolio,代码行数:33,代码来源:Program.cs


示例18: RewriteFile

		protected Program RewriteFile(string relativePath, Address addrBase)
		{
            sc = new ServiceContainer();
            var config = new FakeDecompilerConfiguration();
            var eventListener = new FakeDecompilerEventListener();
            sc.AddService<IConfigurationService>(config);
            sc.AddService<DecompilerHost>(new FakeDecompilerHost());
            sc.AddService<DecompilerEventListener>(eventListener);
            sc.AddService<IFileSystemService>(new FileSystemServiceImpl());
            ILoader ldr = new Loader(sc);
            var program = ldr.AssembleExecutable(
                FileUnitTester.MapTestPath(relativePath),
                new X86TextAssembler(sc, new X86ArchitectureReal()),
                addrBase);
            program.Platform = new DefaultPlatform(sc, program.Architecture);
            var ep = new ImageSymbol(program.SegmentMap.BaseAddress);
            var project = new Project { Programs = { program } };
            var scan = new Scanner(
                program,
                new ImportResolver(project, program, eventListener),
                sc);
			scan.EnqueueImageSymbol(ep, true);
			scan.ScanImage();

            var importResolver = new ImportResolver(project, program, eventListener);
            var dfa = new DataFlowAnalysis(program, importResolver, eventListener);
			dfa.AnalyzeProgram();
            return program;
		}
开发者ID:relaxar,项目名称:reko,代码行数:29,代码来源:TypingTestBase.cs


示例19: CreateJoinForm

    /// <summary>
    /// Constructor
    /// </summary>
    public CreateJoinForm(Peer peerObject, Address addressObject, ConnectWizard connectionWizard)
    {
        //
        // Required for Windows Form Designer support
        //
        InitializeComponent();
        peer = peerObject;
        this.connectionWizard = connectionWizard;
        this.Text = connectionWizard.SampleName + " - " + this.Text;
        deviceAddress = addressObject;

        //Set up the event handlers
        peer.FindHostResponse += new FindHostResponseEventHandler(FindHostResponseMessage);
        peer.ConnectComplete += new ConnectCompleteEventHandler(ConnectResult);
        peer.AsyncOperationComplete += new AsyncOperationCompleteEventHandler(CancelAsync);

        //Set up our timer
        updateListTimer = new System.Timers.Timer(300); // A 300 ms interval
        updateListTimer.Elapsed += new System.Timers.ElapsedEventHandler(this.UpdateTimer);
        updateListTimer.SynchronizingObject = this;
        updateListTimer.Start();
        //Set up our connect timer
        connectTimer = new System.Timers.Timer(100); // A 100ms interval
        connectTimer.Elapsed += new System.Timers.ElapsedEventHandler(this.ConnectTimer);
        connectTimer.SynchronizingObject = this;
        // Set up our connect event
        connectEvent = new ManualResetEvent(false);
    }
开发者ID:timdetering,项目名称:BeginningNetGameProgramming,代码行数:31,代码来源:DPlayConnect_JoinForm.cs


示例20: SetGeographicalLocation

        public static void SetGeographicalLocation(Address address)
        {
            Contract.Requires(address != null);
            var rooturl = "http://maps.google.com/maps/api/geocode/xml?address=";
            var tailurl = "&sensor=false";
            var appendedString = new StringBuilder();
            if (!string.IsNullOrWhiteSpace(address.StreetAddress))
            {
                appendedString.Append(address.StreetAddress.Trim().Replace("  ", " ").Replace(" ", "+"));
            }
            CleanAndAppendAddressPart(appendedString, address.Suburb);
            CleanAndAppendAddressPart(appendedString, address.City);
            CleanAndAppendAddressPart(appendedString, address.Provence);
            CleanAndAppendAddressPart(appendedString, address.PostCode);
            CleanAndAppendAddressPart(appendedString, address.Country);

            appendedString.Insert(0, rooturl);
            appendedString.Append(tailurl);
            var url = appendedString.ToString();
            var xmldata = XDocument.Load(url);
            var response = xmldata.Element("GeocodeResponse");
            if (response.Element("status").Value.ToUpperInvariant() != "OK")
                return;
            var location = response.Element("result").Element("geometry").Element("location");

            var latitude = decimal.Parse(location.Element("lat").Value);
            var longitude = decimal.Parse(location.Element("lng").Value);
            address.AddEstimatedGeoLocation(latitude, longitude);
            //$lat = $xmldata.GeocodeResponse.result.geometry.location.lat
            //$lng = $xmldata.GeocodeResponse.result.geometry.location.lng
            //return @{ "Lat" = $lat; "Long" = $lng; "StreetAddress" = $StreetAddress; "City" = $City; "State" = $State; "Zip" = $Zip}
        }
开发者ID:RhysC,项目名称:GalacticAds,代码行数:32,代码来源:LocationService.cs



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

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