| @ -0,0 +1,38 @@ | |||||
| using ButcherTraceBack.Models; | |||||
| using System; | |||||
| using System.Collections.Generic; | |||||
| using System.Linq; | |||||
| using System.Web; | |||||
| using System.Web.Mvc; | |||||
| namespace ButcherTraceBack.Controllers | |||||
| { | |||||
| public class BeiHaiViewController : Controller | |||||
| { | |||||
| public ActionResult Index(string code) | |||||
| { | |||||
| var allModel = new BeiHaiAllModel(); | |||||
| FreshTraceBack info1 = SqlHelper<FreshTraceBack>.Query(code); | |||||
| BeiHaiTraceBack info2 = SqlHelper<BeiHaiTraceBack>.Query(code); | |||||
| if (info1 == null) | |||||
| { | |||||
| info1 = new FreshTraceBack(); | |||||
| } | |||||
| else if (info1.Code != null && info1.Code.Length >= 10) | |||||
| { | |||||
| info1.Code = info1.Code.Substring(info1.Code.Length - 5, 5); | |||||
| } | |||||
| if (info2 == null) | |||||
| { | |||||
| info2 = new BeiHaiTraceBack(); | |||||
| } | |||||
| allModel.Info1 = info1; | |||||
| allModel.Info2 = info2; | |||||
| return View(allModel); | |||||
| } | |||||
| } | |||||
| } | |||||
| @ -0,0 +1,56 @@ | |||||
| using System; | |||||
| using System.Collections.Generic; | |||||
| using System.Linq; | |||||
| using System.Web; | |||||
| namespace ButcherTraceBack.Models | |||||
| { | |||||
| [Serializable] | |||||
| public class BeiHaiAllModel | |||||
| { | |||||
| public FreshTraceBack Info1 { get; set; } | |||||
| public BeiHaiTraceBack Info2 { get; set; } | |||||
| } | |||||
| [MapToTable("BeiHaiTraceBack"), Serializable] | |||||
| public class BeiHaiTraceBack : IWithCode | |||||
| { | |||||
| //[LogicName("条码")] | |||||
| public string Code { get; set; } | |||||
| //[LogicName("产品图片")] | |||||
| public string GoodsImage { get; set; } | |||||
| //[LogicName("用药图片")] | |||||
| public string UseMedicineImage { get; set; } | |||||
| //[LogicName("免疫图片")] | |||||
| public string ImmunityImage { get; set; } | |||||
| //[LogicName("检疫合格图片")] | |||||
| public string QuarantinePassImage { get; set; } | |||||
| //[LogicName("产品合格图片")] | |||||
| public string GoodsPassImage { get; set; } | |||||
| public string ExpirationTime { get; set; } | |||||
| } | |||||
| public class BeiHaiTraceBackInfo: BeiHaiTraceBack | |||||
| { | |||||
| private List<BeiHaiTraceBackDetail> mDetails = new List<BeiHaiTraceBackDetail>(); | |||||
| public List<BeiHaiTraceBackDetail> Details { get { return mDetails; } } | |||||
| } | |||||
| [Serializable] | |||||
| public class BeiHaiTraceBackDetail | |||||
| { | |||||
| public string Code { get; set; } | |||||
| } | |||||
| } | |||||
| @ -0,0 +1,106 @@ | |||||
| @model ButcherTraceBack.Models.BeiHaiAllModel | |||||
| @{ | |||||
| Layout = null; | |||||
| } | |||||
| <!DOCTYPE html> | |||||
| <html> | |||||
| <head> | |||||
| <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=0.5, maximum-scale=2.0, user-scalable=yes" /> | |||||
| <title>追溯信息 @Model.Info1.Code</title> | |||||
| <link href="css/lrtk.css" rel="stylesheet" /> | |||||
| <script src="js/jquery-3.2.0.js"></script> | |||||
| </head> | |||||
| <body> | |||||
| <div class="flex"> | |||||
| <ul class="slides"> | |||||
| <li> | |||||
| <img src="images3/wanfu01.jpg"> | |||||
| </li> | |||||
| <li> | |||||
| <img src="images3/wanfu02.jpg"> | |||||
| </li> | |||||
| <li> | |||||
| <img src="images3/wanfu03.jpg"> | |||||
| </li> | |||||
| <li> | |||||
| <div style="position:relative;width:100%;height:100%;"> | |||||
| <img src="images3/wanfu04.jpg"> | |||||
| @if (!string.IsNullOrEmpty(Model.Info2.QuarantinePassImage)) | |||||
| { | |||||
| <img style="position:absolute; left:8%;top:50%;width:40%;height:40%;" src="data:image/Jpeg;base64,@Model.Info2.QuarantinePassImage"> | |||||
| } | |||||
| </div> | |||||
| </li> | |||||
| <li> | |||||
| <div style="position:relative;width:100%;height:100%;"> | |||||
| <img src="images3/wanfu05.jpg"> | |||||
| @if (!string.IsNullOrEmpty(Model.Info2.ImmunityImage)) | |||||
| { | |||||
| <img style="position:absolute;left:5%;top: 25%;width: 90%;height: 70%;" src="data:image/Jpeg;base64,@Model.Info2.ImmunityImage"> | |||||
| } | |||||
| </div> | |||||
| </li> | |||||
| <li> | |||||
| <div style="position:relative;width:100%;height:100%;"> | |||||
| <img src="images3/wanfu06.jpg"> | |||||
| @if (!string.IsNullOrEmpty(Model.Info2.UseMedicineImage)) | |||||
| { | |||||
| <img style="position:absolute;left:5%;top: 25%;width: 90%;height: 70%;" src="data:image/Jpeg;base64,@Model.Info2.UseMedicineImage"> | |||||
| } | |||||
| </div> | |||||
| </li> | |||||
| <li> | |||||
| <img src="images3/wanfu07.jpg"> | |||||
| </li> | |||||
| <li> | |||||
| <img src="images3/wanfu08.jpg"> | |||||
| </li> | |||||
| <li> | |||||
| <img src="images3/wanfu09.jpg"> | |||||
| @if (!string.IsNullOrEmpty(Model.Info2.GoodsImage)) { | |||||
| <img style="position:absolute; left:10%;top:25%; width:80%;height:30%" src="data:image/Jpeg;base64,@Model.Info2.GoodsImage"> | |||||
| } | |||||
| <table style="position:absolute; left:10%;top:60%; width:80%;height:35%;line-height:26px;color:white;font-size:18px;font-family:微软雅黑;"> | |||||
| <tr><td>产品名称:@Model.Info1.Goods_Name </td></tr> | |||||
| <tr><td>宰杀时间:@Model.Info1.ButcherDate </td></tr> | |||||
| <tr><td>分割时间:@Model.Info1.ProductDate </td></tr> | |||||
| <tr><td>生产日期:@Model.Info1.ProductDate </td></tr> | |||||
| <tr><td>保质期:@Model.Info2.ExpirationTime </td></tr> | |||||
| <tr><td>生 产 商:青岛新万福食品有限公司 </td></tr> | |||||
| <tr><td>住 所:莱西市珠海路5号</td></tr> | |||||
| <tr><td>生产地址:青岛市莱西市珠海路5号</td></tr> | |||||
| </table> | |||||
| </li> | |||||
| <li> | |||||
| <div style="position:relative;width:100%;height:100%;"> | |||||
| <img src="images3/wanfu10.jpg"> | |||||
| @if (!string.IsNullOrEmpty(Model.Info2.GoodsPassImage)) | |||||
| {<img style="position:absolute;left:5%;top: 25%;width: 90%;height: 70%;" src="data:image/Jpeg;base64,@Model.Info2.GoodsPassImage"> | |||||
| } | |||||
| </div> | |||||
| </li> | |||||
| <li> | |||||
| <img src="images3/wanfu11.jpg"> | |||||
| </li> | |||||
| </ul> | |||||
| </div> | |||||
| <script src="js/jflex.js"></script> | |||||
| <script type="text/javascript"> | |||||
| $('.flex').jFlex({ | |||||
| autoplay: true | |||||
| }); | |||||
| </script> | |||||
| </body> | |||||
| </html> | |||||
| @ -0,0 +1,7 @@ | |||||
| <?xml version="1.0" encoding="utf-8"?> | |||||
| <packages> | |||||
| <package id="Microsoft.AspNet.WebApi.Client" version="5.2.9" targetFramework="net46" /> | |||||
| <package id="Microsoft.AspNet.WebApi.Core" version="5.2.9" targetFramework="net46" /> | |||||
| <package id="Microsoft.AspNet.WebApi.WebHost" version="5.2.9" targetFramework="net46" /> | |||||
| <package id="Newtonsoft.Json" version="6.0.4" targetFramework="net46" /> | |||||
| </packages> | |||||
| @ -0,0 +1,127 @@ | |||||
| MICROSOFT SOFTWARE LICENSE TERMS | |||||
| MICROSOFT .NET LIBRARY | |||||
| These license terms are an agreement between Microsoft Corporation (or based on where you live, one | |||||
| of its affiliates) and you. They apply to the software named above. The terms also apply to any Microsoft | |||||
| services or updates for the software, except to the extent those have different terms. | |||||
| IF YOU COMPLY WITH THESE LICENSE TERMS, YOU HAVE THE RIGHTS BELOW. | |||||
| 1. INSTALLATION AND USE RIGHTS. | |||||
| You may install and use any number of copies of the software to design, develop and test you’re | |||||
| applications. You may modify, copy, distribute or deploy any .js files contained in the software as | |||||
| part of your applications. | |||||
| 2. THIRD PARTY COMPONENTS. The software may include third party components with separate legal | |||||
| notices or governed by other agreements, as may be described in the ThirdPartyNotices file(s) | |||||
| accompanying the software. | |||||
| 3. ADDITIONAL LICENSING REQUIREMENTS AND/OR USE RIGHTS. | |||||
| a. DISTRIBUTABLE CODE. In addition to the .js files described above, the software is comprised | |||||
| of Distributable Code. “Distributable Code” is code that you are permitted to distribute in | |||||
| programs you develop if you comply with the terms below. | |||||
| i. Right to Use and Distribute. | |||||
| • You may copy and distribute the object code form of the software. | |||||
| • Third Party Distribution. You may permit distributors of your programs to copy and | |||||
| distribute the Distributable Code as part of those programs. | |||||
| ii. Distribution Requirements. For any Distributable Code you distribute, you must | |||||
| • use the Distributable Code in your programs and not as a standalone distribution; | |||||
| • require distributors and external end users to agree to terms that protect it at least as | |||||
| much as this agreement; | |||||
| • display your valid copyright notice on your programs; and | |||||
| • indemnify, defend, and hold harmless Microsoft from any claims, including attorneys’ | |||||
| fees, related to the distribution or use of your applications, except to the extent that any | |||||
| claim is based solely on the Distributable Code. | |||||
| iii. Distribution Restrictions. You may not | |||||
| • alter any copyright, trademark or patent notice in the Distributable Code; | |||||
| • use Microsoft’s trademarks in your programs’ names or in a way that suggests your | |||||
| programs come from or are endorsed by Microsoft; | |||||
| • include Distributable Code in malicious, deceptive or unlawful programs; or | |||||
| • modify or distribute the source code of any Distributable Code so that any part of it | |||||
| becomes subject to an Excluded License. An Excluded License is one that requires, as a | |||||
| condition of use, modification or distribution, that | |||||
| • the code be disclosed or distributed in source code form; or | |||||
| • others have the right to modify it. | |||||
| 4. DATA. | |||||
| a. Data Collection. The software may collect information about you and your use of the software, | |||||
| and send that to Microsoft. Microsoft may use this information to provide services and improve | |||||
| our products and services. You may opt-out of many of these scenarios, but not all, as described | |||||
| in the product documentation. There are also some features in the software that may enable | |||||
| you and Microsoft to collect data from users of your applications. If you use these features, you | |||||
| must comply with applicable law, including providing appropriate notices to users of your | |||||
| applications together with a copy of Microsoft’s privacy statement. Our privacy statement is | |||||
| located at https://go.microsoft.com/fwlink/?LinkID=824704. You can learn more about data | |||||
| collection and use in the help documentation and our privacy statement. Your use of the software | |||||
| operates as your consent to these practices. | |||||
| b. Processing of Personal Data. To the extent Microsoft is a processor or subprocessor of | |||||
| personal data in connection with the software, Microsoft makes the commitments in the | |||||
| European Union General Data Protection Regulation Terms of the Online Services Terms to all | |||||
| customers effective May 25, 2018, at http://go.microsoft.com/?linkid=9840733. | |||||
| 5. SCOPE OF LICENSE. The software is licensed, not sold. This agreement only gives you some rights | |||||
| to use the software. Microsoft reserves all other rights. Unless applicable law gives you more rights | |||||
| despite this limitation, you may use the software only as expressly permitted in this agreement. In | |||||
| doing so, you must comply with any technical limitations in the software that only allow you to use it | |||||
| in certain ways. You may not | |||||
| • work around any technical limitations in the software; | |||||
| • reverse engineer, decompile or disassemble the software, or otherwise attempt to derive the | |||||
| source code for the software, except and to the extent required by third party licensing terms | |||||
| governing use of certain open source components that may be included in the software; | |||||
| • remove, minimize, block or modify any notices of Microsoft or its suppliers in the software; | |||||
| • use the software in any way that is against the law; or | |||||
| • share, publish, rent or lease the software, provide the software as a stand-alone offering for | |||||
| others to use, or transfer the software or this agreement to any third party. | |||||
| 6. BACKUP COPY. You may make one backup copy of the software. You may use it only to reinstall | |||||
| the software. | |||||
| 7. DOCUMENTATION. Any person that has valid access to your computer or internal network may | |||||
| copy and use the documentation for your internal, reference purposes. | |||||
| 8. EXPORT RESTRICTIONS. You must comply with all domestic and international export laws and | |||||
| regulations that apply to the software, which include restrictions on destinations, end users, and end | |||||
| use. For further information on export restrictions, visit www.microsoft.com/exporting. | |||||
| 9. SUPPORT SERVICES. Because this software is “as is,” we may not provide support services for it. | |||||
| 10. ENTIRE AGREEMENT. This agreement, and the terms for supplements, updates, Internet-based | |||||
| services and support services that you use, are the entire agreement for the software and support | |||||
| services. | |||||
| 11. APPLICABLE LAW. If you acquired the software in the United States, Washington law applies to | |||||
| interpretation of and claims for breach of this agreement, and the laws of the state where you live | |||||
| apply to all other claims. If you acquired the software in any other country, its laws apply. | |||||
| 12. CONSUMER RIGHTS; REGIONAL VARIATIONS. This agreement describes certain legal rights. | |||||
| You may have other rights, including consumer rights, under the laws of your state or country. | |||||
| Separate and apart from your relationship with Microsoft, you may also have rights with respect to | |||||
| the party from which you acquired the software. This agreement does not change those other rights | |||||
| if the laws of your state or country do not permit it to do so. For example, if you acquired the | |||||
| software in one of the below regions, or mandatory country law applies, then the following provisions | |||||
| apply to you: | |||||
| a) Australia. You have statutory guarantees under the Australian Consumer Law and nothing in | |||||
| this agreement is intended to affect those rights. | |||||
| b) Canada. If you acquired this software in Canada, you may stop receiving updates by turning off | |||||
| the automatic update feature, disconnecting your device from the Internet (if and when you re- | |||||
| connect to the Internet, however, the software will resume checking for and installing updates), | |||||
| or uninstalling the software. The product documentation, if any, may also specify how to turn off | |||||
| updates for your specific device or software. | |||||
| c) Germany and Austria. | |||||
| (i) Warranty. The software will perform substantially as described in any Microsoft | |||||
| materials that accompany it. However, Microsoft gives no contractual guarantee in relation to the | |||||
| software. | |||||
| (ii) Limitation of Liability. In case of intentional conduct, gross negligence, claims based | |||||
| on the Product Liability Act, as well as in case of death or personal or physical injury, Microsoft is | |||||
| liable according to the statutory law. | |||||
| Subject to the foregoing clause (ii), Microsoft will only be liable for slight negligence if Microsoft is in | |||||
| breach of such material contractual obligations, the fulfillment of which facilitate the due | |||||
| performance of this agreement, the breach of which would endanger the purpose of this agreement | |||||
| and the compliance with which a party may constantly trust in (so-called "cardinal obligations"). In | |||||
| other cases of slight negligence, Microsoft will not be liable for slight negligence | |||||
| 13. DISCLAIMER OF WARRANTY. THE SOFTWARE IS LICENSED “AS-IS.” YOU BEAR THE RISK | |||||
| OF USING IT. MICROSOFT GIVES NO EXPRESS WARRANTIES, GUARANTEES OR | |||||
| CONDITIONS. TO THE EXTENT PERMITTED UNDER YOUR LOCAL LAWS, MICROSOFT | |||||
| EXCLUDES THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A | |||||
| PARTICULAR PURPOSE AND NON-INFRINGEMENT. | |||||
| 14. LIMITATION ON AND EXCLUSION OF REMEDIES AND DAMAGES. YOU CAN RECOVER | |||||
| FROM MICROSOFT AND ITS SUPPLIERS ONLY DIRECT DAMAGES UP TO U.S. $5.00. YOU | |||||
| CANNOT RECOVER ANY OTHER DAMAGES, INCLUDING CONSEQUENTIAL, LOST PROFITS, | |||||
| SPECIAL, INDIRECT OR INCIDENTAL DAMAGES. | |||||
| This limitation applies to (a) anything related to the software, services, content (including code) on | |||||
| third party Internet sites, or third party applications; and (b) claims for breach of contract, breach of | |||||
| warranty, guarantee or condition, strict liability, negligence, or other tort to the extent permitted by | |||||
| applicable law. | |||||
| It also applies even if Microsoft knew or should have known about the possibility of the damages. | |||||
| The above limitation or exclusion may not apply to you because your state or country may not allow | |||||
| the exclusion or limitation of incidental, consequential or other damages. | |||||
| Please note: As this software is distributed in Quebec, Canada, some of the clauses in this | |||||
| agreement are provided below in French. | |||||
| @ -0,0 +1,11 @@ | |||||
| <?xml version="1.0" encoding="utf-8"?> | |||||
| <configuration> | |||||
| <system.webServer> | |||||
| <handlers> | |||||
| <remove name="ExtensionlessUrlHandler-Integrated-4.0" /> | |||||
| <remove name="OPTIONSVerbHandler" /> | |||||
| <remove name="TRACEVerbHandler" /> | |||||
| <add name="ExtensionlessUrlHandler-Integrated-4.0" path="*." verb="*" type="System.Web.Handlers.TransferRequestHandler" preCondition="integratedMode,runtimeVersionv4.0" /> | |||||
| </handlers> | |||||
| </system.webServer> | |||||
| </configuration> | |||||
| @ -0,0 +1,127 @@ | |||||
| MICROSOFT SOFTWARE LICENSE TERMS | |||||
| MICROSOFT .NET LIBRARY | |||||
| These license terms are an agreement between Microsoft Corporation (or based on where you live, one | |||||
| of its affiliates) and you. They apply to the software named above. The terms also apply to any Microsoft | |||||
| services or updates for the software, except to the extent those have different terms. | |||||
| IF YOU COMPLY WITH THESE LICENSE TERMS, YOU HAVE THE RIGHTS BELOW. | |||||
| 1. INSTALLATION AND USE RIGHTS. | |||||
| You may install and use any number of copies of the software to design, develop and test you’re | |||||
| applications. You may modify, copy, distribute or deploy any .js files contained in the software as | |||||
| part of your applications. | |||||
| 2. THIRD PARTY COMPONENTS. The software may include third party components with separate legal | |||||
| notices or governed by other agreements, as may be described in the ThirdPartyNotices file(s) | |||||
| accompanying the software. | |||||
| 3. ADDITIONAL LICENSING REQUIREMENTS AND/OR USE RIGHTS. | |||||
| a. DISTRIBUTABLE CODE. In addition to the .js files described above, the software is comprised | |||||
| of Distributable Code. “Distributable Code” is code that you are permitted to distribute in | |||||
| programs you develop if you comply with the terms below. | |||||
| i. Right to Use and Distribute. | |||||
| • You may copy and distribute the object code form of the software. | |||||
| • Third Party Distribution. You may permit distributors of your programs to copy and | |||||
| distribute the Distributable Code as part of those programs. | |||||
| ii. Distribution Requirements. For any Distributable Code you distribute, you must | |||||
| • use the Distributable Code in your programs and not as a standalone distribution; | |||||
| • require distributors and external end users to agree to terms that protect it at least as | |||||
| much as this agreement; | |||||
| • display your valid copyright notice on your programs; and | |||||
| • indemnify, defend, and hold harmless Microsoft from any claims, including attorneys’ | |||||
| fees, related to the distribution or use of your applications, except to the extent that any | |||||
| claim is based solely on the Distributable Code. | |||||
| iii. Distribution Restrictions. You may not | |||||
| • alter any copyright, trademark or patent notice in the Distributable Code; | |||||
| • use Microsoft’s trademarks in your programs’ names or in a way that suggests your | |||||
| programs come from or are endorsed by Microsoft; | |||||
| • include Distributable Code in malicious, deceptive or unlawful programs; or | |||||
| • modify or distribute the source code of any Distributable Code so that any part of it | |||||
| becomes subject to an Excluded License. An Excluded License is one that requires, as a | |||||
| condition of use, modification or distribution, that | |||||
| • the code be disclosed or distributed in source code form; or | |||||
| • others have the right to modify it. | |||||
| 4. DATA. | |||||
| a. Data Collection. The software may collect information about you and your use of the software, | |||||
| and send that to Microsoft. Microsoft may use this information to provide services and improve | |||||
| our products and services. You may opt-out of many of these scenarios, but not all, as described | |||||
| in the product documentation. There are also some features in the software that may enable | |||||
| you and Microsoft to collect data from users of your applications. If you use these features, you | |||||
| must comply with applicable law, including providing appropriate notices to users of your | |||||
| applications together with a copy of Microsoft’s privacy statement. Our privacy statement is | |||||
| located at https://go.microsoft.com/fwlink/?LinkID=824704. You can learn more about data | |||||
| collection and use in the help documentation and our privacy statement. Your use of the software | |||||
| operates as your consent to these practices. | |||||
| b. Processing of Personal Data. To the extent Microsoft is a processor or subprocessor of | |||||
| personal data in connection with the software, Microsoft makes the commitments in the | |||||
| European Union General Data Protection Regulation Terms of the Online Services Terms to all | |||||
| customers effective May 25, 2018, at http://go.microsoft.com/?linkid=9840733. | |||||
| 5. SCOPE OF LICENSE. The software is licensed, not sold. This agreement only gives you some rights | |||||
| to use the software. Microsoft reserves all other rights. Unless applicable law gives you more rights | |||||
| despite this limitation, you may use the software only as expressly permitted in this agreement. In | |||||
| doing so, you must comply with any technical limitations in the software that only allow you to use it | |||||
| in certain ways. You may not | |||||
| • work around any technical limitations in the software; | |||||
| • reverse engineer, decompile or disassemble the software, or otherwise attempt to derive the | |||||
| source code for the software, except and to the extent required by third party licensing terms | |||||
| governing use of certain open source components that may be included in the software; | |||||
| • remove, minimize, block or modify any notices of Microsoft or its suppliers in the software; | |||||
| • use the software in any way that is against the law; or | |||||
| • share, publish, rent or lease the software, provide the software as a stand-alone offering for | |||||
| others to use, or transfer the software or this agreement to any third party. | |||||
| 6. BACKUP COPY. You may make one backup copy of the software. You may use it only to reinstall | |||||
| the software. | |||||
| 7. DOCUMENTATION. Any person that has valid access to your computer or internal network may | |||||
| copy and use the documentation for your internal, reference purposes. | |||||
| 8. EXPORT RESTRICTIONS. You must comply with all domestic and international export laws and | |||||
| regulations that apply to the software, which include restrictions on destinations, end users, and end | |||||
| use. For further information on export restrictions, visit www.microsoft.com/exporting. | |||||
| 9. SUPPORT SERVICES. Because this software is “as is,” we may not provide support services for it. | |||||
| 10. ENTIRE AGREEMENT. This agreement, and the terms for supplements, updates, Internet-based | |||||
| services and support services that you use, are the entire agreement for the software and support | |||||
| services. | |||||
| 11. APPLICABLE LAW. If you acquired the software in the United States, Washington law applies to | |||||
| interpretation of and claims for breach of this agreement, and the laws of the state where you live | |||||
| apply to all other claims. If you acquired the software in any other country, its laws apply. | |||||
| 12. CONSUMER RIGHTS; REGIONAL VARIATIONS. This agreement describes certain legal rights. | |||||
| You may have other rights, including consumer rights, under the laws of your state or country. | |||||
| Separate and apart from your relationship with Microsoft, you may also have rights with respect to | |||||
| the party from which you acquired the software. This agreement does not change those other rights | |||||
| if the laws of your state or country do not permit it to do so. For example, if you acquired the | |||||
| software in one of the below regions, or mandatory country law applies, then the following provisions | |||||
| apply to you: | |||||
| a) Australia. You have statutory guarantees under the Australian Consumer Law and nothing in | |||||
| this agreement is intended to affect those rights. | |||||
| b) Canada. If you acquired this software in Canada, you may stop receiving updates by turning off | |||||
| the automatic update feature, disconnecting your device from the Internet (if and when you re- | |||||
| connect to the Internet, however, the software will resume checking for and installing updates), | |||||
| or uninstalling the software. The product documentation, if any, may also specify how to turn off | |||||
| updates for your specific device or software. | |||||
| c) Germany and Austria. | |||||
| (i) Warranty. The software will perform substantially as described in any Microsoft | |||||
| materials that accompany it. However, Microsoft gives no contractual guarantee in relation to the | |||||
| software. | |||||
| (ii) Limitation of Liability. In case of intentional conduct, gross negligence, claims based | |||||
| on the Product Liability Act, as well as in case of death or personal or physical injury, Microsoft is | |||||
| liable according to the statutory law. | |||||
| Subject to the foregoing clause (ii), Microsoft will only be liable for slight negligence if Microsoft is in | |||||
| breach of such material contractual obligations, the fulfillment of which facilitate the due | |||||
| performance of this agreement, the breach of which would endanger the purpose of this agreement | |||||
| and the compliance with which a party may constantly trust in (so-called "cardinal obligations"). In | |||||
| other cases of slight negligence, Microsoft will not be liable for slight negligence | |||||
| 13. DISCLAIMER OF WARRANTY. THE SOFTWARE IS LICENSED “AS-IS.” YOU BEAR THE RISK | |||||
| OF USING IT. MICROSOFT GIVES NO EXPRESS WARRANTIES, GUARANTEES OR | |||||
| CONDITIONS. TO THE EXTENT PERMITTED UNDER YOUR LOCAL LAWS, MICROSOFT | |||||
| EXCLUDES THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A | |||||
| PARTICULAR PURPOSE AND NON-INFRINGEMENT. | |||||
| 14. LIMITATION ON AND EXCLUSION OF REMEDIES AND DAMAGES. YOU CAN RECOVER | |||||
| FROM MICROSOFT AND ITS SUPPLIERS ONLY DIRECT DAMAGES UP TO U.S. $5.00. YOU | |||||
| CANNOT RECOVER ANY OTHER DAMAGES, INCLUDING CONSEQUENTIAL, LOST PROFITS, | |||||
| SPECIAL, INDIRECT OR INCIDENTAL DAMAGES. | |||||
| This limitation applies to (a) anything related to the software, services, content (including code) on | |||||
| third party Internet sites, or third party applications; and (b) claims for breach of contract, breach of | |||||
| warranty, guarantee or condition, strict liability, negligence, or other tort to the extent permitted by | |||||
| applicable law. | |||||
| It also applies even if Microsoft knew or should have known about the possibility of the damages. | |||||
| The above limitation or exclusion may not apply to you because your state or country may not allow | |||||
| the exclusion or limitation of incidental, consequential or other damages. | |||||
| Please note: As this software is distributed in Quebec, Canada, some of the clauses in this | |||||
| agreement are provided below in French. | |||||
| @ -0,0 +1,127 @@ | |||||
| MICROSOFT SOFTWARE LICENSE TERMS | |||||
| MICROSOFT .NET LIBRARY | |||||
| These license terms are an agreement between Microsoft Corporation (or based on where you live, one | |||||
| of its affiliates) and you. They apply to the software named above. The terms also apply to any Microsoft | |||||
| services or updates for the software, except to the extent those have different terms. | |||||
| IF YOU COMPLY WITH THESE LICENSE TERMS, YOU HAVE THE RIGHTS BELOW. | |||||
| 1. INSTALLATION AND USE RIGHTS. | |||||
| You may install and use any number of copies of the software to design, develop and test you’re | |||||
| applications. You may modify, copy, distribute or deploy any .js files contained in the software as | |||||
| part of your applications. | |||||
| 2. THIRD PARTY COMPONENTS. The software may include third party components with separate legal | |||||
| notices or governed by other agreements, as may be described in the ThirdPartyNotices file(s) | |||||
| accompanying the software. | |||||
| 3. ADDITIONAL LICENSING REQUIREMENTS AND/OR USE RIGHTS. | |||||
| a. DISTRIBUTABLE CODE. In addition to the .js files described above, the software is comprised | |||||
| of Distributable Code. “Distributable Code” is code that you are permitted to distribute in | |||||
| programs you develop if you comply with the terms below. | |||||
| i. Right to Use and Distribute. | |||||
| • You may copy and distribute the object code form of the software. | |||||
| • Third Party Distribution. You may permit distributors of your programs to copy and | |||||
| distribute the Distributable Code as part of those programs. | |||||
| ii. Distribution Requirements. For any Distributable Code you distribute, you must | |||||
| • use the Distributable Code in your programs and not as a standalone distribution; | |||||
| • require distributors and external end users to agree to terms that protect it at least as | |||||
| much as this agreement; | |||||
| • display your valid copyright notice on your programs; and | |||||
| • indemnify, defend, and hold harmless Microsoft from any claims, including attorneys’ | |||||
| fees, related to the distribution or use of your applications, except to the extent that any | |||||
| claim is based solely on the Distributable Code. | |||||
| iii. Distribution Restrictions. You may not | |||||
| • alter any copyright, trademark or patent notice in the Distributable Code; | |||||
| • use Microsoft’s trademarks in your programs’ names or in a way that suggests your | |||||
| programs come from or are endorsed by Microsoft; | |||||
| • include Distributable Code in malicious, deceptive or unlawful programs; or | |||||
| • modify or distribute the source code of any Distributable Code so that any part of it | |||||
| becomes subject to an Excluded License. An Excluded License is one that requires, as a | |||||
| condition of use, modification or distribution, that | |||||
| • the code be disclosed or distributed in source code form; or | |||||
| • others have the right to modify it. | |||||
| 4. DATA. | |||||
| a. Data Collection. The software may collect information about you and your use of the software, | |||||
| and send that to Microsoft. Microsoft may use this information to provide services and improve | |||||
| our products and services. You may opt-out of many of these scenarios, but not all, as described | |||||
| in the product documentation. There are also some features in the software that may enable | |||||
| you and Microsoft to collect data from users of your applications. If you use these features, you | |||||
| must comply with applicable law, including providing appropriate notices to users of your | |||||
| applications together with a copy of Microsoft’s privacy statement. Our privacy statement is | |||||
| located at https://go.microsoft.com/fwlink/?LinkID=824704. You can learn more about data | |||||
| collection and use in the help documentation and our privacy statement. Your use of the software | |||||
| operates as your consent to these practices. | |||||
| b. Processing of Personal Data. To the extent Microsoft is a processor or subprocessor of | |||||
| personal data in connection with the software, Microsoft makes the commitments in the | |||||
| European Union General Data Protection Regulation Terms of the Online Services Terms to all | |||||
| customers effective May 25, 2018, at http://go.microsoft.com/?linkid=9840733. | |||||
| 5. SCOPE OF LICENSE. The software is licensed, not sold. This agreement only gives you some rights | |||||
| to use the software. Microsoft reserves all other rights. Unless applicable law gives you more rights | |||||
| despite this limitation, you may use the software only as expressly permitted in this agreement. In | |||||
| doing so, you must comply with any technical limitations in the software that only allow you to use it | |||||
| in certain ways. You may not | |||||
| • work around any technical limitations in the software; | |||||
| • reverse engineer, decompile or disassemble the software, or otherwise attempt to derive the | |||||
| source code for the software, except and to the extent required by third party licensing terms | |||||
| governing use of certain open source components that may be included in the software; | |||||
| • remove, minimize, block or modify any notices of Microsoft or its suppliers in the software; | |||||
| • use the software in any way that is against the law; or | |||||
| • share, publish, rent or lease the software, provide the software as a stand-alone offering for | |||||
| others to use, or transfer the software or this agreement to any third party. | |||||
| 6. BACKUP COPY. You may make one backup copy of the software. You may use it only to reinstall | |||||
| the software. | |||||
| 7. DOCUMENTATION. Any person that has valid access to your computer or internal network may | |||||
| copy and use the documentation for your internal, reference purposes. | |||||
| 8. EXPORT RESTRICTIONS. You must comply with all domestic and international export laws and | |||||
| regulations that apply to the software, which include restrictions on destinations, end users, and end | |||||
| use. For further information on export restrictions, visit www.microsoft.com/exporting. | |||||
| 9. SUPPORT SERVICES. Because this software is “as is,” we may not provide support services for it. | |||||
| 10. ENTIRE AGREEMENT. This agreement, and the terms for supplements, updates, Internet-based | |||||
| services and support services that you use, are the entire agreement for the software and support | |||||
| services. | |||||
| 11. APPLICABLE LAW. If you acquired the software in the United States, Washington law applies to | |||||
| interpretation of and claims for breach of this agreement, and the laws of the state where you live | |||||
| apply to all other claims. If you acquired the software in any other country, its laws apply. | |||||
| 12. CONSUMER RIGHTS; REGIONAL VARIATIONS. This agreement describes certain legal rights. | |||||
| You may have other rights, including consumer rights, under the laws of your state or country. | |||||
| Separate and apart from your relationship with Microsoft, you may also have rights with respect to | |||||
| the party from which you acquired the software. This agreement does not change those other rights | |||||
| if the laws of your state or country do not permit it to do so. For example, if you acquired the | |||||
| software in one of the below regions, or mandatory country law applies, then the following provisions | |||||
| apply to you: | |||||
| a) Australia. You have statutory guarantees under the Australian Consumer Law and nothing in | |||||
| this agreement is intended to affect those rights. | |||||
| b) Canada. If you acquired this software in Canada, you may stop receiving updates by turning off | |||||
| the automatic update feature, disconnecting your device from the Internet (if and when you re- | |||||
| connect to the Internet, however, the software will resume checking for and installing updates), | |||||
| or uninstalling the software. The product documentation, if any, may also specify how to turn off | |||||
| updates for your specific device or software. | |||||
| c) Germany and Austria. | |||||
| (i) Warranty. The software will perform substantially as described in any Microsoft | |||||
| materials that accompany it. However, Microsoft gives no contractual guarantee in relation to the | |||||
| software. | |||||
| (ii) Limitation of Liability. In case of intentional conduct, gross negligence, claims based | |||||
| on the Product Liability Act, as well as in case of death or personal or physical injury, Microsoft is | |||||
| liable according to the statutory law. | |||||
| Subject to the foregoing clause (ii), Microsoft will only be liable for slight negligence if Microsoft is in | |||||
| breach of such material contractual obligations, the fulfillment of which facilitate the due | |||||
| performance of this agreement, the breach of which would endanger the purpose of this agreement | |||||
| and the compliance with which a party may constantly trust in (so-called "cardinal obligations"). In | |||||
| other cases of slight negligence, Microsoft will not be liable for slight negligence | |||||
| 13. DISCLAIMER OF WARRANTY. THE SOFTWARE IS LICENSED “AS-IS.” YOU BEAR THE RISK | |||||
| OF USING IT. MICROSOFT GIVES NO EXPRESS WARRANTIES, GUARANTEES OR | |||||
| CONDITIONS. TO THE EXTENT PERMITTED UNDER YOUR LOCAL LAWS, MICROSOFT | |||||
| EXCLUDES THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A | |||||
| PARTICULAR PURPOSE AND NON-INFRINGEMENT. | |||||
| 14. LIMITATION ON AND EXCLUSION OF REMEDIES AND DAMAGES. YOU CAN RECOVER | |||||
| FROM MICROSOFT AND ITS SUPPLIERS ONLY DIRECT DAMAGES UP TO U.S. $5.00. YOU | |||||
| CANNOT RECOVER ANY OTHER DAMAGES, INCLUDING CONSEQUENTIAL, LOST PROFITS, | |||||
| SPECIAL, INDIRECT OR INCIDENTAL DAMAGES. | |||||
| This limitation applies to (a) anything related to the software, services, content (including code) on | |||||
| third party Internet sites, or third party applications; and (b) claims for breach of contract, breach of | |||||
| warranty, guarantee or condition, strict liability, negligence, or other tort to the extent permitted by | |||||
| applicable law. | |||||
| It also applies even if Microsoft knew or should have known about the possibility of the damages. | |||||
| The above limitation or exclusion may not apply to you because your state or country may not allow | |||||
| the exclusion or limitation of incidental, consequential or other damages. | |||||
| Please note: As this software is distributed in Quebec, Canada, some of the clauses in this | |||||
| agreement are provided below in French. | |||||
| @ -0,0 +1,135 @@ | |||||
| <?xml version="1.0" encoding="utf-8"?> | |||||
| <doc> | |||||
| <assembly> | |||||
| <name>System.Web.Http.WebHost</name> | |||||
| </assembly> | |||||
| <members> | |||||
| <member name="T:System.Web.Http.GlobalConfiguration"> | |||||
| <summary> Provides a global <see cref="T:System.Web.Http.HttpConfiguration" /> for ASP.NET applications. </summary> | |||||
| </member> | |||||
| <member name="P:System.Web.Http.GlobalConfiguration.Configuration"></member> | |||||
| <member name="M:System.Web.Http.GlobalConfiguration.Configure(System.Action{System.Web.Http.HttpConfiguration})"></member> | |||||
| <member name="P:System.Web.Http.GlobalConfiguration.DefaultHandler"></member> | |||||
| <member name="P:System.Web.Http.GlobalConfiguration.DefaultServer"> | |||||
| <summary> Gets the global <see cref="T:System.Web.Http.HttpServer" />. </summary> | |||||
| </member> | |||||
| <member name="T:System.Web.Http.RouteCollectionExtensions"> | |||||
| <summary> Extension methods for <see cref="T:System.Web.Routing.RouteCollection" /></summary> | |||||
| </member> | |||||
| <member name="M:System.Web.Http.RouteCollectionExtensions.MapHttpRoute(System.Web.Routing.RouteCollection,System.String,System.String)"> | |||||
| <summary>Maps the specified route template.</summary> | |||||
| <returns>A reference to the mapped route.</returns> | |||||
| <param name="routes">A collection of routes for the application.</param> | |||||
| <param name="name">The name of the route to map.</param> | |||||
| <param name="routeTemplate">The route template for the route.</param> | |||||
| </member> | |||||
| <member name="M:System.Web.Http.RouteCollectionExtensions.MapHttpRoute(System.Web.Routing.RouteCollection,System.String,System.String,System.Object)"> | |||||
| <summary>Maps the specified route template and sets default route.</summary> | |||||
| <returns>A reference to the mapped route.</returns> | |||||
| <param name="routes">A collection of routes for the application.</param> | |||||
| <param name="name">The name of the route to map.</param> | |||||
| <param name="routeTemplate">The route template for the route.</param> | |||||
| <param name="defaults">An object that contains default route values.</param> | |||||
| </member> | |||||
| <member name="M:System.Web.Http.RouteCollectionExtensions.MapHttpRoute(System.Web.Routing.RouteCollection,System.String,System.String,System.Object,System.Object)"> | |||||
| <summary>Maps the specified route template and sets default route values and constraints.</summary> | |||||
| <returns>A reference to the mapped route.</returns> | |||||
| <param name="routes">A collection of routes for the application.</param> | |||||
| <param name="name">The name of the route to map.</param> | |||||
| <param name="routeTemplate">The route template for the route.</param> | |||||
| <param name="defaults">An object that contains default route values.</param> | |||||
| <param name="constraints">A set of expressions that specify values for routeTemplate.</param> | |||||
| </member> | |||||
| <member name="M:System.Web.Http.RouteCollectionExtensions.MapHttpRoute(System.Web.Routing.RouteCollection,System.String,System.String,System.Object,System.Object,System.Net.Http.HttpMessageHandler)"> | |||||
| <summary>Maps the specified route template and sets default route values, constraints, and end-point message handler.</summary> | |||||
| <returns>A reference to the mapped route.</returns> | |||||
| <param name="routes">A collection of routes for the application.</param> | |||||
| <param name="name">The name of the route to map.</param> | |||||
| <param name="routeTemplate">The route template for the route.</param> | |||||
| <param name="defaults">An object that contains default route values.</param> | |||||
| <param name="constraints">A set of expressions that specify values for routeTemplate.</param> | |||||
| <param name="handler">The handler to which the request will be dispatched.</param> | |||||
| </member> | |||||
| <member name="T:System.Web.Http.WebHost.HttpControllerHandler"> | |||||
| <summary>A <see cref="T:System.Web.IHttpTaskAsyncHandler" /> that passes ASP.NET requests into the <see cref="T:System.Web.Http.HttpServer" /> pipeline and write the result back.</summary> | |||||
| </member> | |||||
| <member name="M:System.Web.Http.WebHost.HttpControllerHandler.#ctor(System.Web.Routing.RouteData)"> | |||||
| <summary>Initializes a new instance of the <see cref="T:System.Web.Http.WebHost.HttpControllerHandler" /> class.</summary> | |||||
| <param name="routeData">The route data.</param> | |||||
| </member> | |||||
| <member name="M:System.Web.Http.WebHost.HttpControllerHandler.#ctor(System.Web.Routing.RouteData,System.Net.Http.HttpMessageHandler)"> | |||||
| <summary>Initializes a new instance of the <see cref="T:System.Web.Http.WebHost.HttpControllerHandler" /> class.</summary> | |||||
| <param name="routeData">The route data.</param> | |||||
| <param name="handler">The message handler to dispatch requests to.</param> | |||||
| </member> | |||||
| <member name="M:System.Web.Http.WebHost.HttpControllerHandler.ProcessRequestAsync(System.Web.HttpContext)"> | |||||
| <summary>Provides code that handles an asynchronous task</summary> | |||||
| <returns>The asynchronous task.</returns> | |||||
| <param name="context">The HTTP context.</param> | |||||
| </member> | |||||
| <member name="T:System.Web.Http.WebHost.HttpControllerRouteHandler"> | |||||
| <summary> A <see cref="T:System.Web.Routing.IRouteHandler" /> that returns instances of <see cref="T:System.Web.Http.WebHost.HttpControllerHandler" /> that can pass requests to a given <see cref="T:System.Web.Http.HttpServer" /> instance. </summary> | |||||
| </member> | |||||
| <member name="M:System.Web.Http.WebHost.HttpControllerRouteHandler.#ctor"> | |||||
| <summary> Initializes a new instance of the <see cref="T:System.Web.Http.WebHost.HttpControllerRouteHandler" /> class. </summary> | |||||
| </member> | |||||
| <member name="M:System.Web.Http.WebHost.HttpControllerRouteHandler.GetHttpHandler(System.Web.Routing.RequestContext)"> | |||||
| <summary> Provides the object that processes the request. </summary> | |||||
| <returns> An object that processes the request. </returns> | |||||
| <param name="requestContext">An object that encapsulates information about the request.</param> | |||||
| </member> | |||||
| <member name="P:System.Web.Http.WebHost.HttpControllerRouteHandler.Instance"> | |||||
| <summary> Gets the singleton <see cref="T:System.Web.Http.WebHost.HttpControllerRouteHandler" /> instance. </summary> | |||||
| </member> | |||||
| <member name="M:System.Web.Http.WebHost.HttpControllerRouteHandler.System#Web#Routing#IRouteHandler#GetHttpHandler(System.Web.Routing.RequestContext)"> | |||||
| <summary> Provides the object that processes the request. </summary> | |||||
| <returns> An object that processes the request. </returns> | |||||
| <param name="requestContext">An object that encapsulates information about the request.</param> | |||||
| </member> | |||||
| <member name="T:System.Web.Http.WebHost.PreApplicationStartCode"> | |||||
| <summary>Provides a registration point for the simple membership pre-application start code.</summary> | |||||
| </member> | |||||
| <member name="M:System.Web.Http.WebHost.PreApplicationStartCode.Start"> | |||||
| <summary>Registers the simple membership pre-application start code.</summary> | |||||
| </member> | |||||
| <member name="T:System.Web.Http.WebHost.WebHostBufferPolicySelector"> | |||||
| <summary>Represents the web host buffer policy selector.</summary> | |||||
| </member> | |||||
| <member name="M:System.Web.Http.WebHost.WebHostBufferPolicySelector.#ctor"> | |||||
| <summary>Initializes a new instance of the <see cref="T:System.Web.Http.WebHost.WebHostBufferPolicySelector" /> class.</summary> | |||||
| </member> | |||||
| <member name="M:System.Web.Http.WebHost.WebHostBufferPolicySelector.UseBufferedInputStream(System.Object)"> | |||||
| <summary>Gets a value that indicates whether the host should buffer the entity body of the HTTP request.</summary> | |||||
| <returns>true if buffering should be used; otherwise a streamed request should be used.</returns> | |||||
| <param name="hostContext">The host context.</param> | |||||
| </member> | |||||
| <member name="M:System.Web.Http.WebHost.WebHostBufferPolicySelector.UseBufferedOutputStream(System.Net.Http.HttpResponseMessage)"> | |||||
| <summary>Uses a buffered output stream for the web host.</summary> | |||||
| <returns>A buffered output stream.</returns> | |||||
| <param name="response">The response.</param> | |||||
| </member> | |||||
| <member name="T:System.Web.Http.WebHost.WebHostExceptionCatchBlocks"> | |||||
| <summary>Provides the catch blocks used within this assembly.</summary> | |||||
| </member> | |||||
| <member name="P:System.Web.Http.WebHost.WebHostExceptionCatchBlocks.HttpControllerHandlerBufferContent"> | |||||
| <summary>Gets the label for the catch block in System.Web.Http.WebHost.HttpControllerHandler.WriteBufferedResponseContentAsync.</summary> | |||||
| <returns>The label for the catch block in System.Web.Http.WebHost.HttpControllerHandler.WriteBufferedResponseContentAsync.</returns> | |||||
| </member> | |||||
| <member name="P:System.Web.Http.WebHost.WebHostExceptionCatchBlocks.HttpControllerHandlerBufferError"> | |||||
| <summary>Gets the label for the catch block in System.Web.Http.WebHost.HttpControllerHandler.WriteErrorResponseContentAsync.</summary> | |||||
| <returns>The label for the catch block in System.Web.Http.WebHost.HttpControllerHandler.WriteErrorResponseContentAsync.</returns> | |||||
| </member> | |||||
| <member name="P:System.Web.Http.WebHost.WebHostExceptionCatchBlocks.HttpControllerHandlerComputeContentLength"> | |||||
| <summary>Gets the label for the catch block in System.Web.Http.WebHost.HttpControllerHandler.ComputeContentLength.</summary> | |||||
| <returns>The label for the catch block in System.Web.Http.WebHost.HttpControllerHandler.ComputeContentLength.</returns> | |||||
| </member> | |||||
| <member name="P:System.Web.Http.WebHost.WebHostExceptionCatchBlocks.HttpControllerHandlerStreamContent"> | |||||
| <summary>Gets the label for the catch block in System.Web.Http.WebHost.HttpControllerHandler.WriteStreamedResponseContentAsync.</summary> | |||||
| <returns>The label for the catch block in System.Web.Http.WebHost.HttpControllerHandler.WriteStreamedResponseContentAsync.</returns> | |||||
| </member> | |||||
| <member name="P:System.Web.Http.WebHost.WebHostExceptionCatchBlocks.HttpWebRoute"> | |||||
| <summary>Gets the label for the catch block in System.Web.Http.WebHost.WebHostExceptionCatchBlocks.HttpWebRoute.GetRouteData.</summary> | |||||
| <returns>The catch block in System.Web.Http.WebHost.WebHostExceptionCatchBlocks.HttpWebRoute.GetRouteData.</returns> | |||||
| </member> | |||||
| </members> | |||||
| </doc> | |||||
| @ -0,0 +1,93 @@ | |||||
| param($installPath, $toolsPath, $package, $project) | |||||
| # open json.net splash page on package install | |||||
| # don't open if json.net is installed as a dependency | |||||
| try | |||||
| { | |||||
| $url = "http://james.newtonking.com/json" | |||||
| $dte2 = Get-Interface $dte ([EnvDTE80.DTE2]) | |||||
| if ($dte2.ActiveWindow.Caption -eq "Package Manager Console") | |||||
| { | |||||
| # user is installing from VS NuGet console | |||||
| # get reference to the window, the console host and the input history | |||||
| # show webpage if "install-package newtonsoft.json" was last input | |||||
| $consoleWindow = $(Get-VSComponentModel).GetService([NuGetConsole.IPowerConsoleWindow]) | |||||
| $props = $consoleWindow.GetType().GetProperties([System.Reflection.BindingFlags]::Instance -bor ` | |||||
| [System.Reflection.BindingFlags]::NonPublic) | |||||
| $prop = $props | ? { $_.Name -eq "ActiveHostInfo" } | select -first 1 | |||||
| if ($prop -eq $null) { return } | |||||
| $hostInfo = $prop.GetValue($consoleWindow) | |||||
| if ($hostInfo -eq $null) { return } | |||||
| $history = $hostInfo.WpfConsole.InputHistory.History | |||||
| $lastCommand = $history | select -last 1 | |||||
| if ($lastCommand) | |||||
| { | |||||
| $lastCommand = $lastCommand.Trim().ToLower() | |||||
| if ($lastCommand.StartsWith("install-package") -and $lastCommand.Contains("newtonsoft.json")) | |||||
| { | |||||
| $dte2.ItemOperations.Navigate($url) | Out-Null | |||||
| } | |||||
| } | |||||
| } | |||||
| else | |||||
| { | |||||
| # user is installing from VS NuGet dialog | |||||
| # get reference to the window, then smart output console provider | |||||
| # show webpage if messages in buffered console contains "installing...newtonsoft.json" in last operation | |||||
| $instanceField = [NuGet.Dialog.PackageManagerWindow].GetField("CurrentInstance", [System.Reflection.BindingFlags]::Static -bor ` | |||||
| [System.Reflection.BindingFlags]::NonPublic) | |||||
| $consoleField = [NuGet.Dialog.PackageManagerWindow].GetField("_smartOutputConsoleProvider", [System.Reflection.BindingFlags]::Instance -bor ` | |||||
| [System.Reflection.BindingFlags]::NonPublic) | |||||
| if ($instanceField -eq $null -or $consoleField -eq $null) { return } | |||||
| $instance = $instanceField.GetValue($null) | |||||
| if ($instance -eq $null) { return } | |||||
| $consoleProvider = $consoleField.GetValue($instance) | |||||
| if ($consoleProvider -eq $null) { return } | |||||
| $console = $consoleProvider.CreateOutputConsole($false) | |||||
| $messagesField = $console.GetType().GetField("_messages", [System.Reflection.BindingFlags]::Instance -bor ` | |||||
| [System.Reflection.BindingFlags]::NonPublic) | |||||
| if ($messagesField -eq $null) { return } | |||||
| $messages = $messagesField.GetValue($console) | |||||
| if ($messages -eq $null) { return } | |||||
| $operations = $messages -split "==============================" | |||||
| $lastOperation = $operations | select -last 1 | |||||
| if ($lastOperation) | |||||
| { | |||||
| $lastOperation = $lastOperation.ToLower() | |||||
| $lines = $lastOperation -split "`r`n" | |||||
| $installMatch = $lines | ? { $_.StartsWith("------- installing...newtonsoft.json ") } | select -first 1 | |||||
| if ($installMatch) | |||||
| { | |||||
| $dte2.ItemOperations.Navigate($url) | Out-Null | |||||
| } | |||||
| } | |||||
| } | |||||
| } | |||||
| catch | |||||
| { | |||||
| # stop potential errors from bubbling up | |||||
| # worst case the splash page won't open | |||||
| } | |||||
| # yolo | |||||