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


C# Address类代码示例

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


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


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