TAILIEUCHUNG - Microsoft Visual C# 2010 Step by Step (P16 - the end)

Tham khảo sách 'microsoft visual c# 2010 step by step (p16 - the end)', công nghệ thông tin, kỹ thuật lập trình phục vụ nhu cầu học tập, nghiên cứu và làm việc hiệu quả | 720 Appendix Example IronPython The following example shows a Python script called . This class contains four items A class called Customer. This class contains three fields which contain the ID name and telephone number for a customer. The constructor initializes these fields with values passed in as parameters. The_str__ method formats the data in the class as a string so that it can be output. A class called CustomerDB. This class contains a dictionary called customerDatabase. The storeCustomer method adds a customer to this dictionary and the getCustomer method retrieves a customer when given the customer ID. The_str__ method iterates through the customers in the dictionary and formats them as a string. For simplicity none of these methods include any form of error checking. A function called GetNewCustomer. This is a factory method that constructs a Customer object using the parameters passed in and then returns this object. A function called GetCustomerDB. This is another factory method that constructs a CustomerDB object and returns it. class Customer definit_ self id name telephone id name telephone defstr__ self return ID 0 tName 1 tTelephone 2 class CustomerDB def_init__ self def storeCustomer self customer customer def getCustomer self id return id def_str__ self list Customers n for id cust in list 0 cust n return list Appendix 721 def GetNewCustomer id name telephone return Customer id name telephone def GetCustomerDB return CustomerDB The following code example shows a simple C console application that tests these items. You can find this application in the Microsoft Press Visual CSharp Step By Step Appendix PythonInteroperability folder under your Documents folder. It references the IronPython assemblies

TAILIEUCHUNG - Chia sẻ tài liệu không giới hạn
Địa chỉ : 444 Hoang Hoa Tham, Hanoi, Viet Nam
Website : tailieuchung.com
Email : tailieuchung20@gmail.com
Tailieuchung.com là thư viện tài liệu trực tuyến, nơi chia sẽ trao đổi hàng triệu tài liệu như luận văn đồ án, sách, giáo trình, đề thi.
Chúng tôi không chịu trách nhiệm liên quan đến các vấn đề bản quyền nội dung tài liệu được thành viên tự nguyện đăng tải lên, nếu phát hiện thấy tài liệu xấu hoặc tài liệu có bản quyền xin hãy email cho chúng tôi.
Đã phát hiện trình chặn quảng cáo AdBlock
Trang web này phụ thuộc vào doanh thu từ số lần hiển thị quảng cáo để tồn tại. Vui lòng tắt trình chặn quảng cáo của bạn hoặc tạm dừng tính năng chặn quảng cáo cho trang web này.