Repository: JamesYing/JCWX Branch: master Commit: cc9b16436b19 Files: 406 Total size: 4.9 MB Directory structure: gitextract_b2y6yjq7/ ├── .gitattributes ├── .gitignore ├── Business/ │ ├── Api/ │ │ ├── DefaultApiClient.cs │ │ └── IApiClient.cs │ ├── ApiAccessTokenManager.cs │ ├── Common/ │ │ ├── DataSecret.cs │ │ ├── DateTimeExtend.cs │ │ ├── HttpHelper.cs │ │ └── ShelfModuleConverter.cs │ ├── CustomAccount.cs │ ├── IMessageHandler.cs │ ├── IMessageRole.cs │ ├── Logger/ │ │ └── ILogger.cs │ ├── Model/ │ │ ├── ApiRequests/ │ │ │ ├── AccessTokenCodeRequest.cs │ │ │ ├── AccessTokenRequest.cs │ │ │ ├── ApiGetNeedTokenRequest.cs │ │ │ ├── ApiPostNeedTokenRequest.cs │ │ │ ├── ApiRequest.cs │ │ │ ├── CustomServiceGetRecordRequest.cs │ │ │ ├── CustomserviceGetkflistRequest.cs │ │ │ ├── CustomserviceGetonlinekflistRequest.cs │ │ │ ├── CustomserviceKfaccountAddRequest.cs │ │ │ ├── CustomserviceKfaccountUpdateRequest.cs │ │ │ ├── CustomserviceKfaccountUploadheadimgRequest.cs │ │ │ ├── CustomserviceKfsessionCloseRequest.cs │ │ │ ├── CustomserviceKfsessionCreateRequest.cs │ │ │ ├── CustomserviceKfsessionGetsessionRequest.cs │ │ │ ├── CustomserviceKfsessionGetsessionlistRequest.cs │ │ │ ├── CustomserviceKfsessionGetwaitcaseRequest.cs │ │ │ ├── CustomservicesKfaccountDelRequest.cs │ │ │ ├── DatacubeGetInterfaceRequest.cs │ │ │ ├── DatacubeGetInterfaceSummaryHourRequest.cs │ │ │ ├── DatacubeGetInterfaceSummaryRequest.cs │ │ │ ├── DatacubeGetStreamMsgRequest.cs │ │ │ ├── DatacubeGetUpStreamMsgDistMonth.cs │ │ │ ├── DatacubeGetUpStreamMsgDistRequest.cs │ │ │ ├── DatacubeGetUpStreamMsgDistWeek.cs │ │ │ ├── DatacubeGetUpStreamMsgHourRequest.cs │ │ │ ├── DatacubeGetUpStreamMsgMonthRequest.cs │ │ │ ├── DatacubeGetUpStreamMsgRequest.cs │ │ │ ├── DatacubeGetUpStreamMsgWeekRequest.cs │ │ │ ├── DatacubeGetUserCumulateRequest.cs │ │ │ ├── DatacubeGetUserSummaryRequest.cs │ │ │ ├── DatacubeGetarticlesummaryRequest.cs │ │ │ ├── DatacubeGetarticletotalRequest.cs │ │ │ ├── DatacubeGetuserreadRequest.cs │ │ │ ├── DatacubeGetuserreadhourRequest.cs │ │ │ ├── DatacubeGetusershareRequest.cs │ │ │ ├── DatacubeGetusersharehourRequest.cs │ │ │ ├── GetCurrentAutoreplyInfoRequest.cs │ │ │ ├── GetCurrentSelfmenuInfoRequest.cs │ │ │ ├── GetcallbackipRequest.cs │ │ │ ├── GroupsCreateRequest.cs │ │ │ ├── GroupsGetIdRequest.cs │ │ │ ├── GroupsMembersUpdateRequest.cs │ │ │ ├── GroupsQueryRequest.cs │ │ │ ├── GroupsUpdateRequest.cs │ │ │ ├── MaterialAddNewsRequest.cs │ │ │ ├── MediaGetRequest.cs │ │ │ ├── MediaUploadNewsRequest.cs │ │ │ ├── MediaUploadRequest.cs │ │ │ ├── MenuCreateRequest.cs │ │ │ ├── MenuDeleteRequest.cs │ │ │ ├── MenuGetRequest.cs │ │ │ ├── MerchantCategoryGetPropertyRequest.cs │ │ │ ├── MerchantCategoryGetskuRequest.cs │ │ │ ├── MerchantCategoryGetsubRequest.cs │ │ │ ├── MerchantCommonUploadimgRequest.cs │ │ │ ├── MerchantCreateRequest.cs │ │ │ ├── MerchantDelRequest.cs │ │ │ ├── MerchantExpressAddRequest.cs │ │ │ ├── MerchantExpressDelRequest.cs │ │ │ ├── MerchantExpressGetallRequest.cs │ │ │ ├── MerchantExpressGetbyidRequest.cs │ │ │ ├── MerchantExpressUpdateRequest.cs │ │ │ ├── MerchantGetRequest.cs │ │ │ ├── MerchantGetbystatus.cs │ │ │ ├── MerchantGroupAddRequest.cs │ │ │ ├── MerchantGroupDelRequest.cs │ │ │ ├── MerchantGroupGetallRequest.cs │ │ │ ├── MerchantGroupGetbyidRequest.cs │ │ │ ├── MerchantGroupProductmodRequest.cs │ │ │ ├── MerchantGroupPropertymodRequest.cs │ │ │ ├── MerchantModproductstatusRequest.cs │ │ │ ├── MerchantOrderCloseRequest.cs │ │ │ ├── MerchantOrderGetbyfilterRequest.cs │ │ │ ├── MerchantOrderGetbyidRequest.cs │ │ │ ├── MerchantOrderSetdeliveryRequest.cs │ │ │ ├── MerchantShelfAddRequest.cs │ │ │ ├── MerchantShelfDelRequest.cs │ │ │ ├── MerchantShelfGetallRequest.cs │ │ │ ├── MerchantShelfGetbyidRequest.cs │ │ │ ├── MerchantShelfMod.cs │ │ │ ├── MerchantShelfUpdatestatusRequest.cs │ │ │ ├── MerchantStockAddRequest.cs │ │ │ ├── MerchantStockReduceRequest.cs │ │ │ ├── MerchantUpdateRequest.cs │ │ │ ├── MessageCustomSendImageRequest.cs │ │ │ ├── MessageCustomSendMusicRequest.cs │ │ │ ├── MessageCustomSendNewsRequest.cs │ │ │ ├── MessageCustomSendRequest.cs │ │ │ ├── MessageCustomSendTextRequest.cs │ │ │ ├── MessageCustomSendVideoRequest.cs │ │ │ ├── MessageCustomSendVoiceRequest.cs │ │ │ ├── MessageMassDeleteRequest.cs │ │ │ ├── MessageMassSendAllRequest.cs │ │ │ ├── MessageMassSendRequest.cs │ │ │ ├── QrcodeCreateRequest.cs │ │ │ ├── ShorturlRequest.cs │ │ │ ├── SnsOAuthAccessTokenRequest.cs │ │ │ ├── SnsOauthRefreshTokenRequest.cs │ │ │ ├── SnsUserInfoRequest.cs │ │ │ ├── TemplateApiaddtemplateRequest.cs │ │ │ ├── TemplateApisetindustryRequest.cs │ │ │ ├── TemplateSendRequest.cs │ │ │ ├── UserGetRequest.cs │ │ │ ├── UserInfoRequest.cs │ │ │ └── UserInfoUpdateremarkRequest.cs │ │ ├── ApiResponses/ │ │ │ ├── AccessTokenCodeResponse.cs │ │ │ ├── AccessTokenResponse.cs │ │ │ ├── ApiResponse.cs │ │ │ ├── CustomServiceGetRecordResponse.cs │ │ │ ├── CustomserviceGetkflistResponse.cs │ │ │ ├── CustomserviceGetonlinekflistResponse.cs │ │ │ ├── CustomserviceKfsessionCloseResponse.cs │ │ │ ├── CustomserviceKfsessionCreateResponse.cs │ │ │ ├── CustomserviceKfsessionGetsessionResponse.cs │ │ │ ├── CustomserviceKfsessionGetsessionlistResponse.cs │ │ │ ├── CustomserviceKfsessionGetwaitcaseResponse.cs │ │ │ ├── DatacubeGetArticlesResponse.cs │ │ │ ├── DatacubeGetInterfaceResponse.cs │ │ │ ├── DatacubeGetStreamMsgResponse.cs │ │ │ ├── DatacubeGetUserCumulateResponse.cs │ │ │ ├── DatacubeGetUserSummaryResponse.cs │ │ │ ├── DefaultResponse.cs │ │ │ ├── GetCurrentAutoreplyInfoResponse.cs │ │ │ ├── GetCurrentSelfmenuInfoResponse.cs │ │ │ ├── GetcallbackipResponse.cs │ │ │ ├── GroupCreateResponse.cs │ │ │ ├── GroupsGetIdResponse.cs │ │ │ ├── GroupsMembersUpdateResponse.cs │ │ │ ├── GroupsQueryResponse.cs │ │ │ ├── GroupsUpdateResponse.cs │ │ │ ├── MaterialAddNewsResponse.cs │ │ │ ├── MediaGetResponse.cs │ │ │ ├── MediaUploadNewsResponse.cs │ │ │ ├── MediaUploadResponse.cs │ │ │ ├── MenuCreateResponse.cs │ │ │ ├── MenuDeleteResponse.cs │ │ │ ├── MenuGetResponse.cs │ │ │ ├── MerchantCategoryGetpropertyResponse.cs │ │ │ ├── MerchantCategoryGetskuResponse.cs │ │ │ ├── MerchantCategoryGetsubResponse.cs │ │ │ ├── MerchantCommonUploadimgResponse.cs │ │ │ ├── MerchantCreateResponse.cs │ │ │ ├── MerchantExpressAddResponse.cs │ │ │ ├── MerchantExpressGetallResponse.cs │ │ │ ├── MerchantExpressGetbyidResponse.cs │ │ │ ├── MerchantGetResponse.cs │ │ │ ├── MerchantGetbystatusResponse.cs │ │ │ ├── MerchantGroupAddResponse.cs │ │ │ ├── MerchantGroupGetallResponse.cs │ │ │ ├── MerchantGroupGetbyidResponse.cs │ │ │ ├── MerchantOrderGetbyfilterResponse.cs │ │ │ ├── MerchantOrderGetbyidResponse.cs │ │ │ ├── MerchantShelfAddResponse.cs │ │ │ ├── MerchantShelfGetallResponse.cs │ │ │ ├── MerchantShelfGetbyidResponse.cs │ │ │ ├── MerchantShelfUpdatestatusResponse.cs │ │ │ ├── MessageCustomSendResponse.cs │ │ │ ├── MessageMassDeleteResponse.cs │ │ │ ├── MessageMassSendAllResponse.cs │ │ │ ├── MessageMassSendResponse.cs │ │ │ ├── QrcodeCreateResponse.cs │ │ │ ├── ShorturlResponse.cs │ │ │ ├── SnsOAuthAccessTokenResponse.cs │ │ │ ├── SnsUserInfoResponse.cs │ │ │ ├── TemplateApiaddtemplateResponse.cs │ │ │ ├── TemplateSendResponse.cs │ │ │ ├── UserGetResponse.cs │ │ │ └── UserInfoResponse.cs │ │ ├── AppIdentication.cs │ │ ├── ClickButton.cs │ │ ├── Exceptions/ │ │ │ └── WXApiException.cs │ │ ├── Group.cs │ │ ├── MerchantInfoModel.cs │ │ ├── MiddleMessage.cs │ │ ├── OrderInfoModel.cs │ │ ├── PublicMessage.cs │ │ ├── Request/ │ │ │ ├── RequestClickEventMessage.cs │ │ │ ├── RequestEventMessage.cs │ │ │ ├── RequestImageMessage.cs │ │ │ ├── RequestLinkMessage.cs │ │ │ ├── RequestLocationEventMessage.cs │ │ │ ├── RequestLocationMessage.cs │ │ │ ├── RequestMassSendEventMessage.cs │ │ │ ├── RequestMessage.cs │ │ │ ├── RequestOrderEventMessage.cs │ │ │ ├── RequestQREventMessage.cs │ │ │ ├── RequestShortVideoMessage.cs │ │ │ ├── RequestTemplateEventMessage.cs │ │ │ ├── RequestTextMessage.cs │ │ │ ├── RequestVideoMessage.cs │ │ │ ├── RequestViewEventMessage.cs │ │ │ └── RequestVoiceMessage.cs │ │ ├── Response/ │ │ │ ├── ResponseImageMessage.cs │ │ │ ├── ResponseMessage.cs │ │ │ ├── ResponseMusicMessage.cs │ │ │ ├── ResponseNewsMessage.cs │ │ │ ├── ResponseTextMessage.cs │ │ │ ├── ResponseTransferCustomServiceMessage.cs │ │ │ ├── ResponseVideoMessage.cs │ │ │ └── ResponseVoiceMessage.cs │ │ ├── TemplateDataProperty.cs │ │ ├── WXEnum.cs │ │ ├── WXEnum.cs.BASE.cs │ │ ├── WXEnum.cs.LOCAL.cs │ │ ├── WXEnum.cs.REMOTE.cs │ │ ├── WXJsonResult.cs │ │ └── WXMessage.cs │ ├── NotHandlerMessage.cs │ ├── OAuth/ │ │ └── OAuthHelper.cs │ ├── Pay/ │ │ ├── IPayApiClient.cs │ │ ├── PayApiClient.cs │ │ ├── Request/ │ │ │ ├── PayCloseorderRequest.cs │ │ │ ├── PayDownloadbillRequest.cs │ │ │ ├── PayOrderqueryRequest.cs │ │ │ ├── PayRefundQueryRequest.cs │ │ │ ├── PayRefundRequest.cs │ │ │ ├── PayRequest.cs │ │ │ └── PayUnifiedOrderRequest.cs │ │ └── Response/ │ │ ├── PayCloseorderResponse.cs │ │ ├── PayDownloadResponse.cs │ │ ├── PayOrderqueryResponse.cs │ │ ├── PayRefundQueryResponse.cs │ │ ├── PayRefundResponse.cs │ │ ├── PayResponse.cs │ │ └── PayUnifiedOrderResponse.cs │ ├── Properties/ │ │ └── AssemblyInfo.cs │ ├── WXFramework.csproj │ └── packages.config ├── CustomClickMenu/ │ ├── App.config │ ├── App_Code/ │ │ └── DataGridRow.cs │ ├── CustomClickMenu.csproj │ ├── Form1.Designer.cs │ ├── Form1.cs │ ├── Form1.resx │ ├── MenuForm.Designer.cs │ ├── MenuForm.cs │ ├── MenuForm.resx │ ├── Program.cs │ └── Properties/ │ ├── AssemblyInfo.cs │ ├── Resources.Designer.cs │ ├── Resources.resx │ ├── Settings.Designer.cs │ └── Settings.settings ├── JCWX.sln ├── LICENSE ├── README.md ├── WebClasses/ │ ├── CnBlogsFeed.cs │ ├── Command.cs │ ├── Handlers/ │ │ ├── CnblogsArticleNewsMessageHandler.cs │ │ ├── CnblogsTextMessageHandler.cs │ │ ├── DefaultMessageHandler.cs │ │ ├── SubScribeEventMessageHandler.cs │ │ ├── TextMessageHandler.cs │ │ ├── UnSubScribeEventMessageHandler.cs │ │ └── VoiceMessageHandler.cs │ ├── MyLog.cs │ ├── Properties/ │ │ └── AssemblyInfo.cs │ ├── Roles/ │ │ ├── EventMessageRole.cs │ │ ├── MsgTypeMessageRole.cs │ │ ├── TextMessageRole.cs │ │ ├── VoiceMessageRole.cs │ │ └── WebMessageRole.cs │ └── WebClasses.csproj ├── WebDemo/ │ ├── OAuthUserInfoDemo.aspx │ ├── OAuthUserInfoDemo.aspx.cs │ ├── OAuthUserInfoDemo.aspx.designer.cs │ ├── Oauth2Demo.aspx │ ├── Oauth2Demo.aspx.cs │ ├── Oauth2Demo.aspx.designer.cs │ ├── Properties/ │ │ └── AssemblyInfo.cs │ ├── QrcodePage.aspx │ ├── QrcodePage.aspx.cs │ ├── QrcodePage.aspx.designer.cs │ ├── WX.aspx │ ├── WX.aspx.cs │ ├── WX.aspx.designer.cs │ ├── Web.Debug.config │ ├── Web.Release.config │ ├── Web.config │ ├── WebDemo.csproj │ └── packages.config ├── _config.yml ├── packages/ │ ├── Moq.4.2.1402.2112/ │ │ ├── Moq.4.2.1402.2112.nupkg │ │ ├── Moq.4.2.1402.2112.nuspec │ │ └── lib/ │ │ ├── net35/ │ │ │ └── Moq.xml │ │ ├── net40/ │ │ │ └── Moq.xml │ │ └── sl4/ │ │ └── Moq.Silverlight.xml │ ├── Newtonsoft.Json.6.0.2/ │ │ ├── Newtonsoft.Json.6.0.2.nupkg │ │ ├── Newtonsoft.Json.6.0.2.nuspec │ │ ├── lib/ │ │ │ ├── net20/ │ │ │ │ └── Newtonsoft.Json.xml │ │ │ ├── net35/ │ │ │ │ └── Newtonsoft.Json.xml │ │ │ ├── net40/ │ │ │ │ └── Newtonsoft.Json.xml │ │ │ ├── net45/ │ │ │ │ └── Newtonsoft.Json.xml │ │ │ ├── netcore45/ │ │ │ │ └── Newtonsoft.Json.xml │ │ │ ├── portable-net40+sl5+wp80+win8+monotouch+monoandroid/ │ │ │ │ └── Newtonsoft.Json.xml │ │ │ └── portable-net45+wp80+win8+wpa81/ │ │ │ └── Newtonsoft.Json.xml │ │ └── tools/ │ │ └── install.ps1 │ ├── QrCode.Net.0.4.0.0/ │ │ ├── QrCode.Net.0.4.0.0.nupkg │ │ └── lib/ │ │ ├── net35/ │ │ │ └── Gma.QrCodeNet.Encoding.xml │ │ ├── net40/ │ │ │ └── Gma.QrCodeNet.Encoding.XML │ │ ├── net45/ │ │ │ └── Gma.QrCodeNet.Encoding.xml │ │ ├── netcore45/ │ │ │ ├── Gma.QrCodeNet.Encoding.pri │ │ │ ├── Gma.QrCodeNet.Encoding.xml │ │ │ └── Themes/ │ │ │ └── Generic.xaml │ │ └── sl5/ │ │ └── Gma.QrCodeNet.Encoding.xml │ ├── repositories.config │ └── xunit.1.9.2/ │ ├── lib/ │ │ └── net20/ │ │ ├── xunit.dll.tdnet │ │ └── xunit.xml │ ├── xunit.1.9.2.nupkg │ └── xunit.1.9.2.nuspec └── test/ └── FrameworkCoreTest/ ├── AccessTokenTest.cs ├── Api/ │ ├── CustomeServiceGetRecordTest.cs │ ├── CustomserviceKfsessionCloseTest.cs │ ├── CustomserviceKfsessionCreateTest.cs │ ├── CustomserviceKfsessionGetsessionTest.cs │ ├── DAtacubeGetarticletotalTest.cs │ ├── DatacubeGetInterfaceTest.cs │ ├── DatacubeGetUpStreamMsgTest.cs │ ├── DatacubeGetUserCumulateTest.cs │ ├── DatacubeGetUserSummaryTest.cs │ ├── DatacubeGetarticlesummaryTest.cs │ ├── GetCurrentAutoreplyInfoTest.cs │ ├── GetCurrentSelfmenuInfoTest.cs │ ├── GroupCreateTest.cs │ ├── GroupsGetIdTest.cs │ ├── GroupsMembersUpdateTest.cs │ ├── GroupsQueryTest.cs │ ├── GroupsUpdateTest.cs │ ├── MediaGetTest.cs │ ├── MediaUploadNewsTest.cs │ ├── MediaUploadTest.cs │ ├── MenuCreateTest.cs │ ├── MenuGetTest.cs │ ├── MessageCustomSendRequestTest.cs │ ├── MockGetcallbackipTestTest.cs │ ├── MockPostApiBaseTest.cs │ ├── OAuthAccessTokenTest.cs │ ├── OAuthManagerTest.cs │ ├── OAuthRefreshTokenTest.cs │ ├── QrCreatedRequestTestTest.cs │ ├── RequestMessageTest.cs │ ├── ResponseMessageTest.cs │ ├── SNSUserInfoTest.cs │ ├── ShorturlRequestTestTest.cs │ ├── UserGetTest.cs │ └── UserInfoTest.cs ├── App.config ├── BaseTest.cs ├── CustomserviceKfsessionGetsessionlistTest.cs ├── CustomserviceKfsessionGetwaitcaseTest.cs ├── FrameworkCoreTest.csproj ├── Logger.cs ├── Merchant/ │ ├── CreateTest.cs │ ├── MerchantCategoryGetskuTest.cs │ ├── MerchantCategoryGetsubTest.cs │ ├── MerchantCommonUploadimgTest.cs │ ├── MerchantDelTest.cs │ ├── MerchantExpressAddTest.cs │ ├── MerchantExpressDelTest.cs │ ├── MerchantExpressGetallTest.cs │ ├── MerchantExpressGetbyidTest.cs │ ├── MerchantExpressUpdateTest.cs │ ├── MerchantGetTest.cs │ ├── MerchantGetbystatus.cs │ ├── MerchantGetpropertyTest.cs │ ├── MerchantGroupAddTest.cs │ ├── MerchantGroupDelTest.cs │ ├── MerchantGroupGetallTest.cs │ ├── MerchantGroupGetbyidTest.cs │ ├── MerchantGroupProductmodTest.cs │ ├── MerchantGroupPropertymodTest.cs │ ├── MerchantModproductstatusTest.cs │ ├── MerchantOrderCloseTest.cs │ ├── MerchantOrderGetbyfilterTest.cs │ ├── MerchantOrderGetbyidTest.cs │ ├── MerchantOrderSetdeliveryTest.cs │ ├── MerchantShelfAddTest.cs │ ├── MerchantShelfDelTest.cs │ ├── MerchantShelfGetallTest.cs │ ├── MerchantShelfGetbyidTest.cs │ ├── MerchantShelfUpdatestatusTest.cs │ ├── MerchantStockAddTest.cs │ ├── MerchantStockReductTest.cs │ └── MerchantUpdateTest.cs ├── Pay/ │ ├── PayOrderQueryTest.cs │ ├── PayRefundTest.cs │ ├── PayTest.cs │ ├── PayUnifiedorderTest.cs │ └── ReallyPayUnifiedorderRequestTest.cs ├── Properties/ │ └── AssemblyInfo.cs ├── Template/ │ ├── TemplateSendTest.cs │ └── TemplateSetindustrayTest.cs └── packages.config ================================================ FILE CONTENTS ================================================ ================================================ FILE: .gitattributes ================================================ # Auto detect text files and perform LF normalization * text=auto # Custom for Visual Studio *.cs diff=csharp *.sln merge=union *.csproj merge=union *.vbproj merge=union *.fsproj merge=union *.dbproj merge=union # Standard to msysgit *.doc diff=astextplain *.DOC diff=astextplain *.docx diff=astextplain *.DOCX diff=astextplain *.dot diff=astextplain *.DOT diff=astextplain *.pdf diff=astextplain *.PDF diff=astextplain *.rtf diff=astextplain *.RTF diff=astextplain ================================================ FILE: .gitignore ================================================ ################# ## Eclipse ################# *.pydevproject .project .metadata bin/ tmp/ *.tmp *.bak *.swp *~.nib local.properties .classpath .settings/ .loadpath # External tool builders .externalToolBuilders/ # Locally stored "Eclipse launch configurations" *.launch # CDT-specific .cproject # PDT-specific .buildpath ################# ## Visual Studio ################# ## Ignore Visual Studio temporary files, build results, and ## files generated by popular Visual Studio add-ons. # User-specific files *.suo *.user *.sln.docstates # Build results [Dd]ebug/ [Rr]elease/ x64/ build/ [Bb]in/ [Oo]bj/ # MSTest test Results [Tt]est[Rr]esult*/ [Bb]uild[Ll]og.* *_i.c *_p.c *.ilk *.meta *.obj *.pch *.pdb *.pgc *.pgd *.rsp *.sbr *.tlb *.tli *.tlh *.tmp *.tmp_proj *.log *.vspscc *.vssscc .builds *.pidb *.log *.scc # Visual C++ cache files ipch/ *.aps *.ncb *.opensdf *.sdf *.cachefile # Visual Studio profiler *.psess *.vsp *.vspx # Guidance Automation Toolkit *.gpState # ReSharper is a .NET coding add-in _ReSharper*/ *.[Rr]e[Ss]harper # TeamCity is a build add-in _TeamCity* # DotCover is a Code Coverage Tool *.dotCover # NCrunch *.ncrunch* .*crunch*.local.xml # Installshield output folder [Ee]xpress/ # DocProject is a documentation generator add-in DocProject/buildhelp/ DocProject/Help/*.HxT DocProject/Help/*.HxC DocProject/Help/*.hhc DocProject/Help/*.hhk DocProject/Help/*.hhp DocProject/Help/Html2 DocProject/Help/html # Click-Once directory publish/ # Publish Web Output *.Publish.xml *.pubxml # NuGet Packages Directory ## TODO: If you have NuGet Package Restore enabled, uncomment the next line #packages/ # Windows Azure Build Output csx *.build.csdef # Windows Store app package directory AppPackages/ # Others sql/ *.Cache ClientBin/ [Ss]tyle[Cc]op.* ~$* *~ *.dbmdl *.[Pp]ublish.xml *.pfx *.publishsettings # RIA/Silverlight projects Generated_Code/ # Backup & report files from converting an old project file to a newer # Visual Studio version. Backup files are not needed, because we have git ;-) _UpgradeReport_Files/ Backup*/ UpgradeLog*.XML UpgradeLog*.htm # SQL Server files App_Data/*.mdf App_Data/*.ldf ############# ## Windows detritus ############# # Windows image file caches Thumbs.db ehthumbs.db # Folder config file Desktop.ini # Recycle Bin used on file shares $RECYCLE.BIN/ # Mac crap .DS_Store ############# ## Python ############# *.py[co] # Packages *.egg *.egg-info dist/ build/ eggs/ parts/ var/ sdist/ develop-eggs/ .installed.cfg # Installer logs pip-log.txt # Unit test / coverage reports .coverage .tox #Translations *.mo #Mr Developer .mr.developer.cfg /.vs /Business/JCSoft.WX.Framework.4.1.0.nupkg /Business/WXFramework.nuspec ================================================ FILE: Business/Api/DefaultApiClient.cs ================================================ using Newtonsoft.Json; using System; using System.Collections.Generic; using System.IO; using System.Linq; using System.Net; using System.Text; using WX.Common; using WX.Logger; using WX.Model.ApiRequests; using WX.Model.ApiResponses; namespace WX.Api { public class DefaultApiClient : IApiClient { public ILogger Logger { get; set; } public T Execute(ApiRequest request) where T : ApiResponse, new() { request.Validate(); var execResult = DoExecute(request); T result = null; try { result = JsonConvert.DeserializeObject(execResult); } catch(Exception ex) { Log(ex.ToString()); result = null; } if (result == null ) { if (request.NotHasResponse) { return new T(); } else { throw new WebException(); } } return result; } public virtual string DoExecute(ApiRequest request) where T : ApiResponse { var url = request.GetUrl(); //Log(url); var result = String.Empty; switch (request.Method) { case "FILE": result = HttpHelper.HttpUploadFile(url, request.GetPostContent()); break; case "POST": result = HttpHelper.HttpPost(url, request.GetPostContent()); break; case "GET": default: result = HttpHelper.HttpGet(url); break; } return result; } public void Log(string content) { if (Logger != null) { Logger.Log(content); } } } } ================================================ FILE: Business/Api/IApiClient.cs ================================================ using System; using System.Collections.Generic; using System.Linq; using System.Text; using WX.Model.ApiRequests; using WX.Model.ApiResponses; namespace WX.Api { public interface IApiClient { T Execute(ApiRequest request) where T : ApiResponse, new(); } } ================================================ FILE: Business/ApiAccessTokenManager.cs ================================================ using System; using System.Collections.Generic; using System.Linq; using System.Text; using WX.Api; using WX.Model; using System.Configuration; using WX.Model.Exceptions; using WX.Model.ApiRequests; namespace WX.Framework { public sealed class ApiAccessTokenManager { private ApiAccessTokenManager() { if (ConfigurationManager.AppSettings.AllKeys.Contains(s_configAppId) && ConfigurationManager.AppSettings.AllKeys.Contains(s_configAppSecret)) { m_appIdentity = new AppIdentication( ConfigurationManager.AppSettings[s_configAppId], ConfigurationManager.AppSettings[s_configAppSecret]); } } private static ApiAccessTokenManager m_instance; private static object m_lock = new object(); private static string s_configAppId = "wxappid"; private static string s_configAppSecret = "wxappsecret"; public static ApiAccessTokenManager Instance { get { if (m_instance == null) { lock (m_lock) { if (m_instance == null) { m_instance = new ApiAccessTokenManager(); } } } return m_instance; } } public string GetCurrentToken() { if (String.IsNullOrEmpty(Token) || DateTime.Now >= ExpireTime) { RefeshToken(); } return Token; } private void RefeshToken() { if (m_appIdentity == null) { throw new WXApiException(-100, "请先设置好AppID与AppSecret"); } //Console.WriteLine("refesh token"); var now = DateTime.Now; var request = new AccessTokenRequest(m_appIdentity); var response = Client.Execute(request); if (response.IsError) { throw new WXApiException(response.ErrorCode, response.ErrorMessage); } ExpireTime = now.AddSeconds(response.Expires_In); Token = response.Access_Token; } private IApiClient m_client; public IApiClient Client { get { if (m_client == null) { m_client = new DefaultApiClient(); } return m_client; } } private AppIdentication m_appIdentity; public string Token { get; private set; } public DateTime ExpireTime { get; private set; } public void SetAppIdentity(string appId, string appSecret) { SetAppIdentity(new AppIdentication(appId, appSecret)); } public void SetAppIdentity(AppIdentication appIdentity) { m_appIdentity = appIdentity; } } } ================================================ FILE: Business/Common/DataSecret.cs ================================================ using System; using System.Collections.Generic; using System.Linq; using System.Security.Cryptography; using System.Text; namespace WX.Common { public static class DataSecret { public static string Md5(this string data) { var result = ""; MD5 md5 = System.Security.Cryptography.MD5.Create(); byte[] s = md5.ComputeHash(Encoding.UTF8.GetBytes(data)); for (int i = 0; i < s.Length; i++) { // 将得到的字符串使用十六进制类型格式。格式后的字符是小写的字母,如果使用大写(X)则格式后的字符是大写字符 result = result + s[i].ToString("X2"); } return result; } } } ================================================ FILE: Business/Common/DateTimeExtend.cs ================================================ using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace WX { public static class DateTimeExtend { private const long STANDARD_TIME_STAMP = 621355968000000000; public static long ConvertToTimeStamp(this DateTime time) { return (time.ToUniversalTime().Ticks - STANDARD_TIME_STAMP) / 10000000; } public static DateTime ConvertToDateTime(this long timestamp) { return new DateTime(timestamp * 10000000 + STANDARD_TIME_STAMP).ToLocalTime(); } } } ================================================ FILE: Business/Common/HttpHelper.cs ================================================ using System; using System.Collections.Generic; using System.Collections.Specialized; using System.IO; using System.Linq; using System.Net; using System.Text; namespace WX.Common { public static class HttpHelper { public static string HttpUploadFile(string url, string file) { if (!File.Exists(file)) { throw new FileNotFoundException(); } FileInfo fileInfo = new FileInfo(file); string result = string.Empty; string boundary = "---------------------------" + DateTime.Now.Ticks.ToString("x"); byte[] boundarybytes = System.Text.Encoding.ASCII.GetBytes("\r\n--" + boundary + "\r\n"); var request = (HttpWebRequest)WebRequest.Create(url); request.ContentType = "multipart/form-data; boundary=" + boundary; request.Method = "POST"; request.KeepAlive = true; var stream = request.GetRequestStream(); stream.Write(boundarybytes, 0, boundarybytes.Length); var headerTemplate = "Content-Disposition: form-data; name=\"{0}\"; filename=\"{1}\"\r\nContent-Type: {2}\r\n\r\n"; var header = string.Format(headerTemplate, fileInfo.Name, file, GetContentType(fileInfo)); var headerbytes = System.Text.Encoding.UTF8.GetBytes(header); stream.Write(headerbytes, 0, headerbytes.Length); var fileStream = new FileStream(file, FileMode.Open, FileAccess.Read); var buffer = new byte[4096]; var bytesRead = 0; while ((bytesRead = fileStream.Read(buffer, 0, buffer.Length)) != 0) { stream.Write(buffer, 0, bytesRead); } fileStream.Close(); var trailer = System.Text.Encoding.ASCII.GetBytes("\r\n--" + boundary + "--\r\n"); stream.Write(trailer, 0, trailer.Length); stream.Close(); WebResponse wresp = null; try { wresp = request.GetResponse(); Stream stream2 = wresp.GetResponseStream(); StreamReader reader2 = new StreamReader(stream2); result = reader2.ReadToEnd(); } finally { if (wresp != null) { wresp.Close(); wresp = null; } } return result; } private static string GetContentType(FileInfo fileInfo) { var contentType = ""; switch (fileInfo.Extension.ToLower()) { case ".jpg": contentType = "image/jpeg"; break; case ".mp3": contentType = "audio/mp3"; break; case ".amr": contentType = "audio/amr"; break; case ".mp4": contentType = "video/mp4"; break; default: throw new NotSupportedException("文件格式不支持"); } return contentType; } public static string HttpGet(string url) { HttpWebRequest req = HttpWebRequest.Create(url) as HttpWebRequest; if (req == null) throw new ArgumentException(); req.Method = "GET"; HttpWebResponse res = (HttpWebResponse)req.GetResponse(); if (res.StatusCode != HttpStatusCode.OK) throw new WebException("code" + res.StatusCode); using (var stream = res.GetResponseStream()) using (var reader = new System.IO.StreamReader(stream, Encoding.UTF8)) { var result = reader.ReadToEnd(); reader.Close(); stream.Close(); //res.Close(); return result; } } public static string HttpPost(string url, string content) { HttpWebRequest req = HttpWebRequest.Create(url) as HttpWebRequest; if (req == null) throw new ArgumentException(); var postdate = content; var postBytes = Encoding.UTF8.GetBytes(postdate); req.Method = "POST"; req.ContentType = "application/json; charset=utf-8"; req.ContentLength = postBytes.Length; Stream stream = req.GetRequestStream(); stream.Write(postBytes, 0, postBytes.Length); stream.Close(); HttpWebResponse res = (HttpWebResponse)req.GetResponse(); if (res.StatusCode != HttpStatusCode.OK) throw new WebException("code" + res.StatusCode); using (var rstream = res.GetResponseStream()) using (var reader = new System.IO.StreamReader(rstream, Encoding.UTF8)) { var result = reader.ReadToEnd(); reader.Close(); rstream.Close(); //res.Close(); return result; } } internal static string HttpGetFile(string url) { HttpWebRequest req = HttpWebRequest.Create(url) as HttpWebRequest; if (req == null) throw new ArgumentException(); req.Method = "GET"; HttpWebResponse res = (HttpWebResponse)req.GetResponse(); if (res.StatusCode != HttpStatusCode.OK) throw new WebException("code" + res.StatusCode); using (var stream = res.GetResponseStream()) using (var reader = new System.IO.StreamReader(stream, Encoding.UTF8)) { var result = reader.ReadToEnd(); reader.Close(); stream.Close(); return result; } } public static string HttpPostXml(string url, string content) { HttpWebRequest req = HttpWebRequest.Create(url) as HttpWebRequest; if (req == null) throw new ArgumentException(); var postdate = content; var postBytes = Encoding.UTF8.GetBytes(postdate); req.Method = "POST"; req.ContentType = "text/xml; charset=utf-8"; req.ContentLength = postBytes.Length; Stream stream = req.GetRequestStream(); stream.Write(postBytes, 0, postBytes.Length); stream.Close(); HttpWebResponse res = (HttpWebResponse)req.GetResponse(); if (res.StatusCode != HttpStatusCode.OK) throw new WebException("code" + res.StatusCode); using (var rstream = res.GetResponseStream()) using (var reader = new System.IO.StreamReader(rstream, Encoding.UTF8)) { var result = reader.ReadToEnd(); reader.Close(); rstream.Close(); //res.Close(); return result; } } } } ================================================ FILE: Business/Common/ShelfModuleConverter.cs ================================================ using Newtonsoft.Json; using System; using System.Collections.Generic; using System.Linq; using System.Text; using WX.Model; namespace WX.Common { public class ShelfModuleConverter : JsonConverter { public override bool CanConvert(Type objectType) { return objectType.IsAssignableFrom(typeof(ShelfModule)); } public override object ReadJson(JsonReader reader, Type objectType, object existingValue, JsonSerializer serializer) { if (reader.TokenType == JsonToken.Null) return null; ShelfModuleFactory value = new ShelfModuleFactory(); if (value == null) throw new JsonSerializationException("No object created."); serializer.Populate(reader, value); return value.BuildModule(); } public override void WriteJson(JsonWriter writer, object value, JsonSerializer serializer) { throw new NotSupportedException("CustomCreationConverter should only be used while deserializing."); } public override bool CanWrite { get { return false; } } } } ================================================ FILE: Business/CustomAccount.cs ================================================ using Newtonsoft.Json; using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace WX { public class CustomAccount { [JsonProperty("kf_account", NullValueHandling = NullValueHandling.Ignore)] /// /// 完整客服账号,格式为:账号前缀@公众号微信号 /// public string Account { get; set; } [JsonProperty("kf_nick", NullValueHandling = NullValueHandling.Ignore)] /// /// 客服昵称 /// public string Nick { get; set; } [JsonProperty("kf_id", NullValueHandling = NullValueHandling.Ignore)] /// /// 客服工号 /// public string ID { get; set; } [JsonProperty("kf_headimg", NullValueHandling = NullValueHandling.Ignore)] /// /// 头像 /// public string HeadImg { get; set; } [JsonProperty("status", NullValueHandling = NullValueHandling.Ignore)] /// /// 客服在线状态 1:pc在线,2:手机在线。若pc和手机同时在线则为 1+2=3 /// public int Status { get; set; } [JsonProperty("auto_accept", NullValueHandling = NullValueHandling.Ignore)] /// /// 客服设置的最大自动接入数 /// public int AutoAccept { get; set; } [JsonProperty("accepted_case", NullValueHandling = NullValueHandling.Ignore)] /// /// 客服当前正在接待的会话数 /// public int AcceptedCase { get; set; } [JsonProperty("nickname", NullValueHandling = NullValueHandling.Ignore)] /// /// 客服昵称,最长6个汉字或12个英文字符 /// public string NickName { get; set; } [JsonProperty("password", NullValueHandling = NullValueHandling.Ignore)] /// /// 客服账号登录密码,格式为密码明文的32位加密MD5值 /// public string Password { get; set; } } } ================================================ FILE: Business/IMessageHandler.cs ================================================ using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Xml.Linq; using WX.Model; namespace WX.Framework { public interface IMessageHandler { ResponseMessage HandlerRequestMessage(MiddleMessage message); } } ================================================ FILE: Business/IMessageRole.cs ================================================ using System; using System.Collections.Generic; using System.IO; using System.Linq; using System.Text; using System.Xml.Linq; using WX.Model; namespace WX.Framework { public interface IMessageRole { IMessageHandler MessageRole(MiddleMessage message); } } ================================================ FILE: Business/Logger/ILogger.cs ================================================ using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace WX.Logger { public interface ILogger { void Log(string content); void Warn(string content); void Error(string content); void Exception(string content); } } ================================================ FILE: Business/Model/ApiRequests/AccessTokenCodeRequest.cs ================================================ using System; using System.Collections.Generic; using System.Linq; using System.Text; using WX.Model.ApiResponses; namespace WX.Model.ApiRequests { public class AccessTokenCodeRequest : ApiRequest { public string Code { get; set; } public string AppId { get; set; } public string AppSecret { get; set; } protected override string UrlFormat => "https://api.weixin.qq.com/sns/oauth2/access_token?appid={0}&secret={1}&code={2}&grant_type=authorization_code"; protected override bool NeedToken => false; internal override string Method => GETMETHOD; public override string GetPostContent() { throw new NotImplementedException(); } internal override string GetUrl() { return String.Format(UrlFormat, AppId, AppSecret, Code); } } } ================================================ FILE: Business/Model/ApiRequests/AccessTokenRequest.cs ================================================ using System; using System.Collections.Generic; using System.Linq; using System.Text; using WX.Model.ApiResponses; namespace WX.Model.ApiRequests { public class AccessTokenRequest : ApiRequest { public AccessTokenRequest(AppIdentication id) { AppIdentity = id; } public AppIdentication AppIdentity { get; set; } internal override string Method { get { return "GET"; } } protected override string UrlFormat { get { return "https://api.weixin.qq.com/cgi-bin/token?grant_type=client_credential&appid={0}&secret={1}"; } } internal override string GetUrl() { return String.Format(UrlFormat, AppIdentity.AppID, AppIdentity.AppSecret); } protected override bool NeedToken { get { return false; } } internal override void Validate() { if (AppIdentity == null) { throw new ArgumentNullException("AppIdentity"); } } public override string GetPostContent() { throw new NotImplementedException(); } } } ================================================ FILE: Business/Model/ApiRequests/ApiGetNeedTokenRequest.cs ================================================ using System; using System.Collections.Generic; using System.Linq; using System.Text; using WX.Model.ApiResponses; namespace WX.Model.ApiRequests { public abstract class ApiGetNeedTokenRequest : ApiRequest where T : ApiResponse { internal override string Method { get { return GETMETHOD; } } protected abstract override string UrlFormat { get; } internal override string GetUrl() { return String.Format(UrlFormat, AccessToken); } protected override bool NeedToken { get { return true; } } public override string GetPostContent() { return String.Empty; } } } ================================================ FILE: Business/Model/ApiRequests/ApiPostNeedTokenRequest.cs ================================================ using Newtonsoft.Json; using System; using System.Collections.Generic; using System.Linq; using System.Text; using WX.Model.ApiResponses; namespace WX.Model.ApiRequests { public abstract class ApiPostNeedTokenRequest : ApiRequest where T : ApiResponse { internal override string Method { get { return POSTMETHOD; } } protected abstract override string UrlFormat { get; } internal override string GetUrl() { return String.Format(UrlFormat, AccessToken); } protected override bool NeedToken { get { return true; } } public override string GetPostContent() { return JsonConvert.SerializeObject(this); } } } ================================================ FILE: Business/Model/ApiRequests/ApiRequest.cs ================================================ using Newtonsoft.Json; using System; using System.Collections.Generic; using System.Linq; using System.Text; using WX.Logger; using WX.Model.ApiResponses; using WX.Model.Exceptions; namespace WX.Model.ApiRequests { public abstract class ApiRequest where T : ApiResponse { protected const string POSTMETHOD = "POST"; protected const string GETMETHOD = "GET"; protected const string FILEMETHOD = "FILE"; internal abstract string Method { get; } protected abstract string UrlFormat { get; } [JsonIgnore] public ILogger Logger { get; set; } internal abstract string GetUrl(); protected abstract bool NeedToken { get; } internal virtual bool NotHasResponse { get { return false; } } internal virtual void Validate() { Log(GetUrl()); if (NeedToken && String.IsNullOrEmpty(AccessToken)) { Log(new WXApiException(-99, "AccessToken 为空或已过期")); } } public void Log(Exception ex) { if (Logger == null) { throw ex; } else { Logger.Log(ex.ToString()); } } public void Log(string content) { if (Logger != null) { Logger.Log(content); } } [JsonIgnore] public string AccessToken { get; set; } public abstract string GetPostContent(); } } ================================================ FILE: Business/Model/ApiRequests/CustomServiceGetRecordRequest.cs ================================================ using Newtonsoft.Json; using System; using System.Collections.Generic; using System.Linq; using System.Text; using WX.Model.ApiResponses; namespace WX.Model.ApiRequests { public class CustomServiceGetRecordRequest : ApiRequest { [JsonProperty("starttime")] internal long StartTimeStamp { get { return StartTime.ConvertToTimeStamp(); } } [JsonIgnore] public DateTime StartTime { get; set; } [JsonProperty("endtime")] internal long EndTimeStamp { get { return EndTime.ConvertToTimeStamp(); } } [JsonIgnore] public DateTime EndTime { get; set; } [JsonProperty("openid")] public string OpenId { get; set; } [JsonProperty("pagesize")] public int PageSize { get; set; } [JsonProperty("pageindex")] public int PageIndex { get; set; } internal override string Method { get { return "POST"; } } protected override string UrlFormat { get { return "https://api.weixin.qq.com/cgi-bin/customservice/getrecord?access_token={0}"; } } internal override string GetUrl() { return String.Format(UrlFormat, AccessToken); } protected override bool NeedToken { get { return true; } } public override string GetPostContent() { return JsonConvert.SerializeObject(this); } internal override void Validate() { base.Validate(); if (PageSize <= 0 || PageSize > 1000) { throw new ArgumentOutOfRangeException("pagesize", "pagesize must in 1 to 1000"); } if (PageIndex <= 0) { PageIndex = 1; } } } } ================================================ FILE: Business/Model/ApiRequests/CustomserviceGetkflistRequest.cs ================================================ using Newtonsoft.Json; using System; using System.Collections.Generic; using System.Linq; using System.Text; using WX.Model.ApiResponses; namespace WX.Model.ApiRequests { public class CustomserviceGetkflistRequest : ApiRequest { internal override string Method { get { return GETMETHOD; } } protected override string UrlFormat { get { return "https://api.weixin.qq.com/cgi-bin/customservice/getkflist?access_token={0}"; } } internal override string GetUrl() { return String.Format(UrlFormat, AccessToken); } protected override bool NeedToken { get { return true; } } public override string GetPostContent() { return JsonConvert.SerializeObject(this); } } } ================================================ FILE: Business/Model/ApiRequests/CustomserviceGetonlinekflistRequest.cs ================================================ using System; using System.Collections.Generic; using System.Linq; using System.Text; using WX.Model.ApiResponses; namespace WX.Model.ApiRequests { public class CustomserviceGetonlinekflistRequest : ApiRequest { internal override string Method { get { return GETMETHOD; } } protected override string UrlFormat { get { return "https://api.weixin.qq.com/cgi-bin/customservice/getonlinekflist?access_token={0}"; } } internal override string GetUrl() { return String.Format(UrlFormat, AccessToken); } protected override bool NeedToken { get { return true; } } public override string GetPostContent() { throw new NotImplementedException(); } } } ================================================ FILE: Business/Model/ApiRequests/CustomserviceKfaccountAddRequest.cs ================================================ using Newtonsoft.Json; using System; using System.Collections.Generic; using System.Linq; using System.Text; using WX.Model.ApiResponses; namespace WX.Model.ApiRequests { public class CustomserviceKfaccountAddRequest : ApiRequest { /// /// 完整客服账号,格式为:账号前缀@公众号微信号,账号前缀最多10个字符,必须是英文或者数字字符。如果没有公众号微信号,请前往微信公众平台设置。 /// [JsonProperty("kf_account")] public string Account { get; set; } /// /// 客服昵称,最长6个汉字或12个英文字符 /// [JsonProperty("nickname")] public string Nickname { get; set; } /// /// 客服账号登录密码,格式为密码明文的32位加密MD5值 /// [JsonProperty("password")] public string Password { get; set; } internal override string Method { get { return POSTMETHOD; } } protected override string UrlFormat { get { return "https://api.weixin.qq.com/customservice/kfaccount/add?access_token={0}"; } } internal override string GetUrl() { return String.Format(UrlFormat, AccessToken); } protected override bool NeedToken { get { throw new NotImplementedException(); } } public override string GetPostContent() { return JsonConvert.SerializeObject(this); } } } ================================================ FILE: Business/Model/ApiRequests/CustomserviceKfaccountUpdateRequest.cs ================================================ using Newtonsoft.Json; using System; using System.Collections.Generic; using System.Linq; using System.Text; using WX.Model.ApiResponses; namespace WX.Model.ApiRequests { public class CustomserviceKfaccountUpdateRequest : ApiRequest { /// /// 完整客服账号,格式为:账号前缀@公众号微信号,账号前缀最多10个字符,必须是英文或者数字字符。如果没有公众号微信号,请前往微信公众平台设置。 /// [JsonProperty("kf_account")] public string Account { get; set; } /// /// 客服昵称,最长6个汉字或12个英文字符 /// [JsonProperty("nickname")] public string Nickname { get; set; } /// /// 客服账号登录密码,格式为密码明文的32位加密MD5值 /// [JsonProperty("password")] public string Password { get; set; } internal override string Method { get { return POSTMETHOD; } } protected override string UrlFormat { get { return "https://api.weixin.qq.com/customservice/kfaccount/update?access_token={0}"; } } internal override string GetUrl() { return String.Format(UrlFormat, AccessToken); } protected override bool NeedToken { get { return true; } } public override string GetPostContent() { return JsonConvert.SerializeObject(this); } } } ================================================ FILE: Business/Model/ApiRequests/CustomserviceKfaccountUploadheadimgRequest.cs ================================================ using Newtonsoft.Json; using System; using System.Collections.Generic; using System.Linq; using System.Text; using WX.Model.ApiResponses; namespace WX.Model.ApiRequests { public class CustomserviceKfaccountUploadheadimgRequest : ApiRequest { /// /// 文件路径 /// public string FilePath { get; set; } /// /// 完整客服账号,格式为:账号前缀@公众号微信号 /// [JsonProperty("kf_account")] public string Account { get; set; } internal override string Method { get { return FILEMETHOD; } } protected override string UrlFormat { get { return "https://api.weixin.qq.com/customservice/kfacount/uploadheadimg?access_token={0}&kf_account={1}"; } } internal override string GetUrl() { return String.Format(UrlFormat, AccessToken, Account); } protected override bool NeedToken { get { return true; } } public override string GetPostContent() { return this.FilePath; } } } ================================================ FILE: Business/Model/ApiRequests/CustomserviceKfsessionCloseRequest.cs ================================================ using Newtonsoft.Json; using System; using System.Collections.Generic; using System.Linq; using System.Text; using WX.Model.ApiResponses; namespace WX.Model.ApiRequests { public class CustomserviceKfsessionCloseRequest : ApiRequest { [JsonProperty("openid")] public string OpenId { get; set; } [JsonProperty("kf_account")] public string KfAccount { get; set; } [JsonProperty("text")] public string Text { get; set; } internal override string Method { get { return POSTMETHOD; } } protected override string UrlFormat { get { return "https://api.weixin.qq.com/customservice/kfsession/close?access_token={0}"; } } internal override string GetUrl() { return String.Format(UrlFormat, AccessToken); } protected override bool NeedToken { get { return true; } } public override string GetPostContent() { return JsonConvert.SerializeObject(this); } } } ================================================ FILE: Business/Model/ApiRequests/CustomserviceKfsessionCreateRequest.cs ================================================ using Newtonsoft.Json; using System; using System.Collections.Generic; using System.Linq; using System.Text; using WX.Model.ApiResponses; namespace WX.Model.ApiRequests { public class CustomserviceKfsessionCreateRequest : ApiRequest { [JsonProperty("openid")] public string OpenId { get; set; } [JsonProperty("kf_account")] public string KfAccount { get; set; } [JsonProperty("text")] public string Text { get; set; } internal override string Method { get { return POSTMETHOD; } } protected override string UrlFormat { get { return "https://api.weixin.qq.com/customservice/kfsession/create?access_token={0}"; } } internal override string GetUrl() { return String.Format(UrlFormat, AccessToken); } protected override bool NeedToken { get { return true; } } public override string GetPostContent() { return JsonConvert.SerializeObject(this); } } } ================================================ FILE: Business/Model/ApiRequests/CustomserviceKfsessionGetsessionRequest.cs ================================================ using Newtonsoft.Json; using System; using System.Collections.Generic; using System.Linq; using System.Text; using WX.Model.ApiResponses; namespace WX.Model.ApiRequests { public class CustomserviceKfsessionGetsessionRequest : ApiGetNeedTokenRequest { [JsonProperty("openid")] public string OpenId { get; set; } protected override string UrlFormat { get { return "https://api.weixin.qq.com/customservice/kfsession/getsession?access_token={0}&openid={1}"; } } internal override string GetUrl() { return String.Format(UrlFormat, AccessToken, OpenId); } } } ================================================ FILE: Business/Model/ApiRequests/CustomserviceKfsessionGetsessionlistRequest.cs ================================================ using System; using System.Collections.Generic; using System.Linq; using System.Text; using WX.Model.ApiResponses; namespace WX.Model.ApiRequests { public class CustomserviceKfsessionGetsessionlistRequest : ApiGetNeedTokenRequest { public string KfAccount { get; set; } protected override string UrlFormat { get { return "https://api.weixin.qq.com/customservice/kfsession/getsessionlist?access_token={0}&kf_account={1}"; } } internal override string GetUrl() { return String.Format(UrlFormat, AccessToken, KfAccount); } } } ================================================ FILE: Business/Model/ApiRequests/CustomserviceKfsessionGetwaitcaseRequest.cs ================================================ using System; using System.Collections.Generic; using System.Linq; using System.Text; using WX.Model.ApiResponses; namespace WX.Model.ApiRequests { public class CustomserviceKfsessionGetwaitcaseRequest : ApiGetNeedTokenRequest { protected override string UrlFormat { get { return "https://api.weixin.qq.com/customservice/kfsession/getwaitcase?access_token={0}"; } } } } ================================================ FILE: Business/Model/ApiRequests/CustomservicesKfaccountDelRequest.cs ================================================ using Newtonsoft.Json; using System; using System.Collections.Generic; using System.Linq; using System.Text; using WX.Model.ApiResponses; namespace WX.Model.ApiRequests { public class CustomservicesKfaccountDelRequest : ApiRequest { /// /// 完整客服账号,格式为:账号前缀@公众号微信号 /// [JsonProperty("kf_account")] public string Account { get; set; } internal override string Method { get { return GETMETHOD; } } protected override string UrlFormat { get { return "https://api.weixin.qq.com/customservice/kfaccount/del?access_token=ACCESS_TOKEN&kf_account=KFACCOUNT"; } } internal override string GetUrl() { return String.Format(UrlFormat, AccessToken, Account); } protected override bool NeedToken { get { return true; } } public override string GetPostContent() { return JsonConvert.SerializeObject(this); } } } ================================================ FILE: Business/Model/ApiRequests/DatacubeGetInterfaceRequest.cs ================================================ using Newtonsoft.Json; using System; using System.Collections.Generic; using System.Linq; using System.Text; using WX.Model.ApiResponses; namespace WX.Model.ApiRequests { public abstract class DatacubeGetInterfaceRequest : ApiRequest { [JsonProperty("begin_date")] public string BeginDate { get; set; } [JsonProperty("end_date")] public string EndDate { get; set; } internal override string Method { get { return POSTMETHOD; } } protected abstract override string UrlFormat { get; } internal override string GetUrl() { return String.Format(UrlFormat, AccessToken); } protected override bool NeedToken { get { return true; } } public override string GetPostContent() { return JsonConvert.SerializeObject(this); } } } ================================================ FILE: Business/Model/ApiRequests/DatacubeGetInterfaceSummaryHourRequest.cs ================================================ using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace WX.Model.ApiRequests { /// /// 获取接口分析分时数据(getinterfacesummaryhour) /// public class DatacubeGetInterfaceSummaryHourRequest : DatacubeGetInterfaceRequest { protected override string UrlFormat { get { return "https://api.weixin.qq.com/datacube/getinterfacesummaryhour?access_token={0}"; } } } } ================================================ FILE: Business/Model/ApiRequests/DatacubeGetInterfaceSummaryRequest.cs ================================================ using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace WX.Model.ApiRequests { /// /// 获取接口分析数据(getinterfacesummary) /// public class DatacubeGetInterfaceSummaryRequest : DatacubeGetInterfaceRequest { protected override string UrlFormat { get { return "https://api.weixin.qq.com/datacube/getinterfacesummary?access_token={0}"; } } } } ================================================ FILE: Business/Model/ApiRequests/DatacubeGetStreamMsgRequest.cs ================================================ using Newtonsoft.Json; using System; using System.Collections.Generic; using System.Linq; using System.Text; using WX.Model.ApiResponses; namespace WX.Model.ApiRequests { public abstract class DatacubeGetStreamMsgRequest : ApiRequest { [JsonProperty("begin_date")] public string BeginDate { get; set; } [JsonProperty("end_date")] public string EndDate { get; set; } internal override string Method { get { return POSTMETHOD; } } protected abstract override string UrlFormat { get; } internal override string GetUrl() { return String.Format(UrlFormat, AccessToken); } protected override bool NeedToken { get { return true; } } public override string GetPostContent() { return JsonConvert.SerializeObject(this); } } } ================================================ FILE: Business/Model/ApiRequests/DatacubeGetUpStreamMsgDistMonth.cs ================================================ using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace WX.Model.ApiRequests { /// /// 获取消息发送分布月数据(getupstreammsgdistmonth) /// public class DatacubeGetUpStreamMsgDistMonth : DatacubeGetStreamMsgRequest { protected override string UrlFormat { get { return "https://api.weixin.qq.com/datacube/getupstreammsgdistmonth?access_token={0}"; } } } } ================================================ FILE: Business/Model/ApiRequests/DatacubeGetUpStreamMsgDistRequest.cs ================================================ using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace WX.Model.ApiRequests { /// /// 获取消息发送分布数据(getupstreammsgdist) /// public class DatacubeGetUpStreamMsgDistRequest : DatacubeGetStreamMsgRequest { protected override string UrlFormat { get { return "https://api.weixin.qq.com/datacube/getupstreammsgdist?access_token={0}"; } } } } ================================================ FILE: Business/Model/ApiRequests/DatacubeGetUpStreamMsgDistWeek.cs ================================================ using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace WX.Model.ApiRequests { /// /// 获取消息发送分布周数据(getupstreammsgdistweek) /// public class DatacubeGetUpStreamMsgDistWeek : DatacubeGetStreamMsgRequest { protected override string UrlFormat { get { return "https://api.weixin.qq.com/datacube/getupstreammsgdist?access_token={0}"; } } } } ================================================ FILE: Business/Model/ApiRequests/DatacubeGetUpStreamMsgHourRequest.cs ================================================ using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace WX.Model.ApiRequests { /// /// 获取消息分送分时数据(getupstreammsghour) /// public class DatacubeGetUpStreamMsgHourRequest : DatacubeGetStreamMsgRequest { protected override string UrlFormat { get { return "https://api.weixin.qq.com/datacube/getupstreammsghour?access_token={0}"; } } } } ================================================ FILE: Business/Model/ApiRequests/DatacubeGetUpStreamMsgMonthRequest.cs ================================================ using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace WX.Model.ApiRequests { /// /// 获取消息发送月数据(getupstreammsgmonth) /// public class DatacubeGetUpStreamMsgMonthRequest : DatacubeGetStreamMsgRequest { protected override string UrlFormat { get { return "https://api.weixin.qq.com/datacube/getupstreammsgmonth?access_token={0}"; } } } } ================================================ FILE: Business/Model/ApiRequests/DatacubeGetUpStreamMsgRequest.cs ================================================ using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace WX.Model.ApiRequests { /// /// 获取消息发送概况数据(getupstreammsg) /// public class DatacubeGetUpStreamMsgRequest : DatacubeGetStreamMsgRequest { protected override string UrlFormat { get { return "https://api.weixin.qq.com/datacube/getupstreammsg?access_token={0}"; } } } } ================================================ FILE: Business/Model/ApiRequests/DatacubeGetUpStreamMsgWeekRequest.cs ================================================ using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace WX.Model.ApiRequests { /// /// 获取消息发送周数据(getupstreammsgweek) /// public class DatacubeGetUpStreamMsgWeekRequest : DatacubeGetStreamMsgRequest { protected override string UrlFormat { get { return "https://api.weixin.qq.com/datacube/getupstreammsgweek?access_token={0}"; } } } } ================================================ FILE: Business/Model/ApiRequests/DatacubeGetUserCumulateRequest.cs ================================================ using Newtonsoft.Json; using System; using System.Collections.Generic; using System.Linq; using System.Text; using WX.Model.ApiResponses; namespace WX.Model.ApiRequests { public class DatacubeGetUserCumulateRequest : ApiRequest { /// /// 开始时间,字符串,格式:yyyy-MM-dd /// [JsonProperty("begin_date")] public string BeginDate { get; set; } /// /// 结束时间,字符串,格式:yyyy-MM-dd /// [JsonProperty("end_date")] public string EndDate { get; set; } internal override string Method { get { return POSTMETHOD; } } protected override string UrlFormat { get { return "https://api.weixin.qq.com/datacube/getusercumulate?access_token={0}"; } } internal override string GetUrl() { return String.Format(UrlFormat, AccessToken); } protected override bool NeedToken { get { return true; } } public override string GetPostContent() { return JsonConvert.SerializeObject(this); } } } ================================================ FILE: Business/Model/ApiRequests/DatacubeGetUserSummaryRequest.cs ================================================ using Newtonsoft.Json; using System; using System.Collections.Generic; using System.Linq; using System.Text; using WX.Model.ApiResponses; namespace WX.Model.ApiRequests { public class DatacubeGetUserSummaryRequest : ApiRequest { /// /// 开始时间,字符串,格式:yyyy-MM-dd /// [JsonProperty("begin_date")] public string BeginDate { get; set; } /// /// 结束时间,字符串,格式:yyyy-MM-dd /// [JsonProperty("end_date")] public string EndDate { get; set; } internal override string Method { get { return POSTMETHOD; } } protected override string UrlFormat { get { return "https://api.weixin.qq.com/datacube/getusersummary?access_token={0}"; } } internal override string GetUrl() { return String.Format(UrlFormat, AccessToken); } protected override bool NeedToken { get { return true; } } public override string GetPostContent() { return JsonConvert.SerializeObject(this); } } } ================================================ FILE: Business/Model/ApiRequests/DatacubeGetarticlesummaryRequest.cs ================================================ using Newtonsoft.Json; using System; using System.Collections.Generic; using System.Globalization; using System.Linq; using System.Text; using WX.Model.ApiResponses; using WX.Model.Exceptions; namespace WX.Model.ApiRequests { /// /// 获取图文群发每日数据(getarticlesummary) /// public class DatacubeGetarticlesummaryRequest : ApiRequest { /// /// 获取数据的起始日期,begin_date和end_date的差值需小于“最大时间跨度”(比如最大时间跨度为1时,begin_date和end_date的差值只能为0,才能小于1),否则会报错 /// [JsonProperty("begin_date")] public string BeginDate { get; set; } /// /// 获取数据的结束日期,end_date允许设置的最大值为昨日 /// [JsonProperty("end_date")] public string EndDate { get; set; } internal override string Method { get { return POSTMETHOD; } } protected override string UrlFormat { get { return "https://api.weixin.qq.com/datacube/getarticlesummary?access_token={0}"; } } internal override string GetUrl() { return String.Format(UrlFormat, AccessToken); } protected override bool NeedToken { get { return true; } } public override string GetPostContent() { return JsonConvert.SerializeObject(this); } internal override void Validate() { //Log(this.GetUrl()); base.Validate(); var bdate = DateTime.ParseExact(BeginDate, "yyyy-MM-dd", CultureInfo.CurrentCulture); var edate = DateTime.ParseExact(EndDate, "yyyy-MM-dd", CultureInfo.CurrentCulture); if (edate >= DateTime.Today) { Log(new ArgumentOutOfRangeException("end_date允许设置的最大值为昨日")); } } } } ================================================ FILE: Business/Model/ApiRequests/DatacubeGetarticletotalRequest.cs ================================================ using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace WX.Model.ApiRequests { /// /// 获取图文群发总数据(getarticletotal) /// public class DatacubeGetarticletotalRequest : DatacubeGetarticlesummaryRequest { protected override string UrlFormat { get { return "https://api.weixin.qq.com/datacube/getarticletotal?access_token={0}"; } } } } ================================================ FILE: Business/Model/ApiRequests/DatacubeGetuserreadRequest.cs ================================================ using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace WX.Model.ApiRequests { /// /// 获取图文统计数据(getuserread) /// public class DatacubeGetuserreadRequest : DatacubeGetarticlesummaryRequest { protected override string UrlFormat { get { return "https://api.weixin.qq.com/datacube/getuserread?access_token={0}"; } } } } ================================================ FILE: Business/Model/ApiRequests/DatacubeGetuserreadhourRequest.cs ================================================ using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace WX.Model.ApiRequests { /// /// 获取图文统计分时数据(getuserreadhour) /// public class DatacubeGetuserreadhourRequest : DatacubeGetarticlesummaryRequest { protected override string UrlFormat { get { return "https://api.weixin.qq.com/datacube/getuserreadhour?access_token={0}"; } } } } ================================================ FILE: Business/Model/ApiRequests/DatacubeGetusershareRequest.cs ================================================ using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace WX.Model.ApiRequests { public class DatacubeGetusershareRequest : DatacubeGetarticlesummaryRequest { protected override string UrlFormat { get { return "https://api.weixin.qq.com/datacube/getusershare?access_token={0}"; } } } } ================================================ FILE: Business/Model/ApiRequests/DatacubeGetusersharehourRequest.cs ================================================ using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace WX.Model.ApiRequests { public class DatacubeGetusersharehourRequest : DatacubeGetarticlesummaryRequest { protected override string UrlFormat { get { return "https://api.weixin.qq.com/datacube/getusersharehour?access_token={0}"; } } } } ================================================ FILE: Business/Model/ApiRequests/GetCurrentAutoreplyInfoRequest.cs ================================================ using System; using System.Collections.Generic; using System.Linq; using System.Text; using WX.Model.ApiResponses; namespace WX.Model.ApiRequests { public class GetCurrentAutoreplyInfoRequest : ApiRequest { internal override string Method { get { return GETMETHOD; } } protected override string UrlFormat { get { return "https://api.weixin.qq.com/cgi-bin/get_current_autoreply_info?access_token={0}"; } } internal override string GetUrl() { return String.Format(UrlFormat, AccessToken); } protected override bool NeedToken { get { return true; } } public override string GetPostContent() { return String.Empty; } } } ================================================ FILE: Business/Model/ApiRequests/GetCurrentSelfmenuInfoRequest.cs ================================================ using System; using System.Collections.Generic; using System.Linq; using System.Text; using WX.Model.ApiResponses; namespace WX.Model.ApiRequests { public class GetCurrentSelfmenuInfoRequest : ApiRequest { internal override string Method { get { return GETMETHOD; } } protected override string UrlFormat { get { return "https://api.weixin.qq.com/cgi-bin/get_current_selfmenu_info?access_token={0}"; } } internal override string GetUrl() { return String.Format(UrlFormat, AccessToken); } protected override bool NeedToken { get { return true; } } public override string GetPostContent() { return String.Empty; } } } ================================================ FILE: Business/Model/ApiRequests/GetcallbackipRequest.cs ================================================ using System; using System.Collections.Generic; using System.Linq; using System.Text; using WX.Model.ApiResponses; namespace WX.Model.ApiRequests { /// /// 如果公众号基于安全等考虑,需要获知微信服务器的IP地址列表,以便进行相关限制,可以通过该接口获得微信服务器IP地址列表。 /// public class GetcallbackipRequest : ApiRequest { internal override string Method { get { return GETMETHOD; } } protected override string UrlFormat { get { return "https://api.weixin.qq.com/cgi-bin/getcallbackip?access_token={0}"; } } internal override string GetUrl() { return String.Format(UrlFormat, AccessToken); } protected override bool NeedToken { get { return true; } } public override string GetPostContent() { throw new NotImplementedException(); } } } ================================================ FILE: Business/Model/ApiRequests/GroupsCreateRequest.cs ================================================ using Newtonsoft.Json; using System; using System.Collections.Generic; using System.Linq; using System.Text; using WX.Model.ApiResponses; namespace WX.Model.ApiRequests { public class GroupsCreateRequest : ApiRequest { [JsonProperty("group", TypeNameHandling = TypeNameHandling.Objects)] public Group Group { get; set; } internal override string Method { get { return "POST"; } } protected override string UrlFormat { get { return "https://api.weixin.qq.com/cgi-bin/groups/create?access_token={0}"; } } internal override string GetUrl() { return String.Format(UrlFormat, AccessToken); } protected override bool NeedToken { get { return true; } } internal override void Validate() { base.Validate(); var namelength = this.Group.Name.Length; if (namelength < 0 || namelength > 30) { throw new ArgumentException("Property Name length between 1 to 30"); } } public override string GetPostContent() { return JsonConvert.SerializeObject(new { group = Group }); } } } ================================================ FILE: Business/Model/ApiRequests/GroupsGetIdRequest.cs ================================================ using Newtonsoft.Json; using System; using System.Collections.Generic; using System.Linq; using System.Text; using WX.Model.ApiResponses; namespace WX.Model.ApiRequests { public class GroupsGetIdRequest : ApiRequest { internal override string Method { get { return "POST"; } } protected override string UrlFormat { get { return "https://api.weixin.qq.com/cgi-bin/groups/getid?access_token={0}"; } } internal override string GetUrl() { return String.Format(UrlFormat, AccessToken); } protected override bool NeedToken { get { return true; } } public override string GetPostContent() { return JsonConvert.SerializeObject(new { openid = OpenId }); } public string OpenId { get; set; } } } ================================================ FILE: Business/Model/ApiRequests/GroupsMembersUpdateRequest.cs ================================================ using Newtonsoft.Json; using System; using System.Collections.Generic; using System.Linq; using System.Text; using WX.Model.ApiResponses; namespace WX.Model.ApiRequests { public class GroupsMembersUpdateRequest : ApiRequest { [JsonProperty("openid")] public string OpenId { get; set; } [JsonProperty("to_groupid")] public int ToGroupId { get; set; } internal override string Method { get { return "POST"; } } protected override string UrlFormat { get { return "https://api.weixin.qq.com/cgi-bin/groups/members/update?access_token={0}"; } } internal override string GetUrl() { return String.Format(UrlFormat, AccessToken); } protected override bool NeedToken { get { return true; } } public override string GetPostContent() { return JsonConvert.SerializeObject(this); } } } ================================================ FILE: Business/Model/ApiRequests/GroupsQueryRequest.cs ================================================ using System; using System.Collections.Generic; using System.Linq; using System.Text; using WX.Model.ApiResponses; namespace WX.Model.ApiRequests { public class GroupsQueryRequest : ApiRequest { internal override string Method { get { return "GET"; } } protected override string UrlFormat { get { return "https://api.weixin.qq.com/cgi-bin/groups/get?access_token={0}"; } } internal override string GetUrl() { return String.Format(UrlFormat, AccessToken); } protected override bool NeedToken { get { return true; } } public override string GetPostContent() { throw new NotImplementedException(); } } } ================================================ FILE: Business/Model/ApiRequests/GroupsUpdateRequest.cs ================================================ using Newtonsoft.Json; using System; using System.Collections.Generic; using System.Linq; using System.Text; using WX.Model.ApiResponses; namespace WX.Model.ApiRequests { public class GroupsUpdateRequest : ApiRequest { [JsonProperty("group")] public Group Group { get; set; } internal override string Method { get { return "POST"; } } protected override string UrlFormat { get { return "https://api.weixin.qq.com/cgi-bin/groups/update?access_token={0}"; } } internal override string GetUrl() { return String.Format(UrlFormat, AccessToken); } protected override bool NeedToken { get { return true; } } public override string GetPostContent() { return JsonConvert.SerializeObject(this); } } } ================================================ FILE: Business/Model/ApiRequests/MaterialAddNewsRequest.cs ================================================ using Newtonsoft.Json; using System; using System.Collections.Generic; using System.Linq; using System.Text; using WX.Model.ApiResponses; namespace WX.Model.ApiRequests { /// /// 新增永久图文素材 Request /// public class MaterialAddNewsRequest : ApiRequest { [JsonProperty("articles")] public List Articles { get; set; } internal override string Method { get { return POSTMETHOD; } } protected override string UrlFormat { get { return "https://api.weixin.qq.com/cgi-bin/material/add_news?access_token={0}"; } } internal override string GetUrl() { return String.Format(UrlFormat, AccessToken); } protected override bool NeedToken { get { return true; } } public override string GetPostContent() { return JsonConvert.SerializeObject(this); } } } ================================================ FILE: Business/Model/ApiRequests/MediaGetRequest.cs ================================================ using System; using System.Collections.Generic; using System.Linq; using System.Text; using WX.Model.ApiResponses; namespace WX.Model.ApiRequests { public class MediaGetRequest : ApiRequest { public string MediaId { get; set; } internal override string Method { get { return "GET"; } } protected override string UrlFormat { get { return "http://file.api.weixin.qq.com/cgi-bin/media/get?access_token={0}&media_id={1}"; } } internal override string GetUrl() { return String.Format(UrlFormat, AccessToken, MediaId); } protected override bool NeedToken { get { return true; } } public override string GetPostContent() { throw new NotImplementedException(); } internal override bool NotHasResponse { get { return true; } } internal override void Validate() { base.Validate(); if (String.IsNullOrEmpty(MediaId)) { throw new ArgumentNullException("MediaId is null"); } } } } ================================================ FILE: Business/Model/ApiRequests/MediaUploadNewsRequest.cs ================================================ using Newtonsoft.Json; using System; using System.Collections.Generic; using System.Linq; using System.Text; using WX.Model.ApiResponses; namespace WX.Model.ApiRequests { public class MediaUploadNewsRequest : ApiRequest { [JsonProperty("articles")] public IEnumerable Articles { get; set; } internal override string Method { get { return "POST"; } } protected override string UrlFormat { get { return "https://api.weixin.qq.com/cgi-bin/media/uploadnews?access_token={0}"; } } internal override string GetUrl() { return String.Format(UrlFormat, AccessToken); } protected override bool NeedToken { get { return true; } } public override string GetPostContent() { return JsonConvert.SerializeObject(this); } } } ================================================ FILE: Business/Model/ApiRequests/MediaUploadRequest.cs ================================================ using System; using System.Collections.Generic; using System.IO; using System.Linq; using System.Text; using WX.Model.ApiResponses; namespace WX.Model.ApiRequests { /// /// 注意事项 ///上传的临时多媒体文件有格式和大小限制,如下: ///图片(image): 1M,支持JPG格式 ///语音(voice):2M,播放长度不超过60s,支持AMR\MP3格式 ///视频(video):10MB,支持MP4格式 ///缩略图(thumb):64KB,支持JPG格式 /// public class MediaUploadRequest : ApiRequest { public string FilePath { get; set; } public MediaType MediaType { get; set; } internal override string Method { get { return "FILE"; } } protected override string UrlFormat { get { return "http://file.api.weixin.qq.com/cgi-bin/media/upload?access_token={0}&type={1}"; } } internal override string GetUrl() { return String.Format(UrlFormat, AccessToken, MediaType); } protected override bool NeedToken { get { return true; } } public override string GetPostContent() { return FilePath; } internal override void Validate() { base.Validate(); FileInfo file = new FileInfo(FilePath); if (!file.Exists) { throw new FileNotFoundException(); } if (file.Extension != ".jpg" && file.Extension != ".amr" && file.Extension != ".mp3" && file.Extension != ".mp4") { throw new NotSupportedException("不支持上传的文件类型"); } } } } ================================================ FILE: Business/Model/ApiRequests/MenuCreateRequest.cs ================================================ using Newtonsoft.Json; using System; using System.Collections.Generic; using System.Linq; using System.Text; using WX.Model.ApiResponses; using WX.Model.Exceptions; namespace WX.Model.ApiRequests { public class MenuCreateRequest : ApiRequest { [JsonProperty("button")] public IEnumerable Buttons { get; set; } internal override string Method { get { return "POST"; } } protected override string UrlFormat { get { return "https://api.weixin.qq.com/cgi-bin/menu/create?access_token={0}"; } } internal override string GetUrl() { return String.Format(UrlFormat, AccessToken); } protected override bool NeedToken { get { return true; } } public override string GetPostContent() { return JsonConvert.SerializeObject(this); } internal override void Validate() { base.Validate(); if (Buttons == null) { throw new ArgumentNullException("button is null"); } } } } ================================================ FILE: Business/Model/ApiRequests/MenuDeleteRequest.cs ================================================ using System; using System.Collections.Generic; using System.Linq; using System.Text; using WX.Model.ApiResponses; namespace WX.Model.ApiRequests { public sealed class MenuDeleteRequest : ApiRequest { internal override string Method { get { return "GET"; } } protected override string UrlFormat { get { return "https://api.weixin.qq.com/cgi-bin/menu/delete?access_token={0}"; } } internal override string GetUrl() { return String.Format(UrlFormat, AccessToken); } protected override bool NeedToken { get { return true; } } public override string GetPostContent() { throw new NotImplementedException(); } } } ================================================ FILE: Business/Model/ApiRequests/MenuGetRequest.cs ================================================ using System; using System.Collections.Generic; using System.Linq; using System.Text; using WX.Model.ApiResponses; namespace WX.Model.ApiRequests { public class MenuGetRequest : ApiRequest { internal override string Method { get { return "GET"; } } protected override string UrlFormat { get { return "https://api.weixin.qq.com/cgi-bin/menu/get?access_token={0}"; } } internal override string GetUrl() { return String.Format(UrlFormat, AccessToken); } protected override bool NeedToken { get { return true; } } public override string GetPostContent() { throw new NotImplementedException(); } } } ================================================ FILE: Business/Model/ApiRequests/MerchantCategoryGetPropertyRequest.cs ================================================ using Newtonsoft.Json; using System; using System.Collections.Generic; using System.Linq; using System.Text; using WX.Model.ApiResponses; namespace WX.Model.ApiRequests { public class MerchantCategoryGetpropertyRequest : ApiRequest { [JsonProperty("cate_id")] public long CateID { get; set; } internal override string Method { get { return POSTMETHOD; } } protected override string UrlFormat { get { return "https://api.weixin.qq.com/merchant/category/getproperty?access_token={0}"; } } internal override string GetUrl() { return String.Format(UrlFormat, AccessToken); } protected override bool NeedToken { get { return true; } } public override string GetPostContent() { return JsonConvert.SerializeObject(this); } } } ================================================ FILE: Business/Model/ApiRequests/MerchantCategoryGetskuRequest.cs ================================================ using Newtonsoft.Json; using System; using System.Collections.Generic; using System.Linq; using System.Text; using WX.Model.ApiResponses; namespace WX.Model.ApiRequests { public class MerchantCategoryGetskuRequest : ApiRequest { [JsonProperty("cate_id")] public long CateID { get; set; } internal override string Method { get { return POSTMETHOD; } } protected override string UrlFormat { get { return "https://api.weixin.qq.com/merchant/category/getsku?access_token={0}"; } } internal override string GetUrl() { return String.Format(UrlFormat, AccessToken); } protected override bool NeedToken { get { return true; } } public override string GetPostContent() { return JsonConvert.SerializeObject(this); } } } ================================================ FILE: Business/Model/ApiRequests/MerchantCategoryGetsubRequest.cs ================================================ using Newtonsoft.Json; using System; using System.Collections.Generic; using System.Linq; using System.Text; using WX.Model.ApiResponses; namespace WX.Model.ApiRequests { public class MerchantCategoryGetsubRequest : ApiRequest { [JsonProperty("cate_id")] public long CateID { get; set; } internal override string Method { get { return POSTMETHOD; } } protected override string UrlFormat { get { return "https://api.weixin.qq.com/merchant/category/getsub?access_token={0}"; } } internal override string GetUrl() { return String.Format(UrlFormat, AccessToken); } protected override bool NeedToken { get { return true; } } public override string GetPostContent() { return JsonConvert.SerializeObject(this); } } } ================================================ FILE: Business/Model/ApiRequests/MerchantCommonUploadimgRequest.cs ================================================ using System; using System.Collections.Generic; using System.Linq; using System.Text; using WX.Model.ApiResponses; namespace WX.Model.ApiRequests { public class MerchantCommonUploadimgRequest : ApiRequest { public string FilePath { get; set; } public string FileName { get; set; } internal override string Method { get { return FILEMETHOD; } } protected override string UrlFormat { get { return "https://api.weixin.qq.com/merchant/common/upload_img?access_token={0}&filename={1}"; } } internal override string GetUrl() { return String.Format(UrlFormat, AccessToken, FileName); } protected override bool NeedToken { get { return true; } } public override string GetPostContent() { return FilePath; } } } ================================================ FILE: Business/Model/ApiRequests/MerchantCreateRequest.cs ================================================ using Newtonsoft.Json; using System; using System.Collections.Generic; using System.Linq; using System.Text; using WX.Model.ApiResponses; namespace WX.Model.ApiRequests { public class MerchantCreateRequest : ApiRequest { public ProductInfo ProductInfo { get; set; } internal override string Method { get { return "POST"; } } protected override string UrlFormat { get { return "https://api.weixin.qq.com/merchant/create?access_token={0}"; } } internal override string GetUrl() { return String.Format(UrlFormat, AccessToken); } protected override bool NeedToken { get { return true; } } public override string GetPostContent() { return JsonConvert.SerializeObject(this.ProductInfo); } } } ================================================ FILE: Business/Model/ApiRequests/MerchantDelRequest.cs ================================================ using Newtonsoft.Json; using System; using System.Collections.Generic; using System.Linq; using System.Text; using WX.Model.ApiResponses; namespace WX.Model.ApiRequests { public class MerchantDelRequest : ApiRequest { [JsonProperty("product_id")] public string ProductID { get; set; } internal override string Method { get { return "POST"; } } protected override string UrlFormat { get { return "https://api.weixin.qq.com/merchant/del?access_token={0}"; } } internal override string GetUrl() { return String.Format(UrlFormat, AccessToken); } protected override bool NeedToken { get { return true; } } public override string GetPostContent() { return JsonConvert.SerializeObject(this); } } } ================================================ FILE: Business/Model/ApiRequests/MerchantExpressAddRequest.cs ================================================ using Newtonsoft.Json; using System; using System.Collections.Generic; using System.Linq; using System.Text; using WX.Model.ApiResponses; namespace WX.Model.ApiRequests { public class MerchantExpressAddRequest : ApiRequest { [JsonProperty("delivery_template")] public DeliveryTemplate DeliveryTemplate { get; set; } internal override string Method { get { return POSTMETHOD; } } protected override string UrlFormat { get { return "https://api.weixin.qq.com/merchant/express/add?access_token={0}"; } } internal override string GetUrl() { return String.Format(UrlFormat, AccessToken); } protected override bool NeedToken { get { return true; } } public override string GetPostContent() { return JsonConvert.SerializeObject(this); } } } ================================================ FILE: Business/Model/ApiRequests/MerchantExpressDelRequest.cs ================================================ using Newtonsoft.Json; using System; using System.Collections.Generic; using System.Linq; using System.Text; using WX.Model.ApiResponses; namespace WX.Model.ApiRequests { public class MerchantExpressDelRequest : ApiRequest { [JsonProperty("template_id")] public long TemplateID { get; set; } internal override string Method { get { return POSTMETHOD; } } protected override string UrlFormat { get { return "https://api.weixin.qq.com/merchant/express/del?access_token={0}"; } } internal override string GetUrl() { return String.Format(UrlFormat, AccessToken); } protected override bool NeedToken { get { return true; } } public override string GetPostContent() { return JsonConvert.SerializeObject(this); } } } ================================================ FILE: Business/Model/ApiRequests/MerchantExpressGetallRequest.cs ================================================ using System; using System.Collections.Generic; using System.Linq; using System.Text; using WX.Model.ApiResponses; namespace WX.Model.ApiRequests { public class MerchantExpressGetallRequest : ApiRequest { internal override string Method { get { return GETMETHOD; } } protected override string UrlFormat { get { return "https://api.weixin.qq.com/merchant/express/getall?access_token={0}"; } } internal override string GetUrl() { return String.Format(UrlFormat, AccessToken); } protected override bool NeedToken { get { return true; } } public override string GetPostContent() { throw new NotImplementedException(); } } } ================================================ FILE: Business/Model/ApiRequests/MerchantExpressGetbyidRequest.cs ================================================ using Newtonsoft.Json; using System; using System.Collections.Generic; using System.Linq; using System.Text; using WX.Model.ApiResponses; namespace WX.Model.ApiRequests { public class MerchantExpressGetbyidRequest : ApiRequest { [JsonProperty("template_id")] public long TemplateID { get; set; } internal override string Method { get { return POSTMETHOD; } } protected override string UrlFormat { get { return "https://api.weixin.qq.com/merchant/express/getbyid?access_token={0}"; } } internal override string GetUrl() { return String.Format(UrlFormat, AccessToken); } protected override bool NeedToken { get { return true; } } public override string GetPostContent() { return JsonConvert.SerializeObject(this); } } } ================================================ FILE: Business/Model/ApiRequests/MerchantExpressUpdateRequest.cs ================================================ using Newtonsoft.Json; using System; using System.Collections.Generic; using System.Linq; using System.Text; using WX.Model.ApiResponses; namespace WX.Model.ApiRequests { public class MerchantExpressUpdateRequest : ApiRequest { [JsonProperty("template_id")] public long TemplateID { get; set; } [JsonProperty("delivery_template")] public DeliveryTemplate DeliveryTemplate { get; set; } internal override string Method { get { return POSTMETHOD; } } protected override string UrlFormat { get { return "https://api.weixin.qq.com/merchant/express/update?access_token={0}"; } } internal override string GetUrl() { return String.Format(UrlFormat, AccessToken); } protected override bool NeedToken { get { return true; } } public override string GetPostContent() { return JsonConvert.SerializeObject(this); } } } ================================================ FILE: Business/Model/ApiRequests/MerchantGetRequest.cs ================================================ using Newtonsoft.Json; using System; using System.Collections.Generic; using System.Linq; using System.Text; using WX.Model.ApiResponses; namespace WX.Model.ApiRequests { public class MerchantGetRequest : ApiRequest { [JsonProperty("product_id")] public string ProductID { get; set; } internal override string Method { get { return "POST"; } } protected override string UrlFormat { get { return "https://api.weixin.qq.com/merchant/get?access_token={0}"; } } internal override string GetUrl() { return String.Format(UrlFormat, AccessToken); } protected override bool NeedToken { get { return true; } } public override string GetPostContent() { return JsonConvert.SerializeObject(this); } } } ================================================ FILE: Business/Model/ApiRequests/MerchantGetbystatus.cs ================================================ using Newtonsoft.Json; using System; using System.Collections.Generic; using System.Linq; using System.Text; using WX.Model.ApiResponses; namespace WX.Model.ApiRequests { public class MerchantGetbystatusRequest : ApiRequest { public int Status { get; set; } internal override string Method { get { return "POST"; } } protected override string UrlFormat { get { return "https://api.weixin.qq.com/merchant/getbystatus?access_token={0}"; } } internal override string GetUrl() { return String.Format(UrlFormat, AccessToken); } protected override bool NeedToken { get { return true; } } public override string GetPostContent() { return JsonConvert.SerializeObject(this); } internal override void Validate() { base.Validate(); if (Status < 0 || Status > 2) { throw new ArgumentOutOfRangeException("The Status between 0 to 2"); } } } } ================================================ FILE: Business/Model/ApiRequests/MerchantGroupAddRequest.cs ================================================ using Newtonsoft.Json; using System; using System.Collections.Generic; using System.Linq; using System.Text; using WX.Model.ApiResponses; namespace WX.Model.ApiRequests { public class MerchantGroupAddRequest : ApiRequest { [JsonProperty("group_detail")] public MerchantGroupDetail GroupDetail { get; set; } internal override string Method { get { return POSTMETHOD; } } protected override string UrlFormat { get { return "https://api.weixin.qq.com/merchant/group/add?access_token={0}"; } } internal override string GetUrl() { return String.Format(UrlFormat, AccessToken); } protected override bool NeedToken { get { return true; } } public override string GetPostContent() { return JsonConvert.SerializeObject(this); } internal override void Validate() { base.Validate(); if (this.GroupDetail != null) { this.GroupDetail.GroupId = 0; this.GroupDetail.Product = null; } } } } ================================================ FILE: Business/Model/ApiRequests/MerchantGroupDelRequest.cs ================================================ using Newtonsoft.Json; using System; using System.Collections.Generic; using System.Linq; using System.Text; using WX.Model.ApiResponses; namespace WX.Model.ApiRequests { public class MerchantGroupDelRequest : ApiRequest { [JsonProperty("group_id")] public long GroupID { get; set; } internal override string Method { get { return POSTMETHOD; } } protected override string UrlFormat { get { return "https://api.weixin.qq.com/merchant/group/del?access_token={0}"; } } internal override string GetUrl() { return String.Format(UrlFormat, AccessToken); } protected override bool NeedToken { get { return true; } } public override string GetPostContent() { return JsonConvert.SerializeObject(this); } } } ================================================ FILE: Business/Model/ApiRequests/MerchantGroupGetallRequest.cs ================================================ using System; using System.Collections.Generic; using System.Linq; using System.Text; using WX.Model.ApiResponses; namespace WX.Model.ApiRequests { public class MerchantGroupGetallRequest : ApiRequest { internal override string Method { get { return GETMETHOD; } } protected override string UrlFormat { get { return "https://api.weixin.qq.com/merchant/group/getall?access_token={0}"; } } internal override string GetUrl() { return String.Format(UrlFormat, AccessToken); } protected override bool NeedToken { get { return true; } } public override string GetPostContent() { throw new NotImplementedException(); } } } ================================================ FILE: Business/Model/ApiRequests/MerchantGroupGetbyidRequest.cs ================================================ using Newtonsoft.Json; using System; using System.Collections.Generic; using System.Linq; using System.Text; using WX.Model.ApiResponses; namespace WX.Model.ApiRequests { public class MerchantGroupGetbyidRequest : ApiRequest { [JsonProperty("group_id")] public long GroupID { get; set; } internal override string Method { get { return POSTMETHOD; } } protected override string UrlFormat { get { return "https://api.weixin.qq.com/merchant/group/getbyid?access_token={0}"; } } internal override string GetUrl() { return String.Format(UrlFormat, AccessToken); } protected override bool NeedToken { get { return true; } } public override string GetPostContent() { return JsonConvert.SerializeObject(this); } } } ================================================ FILE: Business/Model/ApiRequests/MerchantGroupProductmodRequest.cs ================================================ using Newtonsoft.Json; using System; using System.Collections.Generic; using System.Linq; using System.Text; using WX.Model.ApiResponses; namespace WX.Model.ApiRequests { public class MerchantGroupProductmodRequest : ApiRequest { public MerchantGroupDetail GroupDetail { get; set; } internal override string Method { get { return POSTMETHOD; } } protected override string UrlFormat { get { return "https://api.weixin.qq.com/merchant/group/productmod?access_token={0}"; } } internal override string GetUrl() { return String.Format(UrlFormat, AccessToken); } protected override bool NeedToken { get { return true; } } public override string GetPostContent() { return JsonConvert.SerializeObject(this.GroupDetail); } internal override void Validate() { base.Validate(); if (this.GroupDetail != null) { this.GroupDetail.Name = null; this.GroupDetail.ProductList = null; } } } } ================================================ FILE: Business/Model/ApiRequests/MerchantGroupPropertymodRequest.cs ================================================ using Newtonsoft.Json; using System; using System.Collections.Generic; using System.Linq; using System.Text; using WX.Model.ApiResponses; namespace WX.Model.ApiRequests { public class MerchantGroupPropertymodRequest : ApiRequest { public MerchantGroupDetail GroupDetail { get; set; } internal override string Method { get { return POSTMETHOD; } } protected override string UrlFormat { get { return "https://api.weixin.qq.com/merchant/group/propertymod?access_token={0}"; } } internal override string GetUrl() { return String.Format(UrlFormat, AccessToken); } protected override bool NeedToken { get { return true; } } public override string GetPostContent() { return JsonConvert.SerializeObject(this.GroupDetail); } internal override void Validate() { base.Validate(); if (this.GroupDetail != null) { this.GroupDetail.Product = null; this.GroupDetail.ProductList = null; } } } } ================================================ FILE: Business/Model/ApiRequests/MerchantModproductstatusRequest.cs ================================================ using Newtonsoft.Json; using System; using System.Collections.Generic; using System.Linq; using System.Text; using WX.Model.ApiResponses; namespace WX.Model.ApiRequests { public class MerchantModproductstatusRequest : ApiRequest { /// /// 商品ID /// [JsonProperty("product_id")] public string ProductID { get; set; } /// /// 商品上下架标志,0:下架, 1:上架 /// [JsonProperty("status")] public int Status { get; set; } internal override string Method { get { return "POST"; } } protected override string UrlFormat { get { return "https://api.weixin.qq.com/merchant/modproductstatus?access_token={0}"; } } internal override string GetUrl() { return String.Format(UrlFormat, AccessToken); } protected override bool NeedToken { get { return true; } } public override string GetPostContent() { return JsonConvert.SerializeObject(this); } internal override void Validate() { base.Validate(); if (Status < 0 || Status > 1) { throw new ArgumentOutOfRangeException("Status is between 0 to 1"); } } } } ================================================ FILE: Business/Model/ApiRequests/MerchantOrderCloseRequest.cs ================================================ using Newtonsoft.Json; using System; using System.Collections.Generic; using System.Linq; using System.Text; using WX.Model.ApiResponses; namespace WX.Model.ApiRequests { public class MerchantOrderCloseRequest : ApiRequest { [JsonProperty("order_id")] public string OrderID { get; set; } internal override string Method { get { return POSTMETHOD; } } protected override string UrlFormat { get { return "https://api.weixin.qq.com/merchant/order/clost?access_token={0}"; } } internal override string GetUrl() { return String.Format(UrlFormat, AccessToken); } protected override bool NeedToken { get { return true; } } public override string GetPostContent() { return JsonConvert.SerializeObject(this); } } } ================================================ FILE: Business/Model/ApiRequests/MerchantOrderGetbyfilterRequest.cs ================================================ using Newtonsoft.Json; using System; using System.Collections.Generic; using System.Linq; using System.Text; using WX.Model.ApiResponses; namespace WX.Model.ApiRequests { public class MerchantOrderGetbyfilterRequest : ApiRequest { [JsonProperty("status", DefaultValueHandling = DefaultValueHandling.Ignore)] public OrderStatus Status { get; set; } [JsonIgnore] public DateTime BeginTime { get; set; } [JsonIgnore] public DateTime EndTime { get; set; } [JsonProperty("begintime")] internal long JsonBeginTime { get { return BeginTime.ConvertToTimeStamp(); } } [JsonProperty("endtime")] internal long JsonEndTime { get { return EndTime.ConvertToTimeStamp(); } } internal override string Method { get { return POSTMETHOD; } } protected override string UrlFormat { get { return "https://api.weixin.qq.com/merchant/order/getbyfilter?access_token={0}"; } } internal override string GetUrl() { return String.Format(UrlFormat, AccessToken); } protected override bool NeedToken { get { return true; } } public override string GetPostContent() { return JsonConvert.SerializeObject(this); } } } ================================================ FILE: Business/Model/ApiRequests/MerchantOrderGetbyidRequest.cs ================================================ using Newtonsoft.Json; using System; using System.Collections.Generic; using System.Linq; using System.Text; using WX.Model.ApiResponses; namespace WX.Model.ApiRequests { public class MerchantOrderGetbyidRequest : ApiRequest { [JsonProperty("order_id")] public string OrderID { get; set; } internal override string Method { get { return POSTMETHOD; } } protected override string UrlFormat { get { return "https://api.weixin.qq.com/merchant/order/getbyid?access_token={0}"; } } internal override string GetUrl() { return String.Format(UrlFormat, AccessToken); } protected override bool NeedToken { get { return true; } } public override string GetPostContent() { return JsonConvert.SerializeObject(this); } } } ================================================ FILE: Business/Model/ApiRequests/MerchantOrderSetdeliveryRequest.cs ================================================ using Newtonsoft.Json; using System; using System.Collections.Generic; using System.Linq; using System.Text; using WX.Model.ApiResponses; namespace WX.Model.ApiRequests { public class MerchantOrderSetdeliveryRequest : ApiRequest { [JsonProperty("order_id")] public string OrderID { get; set; } [JsonProperty("delivery_company")] public string DeliveryCompany { get; set; } [JsonProperty("delivery_track_no")] public string DeliveryTrackNo { get; set; } internal override string Method { get { return POSTMETHOD; } } protected override string UrlFormat { get { return "https://api.weixin.qq.com/merchant/order/setdelivery?access_token={0}"; } } internal override string GetUrl() { return String.Format(UrlFormat, AccessToken); } protected override bool NeedToken { get { return true; } } public override string GetPostContent() { return JsonConvert.SerializeObject(this); } } } ================================================ FILE: Business/Model/ApiRequests/MerchantShelfAddRequest.cs ================================================ using Newtonsoft.Json; using System; using System.Collections.Generic; using System.Linq; using System.Text; using WX.Model.ApiResponses; namespace WX.Model.ApiRequests { public class MerchantShelfAddRequest : ApiRequest { public MerchantShelfAddRequest() { Modules = new List(); } [JsonProperty("shelf_banner", NullValueHandling = NullValueHandling.Ignore, DefaultValueHandling = DefaultValueHandling.Ignore)] public string ShelfBanner { get { if (m_needbanner) { return m_shelfbanner; } return null; } set { m_shelfbanner = value; } } private string m_shelfbanner = String.Empty; private bool m_needbanner = true; [JsonProperty("shelf_name", Required = Required.Always)] public string ShelfName { get; set; } [JsonIgnore] private ICollection Modules { get; set; } [JsonProperty("shelf_data")] internal ShelfModulesInfo ShelfData { get; set; } public void AddModules(ShelfModuleOne one, ShelfModuleTwo two, ShelfModuleThree three, ShelfModuleFour four) { Modules.Clear(); if (one != null) Modules.Add(one); if (two != null) Modules.Add(two); if (three != null) Modules.Add(three); if (four != null) Modules.Add(four); ShelfData = new ShelfModulesInfo(Modules); } public void AddModules(ShelfModuleFive five) { Modules.Clear(); if (five != null) Modules.Add(five); ShelfData = new ShelfModulesInfo(Modules); m_needbanner = false; ShelfBanner = String.Empty; } internal override string Method { get { return POSTMETHOD; } } protected override string UrlFormat { get { return "https://api.weixin.qq.com/merchant/shelf/add?access_token={0}"; } } internal override string GetUrl() { return String.Format(UrlFormat, AccessToken); } protected override bool NeedToken { get { return true; } } public override string GetPostContent() { return JsonConvert.SerializeObject(this); } internal override void Validate() { base.Validate(); if (Modules == null || !Modules.Any()) { throw new ArgumentNullException("must add shelfmodule, use addModule function"); } } } } ================================================ FILE: Business/Model/ApiRequests/MerchantShelfDelRequest.cs ================================================ using Newtonsoft.Json; using System; using System.Collections.Generic; using System.Linq; using System.Text; using WX.Model.ApiResponses; namespace WX.Model.ApiRequests { public class MerchantShelfDelRequest : ApiRequest { [JsonProperty("shelf_id")] public long ShelfID { get; set; } internal override string Method { get { return POSTMETHOD; } } protected override string UrlFormat { get { return "https://api.weixin.qq.com/merchant/shelf/del?access_token={0}"; } } internal override string GetUrl() { return String.Format(UrlFormat, AccessToken); } protected override bool NeedToken { get { return true; } } public override string GetPostContent() { return JsonConvert.SerializeObject(this); } } } ================================================ FILE: Business/Model/ApiRequests/MerchantShelfGetallRequest.cs ================================================ using System; using System.Collections.Generic; using System.Linq; using System.Text; using WX.Model.ApiResponses; namespace WX.Model.ApiRequests { public class MerchantShelfGetallRequest : ApiRequest { internal override string Method { get { return GETMETHOD; } } protected override string UrlFormat { get { return "https://api.weixin.qq.com/merchant/shelf/getall?access_token={0}"; } } internal override string GetUrl() { return String.Format(UrlFormat, AccessToken); } protected override bool NeedToken { get { return true; } } public override string GetPostContent() { throw new NotImplementedException(); } } } ================================================ FILE: Business/Model/ApiRequests/MerchantShelfGetbyidRequest.cs ================================================ using Newtonsoft.Json; using System; using System.Collections.Generic; using System.Linq; using System.Text; using WX.Model.ApiResponses; namespace WX.Model.ApiRequests { public class MerchantShelfGetbyidRequest : ApiRequest { [JsonProperty("shelf_id")] public long ShelfID { get; set; } internal override string Method { get { return POSTMETHOD; } } protected override string UrlFormat { get { return "https://api.weixin.qq.com/merchant/shelf/getbyid?access_token={0}"; } } internal override string GetUrl() { return String.Format(UrlFormat, AccessToken); } protected override bool NeedToken { get { return true; } } public override string GetPostContent() { return JsonConvert.SerializeObject(this); } } } ================================================ FILE: Business/Model/ApiRequests/MerchantShelfMod.cs ================================================ using Newtonsoft.Json; using System; using System.Collections.Generic; using System.Linq; using System.Text; using WX.Model.ApiResponses; namespace WX.Model.ApiRequests { public class MerchantShelfMod : ApiRequest { [JsonProperty("shelf_id")] public long ShelfID { get; set; } [JsonProperty("shelf_banner", NullValueHandling = NullValueHandling.Ignore, DefaultValueHandling = DefaultValueHandling.Ignore)] public string ShelfBanner { get { if (m_needbanner) { return m_shelfbanner; } return null; } set { m_shelfbanner = value; } } private string m_shelfbanner = String.Empty; private bool m_needbanner = true; [JsonProperty("shelf_name", Required = Required.Always)] public string ShelfName { get; set; } [JsonIgnore] private ICollection Modules { get; set; } [JsonProperty("shelf_data")] internal ShelfModulesInfo ShelfData { get; set; } public void AddModules(ShelfModuleOne one, ShelfModuleTwo two, ShelfModuleThree three, ShelfModuleFour four) { Modules.Clear(); if (one != null) Modules.Add(one); if (two != null) Modules.Add(two); if (three != null) Modules.Add(three); if (four != null) Modules.Add(four); ShelfData = new ShelfModulesInfo(Modules); } public void AddModules(ShelfModuleFive five) { Modules.Clear(); if (five != null) Modules.Add(five); ShelfData = new ShelfModulesInfo(Modules); m_needbanner = false; ShelfBanner = String.Empty; } internal override string Method { get { return POSTMETHOD; } } protected override string UrlFormat { get { return "https://api.weixin.qq.com/merchant/shelf/mod?access_token={0}"; } } internal override string GetUrl() { return String.Format(UrlFormat, AccessToken); } protected override bool NeedToken { get { return true; } } public override string GetPostContent() { return JsonConvert.SerializeObject(this); } } } ================================================ FILE: Business/Model/ApiRequests/MerchantShelfUpdatestatusRequest.cs ================================================ using Newtonsoft.Json; using System; using System.Collections.Generic; using System.Linq; using System.Text; using WX.Model.ApiResponses; namespace WX.Model.ApiRequests { public class MerchantShelfUpdatestatusRequest : ApiRequest { [JsonProperty("shelf_id")] public long ShelfID { get; set; } [JsonProperty("status")] public int Status { get; set; } internal override string Method { get { return POSTMETHOD; } } protected override string UrlFormat { get { return "https://api.weixin.qq.com/merchant/shelf/updatestatus?access_token={0}"; } } internal override string GetUrl() { return String.Format(UrlFormat, AccessToken); } protected override bool NeedToken { get { return true; } } public override string GetPostContent() { return JsonConvert.SerializeObject(this); } internal override void Validate() { base.Validate(); if (Status < 0 || Status > 1) { throw new ArgumentOutOfRangeException("只能为0:下架,1:上架"); } } } } ================================================ FILE: Business/Model/ApiRequests/MerchantStockAddRequest.cs ================================================ using Newtonsoft.Json; using System; using System.Collections.Generic; using System.Linq; using System.Text; using WX.Model.ApiResponses; namespace WX.Model.ApiRequests { public class MerchantStockAddRequest : ApiRequest { [JsonProperty("product_id")] public string ProductID { get; set; } [JsonProperty("sku_info")] /// /// sku 信息 ,格式 "id1:vid1;id2:vid2" ,如商品为统 如商品为统 一规格, 则此处赋值为空字符串即可 /// public string SkuInfo { get; set; } [JsonProperty("quantity")] public int Quantity { get; set; } internal override string Method { get { return POSTMETHOD; } } protected override string UrlFormat { get { return "https://api.weixin.qq.com/merchant/stock/add?access_token={0}"; } } internal override string GetUrl() { return String.Format(UrlFormat, AccessToken); } protected override bool NeedToken { get { return true; } } public override string GetPostContent() { return JsonConvert.SerializeObject(this); } } } ================================================ FILE: Business/Model/ApiRequests/MerchantStockReduceRequest.cs ================================================ using Newtonsoft.Json; using System; using System.Collections.Generic; using System.Linq; using System.Text; using WX.Model.ApiResponses; namespace WX.Model.ApiRequests { public class MerchantStockReduceRequest : ApiRequest { [JsonProperty("product_id")] public string ProductID { get; set; } [JsonProperty("sku_info")] public string SkuInfo { get; set; } [JsonProperty("quantity")] public int Quantity { get; set; } internal override string Method { get { return POSTMETHOD; } } protected override string UrlFormat { get { return "https://api.weixin.qq.com/merchant/stock/reduce?access_token={0}"; } } internal override string GetUrl() { return String.Format(UrlFormat, AccessToken); } protected override bool NeedToken { get { return true; } } public override string GetPostContent() { return JsonConvert.SerializeObject(this); } } } ================================================ FILE: Business/Model/ApiRequests/MerchantUpdateRequest.cs ================================================ using Newtonsoft.Json; using System; using System.Collections.Generic; using System.Linq; using System.Text; using WX.Model.ApiResponses; namespace WX.Model.ApiRequests { public class MerchantUpdateRequest : ApiRequest { public ProductInfo ProductInfo { get; set; } internal override string Method { get { return "POST"; } } protected override string UrlFormat { get { return "https://api.weixin.qq.com/merchant/update?access_token={0}"; } } internal override string GetUrl() { return String.Format(UrlFormat, AccessToken); } protected override bool NeedToken { get { return true; } } public override string GetPostContent() { return JsonConvert.SerializeObject(this.ProductInfo); } } } ================================================ FILE: Business/Model/ApiRequests/MessageCustomSendImageRequest.cs ================================================ using Newtonsoft.Json; using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace WX.Model.ApiRequests { public class MessageCustomSendImageRequest : MessageCustomSendRequest { [JsonProperty("image")] public ImageMessage Image { get; set; } public override string MsgType { get { return "image"; } } } } ================================================ FILE: Business/Model/ApiRequests/MessageCustomSendMusicRequest.cs ================================================ using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace WX.Model.ApiRequests { public class MessageCustomSendMusicRequest : MessageCustomSendRequest { public override string MsgType { get { return "music"; } } public MusicMessage Music { get; set; } } } ================================================ FILE: Business/Model/ApiRequests/MessageCustomSendNewsRequest.cs ================================================ using Newtonsoft.Json; using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace WX.Model.ApiRequests { public class MessageCustomSendNewsRequest : MessageCustomSendRequest { public override string MsgType { get { return "news"; } } [JsonProperty("news")] public NewsMessage News { get; set; } } } ================================================ FILE: Business/Model/ApiRequests/MessageCustomSendRequest.cs ================================================ using Newtonsoft.Json; using System; using System.Collections.Generic; using System.Linq; using System.Text; using WX.Model.ApiResponses; namespace WX.Model.ApiRequests { public abstract class MessageCustomSendRequest : ApiRequest { [JsonProperty("touser")] public string ToUser { get; set; } [JsonProperty("msgtype")] public abstract string MsgType { get; } internal override string Method { get { return "POST"; } } protected override string UrlFormat { get { return "https://api.weixin.qq.com/cgi-bin/message/custom/send?access_token={0}"; } } internal override string GetUrl() { return String.Format(UrlFormat, AccessToken); } protected override bool NeedToken { get { return true; } } public override string GetPostContent() { return JsonConvert.SerializeObject(this, Formatting.Indented); } } } ================================================ FILE: Business/Model/ApiRequests/MessageCustomSendTextRequest.cs ================================================ using Newtonsoft.Json; using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace WX.Model.ApiRequests { public class MessageCustomSendTextRequest : MessageCustomSendRequest { [JsonProperty("text")] public TextMessage Text { get; set; } public override string MsgType { get { return "text"; } } } } ================================================ FILE: Business/Model/ApiRequests/MessageCustomSendVideoRequest.cs ================================================ using Newtonsoft.Json; using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace WX.Model.ApiRequests { public class MessageCustomSendVideoRequest : MessageCustomSendRequest { public override string MsgType { get { return "video"; } } [JsonProperty("video")] public VideoMessage Video { get; set; } } } ================================================ FILE: Business/Model/ApiRequests/MessageCustomSendVoiceRequest.cs ================================================ using Newtonsoft.Json; using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace WX.Model.ApiRequests { public class MessageCustomSendVoiceRequest : MessageCustomSendRequest { public override string MsgType { get { return "voice"; } } [JsonProperty("voice")] public VoiceMessage Voice { get; set; } } } ================================================ FILE: Business/Model/ApiRequests/MessageMassDeleteRequest.cs ================================================ using Newtonsoft.Json; using System; using System.Collections.Generic; using System.Linq; using System.Text; using WX.Model.ApiResponses; namespace WX.Model.ApiRequests { public class MessageMassDeleteRequest : ApiRequest { [JsonProperty("msgid")] public int MsgId { get; set; } internal override string Method { get { return "POST"; } } protected override string UrlFormat { get { return "https://api.weixin.qq.com//cgi-bin/message/mass/delete?access_token={0}"; } } internal override string GetUrl() { return String.Format(UrlFormat, AccessToken); } protected override bool NeedToken { get { return true; } } public override string GetPostContent() { return JsonConvert.SerializeObject(this); } } } ================================================ FILE: Business/Model/ApiRequests/MessageMassSendAllRequest.cs ================================================ using Newtonsoft.Json; using System; using System.Collections.Generic; using System.Linq; using System.Text; using WX.Model.ApiResponses; namespace WX.Model.ApiRequests { public class SendFilter { [JsonProperty("group_id")] public string GroupId { get; set; } } public class SendMPNews { [JsonProperty("media_id")] public string MediaId { get; set; } } public class MessageMassSendAllRequest : ApiRequest { [JsonProperty("filter")] public SendFilter Filter { get; set; } [JsonProperty("mpnews")] public SendMPNews MPNews { get; set; } [JsonProperty("msgtype")] public string MsgType { get; set; } internal override string Method { get { return "POST"; } } protected override string UrlFormat { get { return "https://api.weixin.qq.com/cgi-bin/message/mass/sendall?access_token={0}"; } } internal override string GetUrl() { return String.Format(UrlFormat, AccessToken); } protected override bool NeedToken { get { return true; } } public override string GetPostContent() { return JsonConvert.SerializeObject(this); } } } ================================================ FILE: Business/Model/ApiRequests/MessageMassSendRequest.cs ================================================ using Newtonsoft.Json; using System; using System.Collections.Generic; using System.Linq; using System.Text; using WX.Model.ApiResponses; namespace WX.Model.ApiRequests { public class MessageMassSendRequest : ApiRequest { [JsonProperty("touser")] public string[] ToUsers { get; set; } [JsonProperty("mpnews")] public SendMPNews MpNews { get; set; } [JsonProperty("msgtype")] public string MsgType { get; set; } internal override string Method { get { return "POST"; } } protected override string UrlFormat { get { return "https://api.weixin.qq.com/cgi-bin/message/mass/send?access_token={0}"; } } internal override string GetUrl() { return String.Format(UrlFormat, AccessToken); } protected override bool NeedToken { get { return true; } } public override string GetPostContent() { return JsonConvert.SerializeObject(this); } } } ================================================ FILE: Business/Model/ApiRequests/QrcodeCreateRequest.cs ================================================ using Newtonsoft.Json; using Newtonsoft.Json.Converters; using System; using System.Collections.Generic; using System.Linq; using System.Text; using WX.Model.ApiResponses; namespace WX.Model.ApiRequests { public enum ActionName { NONE, QR_SCENE, QR_LIMIT_SCENE } public class ActionInfo { public Scene Scene { get; set; } } public class Scene { [JsonProperty("scene_id")] public int SceneId { get; set; } } public class QrcodeCreateRequest : ApiRequest { [JsonProperty("expire_seconds", DefaultValueHandling = DefaultValueHandling.Ignore)] public int ExpireSeconds { get; set; } [JsonProperty("action_name", DefaultValueHandling= DefaultValueHandling.Ignore)] [JsonConverter(typeof(StringEnumConverter))] public ActionName ActionName { get; set; } [JsonProperty("action_info")] public ActionInfo ActionInfo { get; set; } internal override string Method { get { return "POST"; } } protected override string UrlFormat { get { return "https://api.weixin.qq.com/cgi-bin/qrcode/create?access_token={0}"; } } internal override string GetUrl() { return String.Format(UrlFormat, AccessToken); } protected override bool NeedToken { get { return true; } } public override string GetPostContent() { return JsonConvert.SerializeObject(this); } internal override void Validate() { base.Validate(); if (this.ActionName == ApiRequests.ActionName.QR_SCENE) { if (this.ExpireSeconds <= 0 || this.ExpireSeconds > 1800) { throw new ArgumentException("临时二维码过期时间必须大于0小于1800秒"); } } if (this.ActionName == ApiRequests.ActionName.QR_LIMIT_SCENE) { this.ExpireSeconds = 0; } } } } ================================================ FILE: Business/Model/ApiRequests/ShorturlRequest.cs ================================================ using Newtonsoft.Json; using System; using System.Collections.Generic; using System.Linq; using System.Text; using WX.Model.ApiResponses; namespace WX.Model.ApiRequests { public enum ConvertType { Long2Short = 0, Short2Long = 1 } public class ShorturlRequest : ApiRequest { /// /// 此处填long2short,代表长链接转短链接 /// [JsonIgnore] public ConvertType Action { get; set; } /// /// 需要转换的长链接,支持http://、https://、weixin://wxpay 格式的url /// [JsonProperty("long_url")] public string Url { get; set; } [JsonProperty("action")] protected string CAction { get { return Action.ToString().ToLower(); } } internal override string Method { get { return POSTMETHOD; } } protected override string UrlFormat { get { return "https://api.weixin.qq.com/cgi-bin/shorturl?access_token={0}"; } } internal override string GetUrl() { return String.Format(UrlFormat, AccessToken); } protected override bool NeedToken { get { return true; } } public override string GetPostContent() { return JsonConvert.SerializeObject(this); } } } ================================================ FILE: Business/Model/ApiRequests/SnsOAuthAccessTokenRequest.cs ================================================ using System; using System.Collections.Generic; using System.Linq; using System.Text; using WX.Model.ApiResponses; namespace WX.Model.ApiRequests { public class SnsOAuthAccessTokenRequest : ApiRequest { public string AppID { get; set; } public string AppSecret { get; set; } public string Code { get; set; } internal override string Method { get { return "GET"; } } protected override string UrlFormat { get { return "https://api.weixin.qq.com/sns/oauth2/access_token?appid={0}&secret={1}&code={2}&grant_type=authorization_code"; } } internal override string GetUrl() { return String.Format(UrlFormat, AppID, AppSecret, Code); } protected override bool NeedToken { get { return false; } } public override string GetPostContent() { throw new NotImplementedException(); } } } ================================================ FILE: Business/Model/ApiRequests/SnsOauthRefreshTokenRequest.cs ================================================ using System; using System.Collections.Generic; using System.Linq; using System.Text; using WX.Model.ApiResponses; namespace WX.Model.ApiRequests { public class SnsOauthRefreshTokenRequest : ApiRequest { public string AppID { get; set; } public string RefreshToken { get; set; } internal override string Method { get { return "GET"; } } protected override string UrlFormat { get { return "https://api.weixin.qq.com/sns/oauth2/refresh_token?appid={0}&grant_type=refresh_token&refresh_token={1}"; } } internal override string GetUrl() { return String.Format(UrlFormat, AppID, RefreshToken); } protected override bool NeedToken { get { return false; } } public override string GetPostContent() { throw new NotImplementedException(); } } } ================================================ FILE: Business/Model/ApiRequests/SnsUserInfoRequest.cs ================================================ using System; using System.Collections.Generic; using System.Linq; using System.Text; using WX.Model.ApiResponses; namespace WX.Model.ApiRequests { public class SnsUserInfoRequest : ApiRequest { public string OAuthToken { get; set; } public string OpenId { get; set; } public Language Lang { get; set; } private string LangString { get; set; } internal override string Method { get { return "GET"; } } protected override string UrlFormat { get { return "https://api.weixin.qq.com/sns/userinfo?access_token={0}&openid={1}&lang={2}"; } } internal override string GetUrl() { return String.Format(UrlFormat, OAuthToken, OpenId, LangString); } protected override bool NeedToken { get { return false; } } public override string GetPostContent() { throw new NotImplementedException(); } internal override void Validate() { base.Validate(); if (String.IsNullOrEmpty(OAuthToken)) throw new ArgumentNullException("Need OAuth AccessToken"); if (String.IsNullOrEmpty(OpenId)) throw new ArgumentNullException("Need OpenID"); switch (Lang) { case Language.TW: LangString = "zh_TW"; break; case Language.EN: LangString = "en"; break; case Language.CN: default: LangString = "zh_CN"; break; } } } } ================================================ FILE: Business/Model/ApiRequests/TemplateApiaddtemplateRequest.cs ================================================ using Newtonsoft.Json; using System; using System.Collections.Generic; using System.Linq; using System.Text; using WX.Model.ApiResponses; namespace WX.Model.ApiRequests { /// /// 获取模板ID /// public class TemplateApiaddtemplateRequest : ApiRequest { /// /// 模板库中模板的编号,有“TM**”和“OPENTMTM**”等形式 /// [JsonProperty("template_id_short")] public string TemplateIdShort { get; set; } internal override string Method { get { return POSTMETHOD; } } protected override string UrlFormat { get { return "https://api.weixin.qq.com/cgi-bin/template/api_add_template?access_token={0}"; } } internal override string GetUrl() { return String.Format(UrlFormat, AccessToken); } protected override bool NeedToken { get { return true; } } public override string GetPostContent() { return JsonConvert.SerializeObject(this); } } } ================================================ FILE: Business/Model/ApiRequests/TemplateApisetindustryRequest.cs ================================================ using Newtonsoft.Json; using System; using System.Collections.Generic; using System.Linq; using System.Text; using WX.Model.ApiResponses; namespace WX.Model.ApiRequests { /// /// 设置行业可在MP中完成,每月可修改行业1次,账号仅可使用所属行业中相关的模板,为方便第三方开发者,提供通过接口调用的方式来修改账号所属行业,具体如下: /// public class TemplateApisetindustryRequest : ApiRequest { /// /// 主行业 /// [JsonIgnore] public TemplateIndustry Industry_id1 { get; set; } /// /// 副行业 /// [JsonIgnore] public TemplateIndustry Industry_id2 { get; set; } [JsonProperty("industry_id1")] protected string Id1 { get { return ((int)Industry_id1).ToString(); } } [JsonProperty("industry_id2")] protected string Id2 { get { return ((int)Industry_id2).ToString(); } } internal override string Method { get { return POSTMETHOD; } } protected override string UrlFormat { get { return "https://api.weixin.qq.com/cgi-bin/template/api_set_industry?access_token={0}"; } } internal override string GetUrl() { return String.Format(UrlFormat, AccessToken); } protected override bool NeedToken { get { return true; } } public override string GetPostContent() { return JsonConvert.SerializeObject(this); } } } ================================================ FILE: Business/Model/ApiRequests/TemplateSendRequest.cs ================================================ using Newtonsoft.Json; using System; using System.Collections.Generic; using System.Linq; using System.Text; using WX.Model.ApiResponses; namespace WX.Model.ApiRequests { /// /// 发送模板消息 /// public class TemplateSendRequest : ApiRequest { /// /// 用户的openid /// [JsonProperty("touser")] public string ToUser { get; set; } /// /// 模板ID /// [JsonProperty("template_id")] public string TemplateID { get; set; } [JsonProperty("url")] public string Url { get; set; } [JsonProperty("topcolor")] public string TopColor { get; set; } /// /// 模板内的数据内容 /// /// 举例:{{first.Data}}, Data.Add("first", new TemplateDataProperty{Value = "显示文本", Color="颜色"}); [JsonProperty("data")] public Dictionary Data { get; set; } internal override string Method { get { return POSTMETHOD; } } protected override string UrlFormat { get { return "https://api.weixin.qq.com/cgi-bin/message/template/send?access_token={0}"; } } internal override string GetUrl() { return String.Format(UrlFormat, AccessToken); } protected override bool NeedToken { get { return true; } } public override string GetPostContent() { return JsonConvert.SerializeObject(this); } internal override void Validate() { base.Validate(); if (String.IsNullOrEmpty(this.ToUser)) { throw new ArgumentNullException("touser is null"); } if (string.IsNullOrEmpty(this.Url)) { throw new ArgumentNullException("url is null"); } if (string.IsNullOrEmpty(this.TemplateID)) { throw new ArgumentNullException("templateid is null"); } } } } ================================================ FILE: Business/Model/ApiRequests/UserGetRequest.cs ================================================ using Newtonsoft.Json; using System; using System.Collections.Generic; using System.Linq; using System.Text; using WX.Model.ApiResponses; namespace WX.Model.ApiRequests { public class UserGetRequest : ApiRequest { [JsonProperty("next_openid")] public string NextOpenId { get; set; } internal override string Method { get { return "GET"; } } protected override string UrlFormat { get { return "https://api.weixin.qq.com/cgi-bin/user/get?access_token={0}&next_openid={1}"; } } internal override string GetUrl() { return String.Format(UrlFormat, AccessToken, NextOpenId); } protected override bool NeedToken { get { return true; } } public override string GetPostContent() { throw new NotImplementedException(); } } } ================================================ FILE: Business/Model/ApiRequests/UserInfoRequest.cs ================================================ using System; using System.Collections.Generic; using System.Linq; using System.Text; using WX.Model.ApiResponses; namespace WX.Model.ApiRequests { public class UserInfoRequest : ApiRequest { public string OpenId { get; set; } public string Lang { get; set; } internal override string Method { get { return "GET"; } } protected override string UrlFormat { get { return "https://api.weixin.qq.com/cgi-bin/user/info?access_token={0}&openid={1}&lang={2}"; } } internal override string GetUrl() { return String.Format(UrlFormat, AccessToken, OpenId, Lang); } protected override bool NeedToken { get { return true; } } public override string GetPostContent() { throw new NotImplementedException(); } } } ================================================ FILE: Business/Model/ApiRequests/UserInfoUpdateremarkRequest.cs ================================================ using Newtonsoft.Json; using System; using System.Collections.Generic; using System.Linq; using System.Text; using WX.Model.ApiResponses; namespace WX.Model.ApiRequests { /// /// 设置备注名 /// 开发者可以通过该接口对指定用户设置备注名,该接口暂时开放给微信认证的服务号。 /// public class UserInfoUpdateremarkRequest : ApiRequest { /// /// 用户标识 /// [JsonProperty("openid")] public string OpenId { get; set; } /// /// 新的备注名,长度必须小于30字符 /// [JsonProperty("remark")] public string Remark { get; set; } internal override string Method { get { return POSTMETHOD; } } protected override string UrlFormat { get { return "https://api.weixin.qq.com/cgi-bin/user/info/updateremark?access_token={0}"; } } internal override string GetUrl() { return String.Format(UrlFormat, AccessToken); } protected override bool NeedToken { get { return true; } } public override string GetPostContent() { return JsonConvert.SerializeObject(this); } } } ================================================ FILE: Business/Model/ApiResponses/AccessTokenCodeResponse.cs ================================================ using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace WX.Model.ApiResponses { public class AccessTokenCodeResponse : ApiResponse { public string Access_Token { get; set; } public int Expires_in { get; set; } public string Refresh_token { get; set; } public string OpenId { get; set; } public string Scope { get; set; } } } ================================================ FILE: Business/Model/ApiResponses/AccessTokenResponse.cs ================================================ using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace WX.Model.ApiResponses { public class AccessTokenResponse : ApiResponse { public string Access_Token { get; set; } public int Expires_In { get; set; } public override string ToString() { if (IsError) return base.ToString(); return String.Format("accesstoken:{0}, expires_in:{1}", Access_Token, Expires_In); } } } ================================================ FILE: Business/Model/ApiResponses/ApiResponse.cs ================================================ using Newtonsoft.Json; using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace WX.Model.ApiResponses { public abstract class ApiResponse { public bool IsError { get { return ErrorCode != 0; } } [JsonProperty("errcode")] public int ErrorCode { get; set; } [JsonProperty("errmsg")] public string ErrorMessage { get; set; } public override string ToString() { if (IsError) { return String.Format("errcode:{0}, errmsg:{1}", ErrorCode, ErrorMessage); } return base.ToString(); } } } ================================================ FILE: Business/Model/ApiResponses/CustomServiceGetRecordResponse.cs ================================================ using Newtonsoft.Json; using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace WX.Model.ApiResponses { public class CustomServiceGetRecordResponse : ApiResponse { [JsonProperty("recordlist")] public IEnumerable RecordList; } } ================================================ FILE: Business/Model/ApiResponses/CustomserviceGetkflistResponse.cs ================================================ using Newtonsoft.Json; using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace WX.Model.ApiResponses { public class CustomserviceGetkflistResponse : ApiResponse { [JsonProperty("kf_list")] public IEnumerable Accounts { get; set; } } } ================================================ FILE: Business/Model/ApiResponses/CustomserviceGetonlinekflistResponse.cs ================================================ using Newtonsoft.Json; using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace WX.Model.ApiResponses { public class CustomserviceGetonlinekflistResponse : ApiResponse { [JsonProperty("kf_online_list")] public IEnumerable Account { get; set; } } } ================================================ FILE: Business/Model/ApiResponses/CustomserviceKfsessionCloseResponse.cs ================================================ using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace WX.Model.ApiResponses { public class CustomserviceKfsessionCloseResponse : ApiResponse { } } ================================================ FILE: Business/Model/ApiResponses/CustomserviceKfsessionCreateResponse.cs ================================================ using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace WX.Model.ApiResponses { public class CustomserviceKfsessionCreateResponse : ApiResponse { } } ================================================ FILE: Business/Model/ApiResponses/CustomserviceKfsessionGetsessionResponse.cs ================================================ using Newtonsoft.Json; using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace WX.Model.ApiResponses { public class CustomserviceKfsessionGetsessionResponse : ApiResponse { /// /// 正在接待的客服,为空表示没有人在接待 /// [JsonProperty("kf_account")] public string KfAccount { get; set; } /// /// 会话接入的时间 /// [JsonProperty("createtime")] public long Createtime { get; set; } } } ================================================ FILE: Business/Model/ApiResponses/CustomserviceKfsessionGetsessionlistResponse.cs ================================================ using Newtonsoft.Json; using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace WX.Model.ApiResponses { public class CustomserviceKfsessionGetsessionlistResponse : ApiResponse { [JsonProperty("sessionlist")] public IEnumerable SessionList { get; set; } } } ================================================ FILE: Business/Model/ApiResponses/CustomserviceKfsessionGetwaitcaseResponse.cs ================================================ using Newtonsoft.Json; using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace WX.Model.ApiResponses { public class CustomserviceKfsessionGetwaitcaseResponse : ApiResponse { [JsonProperty("count")] public int Count { get; set; } [JsonProperty("waitcaselist")] public IEnumerable WaitCaseList { get; set; } } } ================================================ FILE: Business/Model/ApiResponses/DatacubeGetArticlesResponse.cs ================================================ using Newtonsoft.Json; using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace WX.Model.ApiResponses { /// /// 所有获取图文统计的Request均得到此Response /// 1、获取图文群发每日数据 getarticlesummary /// 2、获取图文群发总数据(getarticletotal) /// 3、获取图文统计数据(getuserread) /// 4、获取图文统计分时数据(getuserreadhour) /// 5、获取图文分享转发数据(getusershare) /// 6、获取图文分享转发分时数据(getusersharehour) /// public class DatacubeGetArticlesResponse : ApiResponse { /// /// 返回的图文统计数据列表 /// [JsonProperty("list")] public IEnumerable Stats { get; set; } } } ================================================ FILE: Business/Model/ApiResponses/DatacubeGetInterfaceResponse.cs ================================================ using Newtonsoft.Json; using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace WX.Model.ApiResponses { public class DatacubeGetInterfaceResponse : ApiResponse { [JsonProperty("list")] public IEnumerable List { get; set; } } } ================================================ FILE: Business/Model/ApiResponses/DatacubeGetStreamMsgResponse.cs ================================================ using Newtonsoft.Json; using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace WX.Model.ApiResponses { public class DatacubeGetStreamMsgResponse : ApiResponse { [JsonProperty("list")] public IEnumerable List { get; set; } } } ================================================ FILE: Business/Model/ApiResponses/DatacubeGetUserCumulateResponse.cs ================================================ using Newtonsoft.Json; using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace WX.Model.ApiResponses { public class DatacubeGetUserCumulateResponse : ApiResponse { [JsonProperty("list")] public IEnumerable List { get; set; } } } ================================================ FILE: Business/Model/ApiResponses/DatacubeGetUserSummaryResponse.cs ================================================ using Newtonsoft.Json; using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace WX.Model.ApiResponses { public class DatacubeGetUserSummaryResponse : ApiResponse { [JsonProperty("list")] public IEnumerable List { get; set; } } } ================================================ FILE: Business/Model/ApiResponses/DefaultResponse.cs ================================================ using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace WX.Model.ApiResponses { public sealed class DefaultResponse : ApiResponse { } } ================================================ FILE: Business/Model/ApiResponses/GetCurrentAutoreplyInfoResponse.cs ================================================ using Newtonsoft.Json; using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace WX.Model.ApiResponses { public class GetCurrentAutoreplyInfoResponse : ApiResponse { /// /// 关注后自动回复是否开启,0代表未开启,1代表开启 /// [JsonProperty("is_add_friend_reply_open")] public int IsAddFriendReplyOpen { get; set; } /// /// 消息自动回复是否开启,0代表未开启,1代表开启 /// [JsonProperty("is_autoreply_open")] public int IsAutoreplyOpen { get; set; } /// /// 关注后自动回复的信息 /// [JsonProperty("add_friend_autoreply_info")] public AutoReplyInfo AddFriendAutoreplyInfo { get; set; } /// /// 消息自动回复的信息 /// [JsonProperty("message_default_autoreply_info")] public AutoReplyInfo MessageDefaultAutoreplyInfo { get; set; } /// /// 关键词自动回复的信息 /// [JsonProperty("keyword_autoreply_info")] public KeywordAutoreplyInfo KeywordAutoreplyInfo { get; set; } } } ================================================ FILE: Business/Model/ApiResponses/GetCurrentSelfmenuInfoResponse.cs ================================================ using Newtonsoft.Json; using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace WX.Model.ApiResponses { public class GetCurrentSelfmenuInfoResponse : ApiResponse { /// /// 菜单是否开启,0代表未开启,1代表开启 /// [JsonProperty("is_menu_open")] public int IsMenuOpen { get; set; } /// /// 菜单信息 /// [JsonProperty("selfmenu_info")] public SelfMenuInfo SelfMenuInfo { get; set; } } } ================================================ FILE: Business/Model/ApiResponses/GetcallbackipResponse.cs ================================================ using Newtonsoft.Json; using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace WX.Model.ApiResponses { public class GetcallbackipResponse : ApiResponse { /// /// 微信服务器IP地址列表 /// [JsonProperty("ip_list")] public IEnumerable IPList { get; set; } } } ================================================ FILE: Business/Model/ApiResponses/GroupCreateResponse.cs ================================================ using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace WX.Model.ApiResponses { public class GroupCreateResponse : ApiResponse { public Group Group { get; set; } public override string ToString() { if (IsError) return base.ToString(); return String.Format("groupname:{0}, groupid:{1}", Group.Name, Group.ID); } } } ================================================ FILE: Business/Model/ApiResponses/GroupsGetIdResponse.cs ================================================ using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace WX.Model.ApiResponses { public class GroupsGetIdResponse : ApiResponse { public int GroupId { get; set; } public override string ToString() { if (IsError) return base.ToString(); return String.Format("groupId:{0}", GroupId); } } } ================================================ FILE: Business/Model/ApiResponses/GroupsMembersUpdateResponse.cs ================================================ using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace WX.Model.ApiResponses { public class GroupsMembersUpdateResponse : ApiResponse { } } ================================================ FILE: Business/Model/ApiResponses/GroupsQueryResponse.cs ================================================ using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace WX.Model.ApiResponses { public class GroupsQueryResponse : ApiResponse { public IEnumerable Groups { get; set; } } } ================================================ FILE: Business/Model/ApiResponses/GroupsUpdateResponse.cs ================================================ using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace WX.Model.ApiResponses { public class GroupsUpdateResponse : ApiResponse { public override string ToString() { if (IsError) return base.ToString(); return String.Format("success, msg:{0}", ErrorMessage); } } } ================================================ FILE: Business/Model/ApiResponses/MaterialAddNewsResponse.cs ================================================ using Newtonsoft.Json; using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace WX.Model.ApiResponses { /// /// 新增永久图文素材 Response /// public class MaterialAddNewsResponse : ApiResponse { [JsonProperty("media_id")] public string MediaId { get; set; } } } ================================================ FILE: Business/Model/ApiResponses/MediaGetResponse.cs ================================================ using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace WX.Model.ApiResponses { public class MediaGetResponse : ApiResponse { } } ================================================ FILE: Business/Model/ApiResponses/MediaUploadNewsResponse.cs ================================================ using Newtonsoft.Json; using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace WX.Model.ApiResponses { public class MediaUploadNewsResponse : ApiResponse { public string Type { get; set; } [JsonProperty("media_id")] public string MediaId { get; set; } [JsonProperty("created_at")] public long CreatedAt { get; set; } } } ================================================ FILE: Business/Model/ApiResponses/MediaUploadResponse.cs ================================================ using Newtonsoft.Json; using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace WX.Model.ApiResponses { public class MediaUploadResponse : ApiResponse { [JsonProperty("type")] public MediaType MediaType { get; set; } [JsonProperty("media_id")] public string MediaId { get; set; } [JsonProperty("created_at")] public long CreatedAt { get; set; } } } ================================================ FILE: Business/Model/ApiResponses/MenuCreateResponse.cs ================================================ using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace WX.Model.ApiResponses { public class MenuCreateResponse : ApiResponse { } } ================================================ FILE: Business/Model/ApiResponses/MenuDeleteResponse.cs ================================================ using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace WX.Model.ApiResponses { public class MenuDeleteResponse : ApiResponse { } } ================================================ FILE: Business/Model/ApiResponses/MenuGetResponse.cs ================================================ using Newtonsoft.Json; using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace WX.Model.ApiResponses { public class MenuGetResponse : ApiResponse { public Menu Menu { get; set; } } public class Menu { [JsonProperty("button")] public IEnumerable Buttons { get; set; } } } ================================================ FILE: Business/Model/ApiResponses/MerchantCategoryGetpropertyResponse.cs ================================================ using Newtonsoft.Json; using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace WX.Model.ApiResponses { public class MerchantCategoryGetpropertyResponse : ApiResponse { [JsonProperty("properties")] public IEnumerable Properties { get; set; } } } ================================================ FILE: Business/Model/ApiResponses/MerchantCategoryGetskuResponse.cs ================================================ using Newtonsoft.Json; using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace WX.Model.ApiResponses { public class MerchantCategoryGetskuResponse : ApiResponse { [JsonProperty("sku_table")] public IEnumerable SkuTables { get; set; } } } ================================================ FILE: Business/Model/ApiResponses/MerchantCategoryGetsubResponse.cs ================================================ using Newtonsoft.Json; using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace WX.Model.ApiResponses { public class MerchantCategoryGetsubResponse : ApiResponse { [JsonProperty("cate_list")] public IEnumerable CateList { get; set; } } } ================================================ FILE: Business/Model/ApiResponses/MerchantCommonUploadimgResponse.cs ================================================ using Newtonsoft.Json; using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace WX.Model.ApiResponses { public class MerchantCommonUploadimgResponse : ApiResponse { [JsonProperty("image_url")] public string ImageUrl { get; set; } } } ================================================ FILE: Business/Model/ApiResponses/MerchantCreateResponse.cs ================================================ using Newtonsoft.Json; using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace WX.Model.ApiResponses { public class MerchantCreateResponse : ApiResponse { [JsonProperty("product_id")] public string ProductID { get; set; } } } ================================================ FILE: Business/Model/ApiResponses/MerchantExpressAddResponse.cs ================================================ using Newtonsoft.Json; using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace WX.Model.ApiResponses { /// /// 添加运费模板 /// public class MerchantExpressAddResponse : ApiResponse { [JsonProperty("template_id")] public int TemplateID { get; set; } } } ================================================ FILE: Business/Model/ApiResponses/MerchantExpressGetallResponse.cs ================================================ using Newtonsoft.Json; using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace WX.Model.ApiResponses { public class MerchantExpressGetallResponse : ApiResponse { [JsonProperty("templates_info")] public IEnumerable Templates { get; set; } } } ================================================ FILE: Business/Model/ApiResponses/MerchantExpressGetbyidResponse.cs ================================================ using Newtonsoft.Json; using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace WX.Model.ApiResponses { public class MerchantExpressGetbyidResponse : ApiResponse { [JsonProperty("template_info")] public DeliveryTemplate TemplateInfo { get; set; } } } ================================================ FILE: Business/Model/ApiResponses/MerchantGetResponse.cs ================================================ using Newtonsoft.Json; using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace WX.Model.ApiResponses { public class MerchantGetResponse : ApiResponse { [JsonProperty("product_info")] public ProductInfo ProductInfo { get; set; } } } ================================================ FILE: Business/Model/ApiResponses/MerchantGetbystatusResponse.cs ================================================ using Newtonsoft.Json; using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace WX.Model.ApiResponses { public class MerchantGetbystatusResponse : ApiResponse { [JsonProperty("products_info")] public IEnumerable ProductInfos { get; set; } } } ================================================ FILE: Business/Model/ApiResponses/MerchantGroupAddResponse.cs ================================================ using Newtonsoft.Json; using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace WX.Model.ApiResponses { public class MerchantGroupAddResponse : ApiResponse { [JsonProperty("group_id")] public long GroupID { get; set; } } } ================================================ FILE: Business/Model/ApiResponses/MerchantGroupGetallResponse.cs ================================================ using Newtonsoft.Json; using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace WX.Model.ApiResponses { public class MerchantGroupGetallResponse : ApiResponse { [JsonProperty("groups_detail")] public IEnumerable GroupsDetail { get; set; } } } ================================================ FILE: Business/Model/ApiResponses/MerchantGroupGetbyidResponse.cs ================================================ using Newtonsoft.Json; using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace WX.Model.ApiResponses { public class MerchantGroupGetbyidResponse : ApiResponse { [JsonProperty("group_detail")] public MerchantGroupDetail GroupDetail { get; set; } } } ================================================ FILE: Business/Model/ApiResponses/MerchantOrderGetbyfilterResponse.cs ================================================ using Newtonsoft.Json; using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace WX.Model.ApiResponses { public class MerchantOrderGetbyfilterResponse : ApiResponse { [JsonProperty("order_list")] public IEnumerable OrderList { get; set; } } } ================================================ FILE: Business/Model/ApiResponses/MerchantOrderGetbyidResponse.cs ================================================ using Newtonsoft.Json; using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace WX.Model.ApiResponses { public class MerchantOrderGetbyidResponse : ApiResponse { [JsonProperty("order")] public OrderInfo Order { get; set; } } } ================================================ FILE: Business/Model/ApiResponses/MerchantShelfAddResponse.cs ================================================ using Newtonsoft.Json; using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace WX.Model.ApiResponses { public class MerchantShelfAddResponse : ApiResponse { [JsonProperty("shelf_id")] public long ShelfID { get; set; } } } ================================================ FILE: Business/Model/ApiResponses/MerchantShelfGetallResponse.cs ================================================ using Newtonsoft.Json; using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace WX.Model.ApiResponses { public class MerchantShelfGetallResponse : ApiResponse { [JsonProperty("shelves")] public IEnumerable Shelves { get; set; } } } ================================================ FILE: Business/Model/ApiResponses/MerchantShelfGetbyidResponse.cs ================================================ using Newtonsoft.Json; using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace WX.Model.ApiResponses { public class MerchantShelfGetbyidResponse : ApiResponse { [JsonProperty("shelf_name", NullValueHandling = NullValueHandling.Ignore, DefaultValueHandling = DefaultValueHandling.Ignore)] public string Name { get; set; } [JsonProperty("shelf_id", NullValueHandling = NullValueHandling.Ignore, DefaultValueHandling = DefaultValueHandling.Ignore)] public long ShelfID { get; set; } [JsonProperty("shelf_banner", NullValueHandling = NullValueHandling.Ignore, DefaultValueHandling = DefaultValueHandling.Ignore)] public string Banner { get; set; } [JsonProperty("shelf_info", NullValueHandling = NullValueHandling.Ignore, DefaultValueHandling = DefaultValueHandling.Ignore)] public ShelfModulesInfo ShelfInfo { get; set; } } } ================================================ FILE: Business/Model/ApiResponses/MerchantShelfUpdatestatusResponse.cs ================================================ using Newtonsoft.Json; using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace WX.Model.ApiResponses { public class MerchantShelfUpdatestatusResponse : ApiResponse { [JsonProperty("shelf_url")] public string ShelfUrl { get; set; } } } ================================================ FILE: Business/Model/ApiResponses/MessageCustomSendResponse.cs ================================================ using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace WX.Model.ApiResponses { public class MessageCustomSendResponse : ApiResponse { } } ================================================ FILE: Business/Model/ApiResponses/MessageMassDeleteResponse.cs ================================================ using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace WX.Model.ApiResponses { public class MessageMassDeleteResponse : ApiResponse { } } ================================================ FILE: Business/Model/ApiResponses/MessageMassSendAllResponse.cs ================================================ using Newtonsoft.Json; using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace WX.Model.ApiResponses { public class MessageMassSendAllResponse : ApiResponse { [JsonProperty("msg_id")] public int MsgId { get; set; } } } ================================================ FILE: Business/Model/ApiResponses/MessageMassSendResponse.cs ================================================ using Newtonsoft.Json; using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace WX.Model.ApiResponses { public class MessageMassSendResponse : ApiResponse { [JsonProperty("msg_id")] public int MsgId { get; set; } } } ================================================ FILE: Business/Model/ApiResponses/QrcodeCreateResponse.cs ================================================ using Newtonsoft.Json; using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace WX.Model.ApiResponses { public class QrcodeCreateResponse : ApiResponse { public string Ticket { get; set; } [JsonProperty("expire_seconds")] public int ExpireSeconds { get; set; } } } ================================================ FILE: Business/Model/ApiResponses/ShorturlResponse.cs ================================================ using Newtonsoft.Json; using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace WX.Model.ApiResponses { public class ShorturlResponse : ApiResponse { [JsonProperty("short_url")] public string ShortUrl { get; set; } } } ================================================ FILE: Business/Model/ApiResponses/SnsOAuthAccessTokenResponse.cs ================================================ using Newtonsoft.Json; using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace WX.Model.ApiResponses { public class SnsOAuthAccessTokenResponse : ApiResponse { [JsonProperty("access_token")] public string AccessToken { get; set; } [JsonProperty("expires_in")] public int ExpiresIn { get; set; } [JsonProperty("refresh_token")] public string RefreshToken { get; set; } [JsonProperty("openid")] public string OpenId { get; set; } [JsonProperty("scope")] public string Scope { get; set; } } } ================================================ FILE: Business/Model/ApiResponses/SnsUserInfoResponse.cs ================================================ using Newtonsoft.Json; using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace WX.Model.ApiResponses { public class SnsUserInfoResponse : ApiResponse { public string OpenId { get; set; } public string NickName { get; set; } public string Sex { get; set; } public string Province { get; set; } public string City { get; set; } public string Country { get; set; } [JsonProperty("headimgurl")] public string HeadImageUrl { get; set; } [JsonProperty("privilege")] public IEnumerable Privilege { get; set; } } } ================================================ FILE: Business/Model/ApiResponses/TemplateApiaddtemplateResponse.cs ================================================ using Newtonsoft.Json; using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace WX.Model.ApiResponses { public class TemplateApiaddtemplateResponse : ApiResponse { /// /// 模板ID /// [JsonProperty("template_id")] public string TemplateID { get; set; } } } ================================================ FILE: Business/Model/ApiResponses/TemplateSendResponse.cs ================================================ using Newtonsoft.Json; using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace WX.Model.ApiResponses { public class TemplateSendResponse : ApiResponse { /// /// 消息ID /// [JsonProperty("msgid")] public long MsgID { get; set; } } } ================================================ FILE: Business/Model/ApiResponses/UserGetResponse.cs ================================================ using Newtonsoft.Json; using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace WX.Model.ApiResponses { public class UserGetResponse : ApiResponse { public int Total { get; set; } public int Count { get; set; } public UserGetData Data { get; set; } [JsonProperty("next_openid")] public string NextOpenId { get; set; } } public class UserGetData { [JsonProperty("openid")] public string[] OpenIds { get; set; } } } ================================================ FILE: Business/Model/ApiResponses/UserInfoResponse.cs ================================================ using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace WX.Model.ApiResponses { public class UserInfoResponse : ApiResponse { public bool Subscribe { get; set; } public string OpenId { get; set; } public string Nickname { get; set; } public int Sex { get; set; } public string City { get; set; } public string Country { get; set; } public string Province { get; set; } public string Language { get; set; } public string Headimgurl { get; set; } public int Subscribe_time { get; set; } public string UnionID { get; set; } } } ================================================ FILE: Business/Model/AppIdentication.cs ================================================ using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace WX.Model { public class AppIdentication { public AppIdentication(string appId, string appSecret) { this.AppID = appId; this.AppSecret = appSecret; } public string AppID { get; set; } public string AppSecret { get; set; } } } ================================================ FILE: Business/Model/ClickButton.cs ================================================ using Newtonsoft.Json; using Newtonsoft.Json.Converters; using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace WX.Model { public enum ClickButtonType { None, click, view, scancode_waitmsg, //扫码推事件 scancode_push, //扫码推事件且弹出“消息接收中”提示框 pic_sysphoto, //弹出系统拍照发图 pic_photo_or_album, //弹出拍照或者相册发图 pic_weixin, // 弹出微信相册发图器 location_select //弹出地理位置选择器 } public class ClickButton { [JsonProperty("type", DefaultValueHandling = DefaultValueHandling.Ignore)] [JsonConverter(typeof(StringEnumConverter))] public ClickButtonType Type { get; set; } [JsonProperty("name")] public string Name { get; set; } [JsonProperty("key", NullValueHandling = NullValueHandling.Ignore)] public string Key { get; set; } [JsonProperty("url", NullValueHandling = NullValueHandling.Ignore)] public string Url { get; set; } [JsonProperty("sub_button", NullValueHandling = NullValueHandling.Ignore)] public IEnumerable SubButton { get; set; } [JsonProperty("news_info", NullValueHandling = NullValueHandling.Ignore)] public NewsInfo NewsInfo { get; set; } } } ================================================ FILE: Business/Model/Exceptions/WXApiException.cs ================================================ using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace WX.Model.Exceptions { public class WXApiException : Exception { public WXApiException(int code, string content) { Code = code; Content = content; } public int Code { get; set; } public string Content { get; set; } } } ================================================ FILE: Business/Model/Group.cs ================================================ using Newtonsoft.Json; using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace WX.Model { public class Group { [JsonProperty("id", DefaultValueHandling = DefaultValueHandling.Ignore)] public int ID { get; set; } [JsonProperty("name", DefaultValueHandling = DefaultValueHandling.Ignore)] public string Name { get; set; } [JsonProperty("count", DefaultValueHandling = DefaultValueHandling.Ignore)] public int Count { get; set; } } } ================================================ FILE: Business/Model/MerchantInfoModel.cs ================================================ using Newtonsoft.Json; using System; using System.Collections.Generic; using System.Linq; using System.Text; using WX.Common; namespace WX.Model { public sealed class ProductInfo { [JsonProperty("product_id", NullValueHandling = NullValueHandling.Ignore)] public string ProductID { get; set; } /// /// 商品基本属性 /// [JsonProperty("product_base", NullValueHandling = NullValueHandling.Ignore)] public Product ProductBase { get; set; } /// /// sku信息列表 /// [JsonProperty("sku_list", NullValueHandling = NullValueHandling.Ignore)] public IEnumerable SkuList { get; set; } /// /// 商品其他属性 /// [JsonProperty("attrext", NullValueHandling = NullValueHandling.Ignore)] public Attrext Attrext { get; set; } /// /// 运费信息 /// [JsonProperty("delivery_info", NullValueHandling = NullValueHandling.Ignore)] public Delivery DeliveryInfo { get; set; } /// /// 修改操作 0:删除 1:增加 /// [JsonProperty("mod_action", NullValueHandling = NullValueHandling.Ignore, DefaultValueHandling = DefaultValueHandling.Ignore)] public byte ModAction { get; set; } } public class Product { /// /// 商品分类ID,通过获取【指定分类所有子分类】获取 /// [JsonProperty("category_id")] public string[] Categories { get; set; } /// /// 商品属性列表 /// [JsonProperty("property")] public IEnumerable Properties { get; set; } /// /// 商品名称 /// [JsonProperty("name")] public string Name { get; set; } /// /// 商品SKU定义 /// [JsonProperty("sku_info")] public IEnumerable SkuInfos { get; set; } /// /// 商品原价 /// [JsonProperty("ori_price")] public float OriPrice { get; set; } /// /// 商品主图 /// [JsonProperty("main_img")] public string MainImage { get; set; } /// /// 商品图片列表 /// [JsonProperty("img")] public string[] Images { get; set; } /// /// 商品详情列表 /// [JsonProperty("detail")] public IEnumerable Detail { get; set; } /// /// 用户限购数量 /// [JsonProperty("buy_limit")] public int BuyLimit { get; set; } } public sealed class Delivery { [JsonProperty("delivery_type")] public int DeliveryType { get; set; } [JsonProperty("template_id")] public int TemplateID { get; set; } [JsonProperty("express", NullValueHandling = NullValueHandling.Ignore)] public IEnumerable Expresses { get; set; } } public sealed class Express { [JsonProperty("id")] public int ID { get; set; } [JsonProperty("price")] public float Price { get; set; } } public sealed class Attrext { /// /// 是否包邮 /// [JsonIgnore] public bool IsPostFree { get; set; } [JsonProperty("isPostFree")] internal int IntIsPostFree { get { return IsPostFree ? 1 : 0; } set { IsPostFree = value == 1; } } /// /// 是否提供发票 /// [JsonIgnore] public bool IsHasReceipt { get; set; } [JsonProperty("isHasReceipt")] internal int IntIsHasReceipt { get { return IsHasReceipt ? 1 : 0; } set { IsHasReceipt = value == 1; } } /// /// 是否保修 /// [JsonIgnore] public bool IsUnderGuaranty { get; set; } [JsonProperty("isUnderGuaranty")] internal int IntIsUnderGuaranty { get { return IsUnderGuaranty ? 1 : 0; } set { IsUnderGuaranty = value == 1; } } /// /// 是否支持退换货 /// [JsonIgnore] public bool IsSupportReplace { get; set; } [JsonProperty("isSupportReplace")] internal int IntIsSupportReplace { get { return IsSupportReplace ? 1 : 0; } set { IsSupportReplace = value == 1; } } /// /// 商品所在地地址 /// [JsonProperty("location")] public Location Location { get; set; } } public sealed class Location { [JsonProperty("country")] public string Country { get; set; } [JsonProperty("province")] public string Province { get; set; } [JsonProperty("city")] public string City { get; set; } [JsonProperty("address")] public string Address { get; set; } } public sealed class Sku { /// /// skuid 格式为:id1:vid1;id2:vid2 /// [JsonProperty("sku_id")] public string SkuID { get; set; } /// /// sku微信价 /// [JsonProperty("price")] public float Price { get; set; } /// /// sku 图片地址 /// [JsonProperty("icon_url")] public string IconUrl { get; set; } /// /// 商家商品编码 /// [JsonProperty("product_code")] public string ProductCode { get; set; } /// /// sku原价格 /// [JsonProperty("ori_price")] public float OriPrice { get; set; } /// /// 库存 /// [JsonProperty("quantity")] public int Quantity { get; set; } } public sealed class ProductDetail { [JsonProperty("text", NullValueHandling = NullValueHandling.Ignore)] public string Text { get; set; } [JsonProperty("img", NullValueHandling = NullValueHandling.Ignore)] public string Image { get; set; } } public sealed class SkuInfo { [JsonProperty("id")] public string ID { get; set; } [JsonProperty("vid")] public string[] VID { get; set; } } public sealed class ProductProperty { [JsonProperty("id")] public string ID { get; set; } [JsonProperty("vid")] public string VID { get; set; } } public class Cate { [JsonProperty("id")] /// /// 分类ID /// public string Id { get; set; } [JsonProperty("name")] /// /// 分类名 /// public string Name { get; set; } } public sealed class SkuTable { [JsonProperty("id")] public string SkuTableID { get; set; } [JsonProperty("name")] public string Name { get; set; } [JsonProperty("value_list")] public IEnumerable ValueList { get; set; } } public sealed class SkuValue : Cate { } public sealed class Property { [JsonProperty("id")] public string PropertyID { get; set; } [JsonProperty("name")] public string Name { get; set; } [JsonProperty("property_value")] public IEnumerable PropertyValues { get; set; } } public sealed class PropertyValue : Cate { } public sealed class DeliveryTemplate { [JsonProperty("id", NullValueHandling = NullValueHandling.Ignore, DefaultValueHandling = DefaultValueHandling.Ignore)] public long ID { get; set; } /// /// 模板名称 /// public string Name { get; set; } /// /// 支付方式 0:买家承担运费 1:卖家承担运费 /// public int Assumer { get; set; } /// /// 计费单位 0:按件计费 1:按重量计费 2:按体积计费(目前只支持0) /// public int Valuation { get; set; } [JsonProperty("TopFee")] public IEnumerable TopFees { get; set; } } public class TopFee { /// /// 快递类型ID 参见快递列表 /// [JsonProperty("Type")] public int FeeType { get; set; } /// /// 默认邮费计费方式 /// public NormalFee Normal { get; set; } /// /// 指定地区邮费计费方式 /// [JsonProperty("Custom")] public IEnumerable Customs { get; set; } } public class CustomFee : NormalFee { /// /// 指定国家 /// public string DestCountry { get; set; } /// /// 指定省份 /// public string DestProvince { get; set; } /// /// 指定地区 /// public string DestCity { get; set; } } public class NormalFee { /// /// 起始计费数量 /// public int StartStandards { get; set; } /// /// 起始计费金额(单位:分) /// public int StartFees { get; set; } /// /// 递增计费数量 /// public int AddStandards { get; set; } /// /// 递增计费金额 (单位:分) /// public int AddFees { get; set; } } public class MerchantGroupDetail { [JsonProperty("group_id", NullValueHandling = NullValueHandling.Ignore, DefaultValueHandling = DefaultValueHandling.Ignore)] public long GroupId { get; set; } [JsonProperty("group_name", NullValueHandling = NullValueHandling.Ignore, DefaultValueHandling = DefaultValueHandling.Ignore)] public string Name { get; set; } [JsonProperty("product", NullValueHandling = NullValueHandling.Ignore)] public IEnumerable Product { get; set; } [JsonProperty("product_list", NullValueHandling = NullValueHandling.Ignore)] public string[] ProductList { get; set; } } [JsonConverter(typeof(ShelfModuleConverter))] public abstract class ShelfModule { [JsonProperty("eid")] public abstract int EID { get; } } internal class ShelfModuleFactory { [JsonProperty("eid")] public int EID { get; set; } [JsonProperty("group_info")] public ShelfGroupInfo GroupInfo { get; set; } [JsonProperty("group_infos")] public ShelfGroupInfos GroupInfos { get; set; } internal ShelfModule BuildModule() { ShelfModule module = null; switch (EID) { case 1: module = new ShelfModuleOne() { GroupInfo = GroupInfo }; break; case 2: module = new ShelfModuleTwo() { GroupInfos = GroupInfos }; break; case 3: module = new ShelfModuleThree() { GroupInfo = GroupInfo }; break; case 4: module = new ShelfModuleFour() { GroupInfos = GroupInfos }; break; case 5: module = new ShelfModuleFive { GroupInfos = GroupInfos }; break; } if (module == null) throw new ArgumentException(); return module; } } /// /// 控件1 /// public class ShelfModuleOne : ShelfModule { public ShelfModuleOne() { } public ShelfModuleOne(long groupId, int count) { GroupInfo = new ShelfGroupInfo() { Count = count, GroupID = groupId }; } [JsonProperty("eid")] public override int EID { get { return 1; } } [JsonProperty("group_info")] public ShelfGroupInfo GroupInfo { get; set; } } /// /// 控件2 /// public class ShelfModuleTwo : ShelfModule { public ShelfModuleTwo() { } public ShelfModuleTwo(long[] groupIds) { GroupInfos = new ShelfGroupInfos(4); GroupInfos.Groups = groupIds.Select(g => new ShelfGroupInfo() { GroupID = g }); } [JsonProperty("eid")] public override int EID { get { return 2; } } [JsonProperty("group_infos")] public ShelfGroupInfos GroupInfos { get; set; } } /// /// 控件3 /// public class ShelfModuleThree : ShelfModule { public ShelfModuleThree() { } public ShelfModuleThree(long groupId, string img) { GroupInfo = new ShelfGroupInfo { GroupID = groupId, Img = img }; } [JsonProperty("eid")] public override int EID { get { return 3; } } [JsonProperty("group_info")] public ShelfGroupInfo GroupInfo { get; set; } } /// /// 控件4 /// public class ShelfModuleFour : ShelfModule { public ShelfModuleFour() { } public ShelfModuleFour(IEnumerable groupInfos) { var groups = groupInfos.Take(3) .Select(g => new ShelfGroupInfo() { GroupID = g.GroupID, Img = g.Img }); GroupInfos = new ShelfGroupInfos(3) { Groups = groups }; } [JsonProperty("eid")] public override int EID { get { return 4; } } [JsonProperty("group_infos")] public ShelfGroupInfos GroupInfos { get; set; } } /// /// 控件5 /// public class ShelfModuleFive : ShelfModule { public ShelfModuleFive() { } public ShelfModuleFive(long[] groupId, string imgbackupground) { GroupInfos = new ShelfGroupInfos(10) { Groups = groupId.Take(10) .Select(s => new ShelfGroupInfo { GroupID = s }), ImgBackground = imgbackupground }; } [JsonProperty("group_infos")] public ShelfGroupInfos GroupInfos { get; set; } [JsonProperty("eid", Order=5)] public override int EID { get { return 5; } } } public class ShelfGroupInfos { public ShelfGroupInfos(int size) { Groups = new ShelfGroupInfo[size]; } [JsonProperty("groups")] public IEnumerable Groups { get; set; } [JsonProperty("img_background", NullValueHandling = NullValueHandling.Ignore)] public string ImgBackground { get; set; } } public class ShelfGroupInfo { [JsonConstructor] public ShelfGroupInfo() { } [JsonProperty("group_id", DefaultValueHandling = DefaultValueHandling.Ignore)] public long GroupID { get; set; } [JsonIgnore] public int Count { get { return Filter.Count; } set { if (Filter == null) { Filter = new GroupFilter(value); } } } [JsonProperty("filter", NullValueHandling = NullValueHandling.Ignore)] internal GroupFilter Filter { get; set; } internal class GroupFilter { [JsonConstructor] internal GroupFilter() { } internal GroupFilter(int count) { Count = count; } [JsonProperty("count")] public int Count { get; set; } } [JsonProperty("img", NullValueHandling = NullValueHandling.Ignore, DefaultValueHandling = DefaultValueHandling.Ignore)] public string Img { get; set; } } public class ShelfModulesInfo { public ShelfModulesInfo() { } public ShelfModulesInfo(IEnumerable modules) { Modules = modules; } [JsonProperty("module_infos")] public IEnumerable Modules { get; set; } } public class ShelfInfo { [JsonProperty("shelf_name", NullValueHandling = NullValueHandling.Ignore, DefaultValueHandling = DefaultValueHandling.Ignore)] public string Name { get; set; } [JsonProperty("shelf_id", NullValueHandling = NullValueHandling.Ignore, DefaultValueHandling = DefaultValueHandling.Ignore)] public long ShelfID { get; set; } [JsonProperty("shelf_banner", NullValueHandling = NullValueHandling.Ignore, DefaultValueHandling = DefaultValueHandling.Ignore)] public string Banner { get; set; } [JsonProperty("shelf_info", NullValueHandling = NullValueHandling.Ignore, DefaultValueHandling = DefaultValueHandling.Ignore)] public ShelfModulesInfo ShelfInfos { get; set; } } } ================================================ FILE: Business/Model/MiddleMessage.cs ================================================ using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Xml.Linq; namespace WX.Model { public sealed class MiddleMessage { public MiddleMessage(XElement element) { if (element == null) throw new ArgumentNullException("element is null"); Element = element; RequestMessage = GetRequestMessageByElement(element); } private RequestMessage GetRequestMessageByElement(XElement element) { MsgType msgType = (MsgType)Enum.Parse(typeof(MsgType), element.Element("MsgType").Value, true); switch (msgType) { case MsgType.Text: return new RequestTextMessage(element); case MsgType.Video : return new RequestVideoMessage(element); case MsgType.Voice: return new RequestVoiceMessage(element); case MsgType.Image: return new RequestImageMessage(element); case MsgType.Link: return new RequestLinkMessage(element); case MsgType.Location: return new RequestLocationMessage(element); case MsgType.Event: return GetEventRequestMessage(element); } throw new ArgumentException("msgType is error"); } private RequestMessage GetEventRequestMessage(XElement element) { var eventType = (Event)Enum.Parse(typeof(Event), element.Element("Event").Value, true); switch (eventType) { case Event.Unsubscribe: return new RequestEventMessage(element); case Event.Location: return new RequestLocationEventMessage(element); case Event.Click: return new RequestClickEventMessage(element); case Event.Scan: return new RequestQREventMessage(element); case Event.Subscribe: return GetSubscribeRequestMessageForQR(element); case Event.View: return new RequestViewEventMessage(element); } throw new ArgumentException("event type is error"); } private RequestMessage GetSubscribeRequestMessageForQR(XElement element) { if (element.Element("Ticket") != null) { return new RequestQREventMessage(element); } return new RequestEventMessage(element); } public ResponseMessage ResponseMeesage { get; private set; } public RequestMessage RequestMessage { get; private set; } public XElement Element { get; private set; } } } ================================================ FILE: Business/Model/OrderInfoModel.cs ================================================ using Newtonsoft.Json; using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace WX.Model { public class OrderInfo { [JsonProperty("order_id")] public string OrderID { get; set; } [JsonProperty("order_status")] public int Status { get; set; } [JsonProperty("order_total_price")] public float TotalPrice { get; set; } [JsonProperty("order_express_price")] public float ExpressPrice { get; set; } [JsonProperty("order_create_time")] public long CreateTime { get; set; } [JsonProperty("buyer_openid")] public string BuyerOpenId { get; set; } [JsonProperty("buyer_nick")] public string BuyerNick { get; set; } [JsonProperty("receiver_name")] public string ReceiverName { get; set; } [JsonProperty("receiver_province")] public string ReceiverProvince { get; set; } [JsonProperty("receiver_city")] public string ReceiverCity { get; set; } [JsonProperty("receiver_address")] public string ReceiverAddress { get; set; } [JsonProperty("receiver_mobile")] public string ReceiverMobile { get; set; } [JsonProperty("receiver_phone")] public string ReceiverPhone { get; set; } [JsonProperty("product_id")] public string ProductID { get; set; } [JsonProperty("product_name")] public string ProductName { get; set; } [JsonProperty("product_price")] public float ProductPrice { get; set; } [JsonProperty("product_sku")] public string ProductSku { get; set; } [JsonProperty("product_count")] public int ProductCount { get; set; } [JsonProperty("product_img")] public string ProductImg { get; set; } [JsonProperty("delivery_id")] public string DeliveryID { get; set; } [JsonProperty("delivery_company")] public string DeliveryCompany { get; set; } [JsonProperty("trans_id")] public string TransID { get; set; } } public enum OrderStatus { All = 0, WaitSend = 2, Delivered = 3, Finish = 5, AfterService = 8 } public class DeliveryCompany { public const string EMS = "Fsearch_code"; public const string STO = "002shentong"; public const string ZTO = "066zhongtong"; public const string YTO = "056yuantong"; public const string TIANTIAN = "042tiantian"; public const string YUNDA = "059Yunda"; public const string SHUNFENG = "003shunfeng"; public const string ZHAIJISONG = "064zhaijisong"; public const string HUITONG = "020huitong"; public const string YIXUN = "zj001yixun"; } } ================================================ FILE: Business/Model/PublicMessage.cs ================================================ using Newtonsoft.Json; using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Xml; using System.Xml.Serialization; namespace WX.Model { public class TextMessage { [JsonProperty("content")] public string Content { get; set; } } public class ImageMessage { [JsonProperty("media_id")] public string MediaId { get; set; } } public class MusicMessage { [JsonProperty("title", DefaultValueHandling = DefaultValueHandling.Ignore, NullValueHandling = NullValueHandling.Ignore)] public string Title { get; set; } [JsonProperty("description", DefaultValueHandling = DefaultValueHandling.Ignore, NullValueHandling = NullValueHandling.Ignore)] public string Description { get; set; } /// /// 感谢C#-古道-广州发现的bug /// [JsonProperty("musicurl")] public string MusicUrl { get; set; } [JsonProperty("hqmusicurl")] public string HQMusicUrl { get; set; } [JsonProperty("thumb_media_id")] public string ThumbMediaId { get; set; } } public class VideoMessage { [JsonProperty("media_id")] public string MediaId { get; set; } [JsonProperty("title", DefaultValueHandling = DefaultValueHandling.Ignore, NullValueHandling = NullValueHandling.Ignore)] public string Title { get; set; } [JsonProperty("description", DefaultValueHandling = DefaultValueHandling.Ignore, NullValueHandling = NullValueHandling.Ignore)] public string Description { get; set; } } public class VoiceMessage { [JsonProperty("media_id")] public string MediaId { get; set; } } public class NewsMessage { [JsonProperty("articles")] public IEnumerable Articles { get; set; } } public class NewsArticleMessage { [JsonProperty("title")] public string Title { get; set; } [JsonProperty("description")] public string Description { get; set; } [JsonProperty("picurl")] public string PicUrl { get; set; } [JsonProperty("url")] public string Url { get; set; } } public class ArticleMessage { protected XmlDocument doc = new XmlDocument(); [XmlIgnore] [JsonProperty("title")] public string Title { get; set; } [XmlIgnore] [JsonProperty("digest")] public string Description { get; set; } [XmlIgnore] [JsonIgnore] public string PicUrl { get; set; } [XmlIgnore] [JsonProperty("thumb_media_id")] public string ThumbMediaId { get; set; } [XmlIgnore] [JsonProperty("content_source_url")] public string Url { get; set; } [XmlIgnore] [JsonProperty("content")] public string Content { get; set; } [XmlIgnore] [JsonProperty("author")] public string Author { get; set; } [XmlElement("Title")] [JsonIgnore] public XmlCDataSection CTitle { get { return doc.CreateCDataSection(Title); } set { Title = value.Value; } } [XmlElement("Description")] [JsonIgnore] public XmlCDataSection CDescription { get { return doc.CreateCDataSection(Description); } set { Description = value.Value; } } [XmlElement("PicUrl")] [JsonIgnore] public XmlCDataSection CPicUrl { get { return doc.CreateCDataSection(PicUrl); } set { PicUrl = value.Value; } } [XmlElement("Url")] [JsonIgnore] public XmlCDataSection CUrl { get { return doc.CreateCDataSection(Url); } set { Url = value.Value; } } } public class CustomServiceRecord { public string Worker { get; set; } public string OpenId { get; set; } public int Opercode { get; set; } public long Time { get; set; } public string Text { get; set; } } public class AutoReplyInfo { /// /// 自动回复的类型。关注后自动回复和消息自动回复的类型仅支持文本(text)、图片(img)、语音(voice)、视频(video),关键词自动回复则还多了图文消息 /// [JsonProperty("type")] public string Type { get; set; } /// /// 对于文本类型,content是文本内容,对于图片、语音、视频类型,content是mediaID /// [JsonProperty("content")] public string Content { get; set; } } /// /// 匹配的关键词信息 /// public class KeywordReplyInfo { [JsonProperty("type")] public string Type { get; set; } [JsonProperty("content")] public string Content { get; set; } /// /// 匹配模式,contain代表消息中含有该关键词即可 /// [JsonProperty("match_mode")] public string MatchMode { get; set; } } public class NewsInfo { [JsonProperty("list")] public IEnumerable List { get; set; } } public class KeywordReplyNews { /// /// 图文消息的标题 /// [JsonProperty("title")] public string Title { get; set; } /// /// 摘要 /// [JsonProperty("digest")] public string Digest { get; set; } /// /// 作者 /// [JsonProperty("author")] public string Author { get; set; } /// /// 是否显示封面,0为不显示,1为显示 /// [JsonProperty("show_cover")] public int ShowConver { get; set; } /// /// 封面图片的URL /// [JsonProperty("cover_url")] public string ConverUrl { get; set; } /// /// 正文的URL /// [JsonProperty("content_url")] public string ContentUrl { get; set; } /// /// 原文的URL,若置空则无查看原文入口 /// [JsonProperty("source_url")] public string SourceUrl { get; set; } [JsonProperty("type")] public string Type { get; set; } [JsonProperty("content")] public string Content { get; set; } } public class KeywordRule { [JsonProperty("rule_name")] public string RuleName { get; set; } [JsonProperty("create_time")] public long CreateTime { get; set; } [JsonProperty("reply_mode")] public string ReplyMode { get; set; } [JsonProperty("keyword_list_info")] public IEnumerable KeywordListInfo { get; set; } [JsonProperty("reply_list_info")] public IEnumerable ReplyListInfo { get; set; } } public class KeywordAutoreplyInfo { [JsonProperty("list")] public IEnumerable List { get; set; } } public class SelfMenuInfo { [JsonProperty("button")] public IEnumerable Buttons { get; set; } } public class ClickMenuInfo { [JsonProperty("type")] public string Type { get; set; } [JsonProperty("name")] public string Name { get; set; } [JsonProperty("key")] public string Key { get; set; } [JsonProperty("url")] public string Url { get; set; } [JsonProperty("value")] public string Value { get; set; } [JsonProperty("news_info")] public NewsInfo NewsInfo { get; set; } [JsonProperty("sub_button", NullValueHandling = NullValueHandling.Ignore)] public SubButton SubButton { get; set; } } public class SubButton { [JsonProperty("list")] public IEnumerable Buttons { get; set; } } /// /// 用户统计数据 /// public class UserDatacube { /// /// 数据的日期 /// [JsonProperty("ref_date")] public string RefDate { get; set; } /// /// 用户的渠道,数值代表的含义如下: ///0代表其他 30代表扫二维码 17代表名片分享 35代表搜号码(即微信添加朋友页的搜索) 39代表查询微信公众帐号 43代表图文页右上角菜单 /// [JsonProperty("user_source")] public int UserSource { get; set; } /// /// 新增的用户数量 /// [JsonProperty("new_user")] public int NewUser { get; set; } /// /// 取消关注的用户数量,new_user减去cancel_user即为净增用户数量 /// [JsonProperty("cancel_user")] public int CanelUser { get; set; } /// /// 总用户量 /// [JsonProperty("cumulate_user")] public int CumulateUser { get; set; } } /// /// 图文统计数据 /// public class DatacubeArticle { /// /// 数据的日期,需在begin_date和end_date之间 /// [JsonProperty("ref_date")] public string RefDate { get; set; } /// /// 数据的小时,包括从000到2300,分别代表的是[000,100)到[2300,2400),即每日的第1小时和最后1小时 /// [JsonProperty("ref_hour")] public int RefHour { get; set; } /// /// 统计的日期,在getarticletotal接口中,ref_date指的是文章群发出日期, 而stat_date是数据统计日期 /// [JsonProperty("stat_date")] public string StatDate { get; set; } /// /// 这里的msgid实际上是由msgid(图文消息id)和index(消息次序索引)组成, 例如12003_3, 其中12003是msgid,即一次群发的id消息的; 3为index,假设该次群发的图文消息共5个文章(因为可能为多图文), 3表示5个中的第3个 /// [JsonProperty("msgid")] public string MsgId { get; set; } /// /// 图文消息的标题 /// [JsonProperty("title")] public string Title { get; set; } /// /// 图文页(点击群发图文卡片进入的页面)的阅读人数 /// [JsonProperty("int_page_read_user")] public int IntPageReadUser { get; set; } /// /// 图文页的阅读次数 /// [JsonProperty("int_page_read_count")] public int IntPageReadCount { get; set; } /// /// 原文页(点击图文页“阅读原文”进入的页面)的阅读人数,无原文页时此处数据为0 /// [JsonProperty("ori_page_read_user")] public int OriPageReadUser { get; set; } /// /// 原文页的阅读次数 /// [JsonProperty("ori_page_read_count")] public int OriPageReadCount { get; set; } /// /// 分享的场景 /// 1代表好友转发 2代表朋友圈 3代表腾讯微博 255代表其他 /// [JsonProperty("share_scene")] public int ShareScene { get; set; } /// /// 分享的人数 /// [JsonProperty("share_user")] public int ShareUser { get; set; } /// /// 分享的次数 /// [JsonProperty("share_count")] public int ShareCount { get; set; } /// /// 收藏的人数 /// [JsonProperty("add_to_fav_user")] public int AddToFavUser { get; set; } /// /// 收藏的次数 /// [JsonProperty("add_to_fav_count")] public int AddToFavCount { get; set; } /// /// 送达人数,一般约等于总粉丝数(需排除黑名单或其他异常情况下无法收到消息的粉丝) /// [JsonProperty("target_user")] public int TargetUser { get; set; } } public class DatacubeMsg { /// /// 数据的日期,需在begin_date和end_date之间 /// [JsonProperty("ref_date")] public string RefDate { get; set; } /// /// 数据的小时,包括从000到2300,分别代表的是[000,100)到[2300,2400),即每日的第1小时和最后1小时 /// [JsonProperty("ref_hour")] public int RefHour { get; set; } /// /// 消息类型,代表含义如下: /// 1代表文字 2代表图片 3代表语音 4代表视频 6代表第三方应用消息(链接消息) /// [JsonProperty("msg_type")] public int MsgType { get; set; } /// /// 上行发送了(向公众号发送了)消息的用户数 /// [JsonProperty("msg_user")] public int MsgUser { get; set; } /// /// 上行发送了消息的消息总数 /// [JsonProperty("msg_count")] public int MsgCount { get; set; } /// /// 当日发送消息量分布的区间,0代表 “0”,1代表“1-5”,2代表“6-10”,3代表“10次以上” /// [JsonProperty("count_interval")] public int CountInterval { get; set; } /// /// 图文页的阅读次数 /// [JsonProperty("int_page_read_count")] public int IntPageReadCount { get; set; } /// /// 原文页(点击图文页“阅读原文”进入的页面)的阅读人数,无原文页时此处数据为0 /// [JsonProperty("ori_page_read_user")] public int OriPageReadUser { get; set; } } public class DatacubeInterface { /// /// 数据的日期,需在begin_date和end_date之间 /// [JsonProperty("ref_date")] public string RefDate { get; set; } /// /// 数据的小时,包括从000到2300,分别代表的是[000,100)到[2300,2400),即每日的第1小时和最后1小时 /// [JsonProperty("ref_hour")] public int RefHour { get; set; } /// /// 通过服务器配置地址获得消息后,被动回复用户消息的次数 /// [JsonProperty("callback_count")] public int CallbackCount { get; set; } /// /// 上述动作的失败次数 /// [JsonProperty("fail_count")] public int FailCount { get; set; } /// /// 总耗时,除以callback_count即为平均耗时 /// [JsonProperty("total_time_cost")] public long TotalTimeCost { get; set; } /// /// 最大耗时 /// [JsonProperty("max_time_cost")] public long MaxTimeCost { get; set; } } public class MaterialNews { /// /// 标题 /// [JsonProperty("title")] public string Title { get; set; } /// /// 图文消息的封面图片素材id(必须是永久mediaID) /// [JsonProperty("thumb_media_id")] public string ThumbMediaId { get; set; } /// /// 作者 /// [JsonProperty("author")] public string Author { get; set; } /// /// 图文消息的摘要,仅有单图文消息才有摘要,多图文此处为空 /// [JsonProperty("digest")] public string Digest { get; set; } /// /// 是否显示封面,0为false,即不显示,1为true,即显示 /// [JsonProperty("show_cover_pic")] public string ShowCoverPic { get; set; } /// /// 图文消息的具体内容,支持HTML标签,必须少于2万字符,小于1M,且此处会去除JS /// [JsonProperty("content")] public string Content { get; set; } /// /// 图文消息的原文地址,即点击“阅读原文”后的URL /// [JsonProperty("content_source_url")] public string ContentSourceUrl { get; set; } } public class KfSession { /// /// 正在接待的客服,为空表示没有人在接待 /// [JsonProperty("openid")] public string OpenId { get; set; } /// /// 会话接入的时间 /// [JsonProperty("createtime")] public long Createtime { get; set; } } public class WaitCase { /// /// 客户openid /// [JsonProperty("openid")] public string OpenId { get; set; } /// /// 正在接待的客服,为空表示没有人在接待 /// [JsonProperty("kf_account")] public string KfAccount { get; set; } /// /// 会话接入的时间 /// [JsonProperty("createtime")] public long Createtime { get; set; } } } ================================================ FILE: Business/Model/Request/RequestClickEventMessage.cs ================================================ using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Xml.Linq; namespace WX.Model { public class RequestClickEventMessage : RequestEventMessage { public RequestClickEventMessage(XElement xml) : base(xml) { EventKey = xml.Element("EventKey").Value; } public string EventKey { get; set; } } } ================================================ FILE: Business/Model/Request/RequestEventMessage.cs ================================================ using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Xml.Linq; namespace WX.Model { public class RequestEventMessage : RequestMessage { public RequestEventMessage(XElement xml) : base(xml) { this.Event = (Model.Event)Enum.Parse(typeof(Model.Event), xml.Element("Event").Value, true); } public Event Event { get; set; } public override MsgType MsgType { get { return MsgType.Event; } } } } ================================================ FILE: Business/Model/Request/RequestImageMessage.cs ================================================ using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Xml.Linq; namespace WX.Model { public class RequestImageMessage : RequestMessage { public RequestImageMessage(XElement xml) : base(xml) { this.PicUrl = xml.Element("PicUrl").Value; this.MediaId = xml.Element("MediaId").Value; } public override MsgType MsgType { get { return MsgType.Image; } } public string PicUrl { get; set; } public string MediaId { get; set; } } } ================================================ FILE: Business/Model/Request/RequestLinkMessage.cs ================================================ using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Xml.Linq; namespace WX.Model { public class RequestLinkMessage : RequestMessage { public RequestLinkMessage(XElement xml) : base(xml) { this.Title = xml.Element("Title").Value; this.Description = xml.Element("Description").Value; this.Url = xml.Element("Url").Value; } public override MsgType MsgType { get { return Model.MsgType.Link; } } public string Title { get; set; } public string Description { get; set; } public string Url { get; set; } } } ================================================ FILE: Business/Model/Request/RequestLocationEventMessage.cs ================================================ using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Xml.Linq; namespace WX.Model { public class RequestLocationEventMessage : RequestEventMessage { public RequestLocationEventMessage(XElement xml) : base(xml) { Latitude = float.Parse(xml.Element("Latitude").Value); Longitude = float.Parse(xml.Element("Longitude").Value); Precision = float.Parse(xml.Element("Precision").Value); } /// /// 地理位置纬度 /// public float Latitude { get; set; } /// /// 地理位置经度 /// public float Longitude { get; set; } /// /// 地理位置精度 /// public float Precision { get; set; } } } ================================================ FILE: Business/Model/Request/RequestLocationMessage.cs ================================================ using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Xml.Linq; namespace WX.Model { public class RequestLocationMessage : RequestMessage { public RequestLocationMessage(XElement xml) : base(xml) { this.Location_X = float.Parse(xml.Element("Location_X").Value); this.Location_Y = float.Parse(xml.Element("Location_Y").Value); this.Scale = int.Parse(xml.Element("Scale").Value); this.Label = xml.Element("Label").Value; } public override MsgType MsgType { get { return Model.MsgType.Location; } } public float Location_X { get; set; } public float Location_Y { get; set; } public int Scale { get; set; } public string Label { get; set; } } } ================================================ FILE: Business/Model/Request/RequestMassSendEventMessage.cs ================================================ using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Xml.Linq; namespace WX.Model { public class RequestMassSendEventMessage : RequestEventMessage { public RequestMassSendEventMessage(XElement xml) : base(xml) { MsgId = long.Parse(xml.Element("MsgID").Value); Status = xml.Element("Status").Value; TotalCount = int.Parse(xml.Element("TotalCount").Value); FilterCount = int.Parse(xml.Element("FilterCount").Value); SentCount = int.Parse(xml.Element("SentCount").Value); ErrorCount = int.Parse(xml.Element("ErrorCount").Value); } public string Status { get; set; } public int TotalCount { get; set; } public int FilterCount { get; set; } public int SentCount { get; set; } public int ErrorCount { get; set; } } } ================================================ FILE: Business/Model/Request/RequestMessage.cs ================================================ using System; using System.Collections.Generic; using System.IO; using System.Linq; using System.Text; using System.Xml.Linq; using System.Xml.Serialization; namespace WX.Model { [Serializable] public abstract class RequestMessage : WXMessage { public RequestMessage() { } public RequestMessage(XElement xml) { this.FromUserName = xml.Element("FromUserName").Value; this.ToUserName = xml.Element("ToUserName").Value; this.CreateTime = Int64.Parse(xml.Element("CreateTime").Value); this.MsgId = xml.Element("MsgId") != null ? Int64.Parse(xml.Element("MsgId").Value) : 0; } public static T Deserializ(Stream stream) where T : RequestMessage { var xs = new XmlSerializer(typeof(T)); return (T)xs.Deserialize(stream); } [XmlElement("MsgId")] public long MsgId { get; set; } } } ================================================ FILE: Business/Model/Request/RequestOrderEventMessage.cs ================================================ using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Xml.Linq; namespace WX.Model.Request { public class RequestOrderEventMessage : RequestEventMessage { public RequestOrderEventMessage(XElement xml) : base(xml) { OrderId = xml.Element("OrderId").Value; OrderStatus = int.Parse(xml.Element("OrderStatus").Value); ProductId = xml.Element("ProductId").Value; SkuInfo = xml.Element("SkuInfo").Value; } public string OrderId { get; set; } public int OrderStatus { get; set; } public string ProductId { get; set; } public string SkuInfo { get; set; } } } ================================================ FILE: Business/Model/Request/RequestQREventMessage.cs ================================================ using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Xml.Linq; namespace WX.Model { public class RequestQREventMessage : RequestEventMessage { public RequestQREventMessage(XElement xml) : base(xml) { this.EventKey = xml.Element("EventKey").Value; this.Ticket = xml.Element("Ticket").Value; } public string EventKey { get; set; } public string Ticket { get; set; } } } ================================================ FILE: Business/Model/Request/RequestShortVideoMessage.cs ================================================ using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Xml.Linq; namespace WX.Model.Request { /// /// 小视频消息 /// V4.1版本增加 /// At 2015-04-01 /// public class RequestShortVideoMessage : RequestMessage { public RequestShortVideoMessage(XElement xml) : base(xml) { this.MediaId = xml.Element("MediaId").Value; this.ThumbMediaId = xml.Element("ThumbMediaId").Value; } public override MsgType MsgType { get { return Model.MsgType.ShortVideo; } } public string MediaId { get; set; } public string ThumbMediaId { get; set; } } } ================================================ FILE: Business/Model/Request/RequestTemplateEventMessage.cs ================================================ using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Xml.Linq; namespace WX.Model.Request { public class RequestTemplateEventMessage : RequestEventMessage { public RequestTemplateEventMessage(XElement xml) : base(xml) { this.Status = xml.Element("Status").Value; } public string Status { get; set; } public override MsgType MsgType { get { return Model.MsgType.Event; } } } } ================================================ FILE: Business/Model/Request/RequestTextMessage.cs ================================================ using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Xml; using System.Xml.Linq; using System.Xml.Serialization; namespace WX.Model { [Serializable] [XmlRoot("xml", Namespace="")] public class RequestTextMessage : RequestMessage { public RequestTextMessage() { } public RequestTextMessage(XElement xml) : base(xml) { this.Content = xml.Element("Content").Value; } public override MsgType MsgType { get { return MsgType.Text; } } [XmlIgnore] public string Content { get; set; } [XmlElement("Content")] public XmlCDataSection CContent { get { return doc.CreateCDataSection(Content.ToString()); } set { Content = value.Value; } } } } ================================================ FILE: Business/Model/Request/RequestVideoMessage.cs ================================================ using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Xml.Linq; namespace WX.Model { public class RequestVideoMessage : RequestMessage { public RequestVideoMessage(XElement xml) : base(xml) { this.MediaId = xml.Element("MediaId").Value; this.ThumbMediaId = xml.Element("ThumbMediaId").Value; } public override MsgType MsgType { get { return Model.MsgType.Video; } } public string MediaId { get; set; } public string ThumbMediaId { get; set; } } } ================================================ FILE: Business/Model/Request/RequestViewEventMessage.cs ================================================ using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Xml.Linq; namespace WX.Model { public class RequestViewEventMessage : RequestEventMessage { public RequestViewEventMessage(XElement xml) : base(xml) { EventKey = xml.Element("EventKey").Value; } public string EventKey { get; set; } } } ================================================ FILE: Business/Model/Request/RequestVoiceMessage.cs ================================================ using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Xml.Linq; namespace WX.Model { public class RequestVoiceMessage : RequestMessage { public RequestVoiceMessage(XElement xml):base(xml) { this.MediaId = xml.Element("MediaId").Value; this.Format = xml.Element("Format").Value; this.Recognition = xml.Element("Recognition").Value; } public override MsgType MsgType { get { return Model.MsgType.Voice; } } public string MediaId { get; set; } public string Format { get; set; } public string Recognition { get; set; } } } ================================================ FILE: Business/Model/Response/ResponseImageMessage.cs ================================================ using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Xml.Serialization; namespace WX.Model { [XmlRoot("xml")] public class ResponseImageMessage : ResponseMessage { public ResponseImageMessage() { } public ResponseImageMessage(RequestMessage request) : base(request) { } public override MsgType MsgType { get { return Model.MsgType.Image; } } public ImageMessage Image { get; set; } } } ================================================ FILE: Business/Model/Response/ResponseMessage.cs ================================================ using System; using System.Collections.Generic; using System.IO; using System.Linq; using System.Text; using System.Xml.Serialization; namespace WX.Model { [Serializable] [XmlRoot("xml")] public abstract class ResponseMessage : WXMessage { public ResponseMessage() { } public ResponseMessage(RequestMessage request) { this.FromUserName = request.ToUserName; this.ToUserName = request.FromUserName; } public override MsgType MsgType { get { throw new NotImplementedException(); } } public String Serializable() { var sw = new StringWriter(); var xmlSerializer = new XmlSerializer(this.GetType()); var ns = new XmlSerializerNamespaces(); ns.Add("", ""); xmlSerializer.Serialize(sw, this, ns); return sw.ToString(); } } } ================================================ FILE: Business/Model/Response/ResponseMusicMessage.cs ================================================ using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Xml.Serialization; namespace WX.Model { [XmlRoot("xml")] public class ResponseMusicMessage : ResponseMessage { public ResponseMusicMessage() { } public ResponseMusicMessage(RequestMessage request) : base(request) { } public override MsgType MsgType { get { return Model.MsgType.Music; } } public MusicMessage Music { get; set; } } } ================================================ FILE: Business/Model/Response/ResponseNewsMessage.cs ================================================ using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Xml.Serialization; namespace WX.Model { [XmlRoot("xml")] public class ResponseNewsMessage : ResponseMessage { public ResponseNewsMessage() { } public ResponseNewsMessage(RequestMessage request) : base(request) { } public override MsgType MsgType { get { return Model.MsgType.News; } } public int ArticleCount { get; set; } [XmlArrayItem("item")] public List Articles { get; set; } } } ================================================ FILE: Business/Model/Response/ResponseTextMessage.cs ================================================ using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Xml.Serialization; namespace WX.Model { [XmlRoot("xml")] public class ResponseTextMessage : ResponseMessage { public ResponseTextMessage() { } public ResponseTextMessage(RequestMessage request) : base(request) { } public override MsgType MsgType { get { return Model.MsgType.Text; } } public string Content { get; set; } } } ================================================ FILE: Business/Model/Response/ResponseTransferCustomServiceMessage.cs ================================================ using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace WX.Model.Response { public class ResponseTransferCustomServiceMessage : ResponseMessage { public ResponseTransferCustomServiceMessage() { } public ResponseTransferCustomServiceMessage(RequestMessage request) : base(request) { } public override MsgType MsgType { get { return MsgType.transfer_customer_service; } } } } ================================================ FILE: Business/Model/Response/ResponseVideoMessage.cs ================================================ using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Xml.Serialization; namespace WX.Model { [XmlRoot("xml")] public class ResponseVideoMessage : ResponseMessage { public ResponseVideoMessage() { } public ResponseVideoMessage(RequestMessage request) : base(request) { } public override MsgType MsgType { get { return Model.MsgType.Video; } } public VideoMessage Video { get; set; } } } ================================================ FILE: Business/Model/Response/ResponseVoiceMessage.cs ================================================ using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Xml.Serialization; namespace WX.Model { [XmlRoot("xml")] public class ResponseVoiceMessage : ResponseMessage { public ResponseVoiceMessage() { } public ResponseVoiceMessage(RequestMessage request) : base(request) { } public override MsgType MsgType { get { return Model.MsgType.Voice; } } public VoiceMessage Voice { get; set; } } } ================================================ FILE: Business/Model/TemplateDataProperty.cs ================================================ using Newtonsoft.Json; using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace WX.Model { public class TemplateDataProperty { public TemplateDataProperty() { } public TemplateDataProperty(string value, string color) { Value = value; Color = color; } /// /// 显示的文本 /// [JsonProperty("value")] public string Value { get; set; } /// /// 显示的颜色 /// [JsonProperty("color")] public string Color { get; set; } } } ================================================ FILE: Business/Model/WXEnum.cs ================================================ using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace WX.Model { public enum MsgType { Text, Image, Voice, Video, Location, Link, Event, News, Music, ShortVideo, transfer_customer_service } public enum Event { Subscribe, Unsubscribe, Scan, Location, Click, MASSSENDJOBFINISH, View, Merchant_Order, TEMPLATESENDJOBFINISH //模板消息 2014-09-23 } public enum MediaType { Image, Voice, Video, Thumb } public enum OAuthScope { Base, UserInfo } public enum Language { CN, TW, EN } /// /// 行业模板 /// public enum TemplateIndustry { /// /// 互联网/电子商务 /// ITNetAndBusiness = 1, /// /// IT软件与服务 /// ITSoftAndServices = 2, /// /// IT硬件与设备 /// ITHardware = 3, /// /// 电子技术 /// ITElectronicTech = 4, /// /// 通信运营商 /// ITOperators =5, /// /// 网络游戏 /// ITGames = 6, /// /// 银行 /// FBank = 7, /// /// 基金|理财|信托 /// FInvestment = 8, /// /// 保险 /// FInsurance = 9, /// /// 餐饮 /// Catering = 10, /// /// 酒店 /// Hotel = 11, /// /// 旅游 /// Travel = 12, /// /// 快递 /// Express = 13, /// /// 物流 /// Logistics = 14, /// /// 仓储 /// Store = 15, /// /// 培训 /// Cultivate = 16, /// /// 院校 /// School = 17, /// /// 学术和科研 /// AcademicResearch = 18, /// /// 交警 /// TrafficPolice = 19, /// /// 博物馆 /// Museum = 20, /// /// 公共事业 /// PublicUtilities = 21, /// /// 医药医疗 /// Medical = 22, /// /// 美容 /// Cosmetology = 23, /// /// 保健与卫生 /// HealthCare = 24, /// /// 汽车业 /// Auto = 25, /// /// 摩托车 /// Motor = 26, /// /// 火车 /// Train = 27, /// /// 飞机业 /// Plane = 28, /// /// 建筑业 /// Building = 29, /// /// 物业 /// Property = 30, /// /// 消费品 /// ConsumerGoods = 31, /// /// 法律 /// Law = 32, /// /// 会展 /// Exhibition = 33, /// /// 中介服务 /// Intermediary = 34, /// /// 认证 /// Authentication = 35, /// /// 审计 /// Audit = 36, /// /// 传媒 /// Media = 37, /// /// 体育 /// Sports = 38, /// /// 娱乐和休闲 /// Entertainment = 39, /// /// 印刷 /// Printing = 40, /// /// 其他 /// Other = 41 } } ================================================ FILE: Business/Model/WXEnum.cs.BASE.cs ================================================ using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace WX.Model { public enum MsgType { Text, Image, Voice, Video, Location, Link, Event, News, Music } public enum Event { Subscribe, Unsubscribe, Scan, Location, Click, MASSSENDJOBFINISH } public enum MediaType { Image, Voice, Video, Thumb } public enum OAuthScope { Base, UserInfo } public enum Language { CN, TW, EN } } ================================================ FILE: Business/Model/WXEnum.cs.LOCAL.cs ================================================ using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace WX.Model { public enum MsgType { Text, Image, Voice, Video, Location, Link, Event, News, Music } public enum Event { Subscribe, Unsubscribe, Scan, Location, Click, MASSSENDJOBFINISH, VIEW } public enum MediaType { Image, Voice, Video, Thumb } public enum OAuthScope { Base, UserInfo } public enum Language { CN, TW, EN } } ================================================ FILE: Business/Model/WXEnum.cs.REMOTE.cs ================================================ using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace WX.Model { public enum MsgType { Text, Image, Voice, Video, Location, Link, Event, News, Music } public enum Event { Subscribe, Unsubscribe, Scan, Location, Click, MASSSENDJOBFINISH, View } public enum MediaType { Image, Voice, Video, Thumb } public enum OAuthScope { Base, UserInfo } public enum Language { CN, TW, EN } } ================================================ FILE: Business/Model/WXJsonResult.cs ================================================ using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace WX.Model { public class WXJsonResult { } } ================================================ FILE: Business/Model/WXMessage.cs ================================================ using Newtonsoft.Json; using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Xml; using System.Xml.Serialization; namespace WX.Model { [Serializable] public abstract class WXMessage { protected XmlDocument doc = new XmlDocument(); [XmlIgnore] public string ToUserName { get; set; } [XmlIgnore] public string FromUserName { get; set; } [XmlElement("CreateTime")] public long CreateTime { get; set; } public abstract MsgType MsgType { get; } [XmlElement("MsgType")] public XmlCDataSection CMsgType { get { return doc.CreateCDataSection(MsgType.ToString().ToLower()); } set { ;} } [XmlElement("ToUserName")] public XmlCDataSection CToUserName { get { return doc.CreateCDataSection(ToUserName); } set { ToUserName = value.Value; } } [XmlElement("FromUserName")] public XmlCDataSection CFromUserName { get { return doc.CreateCDataSection(FromUserName); } set { FromUserName = value.Value; } } } } ================================================ FILE: Business/NotHandlerMessage.cs ================================================ using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Xml.Linq; using WX.Model; namespace WX.Framework { public class NotHandlerMessage : IMessageHandler { public ResponseMessage HandlerRequestMessage(MiddleMessage message) { return null; } } } ================================================ FILE: Business/OAuth/OAuthHelper.cs ================================================ using System; using System.Collections.Generic; using System.Linq; using System.Text; using WX.Model; namespace WX.OAuth { public class OAuthHelper { private String AppID { get; set; } public OAuthHelper(string appId) { AppID = appId; } private static string s_weixin_oauth_format_url = "https://open.weixin.qq.com/connect/oauth2/authorize?appid={0}&redirect_uri={1}&response_type=code&scope=snsapi_{2}&state={3}#wechat_redirect"; public string BuildOAuthUrl(string redirectUrl, OAuthScope scope, string state) { return String.Format(s_weixin_oauth_format_url, AppID, redirectUrl, scope.ToString().ToLower(), state); } } } ================================================ FILE: Business/Pay/IPayApiClient.cs ================================================ using System; using System.Collections.Generic; using System.Linq; using System.Text; using WX.Pay.Request; using WX.Pay.Response; namespace WX.Pay { public interface IPayApiClient { T Execute(PayRequest request) where T : PayResponse, new(); } } ================================================ FILE: Business/Pay/PayApiClient.cs ================================================ using System; using System.Collections.Generic; using System.IO; using System.Linq; using System.Text; using System.Xml.Serialization; using WX.Common; using WX.Logger; using WX.Pay.Request; using WX.Pay.Response; namespace WX.Pay { public class PayApiClient : IPayApiClient { public ILogger Logger { get; set; } public T Execute(PayRequest request) where T : PayResponse, new() { T result = null; try { var responseXml = HttpHelper.HttpPost(request.Url, request.Serializable()); var stream = new MemoryStream(Encoding.UTF8.GetBytes(responseXml)); var xs = new XmlSerializer(typeof(T), ""); result = (T)xs.Deserialize(stream); } catch(Exception e) { Error(e.ToString()); } if (result == null) { return new T() { }; } return result; } public void Error(string content) { if (Logger != null) { Logger.Error(content); } } } } ================================================ FILE: Business/Pay/Request/PayCloseorderRequest.cs ================================================ using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Xml.Serialization; using WX.Pay.Response; namespace WX.Pay.Request { [XmlRoot("xml")] public class PayCloseorderRequest : PayRequest { [XmlIgnore] public override string Url { get { return "https://api.mch.weixin.qq.com/pay/closeorder"; } } private string out_trade_no; /// /// 商户订单号 /// [XmlElement("out_trade_no")] public string OutTradeNo { get { return out_trade_no; } set { out_trade_no = value; PushKeyValue("out_trade_no", value); } } private string nonce_str; /// /// 商户订单号 /// [XmlElement("nonce_str")] public string NonceStr { get { return nonce_str; } set { nonce_str = value; PushKeyValue("nonce_str", value); } } } } ================================================ FILE: Business/Pay/Request/PayDownloadbillRequest.cs ================================================ using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Xml.Serialization; using WX.Pay.Response; namespace WX.Pay.Request { /// /// 下载对账单 /// 商户可以通过该接口下载历史交易清单。比如掉单、系统错误等导致商户侧和微信侧数据不一致,通过对账单核对后可校正支付状态。 /// 注意: /// 1.微信侧未成功下单的交易不会出现在对账单中。支付成功后撤销的交易会出现在对账单中,跟原支付单订单号一致,bill_type为REVOKED; /// 2.微信在次日9点启动生成前一天的对账单,建议商户10点后再获取; /// 3.对账单中涉及金额的字段单位为“元”。 /// public class PayDownloadbillRequest : PayRequest { public override string Url { get { return "https://api.mch.weixin.qq.com/pay/downloadbill"; } } private string _billdate; /// /// 对账单日期 /// [XmlElement("bill_date")] public string BillDate { get { return _billdate; } set { _billdate = value; PushKeyValue("bill_date", value); } } private string _bill_type; /// /// 账单类型 /// ALL,返回当日所有订单信息,默认值 /// SUCCESS,返回当日成功支付的订单 /// REFUND,返回当日退款订单 /// REVOKED,已撤销的订单 /// [XmlElement("bill_type")] public string BillType { get { return _bill_type; } set { _bill_type = value; PushKeyValue("bill_type", value); } } } } ================================================ FILE: Business/Pay/Request/PayOrderqueryRequest.cs ================================================ using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Xml.Serialization; using WX.Pay.Response; namespace WX.Pay.Request { [XmlRoot("xml")] public class PayOrderqueryRequest : PayRequest { [XmlIgnore] public override string Url { get { return "https://api.mch.weixin.qq.com/pay/orderquery"; } } private string transaction_id; /// /// /// [XmlElement("transaction_id")] public string TransactionId { get { return transaction_id; } set { if (!String.IsNullOrEmpty(value)) { transaction_id = value; PushKeyValue("transaction_id", value); } } } private string out_trade_no; /// /// /// [XmlElement("out_trade_no")] public string OutTradeNo { get { return out_trade_no; } set { if (!String.IsNullOrEmpty(value)) { out_trade_no = value; PushKeyValue("out_trade_no", value); } } } private string nonce_str; /// /// /// [XmlElement("nonce_str")] public string NonceStr { get { return nonce_str; } set { if (!String.IsNullOrEmpty(value)) { nonce_str = value; PushKeyValue("nonce_str", value); } } } } } ================================================ FILE: Business/Pay/Request/PayRefundQueryRequest.cs ================================================ using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Xml.Serialization; using WX.Pay.Response; namespace WX.Pay.Request { /// /// 提交退款申请后,通过调用该接口查询退款状态。退款有一定延时,用零钱支付的退款20分钟内到账,银行卡支付的退款3个工作日后重新查询退款状态。 /// [XmlRoot(ElementName = "xml")] public class PayRefundQueryRequest : PayRequest { public override string Url { get { return "https://api.mch.weixin.qq.com/pay/refundquery"; } } private string device_info; /// /// 设备号 微信支付分配的终端设备号,与下单一致 /// [XmlElement("device_info")] public string DeviceInfo { get { return device_info; } set { if (!String.IsNullOrEmpty(value)) { device_info = value; PushKeyValue("device_info", value); } } } private string nonce_str; /// /// 随机字符串 /// [XmlElement("nonce_str")] public string NonceStr { get { return nonce_str; } set { if (!String.IsNullOrEmpty(value)) { nonce_str = value; PushKeyValue("nonce_str", value); } } } private string transaction_id; /// /// 微信订单号 /// [XmlElement("transaction_id")] public string TransactionId { get { return transaction_id; } set { if (!String.IsNullOrEmpty(value)) { transaction_id = value; PushKeyValue("transaction_id", value); } } } private string out_trade_no; /// /// 商户订单号 /// [XmlElement("out_trade_no")] public string OutTradeNo { get { return out_trade_no; } set { if (!String.IsNullOrEmpty(value)) { out_trade_no = value; PushKeyValue("out_trade_no", value); } } } private string out_refund_no; /// /// 商户退款单号 /// [XmlElement("out_refund_no")] public string OutRefundNo { get { return out_refund_no; } set { if (!String.IsNullOrEmpty(value)) { out_refund_no = value; PushKeyValue("out_refund_no", value); } } } private string refund_id; /// /// 微信退款单号 /// [XmlElement("refund_id")] public string RefundId { get { return refund_id; } set { if (!String.IsNullOrEmpty(value)) { refund_id = value; PushKeyValue("refund_id", value); } } } } } ================================================ FILE: Business/Pay/Request/PayRefundRequest.cs ================================================ using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Xml.Serialization; using WX.Pay.Response; namespace WX.Pay.Request { [XmlRoot("xml")] public class PayRefundRequest : PayRequest { [XmlIgnore] public override string Url { get { return "https://api.mch.weixin.qq.com/secapi/pay/refund"; } } private string device_info; /// /// 设备号 微信支付分配的终端设备号,与下单一致 /// [XmlElement("device_info")] public string DeviceInfo { get { return device_info; } set { if (!String.IsNullOrEmpty(value)) { device_info = value; PushKeyValue("device_info", value); } } } private string nonce_str; /// /// 随机字符串 /// [XmlElement("nonce_str")] public string NonceStr { get { return nonce_str; } set { if (!String.IsNullOrEmpty(value)) { nonce_str = value; PushKeyValue("nonce_str", value); } } } private string transaction_id; /// /// 微信订单号 /// [XmlElement("transaction_id")] public string TransactionId { get { return transaction_id; } set { if (!String.IsNullOrEmpty(value)) { transaction_id = value; PushKeyValue("transaction_id", value); } } } private string out_trade_no; /// /// 商户订单号 /// [XmlElement("out_trade_no")] public string OutTradeNo { get { return out_trade_no; } set { if (!String.IsNullOrEmpty(value)) { out_trade_no = value; PushKeyValue("out_trade_no", value); } } } private string out_refund_no; /// /// 商户退款单号 /// [XmlElement("out_refund_no")] public string OutRefundNo { get { return out_refund_no; } set { if (!String.IsNullOrEmpty(value)) { out_refund_no = value; PushKeyValue("out_refund_no", value); } } } private int total_fee; /// /// 总金额 /// [XmlElement("total_fee")] public int TotalFee { get { return total_fee; } set { total_fee = value; PushKeyValue("total_fee", value.ToString()); } } private int refund_fee; /// /// 退款金额 /// [XmlElement("refund_fee")] public int RefundFee { get { return refund_fee; } set { refund_fee = value; PushKeyValue("refund_fee", value.ToString()); } } private string refund_fee_type; /// /// 货币种类 /// [XmlElement("refund_fee_type")] public string RefundFeeType { get { return refund_fee_type; } set { if (!String.IsNullOrEmpty(value)) { refund_fee_type = value; PushKeyValue("refund_fee_type", value); } } } private string op_user_id; /// /// 操作员 /// [XmlElement("op_user_id")] public string OpUserId { get { return op_user_id; } set { if (!String.IsNullOrEmpty(value)) { op_user_id = value; PushKeyValue("op_user_id", value); } } } } } ================================================ FILE: Business/Pay/Request/PayRequest.cs ================================================ using System; using System.Collections.Generic; using System.IO; using System.Linq; using System.Text; using System.Xml; using System.Xml.Serialization; using WX.Common; using WX.Pay.Response; namespace WX.Pay.Request { [XmlRoot("xml")] public abstract class PayRequest where T : PayResponse { private string appid; /// /// 公众账号ID /// [XmlElement("appid")] public string AppId { get { return appid; } set { if (!String.IsNullOrEmpty(value)) { appid = value; PushKeyValue("appid", appid); } } } /// /// API密钥,在商户后台进行设置,非AppSecret /// [XmlIgnore] public string PayApiSecret { get; set; } private string mchid; /// /// 商户号 /// [XmlElement("mch_id")] public string MchId { get { return mchid; } set { if (!String.IsNullOrEmpty(value)) { mchid = value; PushKeyValue("mch_id", mchid); } } } [XmlElement("sign")] public string Sign { get { return CreateSign(); } set { throw new NotImplementedException(); } } private string CreateSign() { var sb = new StringBuilder(); foreach (var key in m_keyValue.Keys) { if (!String.IsNullOrEmpty(m_keyValue[key])) { sb.AppendFormat("{0}={1}&", key, m_keyValue[key]); } } sb.AppendFormat("key={0}", PayApiSecret); return sb.ToString().Md5().ToUpper(); } protected void PushKeyValue(string key, string value) { if (!String.IsNullOrEmpty(value)) { if (m_keyValue.Keys.Contains(key)) { m_keyValue[key] = value; } else { m_keyValue.Add(key, value); } } } protected SortedDictionary m_keyValue = new SortedDictionary(); [XmlIgnore] public abstract string Url { get; } protected XmlDocument _doc = new XmlDocument(); public String Serializable() { var stream = new MemoryStream(); XmlWriterSettings settings = new XmlWriterSettings(); settings.Indent = true; settings.Encoding = Encoding.UTF8; settings.OmitXmlDeclaration = true; using (var sw = XmlWriter.Create(stream, settings)) { var xmlSerializer = new XmlSerializer(this.GetType()); var ns = new XmlSerializerNamespaces(); ns.Add("", ""); xmlSerializer.Serialize(sw, this, ns); } stream.Position = 0; using (var reader = new StreamReader(stream, Encoding.UTF8)) { return reader.ReadToEnd(); } } } } ================================================ FILE: Business/Pay/Request/PayUnifiedOrderRequest.cs ================================================ using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Xml; using System.Xml.Serialization; using WX.Pay.Response; namespace WX.Pay.Request { /// /// 统一下单 /// 除被扫支付场景以外,商户系统先调用该接口在微信支付服务后台生成预支付交易单,返回正确的预支付交易回话标识后再按扫码、JSAPI、APP等不同场景生成交易串调起支付。 /// [XmlRoot(ElementName = "xml", DataType = "string")] public class PayUnifiedOrderRequest : PayRequest { [XmlIgnore] public override string Url { get { return "https://api.mch.weixin.qq.com/pay/unifiedorder"; } } private string device_info; /// /// 设备号 微信支付分配的终端设备号,商户自定义 /// [XmlElement("device_info")] public string DeviceInfo { get { return device_info; } set { if (!String.IsNullOrEmpty(value)) { device_info = value; PushKeyValue("device_info", value); } } } private string nonce_str; /// /// 随机字符串 随机字符串,不长于32位 http://pay.weixin.qq.com/wiki/doc/api/index.php?chapter=4_3 /// [XmlElement("nonce_str")] public string NonceStr { get { return nonce_str; } set { if (!String.IsNullOrEmpty(value)) { nonce_str = value; PushKeyValue("nonce_str", value); } } } private string body; /// /// 商品描述 商品或支付单简要描述 /// [XmlElement("body")] public string Body { get { return body; } set { if (!String.IsNullOrEmpty(value)) { body = value; PushKeyValue("body", value); } } } private string detail; /// /// 商品详情 商品名称明细列表 /// //[XmlElement("detail")] [XmlIgnore] public string Detail { get { return detail; } set { if (!String.IsNullOrEmpty(value)) { detail = value; PushKeyValue("detail", value); } } } /// /// 请勿赋值 /// [XmlElement("detail")] public XmlCDataSection CDetail { get { return _doc.CreateCDataSection(detail); } set { ;} } private string attach; /// /// 附加数据 附加数据,在查询API和支付通知中原样返回,该字段主要用于商户携带订单的自定义数据 /// [XmlElement("attach")] public string Attach { get { return attach; } set { if (!String.IsNullOrEmpty(value)) { attach = value; PushKeyValue("attach", value); } } } private string out_trade_no; /// /// 商户订单号 商户系统内部的订单号,32个字符内、可包含字母, 其他说明见商户订单号 /// [XmlElement("out_trade_no")] public string OutTradeNo { get { return out_trade_no; } set { if (!String.IsNullOrEmpty(value)) { out_trade_no = value; PushKeyValue("out_trade_no", value); } } } private string fee_type; /// /// 货币类型 符合ISO 4217标准的三位字母代码,默认人民币:CNY,其他值列表详见http://pay.weixin.qq.com/wiki/doc/api/index.php?chapter=4_2 /// [XmlElement("fee_type")] public string FeeType { get { return fee_type; } set { if (!String.IsNullOrEmpty(value)) { fee_type = value; PushKeyValue("fee_type", value); } } } private int total_fee; /// /// 总金额 订单总金额,只能为整数,详见支付金额 http://pay.weixin.qq.com/wiki/doc/api/index.php?chapter=4_2 /// [XmlElement("total_fee")] public int TotalFee { get { return total_fee; } set { total_fee = value; PushKeyValue("total_fee", value.ToString()); } } private string spbill_create_ip; /// /// 终端IP APP和网页支付提交用户端ip,Native支付填调用微信支付API的机器IP。 /// [XmlElement("spbill_create_ip")] public string SpbillCreateIp { get { return spbill_create_ip; } set { if (!String.IsNullOrEmpty(value)) { spbill_create_ip = value; PushKeyValue("spbill_create_ip", value); } } } private string time_start; /// /// 交易起始时间 订单生成时间,格式为yyyyMMddHHmmss,如2009年12月25日9点10分10秒表示为20091225091010 /// [XmlElement("time_start")] public string TimeStart { get { return time_start; } set { if (!String.IsNullOrEmpty(value)) { time_start = value; PushKeyValue("time_start", value); } } } private string time_expire; /// /// 交易结束时间 订单失效时间,格式为yyyyMMddHHmmss,如2009年12月27日9点10分10秒表示为20091227091010 /// [XmlElement("time_expire")] public string TimeExpire { get { return time_expire; } set { if (!String.IsNullOrEmpty(value)) { time_expire = value; PushKeyValue("time_expire", value); } } } private string goods_tag; /// /// 商品标记 商品标记,代金券或立减优惠功能的参数,说明详见http://pay.weixin.qq.com/wiki/doc/api/index.php?chapter=12_1 /// [XmlElement("goods_tag")] public string GoodsTag { get { return goods_tag; } set { if (!String.IsNullOrEmpty(value)) { goods_tag = value; PushKeyValue("goods_tag", value); } } } private string notify_url; /// /// 通知地址 接收微信支付异步通知回调地址 /// [XmlElement("notify_url")] public string NotifyUrl { get { return notify_url; } set { if (!String.IsNullOrEmpty(value)) { notify_url = value; PushKeyValue("notify_url", value); } } } private string trade_type; /// /// 交易类型 取值如下:JSAPI,NATIVE,APP,详细说明见http://pay.weixin.qq.com/wiki/doc/api/index.php?chapter=4_2 /// [XmlElement("trade_type")] public string TradeType { get { return trade_type; } set { if (!String.IsNullOrEmpty(value)) { trade_type = value; PushKeyValue("trade_type", value); } } } private string product_id; /// /// 商品ID trade_type=NATIVE,此参数必传。此id为二维码中包含的商品ID,商户自行定义。 /// [XmlElement("product_id")] public string ProductId { get { return product_id; } set { if (!String.IsNullOrEmpty(value)) { product_id = value; PushKeyValue("product_id", value); } } } private string openid; /// /// 用户标识 trade_type=JSAPI,此参数必传,用户在商户appid下的唯一标识。下单前需要调用【网页授权获取用户信息】接口获取到用户的Openid。 /// [XmlElement("openid")] public string Openid { get { return openid; } set { if (!String.IsNullOrEmpty(value)) { openid = value; PushKeyValue("openid", value); } } } } } ================================================ FILE: Business/Pay/Response/PayCloseorderResponse.cs ================================================ using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Xml.Serialization; namespace WX.Pay.Response { [XmlRoot("xml")] public class PayCloseorderResponse : PayResponse { } } ================================================ FILE: Business/Pay/Response/PayDownloadResponse.cs ================================================ using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace WX.Pay.Response { public class PayDownloadResponse : PayResponse { } } ================================================ FILE: Business/Pay/Response/PayOrderqueryResponse.cs ================================================ using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Xml.Serialization; namespace WX.Pay.Response { [XmlRoot("xml")] public class PayOrderqueryResponse : PayResponse { /// /// 用户在商户appid下的唯一标识 /// [XmlElement("openid")] public string OpenId { get; set; } /// /// 用户是否关注公众账号,Y-关注,N-未关注,仅在公众账号类型支付有效 /// [XmlElement("is_subscribe")] public string IsSubcribe { get; set; } /// /// 交易类型 /// 调用接口提交的交易类型,取值如下:JSAPI,NATIVE,APP,MICROPAY,详细说明见http://pay.weixin.qq.com/wiki/doc/api/index.php?chapter=4_2 /// [XmlElement("trade_type")] public string TradeType { get; set; } /// /// 交易状态 /// SUCCESS—支付成功 ///REFUND—转入退款 ///NOTPAY—未支付 ///CLOSED—已关闭 ///REVOKED—已撤销 ///USERPAYING--用户支付中 ///PAYERROR--支付失败(其他原因,如银行返回失败) /// [XmlElement("trade_state")] public string TradeState { get; set; } /// /// 付款银行 银行类型,采用字符串类型的银行标识 /// [XmlElement("bank_type")] public string BankType { get; set; } /// /// 总金额 订单总金额,单位为分 /// [XmlElement("total_fee")] public int TotalFee { get; set; } /// /// 货币种类 货币类型,符合ISO 4217标准的三位字母代码,默认人民币:CNY,其他值列表详见http://pay.weixin.qq.com/wiki/doc/api/index.php?chapter=4_2 /// [XmlElement("fee_type")] public string FeeType { get; set; } /// /// 现金支付金额 详见http://pay.weixin.qq.com/wiki/doc/api/index.php?chapter=4_2 /// [XmlElement("cash_fee")] public int CashFee { get; set; } /// /// 货币类型,符合ISO 4217标准的三位字母代码,默认人民币:CNY,其他值列表详见http://pay.weixin.qq.com/wiki/doc/api/index.php?chapter=4_2 /// [XmlElement("cash_fee_type")] public string CashFeeType { get; set; } /// /// 代金券或立减优惠”金额 订单总金额,订单总金额-“代金券或立减优惠”金额=现金支付金额,详见 /// [XmlElement("coupon_fee")] public int CouponFee { get; set; } /// /// 代金券或立减优惠使用数量 /// [XmlElement("coupon_count")] public int CouponCount { get; set; } /// /// 微信支付订单号 /// [XmlElement("transaction_id")] public string TransactionId { get; set; } /// /// 商户订单号 /// [XmlElement("out_trade_no")] public string OutTradeNo { get; set; } /// /// 商家数据包 /// [XmlElement("attach")] public string Attach { get; set; } /// /// 支付完成时间 /// [XmlElement("time_end")] public string TimeEnd { get; set; } /// /// 交易状态描述 /// [XmlElement("trade_state_desc")] public string TradeStateDesc { get; set; } } } ================================================ FILE: Business/Pay/Response/PayRefundQueryResponse.cs ================================================ using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Xml.Serialization; namespace WX.Pay.Response { [XmlRoot("xml")] public class PayRefundQueryResponse : PayRefundResponse { /// /// 退款渠道 /// [XmlElement("refund_channel")] public string RefundChannel { get; set; } } } ================================================ FILE: Business/Pay/Response/PayRefundResponse.cs ================================================ using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Xml.Serialization; namespace WX.Pay.Response { [XmlRoot("xml")] public class PayRefundResponse : PayResponse { /// /// 微信订单号 /// [XmlElement("transaction_id")] public string TransactionId { get; set; } /// /// 商户订单号 /// [XmlElement("out_trade_no")] public string OutTradeNo { get; set; } /// /// 商户退款单号 /// [XmlElement("out_refund_no")] public string OutRefundNo { get; set; } /// /// 微信退款单号 /// [XmlElement("refund_id")] public string RefundId { get; set; } /// /// 退款渠道 ORIGINAL—原路退款 BALANCE—退回到余额 /// [XmlElement("refund_channel")] public string RefundChannel { get; set; } /// /// 退款金额 /// [XmlElement("refund_fee")] public int RefundFee { get; set; } /// /// 退款货币种类 /// [XmlIgnore] [Obsolete] public string RefundFeeType { get; set; } /// /// 订单总金额 /// [XmlElement("total_fee")] public int TotalFee { get; set; } /// /// 订单金额货币种类 /// [XmlElement("fee_type")] public string FeeType { get; set; } /// /// 现金支付金额 /// [XmlElement("cash_fee")] public int CashFee { get; set; } /// /// 货币种类 /// [XmlIgnore] [Obsolete] public string CashFeeType { get; set; } /// /// 现金退款金额 /// [XmlElement("cash_refund_fee")] public int CashRefundFee { get; set; } /// /// 现金退款货币类型 /// [XmlIgnore] [Obsolete] public string CashRefundFeeType { get; set; } /// /// 代金券或立减优惠退款金额 /// [XmlElement("coupon_refund_fee")] public int CouponRefundFee { get; set; } /// /// 代金券或立减优惠使用数量 /// [XmlElement("coupon_count")] public int CouponCount { get; set; } /// /// 代金券或立减优惠ID /// [XmlElement("coupon_refund_id")] public string CouponRefundId { get; set; } //代金券或立减优惠批次ID //coupon_batch_id_$n //否 //String(20) //100 //代金券或立减优惠批次ID ,$n为下标,从1开始编号 //代金券或立减优惠ID //coupon_id_$n //否 //String(20) //10000 //代金券或立减优惠ID, $n为下标,从1开始编号 //单个代金券或立减优惠支付金额 //coupon_fee_$n //否 //Int //100 //单个代金券或立减优惠支付金额, $n为下标,从1开始编号 } } ================================================ FILE: Business/Pay/Response/PayResponse.cs ================================================ using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Xml.Serialization; namespace WX.Pay.Response { [XmlRoot("xml")] public class PayResponse { /// /// 返回状态码 /// SUCCESS/FAIL /// 此字段是通信标识,非交易标识,交易是否成功需要查看trade_state来判断 /// [XmlElement("return_code")] public string ReturnCode { get; set; } /// /// 返回信息,如非空,为错误原因 /// [XmlElement("return_msg")] public string ReturnMsg { get; set; } /// /// 公众账号ID /// [XmlElement("appid")] public string AppId { get; set; } /// /// 商户号 /// [XmlElement("mch_id")] public string MchId { get; set; } /// /// 设备号 /// [XmlElement("device_info")] public string DeviceInfo { get; set; } /// /// 随机字符串 /// [XmlElement("nonce_str")] public string NonceStr { get; set; } /// /// 签名 /// [XmlElement("sign")] public string Sign { get; set; } /// /// 业务结果 /// [XmlElement("result_code")] public string ResultCode { get; set; } /// /// 错误代码 /// [XmlElement("err_code")] public string ErrCode { get; set; } /// /// 错误代码描述 /// [XmlElement("err_code_des")] public string ErrCodeDes { get; set; } } } ================================================ FILE: Business/Pay/Response/PayUnifiedOrderResponse.cs ================================================ using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Xml.Serialization; namespace WX.Pay.Response { [XmlRoot("xml")] public class PayUnifiedOrderResponse : PayResponse { /// /// 交易类型 /// [XmlElement("trade_type")] public string TradeType { get; set; } /// /// 预支付交易会话标识 微信生成的预支付回话标识,用于后续接口调用中使用,该值有效期为2小时 /// [XmlElement("prepay_id")] public string PrepayId { get; set; } /// /// 二维码链接 trade_type为NATIVE是有返回,可将该参数值生成二维码展示出来进行扫码支付 /// [XmlElement("code_url")] public string CodeUrl { get; set; } } } ================================================ FILE: Business/Properties/AssemblyInfo.cs ================================================ using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; // 有关程序集的常规信息通过以下 // 特性集控制。更改这些特性值可修改 // 与程序集关联的信息。 [assembly: AssemblyTitle("WXPP Quick Framework")] [assembly: AssemblyDescription("WeiXin Public Platform Quick Framework")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("James & Candy")] [assembly: AssemblyProduct("QuickFramework")] [assembly: AssemblyCopyright("Copyright © 2014")] [assembly: AssemblyTrademark("JCSoft")] [assembly: AssemblyCulture("")] // 将 ComVisible 设置为 false 使此程序集中的类型 // 对 COM 组件不可见。如果需要从 COM 访问此程序集中的类型, // 则将该类型上的 ComVisible 特性设置为 true。 [assembly: ComVisible(false)] // 如果此项目向 COM 公开,则下列 GUID 用于类型库的 ID [assembly: Guid("eca0efff-69cf-4ea9-ad12-2193bda3ce8e")] // 程序集的版本信息由下面四个值组成: // // 主版本 // 次版本 // 生成号 // 修订号 // // 可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值, // 方法是按如下所示使用“*”: // [assembly: AssemblyVersion("1.0.*")] [assembly: AssemblyVersion("4.1.0.0")] [assembly: AssemblyFileVersion("4.1.0.0")] ================================================ FILE: Business/WXFramework.csproj ================================================  Debug AnyCPU {5765CFA5-1892-4A06-81A8-F5E4C8A28DFF} Library Properties WX JCSoft.WX.Framework v4.5 512 ..\ true true full false bin\Debug\ DEBUG;TRACE prompt 4 false pdbonly true bin\Release\ TRACE prompt 4 false bin\librelease\ TRACE true pdbonly AnyCPU prompt MinimumRecommendedRules.ruleset false ..\packages\Newtonsoft.Json.6.0.2\lib\net35\Newtonsoft.Json.dll xcopy /r /y $(TargetPath) $(ProjectDir)..\Bin\ ================================================ FILE: Business/packages.config ================================================  ================================================ FILE: CustomClickMenu/App.config ================================================ ================================================ FILE: CustomClickMenu/App_Code/DataGridRow.cs ================================================ using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace CustomClickMenu.App_Code { public class DataGridRow { public string Title { get; set; } public string Key { get; set; } public string Url { get; set; } public string Id { get; set; } public string RootId { get; set; } public string MenuType { get; set; } } } ================================================ FILE: CustomClickMenu/CustomClickMenu.csproj ================================================  Debug AnyCPU {EE5E6F8A-4E99-45B9-8619-C6B98663E33A} WinExe Properties CustomClickMenu CustomClickMenu v4.5 512 AnyCPU true full false bin\Debug\ DEBUG;TRACE prompt 4 false AnyCPU pdbonly true bin\Release\ TRACE prompt 4 false Form Form1.cs Form MenuForm.cs Form1.cs MenuForm.cs ResXFileCodeGenerator Resources.Designer.cs Designer True Resources.resx True SettingsSingleFileGenerator Settings.Designer.cs True Settings.settings True {5765cfa5-1892-4a06-81a8-f5e4c8a28dff} WXFramework ================================================ FILE: CustomClickMenu/Form1.Designer.cs ================================================ namespace CustomClickMenu { partial class Form1 { /// /// 必需的设计器变量。 /// private System.ComponentModel.IContainer components = null; /// /// 清理所有正在使用的资源。 /// /// 如果应释放托管资源,为 true;否则为 false。 protected override void Dispose(bool disposing) { if (disposing && (components != null)) { components.Dispose(); } base.Dispose(disposing); } #region Windows 窗体设计器生成的代码 /// /// 设计器支持所需的方法 - 不要 /// 使用代码编辑器修改此方法的内容。 /// private void InitializeComponent() { this.label1 = new System.Windows.Forms.Label(); this.label2 = new System.Windows.Forms.Label(); this.tb_appId = new System.Windows.Forms.TextBox(); this.tb_appSecret = new System.Windows.Forms.TextBox(); this.dataGridView1 = new System.Windows.Forms.DataGridView(); this.button1 = new System.Windows.Forms.Button(); this.button2 = new System.Windows.Forms.Button(); this.button3 = new System.Windows.Forms.Button(); this.button4 = new System.Windows.Forms.Button(); this.button5 = new System.Windows.Forms.Button(); this.button6 = new System.Windows.Forms.Button(); this.openFileDialog1 = new System.Windows.Forms.OpenFileDialog(); this.textBox1 = new System.Windows.Forms.TextBox(); this.label3 = new System.Windows.Forms.Label(); this.button7 = new System.Windows.Forms.Button(); this.comboBox1 = new System.Windows.Forms.ComboBox(); ((System.ComponentModel.ISupportInitialize)(this.dataGridView1)).BeginInit(); this.SuspendLayout(); // // label1 // this.label1.AutoSize = true; this.label1.Location = new System.Drawing.Point(26, 13); this.label1.Name = "label1"; this.label1.Size = new System.Drawing.Size(47, 12); this.label1.TabIndex = 0; this.label1.Text = "AppID:"; // // label2 // this.label2.AutoSize = true; this.label2.Location = new System.Drawing.Point(258, 13); this.label2.Name = "label2"; this.label2.Size = new System.Drawing.Size(71, 12); this.label2.TabIndex = 1; this.label2.Text = "AppSecret:"; // // tb_appId // this.tb_appId.Location = new System.Drawing.Point(79, 9); this.tb_appId.Name = "tb_appId"; this.tb_appId.Size = new System.Drawing.Size(160, 21); this.tb_appId.TabIndex = 2; // // tb_appSecret // this.tb_appSecret.Location = new System.Drawing.Point(335, 9); this.tb_appSecret.Name = "tb_appSecret"; this.tb_appSecret.Size = new System.Drawing.Size(160, 21); this.tb_appSecret.TabIndex = 3; // // dataGridView1 // this.dataGridView1.AllowUserToAddRows = false; this.dataGridView1.AllowUserToDeleteRows = false; this.dataGridView1.AllowUserToResizeColumns = false; this.dataGridView1.AllowUserToResizeRows = false; this.dataGridView1.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize; this.dataGridView1.Location = new System.Drawing.Point(12, 52); this.dataGridView1.MultiSelect = false; this.dataGridView1.Name = "dataGridView1"; this.dataGridView1.ReadOnly = true; this.dataGridView1.RowTemplate.Height = 23; this.dataGridView1.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect; this.dataGridView1.Size = new System.Drawing.Size(614, 250); this.dataGridView1.TabIndex = 4; // // button1 // this.button1.Location = new System.Drawing.Point(12, 312); this.button1.Name = "button1"; this.button1.Size = new System.Drawing.Size(87, 29); this.button1.TabIndex = 5; this.button1.Text = "添加新菜单"; this.button1.UseVisualStyleBackColor = true; this.button1.Click += new System.EventHandler(this.button1_Click); // // button2 // this.button2.Location = new System.Drawing.Point(532, 312); this.button2.Name = "button2"; this.button2.Size = new System.Drawing.Size(91, 29); this.button2.TabIndex = 6; this.button2.Text = "导出到xml"; this.button2.UseVisualStyleBackColor = true; this.button2.Click += new System.EventHandler(this.button2_Click); // // button3 // this.button3.Location = new System.Drawing.Point(142, 312); this.button3.Name = "button3"; this.button3.Size = new System.Drawing.Size(87, 29); this.button3.TabIndex = 7; this.button3.Text = "修改菜单"; this.button3.UseVisualStyleBackColor = true; this.button3.Click += new System.EventHandler(this.button3_Click); // // button4 // this.button4.Location = new System.Drawing.Point(272, 312); this.button4.Name = "button4"; this.button4.Size = new System.Drawing.Size(87, 29); this.button4.TabIndex = 8; this.button4.Text = "删除菜单"; this.button4.UseVisualStyleBackColor = true; this.button4.Click += new System.EventHandler(this.button4_Click); // // button5 // this.button5.Location = new System.Drawing.Point(402, 312); this.button5.Name = "button5"; this.button5.Size = new System.Drawing.Size(87, 29); this.button5.TabIndex = 9; this.button5.Text = "生成菜单"; this.button5.UseVisualStyleBackColor = true; this.button5.Click += new System.EventHandler(this.button5_Click); // // button6 // this.button6.Location = new System.Drawing.Point(532, 8); this.button6.Name = "button6"; this.button6.Size = new System.Drawing.Size(75, 23); this.button6.TabIndex = 10; this.button6.Text = "保存"; this.button6.UseVisualStyleBackColor = true; this.button6.Click += new System.EventHandler(this.button6_Click); // // openFileDialog1 // this.openFileDialog1.FileName = "jpg"; // // textBox1 // this.textBox1.Location = new System.Drawing.Point(79, 347); this.textBox1.Name = "textBox1"; this.textBox1.ReadOnly = true; this.textBox1.Size = new System.Drawing.Size(359, 21); this.textBox1.TabIndex = 11; this.textBox1.Click += new System.EventHandler(this.textBox1_Click); // // label3 // this.label3.AutoSize = true; this.label3.Location = new System.Drawing.Point(12, 350); this.label3.Name = "label3"; this.label3.Size = new System.Drawing.Size(65, 12); this.label3.TabIndex = 12; this.label3.Text = "选择文件:"; // // button7 // this.button7.Location = new System.Drawing.Point(532, 345); this.button7.Name = "button7"; this.button7.Size = new System.Drawing.Size(75, 23); this.button7.TabIndex = 13; this.button7.Text = "上传文件"; this.button7.UseVisualStyleBackColor = true; this.button7.Click += new System.EventHandler(this.button7_Click); // // comboBox1 // this.comboBox1.FormattingEnabled = true; this.comboBox1.Items.AddRange(new object[] { "图片", "视频", "音频", "缩略图"}); this.comboBox1.Location = new System.Drawing.Point(444, 347); this.comboBox1.Name = "comboBox1"; this.comboBox1.Size = new System.Drawing.Size(82, 20); this.comboBox1.TabIndex = 14; // // Form1 // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.ClientSize = new System.Drawing.Size(638, 395); this.Controls.Add(this.comboBox1); this.Controls.Add(this.button7); this.Controls.Add(this.label3); this.Controls.Add(this.textBox1); this.Controls.Add(this.button6); this.Controls.Add(this.button5); this.Controls.Add(this.button4); this.Controls.Add(this.button3); this.Controls.Add(this.button2); this.Controls.Add(this.button1); this.Controls.Add(this.dataGridView1); this.Controls.Add(this.tb_appSecret); this.Controls.Add(this.tb_appId); this.Controls.Add(this.label2); this.Controls.Add(this.label1); this.Name = "Form1"; this.Text = "微信公众平台自定义菜单"; this.FormClosed += new System.Windows.Forms.FormClosedEventHandler(this.Form1_FormClosed); ((System.ComponentModel.ISupportInitialize)(this.dataGridView1)).EndInit(); this.ResumeLayout(false); this.PerformLayout(); } #endregion private System.Windows.Forms.Label label1; private System.Windows.Forms.Label label2; private System.Windows.Forms.TextBox tb_appId; private System.Windows.Forms.TextBox tb_appSecret; private System.Windows.Forms.DataGridView dataGridView1; private System.Windows.Forms.Button button1; private System.Windows.Forms.Button button2; private System.Windows.Forms.Button button3; private System.Windows.Forms.Button button4; private System.Windows.Forms.Button button5; private System.Windows.Forms.Button button6; private System.Windows.Forms.OpenFileDialog openFileDialog1; private System.Windows.Forms.TextBox textBox1; private System.Windows.Forms.Label label3; private System.Windows.Forms.Button button7; private System.Windows.Forms.ComboBox comboBox1; } } ================================================ FILE: CustomClickMenu/Form1.cs ================================================ using CustomClickMenu.App_Code; using System; using System.Collections; using System.Collections.Generic; using System.ComponentModel; using System.Configuration; using System.Data; using System.Drawing; using System.IO; using System.Linq; using System.Reflection; using System.Text; using System.Windows.Forms; using System.Xml; using System.Xml.Linq; using System.Xml.Serialization; using WX.Api; using WX.Framework; using WX.Model; using WX.Model.ApiRequests; namespace CustomClickMenu { public partial class Form1 : Form { private static string s_menufilepath = ConfigurationManager.AppSettings["menufile"]; private static string s_appfilename; private List Rows { get; set; } public Form1() { InitializeComponent(); ReadMenuXml(); RefreshGrid(); LoadAppId(); } private void LoadAppId() { FileInfo fi = new FileInfo(s_menufilepath); s_appfilename = fi.DirectoryName + "\\app.txt"; if (File.Exists(s_appfilename)) { var content = File.ReadAllText(s_appfilename).Trim(); if (content.IndexOf("|") > -1) { var sub = content.Split(new char[] { '|' }, StringSplitOptions.RemoveEmptyEntries); tb_appId.Text = sub[0]; tb_appSecret.Text = sub[1]; } } } private void ReadMenuXml() { Rows = new List(); if (File.Exists(s_menufilepath)) { ReadXmlToList(s_menufilepath); } } private void ReadXmlToList(string s_menufilepath) { XDocument doc = XDocument.Load(s_menufilepath); var elements = doc.Element("NewDataSet").Elements(); if (elements.Any()) { foreach (var e in elements) { var row = new DataGridRow(); if (e.Element("Id") != null) { row.Id = e.Element("Id").Value; if (e.Element("Title") != null) row.Title = e.Element("Title").Value; if (e.Element("Key") != null) row.Key = e.Element("Key").Value; if (e.Element("RootId") != null) row.RootId = e.Element("RootId").Value; if (e.Element("Url") != null) row.Url = e.Element("Url").Value; if (e.Element("MenuType") != null) row.MenuType = e.Element("MenuType").Value; Rows.Add(row); } } } } private void button1_Click(object sender, EventArgs e) { var form = new MenuForm(Rows.Where(r => String.IsNullOrEmpty(r.RootId))); if (form.ShowDialog(this) == System.Windows.Forms.DialogResult.OK) { form.Row.Id = GetMaxId().ToString(); Rows.Add(form.Row); } RefreshGrid(); } private void RefreshGrid() { if (Rows != null && Rows.Count > 0) { this.dataGridView1.DataSource = null; this.dataGridView1.DataSource = Rows; this.dataGridView1.Refresh(); } else { this.dataGridView1.DataSource = null; } } private void button2_Click(object sender, EventArgs e) { ExportToXml(); MessageBox.Show("数据成功保存到" + s_menufilepath, "系统提示", MessageBoxButtons.OK, MessageBoxIcon.Information); } private void ExportToXml() { if (File.Exists(s_menufilepath)) File.Delete(s_menufilepath); DataTable dt = ToDataTable(Rows); DataSet ds = new DataSet(); ds.Tables.Add(dt); ds.WriteXml(s_menufilepath); } public static DataTable ToDataTable(IList list) { DataTable result = new DataTable(); if (list.Count > 0) { PropertyInfo[] propertys = list[0].GetType().GetProperties(); foreach (PropertyInfo pi in propertys) { result.Columns.Add(pi.Name, pi.PropertyType); } for (int i = 0; i < list.Count; i++) { ArrayList tempList = new ArrayList(); foreach (PropertyInfo pi in propertys) { object obj = pi.GetValue(list[i], null); tempList.Add(obj); } object[] array = tempList.ToArray(); result.LoadDataRow(array, true); } } return result; } private void Form1_FormClosed(object sender, FormClosedEventArgs e) { ExportToXml(); } private void button4_Click(object sender, EventArgs e) { if (this.dataGridView1.SelectedRows.Count > 0) { var id = this.dataGridView1.SelectedRows[0].Cells["Id"].Value.ToString(); if (MessageBox.Show(this, "是否删除此菜单", "", MessageBoxButtons.YesNoCancel) == System.Windows.Forms.DialogResult.Yes) { Rows.RemoveAll(r => r.RootId == id || r.Id == id); } } RefreshGrid(); } private void button3_Click(object sender, EventArgs e) { if (this.dataGridView1.SelectedRows.Count > 0) { var id = this.dataGridView1.SelectedRows[0].Cells["Id"].Value.ToString(); var row = Rows.FirstOrDefault(r => r.Id == id); if (row != null) { var form = new MenuForm(Rows.Where(r => String.IsNullOrEmpty(r.RootId)), row); if (form.ShowDialog(this) == System.Windows.Forms.DialogResult.OK) { row.Title = form.Row.Title; row.MenuType = form.Row.MenuType; row.Key = form.Row.Key; row.Url = form.Row.Url; row.RootId = form.Row.RootId; } RefreshGrid(); } } } private int GetMaxId() { return Rows.Any() ? Rows.Max(r => int.Parse(r.Id)) + 1 : 1; } private void button5_Click(object sender, EventArgs e) { var appId = tb_appId.Text.Trim(); var appSecret = tb_appSecret.Text.Trim(); if (String.IsNullOrEmpty(appId) || String.IsNullOrEmpty(appSecret)) { MessageBox.Show("请输入appId和appSecret"); return; } if (Rows == null || !Rows.Any()) { MessageBox.Show("请添加菜单"); return; } ApiAccessTokenManager.Instance.SetAppIdentity(appId, appSecret); IApiClient client = new DefaultApiClient(); var request = new MenuCreateRequest() { AccessToken = ApiAccessTokenManager.Instance.GetCurrentToken(), Buttons = BuildButton() }; var response = client.Execute(request); if (response.IsError) { MessageBox.Show(response.ToString()); return; } else { MessageBox.Show("菜单生成成功,一般有24小时缓存时间,也可以直接取消关注再关注直接查看效果"); } } private IEnumerable BuildButton() { var result = new List(); foreach (var r in Rows.Where(r => String.IsNullOrEmpty(r.RootId))) { var button = new ClickButton { Name = r.Title, Key = r.Key, Type = r.MenuType == "View" ? ClickButtonType.view : ClickButtonType.click }; if (button.Type == ClickButtonType.view) { button.Url = r.Url; } var subButton = Rows.Where(s => s.RootId == r.Id); if (subButton.Any()) { button.SubButton = subButton.Select(s => new ClickButton { Name = s.Title, Key = s.Key, Type = s.MenuType == "View" ? ClickButtonType.view : ClickButtonType.click, Url = s.MenuType == "View" ? s.Url : "" }).Take(5); } result.Add(button); } return result.Take(3); } private void button6_Click(object sender, EventArgs e) { var appId = tb_appId.Text.Trim(); var appSecret = tb_appSecret.Text.Trim(); if (String.IsNullOrEmpty(appId) || String.IsNullOrEmpty(appSecret)) { MessageBox.Show("请输入appId和appSecret"); return; } File.WriteAllText(s_appfilename, appId + "|" + appSecret); MessageBox.Show("保存文件成功"); } private void textBox1_Click(object sender, EventArgs e) { this.openFileDialog1.ShowDialog(this); this.textBox1.Text = this.openFileDialog1.FileName; } private void button7_Click(object sender, EventArgs e) { var appId = tb_appId.Text.Trim(); var appSecret = tb_appSecret.Text.Trim(); ApiAccessTokenManager.Instance.SetAppIdentity(appId, appSecret); IApiClient client = new DefaultApiClient(); var request = new MediaUploadRequest { AccessToken = ApiAccessTokenManager.Instance.GetCurrentToken(), MediaType = GetMediaType(), FilePath = textBox1.Text }; var response = client.Execute(request); if (response.IsError) { MessageBox.Show("错误:" + response.ErrorMessage); } else { MessageBox.Show("保存成功!mediaid:" + response.MediaId); } } private MediaType GetMediaType() { switch (this.comboBox1.Text) { case "视频": return MediaType.Video; break; case "音频": return MediaType.Voice; break; case "缩略图": return MediaType.Thumb; break; case "图片": default: return MediaType.Image; break; } } } } ================================================ FILE: CustomClickMenu/Form1.resx ================================================  text/microsoft-resx 2.0 System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 17, 17 ================================================ FILE: CustomClickMenu/MenuForm.Designer.cs ================================================ namespace CustomClickMenu { partial class MenuForm { /// /// Required designer variable. /// private System.ComponentModel.IContainer components = null; /// /// Clean up any resources being used. /// /// true if managed resources should be disposed; otherwise, false. protected override void Dispose(bool disposing) { if (disposing && (components != null)) { components.Dispose(); } base.Dispose(disposing); } #region Windows Form Designer generated code /// /// Required method for Designer support - do not modify /// the contents of this method with the code editor. /// private void InitializeComponent() { this.label1 = new System.Windows.Forms.Label(); this.label2 = new System.Windows.Forms.Label(); this.label3 = new System.Windows.Forms.Label(); this.label4 = new System.Windows.Forms.Label(); this.label5 = new System.Windows.Forms.Label(); this.radioButton1 = new System.Windows.Forms.RadioButton(); this.radioButton2 = new System.Windows.Forms.RadioButton(); this.comboBox1 = new System.Windows.Forms.ComboBox(); this.textBox1 = new System.Windows.Forms.TextBox(); this.textBox2 = new System.Windows.Forms.TextBox(); this.textBox3 = new System.Windows.Forms.TextBox(); this.button1 = new System.Windows.Forms.Button(); this.button2 = new System.Windows.Forms.Button(); this.SuspendLayout(); // // label1 // this.label1.AutoSize = true; this.label1.Location = new System.Drawing.Point(10, 13); this.label1.Name = "label1"; this.label1.Size = new System.Drawing.Size(65, 12); this.label1.TabIndex = 0; this.label1.Text = "菜单类型:"; // // label2 // this.label2.AutoSize = true; this.label2.Location = new System.Drawing.Point(34, 81); this.label2.Name = "label2"; this.label2.Size = new System.Drawing.Size(41, 12); this.label2.TabIndex = 1; this.label2.Text = "标题:"; // // label3 // this.label3.AutoSize = true; this.label3.Location = new System.Drawing.Point(40, 115); this.label3.Name = "label3"; this.label3.Size = new System.Drawing.Size(35, 12); this.label3.TabIndex = 2; this.label3.Text = "Key:"; // // label4 // this.label4.AutoSize = true; this.label4.Location = new System.Drawing.Point(40, 149); this.label4.Name = "label4"; this.label4.Size = new System.Drawing.Size(35, 12); this.label4.TabIndex = 3; this.label4.Text = "Url:"; // // label5 // this.label5.AutoSize = true; this.label5.Location = new System.Drawing.Point(22, 47); this.label5.Name = "label5"; this.label5.Size = new System.Drawing.Size(53, 12); this.label5.TabIndex = 4; this.label5.Text = "父菜单:"; // // radioButton1 // this.radioButton1.AutoSize = true; this.radioButton1.Location = new System.Drawing.Point(96, 11); this.radioButton1.Name = "radioButton1"; this.radioButton1.Size = new System.Drawing.Size(59, 16); this.radioButton1.TabIndex = 5; this.radioButton1.Text = "链接型"; this.radioButton1.UseVisualStyleBackColor = true; this.radioButton1.CheckedChanged += new System.EventHandler(this.radioButton1_CheckedChanged); // // radioButton2 // this.radioButton2.AutoSize = true; this.radioButton2.Location = new System.Drawing.Point(176, 11); this.radioButton2.Name = "radioButton2"; this.radioButton2.Size = new System.Drawing.Size(59, 16); this.radioButton2.TabIndex = 6; this.radioButton2.Text = "点击型"; this.radioButton2.UseVisualStyleBackColor = true; this.radioButton2.CheckedChanged += new System.EventHandler(this.radioButton2_CheckedChanged); // // comboBox1 // this.comboBox1.FormattingEnabled = true; this.comboBox1.Location = new System.Drawing.Point(96, 43); this.comboBox1.Name = "comboBox1"; this.comboBox1.Size = new System.Drawing.Size(139, 20); this.comboBox1.TabIndex = 7; // // textBox1 // this.textBox1.Location = new System.Drawing.Point(96, 77); this.textBox1.Name = "textBox1"; this.textBox1.Size = new System.Drawing.Size(139, 21); this.textBox1.TabIndex = 8; // // textBox2 // this.textBox2.Location = new System.Drawing.Point(96, 111); this.textBox2.Name = "textBox2"; this.textBox2.Size = new System.Drawing.Size(139, 21); this.textBox2.TabIndex = 9; // // textBox3 // this.textBox3.Location = new System.Drawing.Point(96, 145); this.textBox3.Name = "textBox3"; this.textBox3.Size = new System.Drawing.Size(139, 21); this.textBox3.TabIndex = 10; // // button1 // this.button1.Location = new System.Drawing.Point(29, 189); this.button1.Name = "button1"; this.button1.Size = new System.Drawing.Size(88, 25); this.button1.TabIndex = 11; this.button1.Text = "保存"; this.button1.UseVisualStyleBackColor = true; this.button1.Click += new System.EventHandler(this.button1_Click); // // button2 // this.button2.Location = new System.Drawing.Point(164, 189); this.button2.Name = "button2"; this.button2.Size = new System.Drawing.Size(88, 25); this.button2.TabIndex = 12; this.button2.Text = "取消"; this.button2.UseVisualStyleBackColor = true; this.button2.Click += new System.EventHandler(this.button2_Click); // // MenuForm // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.ClientSize = new System.Drawing.Size(284, 226); this.Controls.Add(this.button2); this.Controls.Add(this.button1); this.Controls.Add(this.textBox3); this.Controls.Add(this.textBox2); this.Controls.Add(this.textBox1); this.Controls.Add(this.comboBox1); this.Controls.Add(this.radioButton2); this.Controls.Add(this.radioButton1); this.Controls.Add(this.label5); this.Controls.Add(this.label4); this.Controls.Add(this.label3); this.Controls.Add(this.label2); this.Controls.Add(this.label1); this.Name = "MenuForm"; this.Text = "编辑菜单"; this.ResumeLayout(false); this.PerformLayout(); } #endregion private System.Windows.Forms.Label label1; private System.Windows.Forms.Label label2; private System.Windows.Forms.Label label3; private System.Windows.Forms.Label label4; private System.Windows.Forms.Label label5; private System.Windows.Forms.RadioButton radioButton1; private System.Windows.Forms.RadioButton radioButton2; private System.Windows.Forms.ComboBox comboBox1; private System.Windows.Forms.TextBox textBox1; private System.Windows.Forms.TextBox textBox2; private System.Windows.Forms.TextBox textBox3; private System.Windows.Forms.Button button1; private System.Windows.Forms.Button button2; } } ================================================ FILE: CustomClickMenu/MenuForm.cs ================================================ using CustomClickMenu.App_Code; using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Windows.Forms; namespace CustomClickMenu { public partial class MenuForm : Form { public MenuForm(IEnumerable parentRows, DataGridRow row) : this(parentRows) { if (row.MenuType == "Click") radioButton2.Checked = true; else radioButton1.Checked = true; if (!String.IsNullOrEmpty(row.RootId)) comboBox1.SelectedValue = row.RootId; textBox1.Text = row.Title; textBox2.Text = row.Key; textBox3.Text = row.Url; RowId = row.Id; } private string RowId { get; set; } public MenuForm(IEnumerable parentRows) : this() { ParentRows = parentRows; BindParentData(); CheckBoxCheckChanged(); } private void BindParentData() { var list = ParentRows.ToList(); list.Add(new DataGridRow { Title = "无父类", Id = "0" }); comboBox1.DataSource = list; comboBox1.DisplayMember = "Title"; comboBox1.ValueMember = "Id"; comboBox1.SelectedValue = "0"; } private MenuForm() { InitializeComponent(); } private void button2_Click(object sender, EventArgs e) { this.DialogResult = System.Windows.Forms.DialogResult.Cancel; this.Close(); } public DataGridRow Row { get; set; } private IEnumerable ParentRows { get; set; } private void button1_Click(object sender, EventArgs e) { if (!Verfiry()) return; Row = new DataGridRow(); Row.Id = RowId; Row.Title = textBox1.Text; Row.Key = textBox2.Text; Row.Url = textBox3.Text; if (comboBox1.SelectedValue != "0") { Row.RootId = comboBox1.SelectedValue.ToString(); } if (radioButton1.Checked) Row.MenuType = "View"; else Row.MenuType = "Click"; this.DialogResult = System.Windows.Forms.DialogResult.OK; this.Close(); } private bool Verfiry() { if (!radioButton1.Checked && !radioButton2.Checked) { ShowMessage("请选择类型"); return false; } if (String.IsNullOrEmpty(textBox1.Text)) { ShowMessage("请输入标题"); return false; } if (radioButton2.Checked && String.IsNullOrEmpty(textBox2.Text)) { ShowMessage("点击型菜单请设置Key"); return false; } if(radioButton1.Checked && String.IsNullOrEmpty(textBox3.Text)) { ShowMessage("链接型菜单请设置url"); return false; } return true; } private void ShowMessage(string message) { MessageBox.Show(message); return; } private void radioButton1_CheckedChanged(object sender, EventArgs e) { CheckBoxCheckChanged(); } private void CheckBoxCheckChanged() { if (!radioButton1.Checked && !radioButton2.Checked) { textBox2.Enabled = false; textBox3.Enabled = false; } if (radioButton1.Checked) { textBox2.Enabled = true; textBox3.Enabled = true; } if (radioButton2.Checked) { textBox3.Enabled = false; textBox2.Enabled = true; } } private void radioButton2_CheckedChanged(object sender, EventArgs e) { CheckBoxCheckChanged(); } } } ================================================ FILE: CustomClickMenu/MenuForm.resx ================================================  text/microsoft-resx 2.0 System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 ================================================ FILE: CustomClickMenu/Program.cs ================================================ using System; using System.Collections.Generic; using System.Linq; using System.Windows.Forms; namespace CustomClickMenu { static class Program { /// /// 应用程序的主入口点。 /// [STAThread] static void Main() { Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); Application.Run(new Form1()); } } } ================================================ FILE: CustomClickMenu/Properties/AssemblyInfo.cs ================================================ using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; // 有关程序集的常规信息通过以下 // 特性集控制。更改这些特性值可修改 // 与程序集关联的信息。 [assembly: AssemblyTitle("CustomClickMenu")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("CustomClickMenu")] [assembly: AssemblyCopyright("Copyright © 2014")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] // 将 ComVisible 设置为 false 使此程序集中的类型 // 对 COM 组件不可见。如果需要从 COM 访问此程序集中的类型, // 则将该类型上的 ComVisible 特性设置为 true。 [assembly: ComVisible(false)] // 如果此项目向 COM 公开,则下列 GUID 用于类型库的 ID [assembly: Guid("fdfafba9-a78f-4d25-aae4-f44b1561754b")] // 程序集的版本信息由下面四个值组成: // // 主版本 // 次版本 // 生成号 // 修订号 // // 可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值, // 方法是按如下所示使用“*”: // [assembly: AssemblyVersion("1.0.*")] [assembly: AssemblyVersion("1.0.0.0")] [assembly: AssemblyFileVersion("1.0.0.0")] ================================================ FILE: CustomClickMenu/Properties/Resources.Designer.cs ================================================ //------------------------------------------------------------------------------ // // 此代码由工具生成。 // 运行时版本:4.0.30319.42000 // // 对此文件的更改可能会导致不正确的行为,并且如果 // 重新生成代码,这些更改将会丢失。 // //------------------------------------------------------------------------------ namespace CustomClickMenu.Properties { using System; /// /// 一个强类型的资源类,用于查找本地化的字符串等。 /// // 此类是由 StronglyTypedResourceBuilder // 类通过类似于 ResGen 或 Visual Studio 的工具自动生成的。 // 若要添加或移除成员,请编辑 .ResX 文件,然后重新运行 ResGen // (以 /str 作为命令选项),或重新生成 VS 项目。 [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "15.0.0.0")] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] internal class Resources { private static global::System.Resources.ResourceManager resourceMan; private static global::System.Globalization.CultureInfo resourceCulture; [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] internal Resources() { } /// /// 返回此类使用的缓存的 ResourceManager 实例。 /// [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] internal static global::System.Resources.ResourceManager ResourceManager { get { if (object.ReferenceEquals(resourceMan, null)) { global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("CustomClickMenu.Properties.Resources", typeof(Resources).Assembly); resourceMan = temp; } return resourceMan; } } /// /// 使用此强类型资源类,为所有资源查找 /// 重写当前线程的 CurrentUICulture 属性。 /// [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] internal static global::System.Globalization.CultureInfo Culture { get { return resourceCulture; } set { resourceCulture = value; } } } } ================================================ FILE: CustomClickMenu/Properties/Resources.resx ================================================  text/microsoft-resx 2.0 System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 ================================================ FILE: CustomClickMenu/Properties/Settings.Designer.cs ================================================ //------------------------------------------------------------------------------ // // 此代码由工具生成。 // 运行时版本:4.0.30319.42000 // // 对此文件的更改可能会导致不正确的行为,并且如果 // 重新生成代码,这些更改将会丢失。 // //------------------------------------------------------------------------------ namespace CustomClickMenu.Properties { [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "15.7.0.0")] internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase { private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); public static Settings Default { get { return defaultInstance; } } } } ================================================ FILE: CustomClickMenu/Properties/Settings.settings ================================================  ================================================ FILE: JCWX.sln ================================================  Microsoft Visual Studio Solution File, Format Version 12.00 # Visual Studio 2012 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WebDemo", "WebDemo\WebDemo.csproj", "{72472759-0504-49E8-A289-F12E71A93181}" EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "demo", "demo", "{8AB866F7-4EAA-44EF-AD67-7CB4CF12FA72}" EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "lib", "lib", "{B1E93B15-EB4F-493D-B309-E2F53016F0D1}" EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WebClasses", "WebClasses\WebClasses.csproj", "{7167FFE5-2C16-4466-AAED-2B4107974BAE}" EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "test", "test", "{845B1649-482C-4C6E-97B7-0F6C320DCCEC}" EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "FrameworkCoreTest", "test\FrameworkCoreTest\FrameworkCoreTest.csproj", "{2DE1B569-2437-47E0-AA51-84CDCCB2968A}" EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WXFramework", "Business\WXFramework.csproj", "{5765CFA5-1892-4A06-81A8-F5E4C8A28DFF}" EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CustomClickMenu", "CustomClickMenu\CustomClickMenu.csproj", "{EE5E6F8A-4E99-45B9-8619-C6B98663E33A}" EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = ".nuget", ".nuget", "{245A5585-8A13-4FF6-8AC9-93110F5FCCE3}" ProjectSection(SolutionItems) = preProject .nuget\NuGet.Config = .nuget\NuGet.Config .nuget\NuGet.exe = .nuget\NuGet.exe .nuget\NuGet.targets = .nuget\NuGet.targets EndProjectSection EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU librelease|Any CPU = librelease|Any CPU Release|Any CPU = Release|Any CPU EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution {72472759-0504-49E8-A289-F12E71A93181}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {72472759-0504-49E8-A289-F12E71A93181}.Debug|Any CPU.Build.0 = Debug|Any CPU {72472759-0504-49E8-A289-F12E71A93181}.librelease|Any CPU.ActiveCfg = librelease|Any CPU {72472759-0504-49E8-A289-F12E71A93181}.Release|Any CPU.ActiveCfg = Release|Any CPU {72472759-0504-49E8-A289-F12E71A93181}.Release|Any CPU.Build.0 = Release|Any CPU {7167FFE5-2C16-4466-AAED-2B4107974BAE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {7167FFE5-2C16-4466-AAED-2B4107974BAE}.Debug|Any CPU.Build.0 = Debug|Any CPU {7167FFE5-2C16-4466-AAED-2B4107974BAE}.librelease|Any CPU.ActiveCfg = librelease|Any CPU {7167FFE5-2C16-4466-AAED-2B4107974BAE}.Release|Any CPU.ActiveCfg = Release|Any CPU {7167FFE5-2C16-4466-AAED-2B4107974BAE}.Release|Any CPU.Build.0 = Release|Any CPU {2DE1B569-2437-47E0-AA51-84CDCCB2968A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {2DE1B569-2437-47E0-AA51-84CDCCB2968A}.Debug|Any CPU.Build.0 = Debug|Any CPU {2DE1B569-2437-47E0-AA51-84CDCCB2968A}.librelease|Any CPU.ActiveCfg = Release|Any CPU {2DE1B569-2437-47E0-AA51-84CDCCB2968A}.librelease|Any CPU.Build.0 = Release|Any CPU {2DE1B569-2437-47E0-AA51-84CDCCB2968A}.Release|Any CPU.ActiveCfg = Release|Any CPU {2DE1B569-2437-47E0-AA51-84CDCCB2968A}.Release|Any CPU.Build.0 = Release|Any CPU {5765CFA5-1892-4A06-81A8-F5E4C8A28DFF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {5765CFA5-1892-4A06-81A8-F5E4C8A28DFF}.Debug|Any CPU.Build.0 = Debug|Any CPU {5765CFA5-1892-4A06-81A8-F5E4C8A28DFF}.librelease|Any CPU.ActiveCfg = librelease|Any CPU {5765CFA5-1892-4A06-81A8-F5E4C8A28DFF}.librelease|Any CPU.Build.0 = librelease|Any CPU {5765CFA5-1892-4A06-81A8-F5E4C8A28DFF}.Release|Any CPU.ActiveCfg = Release|Any CPU {5765CFA5-1892-4A06-81A8-F5E4C8A28DFF}.Release|Any CPU.Build.0 = Release|Any CPU {EE5E6F8A-4E99-45B9-8619-C6B98663E33A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {EE5E6F8A-4E99-45B9-8619-C6B98663E33A}.Debug|Any CPU.Build.0 = Debug|Any CPU {EE5E6F8A-4E99-45B9-8619-C6B98663E33A}.librelease|Any CPU.ActiveCfg = Release|Any CPU {EE5E6F8A-4E99-45B9-8619-C6B98663E33A}.librelease|Any CPU.Build.0 = Release|Any CPU {EE5E6F8A-4E99-45B9-8619-C6B98663E33A}.Release|Any CPU.ActiveCfg = Release|Any CPU {EE5E6F8A-4E99-45B9-8619-C6B98663E33A}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE EndGlobalSection GlobalSection(NestedProjects) = preSolution {72472759-0504-49E8-A289-F12E71A93181} = {8AB866F7-4EAA-44EF-AD67-7CB4CF12FA72} {7167FFE5-2C16-4466-AAED-2B4107974BAE} = {8AB866F7-4EAA-44EF-AD67-7CB4CF12FA72} {EE5E6F8A-4E99-45B9-8619-C6B98663E33A} = {8AB866F7-4EAA-44EF-AD67-7CB4CF12FA72} {5765CFA5-1892-4A06-81A8-F5E4C8A28DFF} = {B1E93B15-EB4F-493D-B309-E2F53016F0D1} {2DE1B569-2437-47E0-AA51-84CDCCB2968A} = {845B1649-482C-4C6E-97B7-0F6C320DCCEC} EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution VisualSVNWorkingCopyRoot = . EndGlobalSection EndGlobal ================================================ FILE: LICENSE ================================================ The MIT License (MIT) Copyright (c) 2014 JamesYinG Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ================================================ FILE: README.md ================================================ 微信快速开发框架.Net Core版本已经正在开发中,项目地址:https://github.com/jamesying/jcwxcore 目前除文件上传api还未完成,其他都可以正常使用 --------------------------------------------------------------------------- 微信快速开发框架(WXPP QuickFramework)已更新至V4.0版本上线 您可以用来做什么? 您可以使用此框架快速开发微信公众平台,目前V3.0已经支持高级接口的开发。 使用教程可以参考我的博客:http://inday.cnblogs.com 如果在使用中有任何问题,可以Email给我:james#taogame.com --------------------------------------------------------------------------- 更新日期:2015-5-7 更新内容: 1、新增了素材管理接口 2、新增了图文统计接口 3、新增了多客服会话接口 重要更新: 1、新添加了【微信支付】接口 2、统一下单接口 3、申请退款接口 4、订单查询及退款查询接口暂时不要用,还没有完善 5、对账单下载接口 详细内容请参考:[项目wiki](https://github.com/JamesYing/JCWX/wiki/V4.1%E7%89%88%E6%9C%AC%E5%8F%91%E5%B8%83%EF%BC%8C%E6%B7%BB%E5%8A%A0%E4%BA%86%E9%83%A8%E5%88%86%E5%BE%AE%E4%BF%A1%E6%94%AF%E4%BB%98%E5%8A%9F%E8%83%BD) --------------------------------------------------------------------------- 更新日期:2015-1-26 更新内容: 1、增加了对客服管理的支持 2、增加了获取微信服务器端ip列表 3、增加了短链接推广支持 4、增加了模板消息的支持 5、修正了部分bug 暂时没有更新博客,等有时间再写,使用方法可参以下教程 --------------------------------------------------------------------------- 快速开发系列教程:
一、[对微信公众平台开发的消息处理](http://www.cnblogs.com/inday/p/weixin-dev-msg-Question.html)
二、[快速开发微信公众平台框架---简介](http://www.cnblogs.com/inday/p/weixin-public-platform.html)
三、[建立微信公众平台测试账号](http://www.cnblogs.com/inday/p/weixin-public-platform-test-account.html)
四、[体验微信公众平台快速开发框架](http://www.cnblogs.com/inday/p/wx-publicform-quick-framework-webdemo.html)
五、[利用快速开发框架,快速搭建微信浏览博客园首页文章](http://www.cnblogs.com/inday/p/weixin-publicf-platform-cnblogs.html)
六、[微信快速开发框架(WXPP QuickFramework)V2.0版本上线--源码已更新至github](http://www.cnblogs.com/inday/p/wxpp-quick-framework-v-2.html)
七、[微信快速开发框架(七)--发送客服信息,版本更新至V2.2](http://www.cnblogs.com/inday/p/weixin-public-platform-quick-framework-v-2-2.html)
八、[微信快速开发框架V2.3--增加语音识别及网页获取用户信息](http://www.cnblogs.com/inday/p/wechat-public-platform-v2-3.html) ---------------------------------------------------------------------------- ================================================ FILE: WebClasses/CnBlogsFeed.cs ================================================ using System; using System.Collections.Generic; using System.Linq; using System.Net; using System.Text; using System.Text.RegularExpressions; using System.Web; using System.Xml; using System.Xml.Linq; using WX.Model; namespace WX.Demo.WebClasses { public class CnBlogsFeed { private int m_topNum = 5; //缓存过期时间,这里是10分钟 private static int s_timeout = 10 * 60 * 1000; //缓存过期时间 private static DateTime s_outDate = DateTime.Now; //博客园文章列表正则表达式 private static Regex s_cnblogsIndexRegex = new Regex("\\s*.*\\s*.*\\s*.*\\s*.*\\s*.*\\s*.*\\s*.*\\s*\\s*

.*)\"\\s*target=\"_blank\">(?.*)</a>.*\\s*<p\\s*class=\"post_item_summary\">\\s*(?<content>.*)\\s*</p>"); //内容中,用户头像正则表达式 private static Regex s_picUrlRegex = new Regex("src=\"(?<picurl>.*)\"\\s"); //博客园文章列表uri private static string s_cnblogsIndexUri = "http://www.cnblogs.com/mvc/AggSite/PostList.aspx?CategoryId=808&PageIndex=1"; //默认的一个大图,一个小图的图片地址 private static string s_defaultBigPicUri = "http://wx.jamesying.com/images/default_title.jpg"; private static string s_defaultSmallPicUri = "http://wx.jamesying.com/images/default_small.jpg"; //用来缓存请求过来的数据,不高兴用Cache了。 private static List<ArticleMessage> s_articles = null; public CnBlogsFeed(int topNum) { m_topNum = topNum; } public List<ArticleMessage> GetTopCnblogsFeed() { if (s_articles == null) { GetTopCnblogsFeed(m_topNum); } else { if (DateTime.Now > s_outDate) { GetTopCnblogsFeed(m_topNum); } } return s_articles; } private void GetTopCnblogsFeed(int m_topNum) { try { var html = GetRemoteUri(s_cnblogsIndexUri, Encoding.UTF8); var matchs = s_cnblogsIndexRegex.Matches(html); var i = 0; s_articles = new List<ArticleMessage>(); foreach (Match match in matchs) { if (i >= m_topNum) break; var article = new ArticleMessage { Title = match.Groups[2].Value, Url = match.Groups[1].Value, Description = match.Groups[3].Value }; if (i == 0) { article.PicUrl = s_defaultBigPicUri; } else { var matchPic = s_picUrlRegex.Match(article.Description); if (matchPic.Success) { article.PicUrl = matchPic.Groups[1].Value; } else { article.PicUrl = s_defaultSmallPicUri; } } s_articles.Add(article); i += 1; } s_outDate = DateTime.Now.AddMilliseconds(s_timeout); } catch(Exception ex) { s_articles = null; s_outDate = DateTime.Now; #if DEBUG throw ex; #endif } //return s_articles; } private string GetRemoteUri(string uri, Encoding encoding) { var client = new WebClient(); client.Encoding = encoding; return client.DownloadString(uri); } } } ================================================ FILE: WebClasses/Command.cs ================================================ using System; using System.Collections.Generic; using System.Linq; using System.Text; using WX.Framework; namespace WX.Demo.WebClasses { public class Command { public string Keywords { get; set; } public string Parameter { get; set; } public IMessageHandler MessageHandler { get; set; } } } ================================================ FILE: WebClasses/Handlers/CnblogsArticleNewsMessageHandler.cs ================================================ using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Xml.Linq; using WX.Framework; using WX.Model; namespace WX.Demo.WebClasses { public class CnblogsArticleNewsMessageHandler : IMessageHandler { public ResponseMessage HandlerRequestMessage(MiddleMessage msg) { //var request = new RequestTextMessage(xml); var response = new ResponseNewsMessage(msg.RequestMessage); var cnblogsFeed = new CnBlogsFeed(5); var articles = cnblogsFeed.GetTopCnblogsFeed(); response.ArticleCount = articles.Count; response.CreateTime = DateTime.Now.Ticks; response.Articles = articles; return response; } } } ================================================ FILE: WebClasses/Handlers/CnblogsTextMessageHandler.cs ================================================ using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Xml.Linq; using WX.Framework; using WX.Model; namespace WX.Demo.WebClasses { public class CnblogsTextMessageHandler : IMessageHandler { private static string s_cnblogsMsg = "HI,博客园的园友,欢迎来到JamesYing的微信世界,请关注我,http://inday.cnblogs.com"; public ResponseMessage HandlerRequestMessage(MiddleMessage msg) { return new ResponseTextMessage(msg.RequestMessage) { CreateTime = DateTime.Now.Ticks, Content = s_cnblogsMsg }; } } } ================================================ FILE: WebClasses/Handlers/DefaultMessageHandler.cs ================================================ using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Xml.Linq; using WX.Framework; using WX.Model; namespace WX.Demo.WebClasses { public class DefaultMessageHandler : IMessageHandler { private static string s_defaultMsg = "对不起,亲,我还无法了解您的需求,我会不断改进的!"; public ResponseMessage HandlerRequestMessage(MiddleMessage msg) { return new ResponseTextMessage(msg.RequestMessage) { CreateTime = DateTime.Now.Ticks, Content = s_defaultMsg }; } } } ================================================ FILE: WebClasses/Handlers/SubScribeEventMessageHandler.cs ================================================ using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Xml.Linq; using WX.Framework; using WX.Model; namespace WX.Demo.WebClasses { public class SubScribeEventMessageHandler : TextMessageHandler { private static string subScribeMsg = "欢迎您关注本微信,此微信关注公众平台快速框架的开发,详细内容可参考:http://inday.cnblogs.com"; public SubScribeEventMessageHandler() : base(subScribeMsg) { } } } ================================================ FILE: WebClasses/Handlers/TextMessageHandler.cs ================================================ using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Xml.Linq; using WX.Framework; using WX.Model; namespace WX.Demo.WebClasses { public class TextMessageHandler : IMessageHandler { private string Message { get; set; } public TextMessageHandler(string msg) { Message = msg; } public ResponseMessage HandlerRequestMessage(MiddleMessage msg) { return new ResponseTextMessage(msg.RequestMessage) { CreateTime = DateTime.Now.Ticks, Content = Message }; } } } ================================================ FILE: WebClasses/Handlers/UnSubScribeEventMessageHandler.cs ================================================ using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Xml.Linq; using WX.Framework; using WX.Model; namespace WX.Demo.WebClasses { public class UnSubScribeEventMessageHandler : TextMessageHandler { private static string unsubScribeMsg = "让您失望了,有什么好的建议您可以通过网站留言给我,我们将会改进,此微信关注公众平台快速框架的开发,详细内容可参考:http://inday.cnblogs.com"; public UnSubScribeEventMessageHandler() : base(unsubScribeMsg) { } } } ================================================ FILE: WebClasses/Handlers/VoiceMessageHandler.cs ================================================ using System; using System.Collections.Generic; using System.Linq; using System.Text; using WX.Framework; using WX.Model; namespace WX.Demo.WebClasses.Handlers { public class VoiceMessageHandler : IMessageHandler { public ResponseMessage HandlerRequestMessage(MiddleMessage message) { return new ResponseTextMessage(message.RequestMessage) { Content = "您声音真好听" }; } } } ================================================ FILE: WebClasses/MyLog.cs ================================================ using System; using System.Collections.Generic; using System.IO; using System.Linq; using System.Web; namespace WX.Demo.WebClasses { public class MyLog { private static string fileName = HttpContext.Current.Server.MapPath("log.log"); private static object lockobj = new object(); public static void Log(string content) { lock (lockobj) { File.AppendAllText(fileName, content + "\r\n-----------------\r\n"); } } } } ================================================ FILE: WebClasses/Properties/AssemblyInfo.cs ================================================ using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; // 有关程序集的常规信息通过以下 // 特性集控制。更改这些特性值可修改 // 与程序集关联的信息。 [assembly: AssemblyTitle("WebClasses")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("WebClasses")] [assembly: AssemblyCopyright("Copyright © 2013")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] // 将 ComVisible 设置为 false 使此程序集中的类型 // 对 COM 组件不可见。如果需要从 COM 访问此程序集中的类型, // 则将该类型上的 ComVisible 特性设置为 true。 [assembly: ComVisible(false)] // 如果此项目向 COM 公开,则下列 GUID 用于类型库的 ID [assembly: Guid("d72c72a4-f472-469b-9431-8c0da888f996")] // 程序集的版本信息由下面四个值组成: // // 主版本 // 次版本 // 生成号 // 修订号 // // 可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值, // 方法是按如下所示使用“*”: // [assembly: AssemblyVersion("1.0.*")] [assembly: AssemblyVersion("1.0.0.0")] [assembly: AssemblyFileVersion("1.0.0.0")] ================================================ FILE: WebClasses/Roles/EventMessageRole.cs ================================================ using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Xml.Linq; using WX.Framework; using WX.Model; namespace WX.Demo.WebClasses { public class EventMessageRole : IMessageRole { public IMessageHandler MessageRole(MiddleMessage msg) { var eventType = (Event)Enum.Parse(typeof(Event), msg.Element.Element("Event").Value, true); switch (eventType) { case Event.Subscribe: return new SubScribeEventMessageHandler(); case Event.Unsubscribe: return new UnSubScribeEventMessageHandler(); } return new DefaultMessageHandler(); } } } ================================================ FILE: WebClasses/Roles/MsgTypeMessageRole.cs ================================================ using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Xml.Linq; using WX.Demo.WebClasses.Handlers; using WX.Demo.WebClasses.Roles; using WX.Framework; using WX.Model; namespace WX.Demo.WebClasses { public class MsgTypeMessageRole : IMessageRole { public IMessageHandler MessageRole(MiddleMessage msg) { switch (msg.RequestMessage.MsgType) { case MsgType.Text: return new TextMessageRole().MessageRole(msg); case MsgType.Event: return new EventMessageRole().MessageRole(msg); case MsgType.Voice: return new VoiceMessageRole().MessageRole(msg); default: return new DefaultMessageHandler(); } } } } ================================================ FILE: WebClasses/Roles/TextMessageRole.cs ================================================ using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Xml.Linq; using WX.Framework; using WX.Model; namespace WX.Demo.WebClasses { public class TextMessageRole : IMessageRole { public IMessageHandler MessageRole(MiddleMessage msg) { var request = (RequestTextMessage)msg.RequestMessage; if (request.Content.IndexOf("博客园文章") > -1) { return new CnblogsArticleNewsMessageHandler(); } if (request.Content.IndexOf("博客园") > -1) { return new CnblogsTextMessageHandler(); } return new DefaultMessageHandler(); } } } ================================================ FILE: WebClasses/Roles/VoiceMessageRole.cs ================================================ using System; using System.Collections.Generic; using System.Linq; using System.Text; using WX.Demo.WebClasses.Handlers; using WX.Framework; using WX.Model; namespace WX.Demo.WebClasses.Roles { public class VoiceMessageRole : IMessageRole { public IMessageHandler MessageRole(MiddleMessage message) { var request = message.RequestMessage as RequestVoiceMessage; if (request != null) { //sMyLog.Log("语音识别:" + request.Recognition); if (!String.IsNullOrEmpty(request.Recognition)) { if (request.Recognition.IndexOf("博客园文章") > -1) { return new CnblogsArticleNewsMessageHandler(); } if (request.Recognition.IndexOf("博客园") > -1) { return new CnblogsTextMessageHandler(); } return new DefaultMessageHandler(); } else { return new VoiceMessageHandler(); } } else { return new DefaultMessageHandler(); } } } } ================================================ FILE: WebClasses/Roles/WebMessageRole.cs ================================================ using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Xml.Linq; using WX.Framework; using WX.Model; namespace WX.Demo.WebClasses { public class WebMessageRole : IMessageRole { public IMessageHandler MessageRole(MiddleMessage msg) { try { return new MsgTypeMessageRole().MessageRole(msg); } catch { return new DefaultMessageHandler(); } } } } ================================================ FILE: WebClasses/WebClasses.csproj ================================================ <?xml version="1.0" encoding="utf-8"?> <Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> <Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" /> <PropertyGroup> <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> <ProjectGuid>{7167FFE5-2C16-4466-AAED-2B4107974BAE}</ProjectGuid> <OutputType>Library</OutputType> <AppDesignerFolder>Properties</AppDesignerFolder> <RootNamespace>WX.Demo.WebClasses</RootNamespace> <AssemblyName>JCSoft.WX.Demo.WebClasses</AssemblyName> <TargetFrameworkVersion>v4.5</TargetFrameworkVersion> <FileAlignment>512</FileAlignment> <TargetFrameworkProfile /> </PropertyGroup> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> <DebugSymbols>true</DebugSymbols> <DebugType>full</DebugType> <Optimize>false</Optimize> <OutputPath>bin\Debug\</OutputPath> <DefineConstants>DEBUG;TRACE</DefineConstants> <ErrorReport>prompt</ErrorReport> <WarningLevel>4</WarningLevel> <Prefer32Bit>false</Prefer32Bit> </PropertyGroup> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> <DebugType>pdbonly</DebugType> <Optimize>true</Optimize> <OutputPath>bin\Release\</OutputPath> <DefineConstants>TRACE</DefineConstants> <ErrorReport>prompt</ErrorReport> <WarningLevel>4</WarningLevel> <Prefer32Bit>false</Prefer32Bit> </PropertyGroup> <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'librelease|AnyCPU'"> <OutputPath>bin\librelease\</OutputPath> <DefineConstants>TRACE</DefineConstants> <Optimize>true</Optimize> <DebugType>pdbonly</DebugType> <PlatformTarget>AnyCPU</PlatformTarget> <ErrorReport>prompt</ErrorReport> <CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet> <Prefer32Bit>false</Prefer32Bit> </PropertyGroup> <ItemGroup> <Reference Include="System" /> <Reference Include="System.Core" /> <Reference Include="System.Web" /> <Reference Include="System.Xml.Linq" /> <Reference Include="System.Data.DataSetExtensions" /> <Reference Include="System.Data" /> <Reference Include="System.Xml" /> </ItemGroup> <ItemGroup> <Compile Include="CnBlogsFeed.cs" /> <Compile Include="Command.cs" /> <Compile Include="Handlers\CnblogsArticleNewsMessageHandler.cs" /> <Compile Include="Handlers\CnblogsTextMessageHandler.cs" /> <Compile Include="Handlers\DefaultMessageHandler.cs" /> <Compile Include="Handlers\SubScribeEventMessageHandler.cs" /> <Compile Include="Handlers\TextMessageHandler.cs" /> <Compile Include="Handlers\UnSubScribeEventMessageHandler.cs" /> <Compile Include="Handlers\VoiceMessageHandler.cs" /> <Compile Include="MyLog.cs" /> <Compile Include="Properties\AssemblyInfo.cs" /> <Compile Include="Roles\EventMessageRole.cs" /> <Compile Include="Roles\MsgTypeMessageRole.cs" /> <Compile Include="Roles\TextMessageRole.cs" /> <Compile Include="Roles\VoiceMessageRole.cs" /> <Compile Include="Roles\WebMessageRole.cs" /> </ItemGroup> <ItemGroup> <ProjectReference Include="..\Business\WXFramework.csproj"> <Project>{5765cfa5-1892-4a06-81a8-f5e4c8a28dff}</Project> <Name>WXFramework</Name> </ProjectReference> </ItemGroup> <ItemGroup /> <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> <!-- To modify your build process, add your task inside one of the targets below and uncomment it. Other similar extension points exist, see Microsoft.Common.targets. <Target Name="BeforeBuild"> </Target> <Target Name="AfterBuild"> </Target> --> </Project> ================================================ FILE: WebDemo/OAuthUserInfoDemo.aspx ================================================ <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="OAuthUserInfoDemo.aspx.cs" Inherits="WebDemo.OAuthUserInfoDemo" %> <!DOCTYPE html> <html xmlns="http://www.w3.org/1999/xhtml"> <head runat="server"> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/> <title>

Code:

AccessToken:

RefreshToken:

用户昵称:

用户ID:

错误信息:

================================================ FILE: WebDemo/OAuthUserInfoDemo.aspx.cs ================================================ using System; using System.Collections.Generic; using System.Configuration; using System.Linq; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; using WX.Api; using WX.Model; using WX.Model.ApiRequests; using WX.Model.ApiResponses; namespace WebDemo { public partial class OAuthUserInfoDemo : System.Web.UI.Page { private IApiClient m_client = new DefaultApiClient(); private AppIdentication m_appIdent = new AppIdentication( ConfigurationManager.AppSettings["wxappid"], ConfigurationManager.AppSettings["wxappsecret"]); protected void Page_Load(object sender, EventArgs e) { if (Request["Code"] == null) { throw new ArgumentNullException("Code is null"); } Label1.Text = Request["Code"]; Label6.Text = ""; } protected void Button1_Click(object sender, EventArgs e) { var request = new SnsOAuthAccessTokenRequest { AppID = m_appIdent.AppID, AppSecret = m_appIdent.AppSecret, Code = Label1.Text }; var response = m_client.Execute(request); if (!response.IsError) { Label2.Text = response.AccessToken; Label3.Text = response.RefreshToken; Label5.Text = response.OpenId; } else { Label6.Text = response.ToString(); } } protected void Button2_Click(object sender, EventArgs e) { var request = new SnsOauthRefreshTokenRequest { AppID = m_appIdent.AppID, RefreshToken = Label3.Text }; var response = m_client.Execute(request); if (!response.IsError) { Label2.Text = response.AccessToken; Label3.Text = response.RefreshToken; Label5.Text = response.OpenId; } else { Label6.Text = response.ToString(); } } protected void Button3_Click(object sender, EventArgs e) { SnsUserInfoRequest request = new SnsUserInfoRequest { OAuthToken = Label2.Text, Lang = Language.CN, OpenId = Label5.Text }; SnsUserInfoResponse response = m_client.Execute(request); if (response.IsError) { Label6.Text = response.ToString(); } else { Label4.Text = response.NickName; } } } } ================================================ FILE: WebDemo/OAuthUserInfoDemo.aspx.designer.cs ================================================ //------------------------------------------------------------------------------ // <自动生成> // 此代码由工具生成。 // // 对此文件的更改可能会导致不正确的行为,并且如果 // 重新生成代码,这些更改将会丢失。 // //------------------------------------------------------------------------------ namespace WebDemo { public partial class OAuthUserInfoDemo { /// /// form1 控件。 /// /// /// 自动生成的字段。 /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::System.Web.UI.HtmlControls.HtmlForm form1; /// /// Label1 控件。 /// /// /// 自动生成的字段。 /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::System.Web.UI.WebControls.Label Label1; /// /// Button1 控件。 /// /// /// 自动生成的字段。 /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::System.Web.UI.WebControls.Button Button1; /// /// Button2 控件。 /// /// /// 自动生成的字段。 /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::System.Web.UI.WebControls.Button Button2; /// /// Label2 控件。 /// /// /// 自动生成的字段。 /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::System.Web.UI.WebControls.Label Label2; /// /// Label3 控件。 /// /// /// 自动生成的字段。 /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::System.Web.UI.WebControls.Label Label3; /// /// Button3 控件。 /// /// /// 自动生成的字段。 /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::System.Web.UI.WebControls.Button Button3; /// /// Label4 控件。 /// /// /// 自动生成的字段。 /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::System.Web.UI.WebControls.Label Label4; /// /// Label5 控件。 /// /// /// 自动生成的字段。 /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::System.Web.UI.WebControls.Label Label5; /// /// Label6 控件。 /// /// /// 自动生成的字段。 /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::System.Web.UI.WebControls.Label Label6; } } ================================================ FILE: WebDemo/Oauth2Demo.aspx ================================================ <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Oauth2Demo.aspx.cs" Inherits="WebDemo.Oauth2Demo" %>

网页授权获取用户基本信息

第一步:选择类型

SnsApi_Base:无需弹窗认证,只需不弹出授权页面,直接跳转,只能获取用户openid

Snsapi_userinfo:弹出授权页面,可通过openid拿到昵称、性别、所在地。并且,即使在未关注的情况下,只要用户授权,也能获取其信息

请选择 SnsApi_Base SnsApi_UserInfo

请用微信扫一扫功能,扫描以下二维码:

================================================ FILE: WebDemo/Oauth2Demo.aspx.cs ================================================ using System; using System.Collections.Generic; using System.Configuration; using System.Linq; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; using WX.Model; using WX.Model.ApiResponses; using WX.OAuth; namespace WebDemo { public partial class Oauth2Demo : System.Web.UI.Page { protected void Page_Load(object sender, EventArgs e) { } protected void Button1_Click(object sender, EventArgs e) { if (DropDownList1.SelectedValue != "0") { Image1.ImageUrl = "~/Qrcodepage.aspx?api=" + DropDownList1.SelectedValue; Image1.Visible = true; var manager = new OAuthHelper(ConfigurationManager.AppSettings["wxappid"]); var url = manager.BuildOAuthUrl("http://wx.taogame.com/OAuthUserInfoDemo.aspx", DropDownList1.SelectedValue == "snsapi_base" ? OAuthScope.Base : OAuthScope.UserInfo, DropDownList1.SelectedValue); Label1.Text = url; } else { Image1.Visible = false; Label1.Visible = true; } } } } ================================================ FILE: WebDemo/Oauth2Demo.aspx.designer.cs ================================================ //------------------------------------------------------------------------------ // <自动生成> // 此代码由工具生成。 // // 对此文件的更改可能会导致不正确的行为,并且如果 // 重新生成代码,这些更改将会丢失。 // //------------------------------------------------------------------------------ namespace WebDemo { public partial class Oauth2Demo { /// /// form1 控件。 /// /// /// 自动生成的字段。 /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::System.Web.UI.HtmlControls.HtmlForm form1; /// /// DropDownList1 控件。 /// /// /// 自动生成的字段。 /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::System.Web.UI.WebControls.DropDownList DropDownList1; /// /// Button1 控件。 /// /// /// 自动生成的字段。 /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::System.Web.UI.WebControls.Button Button1; /// /// Image1 控件。 /// /// /// 自动生成的字段。 /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::System.Web.UI.WebControls.Image Image1; /// /// Label1 控件。 /// /// /// 自动生成的字段。 /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::System.Web.UI.WebControls.Label Label1; } } ================================================ FILE: WebDemo/Properties/AssemblyInfo.cs ================================================ using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; // 有关程序集的常规信息通过下列特性集 // 控制。更改这些特性值可修改 // 与程序集关联的信息。 [assembly: AssemblyTitle("WebDemo")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("WebDemo")] [assembly: AssemblyCopyright("版权所有(C) 2013")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] // 将 ComVisible 设置为 false 会使此程序集中的类型 // 对 COM 组件不可见。如果需要从 COM 访问此程序集中的某个类型, // 请针对该类型将 ComVisible 特性设置为 true。 [assembly: ComVisible(false)] // 如果此项目向 COM 公开,则下列 GUID 用于类型库的 ID [assembly: Guid("833472ae-e812-40c9-b823-ae2a9e9abf23")] // 程序集的版本信息由下列四个值组成: // // 主版本 // 次版本 // 内部版本号 // 修订号 // // 可以指定所有这些值,也可以使用“修订号”和“内部版本号”的默认值, // 方法是按如下所示使用“*”: [assembly: AssemblyVersion("1.0.0.0")] [assembly: AssemblyFileVersion("1.0.0.0")] ================================================ FILE: WebDemo/QrcodePage.aspx ================================================ <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="QrcodePage.aspx.cs" Inherits="WebDemo.QrcodePage" %> ================================================ FILE: WebDemo/QrcodePage.aspx.cs ================================================ using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; using WX.OAuth; using System.Configuration; using WX.Model; using Gma.QrCodeNet.Encoding; using Gma.QrCodeNet.Encoding.Windows.Render; using System.Drawing.Imaging; using System.Drawing; using System.IO; namespace WebDemo { public partial class QrcodePage : System.Web.UI.Page { protected void Page_Load(object sender, EventArgs e) { var api = Request["Api"]; if (String.IsNullOrEmpty(api)) return; var manager = new OAuthHelper(ConfigurationManager.AppSettings["wxappid"]); var url = manager.BuildOAuthUrl("http://wx.taogame.com/OAuthUserInfoDemo.aspx", api == "snsapi_base" ? OAuthScope.Base : OAuthScope.UserInfo, api); QrEncoder encoder = new QrEncoder(ErrorCorrectionLevel.M); QrCode qrCode; encoder.TryEncode(url, out qrCode); GraphicsRenderer gRenderer = new GraphicsRenderer( new FixedModuleSize(2, QuietZoneModules.Two), Brushes.Black, Brushes.White); MemoryStream ms = new MemoryStream(); gRenderer.WriteToStream(qrCode.Matrix, ImageFormat.Jpeg, ms); Response.BinaryWrite(ms.ToArray()); } } } ================================================ FILE: WebDemo/QrcodePage.aspx.designer.cs ================================================ //------------------------------------------------------------------------------ // <自动生成> // 此代码由工具生成。 // // 对此文件的更改可能会导致不正确的行为,并且如果 // 重新生成代码,这些更改将会丢失。 // //------------------------------------------------------------------------------ namespace WebDemo { public partial class QrcodePage { } } ================================================ FILE: WebDemo/WX.aspx ================================================ <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="WX.aspx.cs" Inherits="WebDemo.WX" %> ================================================ FILE: WebDemo/WX.aspx.cs ================================================ using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; using System.Xml; using System.Xml.Linq; using WX.Demo.WebClasses; using WX.Model; namespace WebDemo { public partial class WX : System.Web.UI.Page { protected void Page_Load(object sender, EventArgs e) { try { //微信服务器一直把用户发过来的消息,post过来 if (Request.HttpMethod == "POST") { var reader = XmlReader.Create(Request.InputStream); var doc = XDocument.Load(reader); MyLog.Log(doc.ToString()); var xml = doc.Element("xml"); var msg = new MiddleMessage(xml); //把inputstream转换成xelement后,直接交给WebMessageRole来处理吧 var responseMessage = new WebMessageRole() .MessageRole(msg) .HandlerRequestMessage(msg); if (responseMessage != null) { Response.Write(responseMessage.Serializable()); #if DEBUG MyLog.Log(responseMessage.Serializable()); #endif } } else if (Request.HttpMethod == "GET") //微信服务器在首次验证时,需要进行一些验证,但。。。。 { //我仅需返回给他echostr中的值,就为验证成功,可能微信觉得这些安全策略是为了保障我的服务器,要不要随你吧 Response.Write(Request["echostr"].ToString()); } } catch (Exception ex) { MyLog.Log("error:" + ex.ToString()); } } } } ================================================ FILE: WebDemo/WX.aspx.designer.cs ================================================ //------------------------------------------------------------------------------ // <自动生成> // 此代码由工具生成。 // // 对此文件的更改可能会导致不正确的行为,并且如果 // 重新生成代码,这些更改将会丢失。 // //------------------------------------------------------------------------------ namespace WebDemo { public partial class WX { } } ================================================ FILE: WebDemo/Web.Debug.config ================================================ ================================================ FILE: WebDemo/Web.Release.config ================================================ ================================================ FILE: WebDemo/Web.config ================================================  ================================================ FILE: WebDemo/WebDemo.csproj ================================================  Debug AnyCPU 2.0 {72472759-0504-49E8-A289-F12E71A93181} {349c5851-65df-11da-9384-00065b846f21};{fae04ec0-301f-11d3-bf4b-00c04f79efbc} Library Properties WebDemo WebDemo v4.5 true ..\ true true full false bin\ DEBUG;TRACE prompt 4 false pdbonly true bin\ TRACE prompt 4 false ..\packages\QrCode.Net.0.4.0.0\lib\net35\Gma.QrCodeNet.Encoding.dll Designer Oauth2Demo.aspx ASPXCodeBehind Oauth2Demo.aspx OAuthUserInfoDemo.aspx ASPXCodeBehind OAuthUserInfoDemo.aspx QrcodePage.aspx ASPXCodeBehind QrcodePage.aspx WX.aspx ASPXCodeBehind WX.aspx {5765cfa5-1892-4a06-81a8-f5e4c8a28dff} WXFramework {7167ffe5-2c16-4466-aaed-2b4107974bae} WebClasses 10.0 $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion) bin\ TRACE true pdbonly AnyCPU prompt MinimumRecommendedRules.ruleset false True True 22141 / http://localhost:20466/ False False False ================================================ FILE: WebDemo/packages.config ================================================  ================================================ FILE: _config.yml ================================================ theme: jekyll-theme-time-machine ================================================ FILE: packages/Moq.4.2.1402.2112/Moq.4.2.1402.2112.nuspec ================================================ Moq 4.2.1402.2112 Moq: an enjoyable mocking library Daniel Cazzulino Daniel Cazzulino http://www.opensource.org/licenses/bsd-license.php http://www.moqthis.com/ false The most popular and friendly mocking framework for .NET Version 4.2 * Improved support for async APIs by making default value a completed task * Added support for async Returns and Throws * Improved mock invocation sequence testing * Improved support for multi-threaded tests * Added support for named mocks Version 4.1 * Added covariant IMock<out T> interface to Mock<T> * Added It.IsNotNull<T> * Fix: 'NullReferenceException when subscribing to an event' * Added overloads to Verify to accept Times as a Method Group * Feature request: It.IsIn(..), It.IsNotIn(...) * Corrected Verify method behavior for generic methods calls * Differentiate verification error from mock crash * Fix: Adding (and removing) handlers for events declared on interfaces works when CallBase = true. * Update to latest Castle * Fix: Mock.Of (Functional Syntax) doesn't work on properties with non-public setters * Fix: Allow to use CallBase instead of Returns * Fix: Solved Multi-threading issue - IndexOutOfRangeException * Capability of mocking delegates (event handlers) Version 4.0 * Linq to Mocks: Mock.Of<T>(x => x.Id == 23 && x.Title == "Rocks!") * Fixed issues: * 87 BadImageFormatException when using a mock with a Visual Studio generated Accessor object * 166 Unable to use a delegate to mock a function that takes 5 or more parameters. * 168 Call count failure message never says which is the actual invocation count * 175 theMock.Object failing on VS2010 Beta 1 * 177 Generic constraint on interface method causes BadImageFormatException when getting Object. * 183 Display what invocations were recieved when the expected one hasn't been met * 186 Methods that are not virtual gives non-sense-exception message * 188 More Callback Overloads * 199 Simplify SetupAllProperties implementation to simply iterate and call SetupProperty * 200 Fluent mock does not honor parent mock CallBase setting. * 202 Mock.Protected().Expect() deprecated with no work-around * 204 Allow default return values to be specified (per-mock) * 205 Error calling SetupAllProperties for Mock<IDataErrorInfo> * 206 Linq-to-Mocks Never Returns on Implicit Boolean Property * 207 NullReferenceException thrown when using Mocks.CreateQuery with implicit boolean expression * 208 Can't setup a mock for method that accept lambda expression as argument. * 211 SetupAllProperties should return the Mock<T> instead of void. * 223 When a method is defined to make the setup an asserts mock fails * 226 Can't raise events on mocked Interop interfaces * 229 CallBase is not working for virtual events * 238 Moq fails to mock events defined in F# * 239 Use Func instead of Predicate * 250 4.0 Beta 2 regression - cannot mock MethodInfo when targetting .NET 4 * 251 When a generic interface also implements a non-generic version, Verify does not work in some cases * 254 Unable to create mock of EnvDTE.DTE * 261 Can not use protected setter in public property * 267 Generic argument as dependency for method Setup overrides all previous method setups for a given method * 273 Attempting to create a mock thrown a Type Load exception. The message refers to an inaccessible interface. * 276 .Net 3.5 no more supported Version 3.0 * Silverlight support! Finally integrated Jason's Silverlight contribution! Issue #73 * Brand-new simplified event raising syntax (#130): mock.Raise(foo => foo.MyEvent += null, new MyArgs(...)); * Support for custom event signatures (not compatible with EventHandler): mock.Raise(foo => foo.MyEvent += null, arg1, arg2, arg3); * Substantially improved property setter behavior: mock.VerifySet(foo => foo.Value = "foo"); //(also available for SetupSet * Renamed Expect* with Setup* * Vastly simplified custom argument matchers: public int IsOdd() < return Match<int>.Create(v => i % 2 == 0); > * Added support for verifying how many times a member was invoked: mock.Verify(foo => foo.Do(), Times.Never()); * Added simple sample app named StoreSample * Moved Stub functionality to the core API (SetupProperty and SetupAllProperties) * Fixed sample ASP.NET MVC app to work with latest version * Allow custom matchers to be created with a substantially simpler API * Fixed issue #145 which prevented discrimination of setups by generic method argument types * Fixed issue #141 which prevented ref arguments matching value types (i.e. a Guid) * Implemented improvement #131: Add support for It.IsAny and custom argument matchers for SetupSet/VerifySet * Implemented improvement #124 to render better error messages * Applied patch from David Kirkland for improvement #125 to improve matching of enumerable parameters * Implemented improvement #122 to provide custom errors for Verify * Implemented improvement #121 to provide null as default value for Nullable<T> * Fixed issue #112 which fixes passing a null argument to a mock constructor * Implemented improvement #111 to better support params arguments * Fixed bug #105 about improperly overwriting setups for property getter and setter * Applied patch from Ihar.Bury for issue #99 related to protected expectations * Fixed issue #97 on not being able to use SetupSet/VerifySet if property did not have a getter * Better integration with Pex (http://research.microsoft.com/en-us/projects/Pex/) * Various other minor fixes (#134, #135, #137, #138, #140, etc.) Version 2.6 * Implemented Issue #55: We now provide a mock.DefaultValue = [DefaultValue.Empty | DefaultValue.Mock] which will provide the current behavior (default) or mocks for mockeable return types for loose mock invocations without expectations. * Added support for stubbing properties from moq-contrib: now you can do mock.Stub(m => m.Value) and add stub behavior to the property. mock.StubAll() is also provided. This integrates with the DefaultValue behavior too, so you can stub entire hierarchies :). * Added support for mocking methods with out and ref parameters (Issue #50) * Applied patch contributed by slava for Issue #72: add support to limit numbor of calls on mocked method (we now have mock.Expect(...).AtMost(5)) * Implemented Issue #94: Easier setter verification: Now we support ExpectSet(m = m.Value, "foo") and VerifySet(m = m.Value, 5) (Thanks ASP.NET MVC Team!) * Implemented issue #96: Automatically chain mocks when setting expectations. It's now possible to specify expectations for an entire hierarchy of objects just starting from the root mock. THIS IS REALLY COOL!!! * Fixed Issue #89: Expects() does not always return last expectation * Implemented Issue 91: Expect a method/property to never be called (added Never() method to an expectation. Can be used on methods, property getters and setters) * Fixed Issue 86: IsAny<T> should check if the value is actually of type T * Fixed Issue 88: Cannot mock protected internal virtual methods using Moq.Protected * Fixed Issue 90: Removing event handlers from mocked objects * Updated demo and added one more test for the dynamic addition of interfaces Version 2.5 * Added support for mocking protected members * Added new way of extending argument matchers which is now very straightforward * Added support for mocking events * Added support for firing events from expectations * Removed usage of MBROs which caused inconsistencies in mocking features * Added ExpectGet and ExpectSet to better support properties, and provide better intellisense. * Added verification with expressions, which better supports Arrange-Act-Assert testing model (can do Verify(m => m.Do(...))) * Added Throws<TException> * Added mock.CallBase property to specify whether the virtual members base implementation should be called * Added support for implementing and setting expectations and verifying additional interfaces in the mock, via the new mock.As<TInterface>() method (thanks Fernando Simonazzi!) * Improved argument type matching for Is/IsAny (thanks Jeremy.Skinner!) Version 2.0 * Refactored fluent API on mocks. This may cause some existing tests to fail, but the fix is trivial (just reorder the calls to Callback, Returns and Verifiable) * Added support for retrieving a Mock<T> from a T instance created by a mock. * Added support for retrieving the invocation arguments from a Callback or Returns. * Implemented AtMostOnce() constraint * Added support for creating MBROs with protected constructors * Loose mocks now return default empty arrays and IEnumerables instead of nulls Version 1.5.1 * Refactored MockFactory to make it simpler and more explicit to use with regards to verification. Thanks Garry Shutler for the feedback! Version 1.5 * Added MockFactory to allow easy construction of multiple mocks with the same behavior and verification Version 1.4 * Added support for passing constructor arguments for mocked classes. * Improved code documentation Version 1.3 * Added support for overriding expectations set previously on a Mock. Now adding a second expectation for the same method/property call will override the existing one. This facilitates setting up default expectations in a fixture setup and overriding when necessary in a specific test. * Added support for mock verification. Both Verify and VerifyAll are provided for more flexibility (the former only verifies methods marked Verifiable) Version 1.2 * Added support for MockBehavior mock constructor argument to affect the way the mocks expect or throw on calls. Version 1.1 * Merged branch for dynamic types. Now Moq is based on Castle DynamicProxy2 to support a wider range of mock targets. * Added ILMerge so that Castle libraries are merged into Moq assembly (no need for external references and avoid conflicts) Version 1.0 * Initial release, initial documentation process in place, etc. tdd mocking mocks unittesting agile ================================================ FILE: packages/Moq.4.2.1402.2112/lib/net35/Moq.xml ================================================ Moq Implements the fluent API. The expectation will be considered only in the former condition. The expectation will be considered only in the former condition. Setups the get. The type of the property. The expression. Setups the set. The type of the property. The setter expression. Setups the set. The setter expression. Handle interception the current invocation context shared data for the interceptor as a whole shared data among the strategies during a single interception InterceptionAction.Continue if further interception has to be processed, otherwise InterceptionAction.Stop Covarient interface for Mock<T> such that casts between IMock<Employee> to IMock<Person> are possible. Only covers the covariant members of Mock<T>. Exposes the mocked object instance. Behavior of the mock, according to the value set in the constructor. Whether the base member virtual implementation will be called for mocked classes if no setup is matched. Defaults to . Specifies the behavior to use when returning default values for unexpected invocations on loose mocks. Get an eventInfo for a given event name. Search type ancestors depth first if necessary. Name of the event, with the set_ or get_ prefix already removed Get an eventInfo for a given event name. Search type ancestors depth first if necessary. Searches also in non public events. Name of the event, with the set_ or get_ prefix already removed Given a type return all of its ancestors, both types and interfaces. The type to find immediate ancestors of Defines the Callback verb and overloads. Helper interface used to hide the base members from the fluent API to make it much cleaner in Visual Studio intellisense. Specifies a callback to invoke when the method is called. The callback method to invoke. The following example specifies a callback to set a boolean value that can be used later: var called = false; mock.Setup(x => x.Execute()) .Callback(() => called = true); Specifies a callback to invoke when the method is called that receives the original arguments. The argument type of the invoked method. The callback method to invoke. Invokes the given callback with the concrete invocation argument value. Notice how the specific string argument is retrieved by simply declaring it as part of the lambda expression for the callback: mock.Setup(x => x.Execute(It.IsAny<string>())) .Callback((string command) => Console.WriteLine(command)); Specifies a callback to invoke when the method is called that receives the original arguments. The type of the first argument of the invoked method. The type of the second argument of the invoked method. The callback method to invoke. A reference to interface. Invokes the given callback with the concrete invocation arguments values. Notice how the specific arguments are retrieved by simply declaring them as part of the lambda expression for the callback: mock.Setup(x => x.Execute( It.IsAny<string>(), It.IsAny<string>())) .Callback((string arg1, string arg2) => Console.WriteLine(arg1 + arg2)); Specifies a callback to invoke when the method is called that receives the original arguments. The type of the first argument of the invoked method. The type of the second argument of the invoked method. The type of the third argument of the invoked method. The callback method to invoke. A reference to interface. Invokes the given callback with the concrete invocation arguments values. Notice how the specific arguments are retrieved by simply declaring them as part of the lambda expression for the callback: mock.Setup(x => x.Execute( It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>())) .Callback((string arg1, string arg2, string arg3) => Console.WriteLine(arg1 + arg2 + arg3)); Specifies a callback to invoke when the method is called that receives the original arguments. The type of the first argument of the invoked method. The type of the second argument of the invoked method. The type of the third argument of the invoked method. The type of the fourth argument of the invoked method. The callback method to invoke. A reference to interface. Invokes the given callback with the concrete invocation arguments values. Notice how the specific arguments are retrieved by simply declaring them as part of the lambda expression for the callback: mock.Setup(x => x.Execute( It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>())) .Callback((string arg1, string arg2, string arg3, string arg4) => Console.WriteLine(arg1 + arg2 + arg3 + arg4)); Specifies a callback to invoke when the method is called that receives the original arguments. The type of the first argument of the invoked method. The type of the second argument of the invoked method. The type of the third argument of the invoked method. The type of the fourth argument of the invoked method. The type of the fifth argument of the invoked method. The callback method to invoke. A reference to interface. Invokes the given callback with the concrete invocation arguments values. Notice how the specific arguments are retrieved by simply declaring them as part of the lambda expression for the callback: mock.Setup(x => x.Execute( It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>())) .Callback((string arg1, string arg2, string arg3, string arg4, string arg5) => Console.WriteLine(arg1 + arg2 + arg3 + arg4 + arg5)); Specifies a callback to invoke when the method is called that receives the original arguments. The type of the first argument of the invoked method. The type of the second argument of the invoked method. The type of the third argument of the invoked method. The type of the fourth argument of the invoked method. The type of the fifth argument of the invoked method. The type of the sixth argument of the invoked method. The callback method to invoke. A reference to interface. Invokes the given callback with the concrete invocation arguments values. Notice how the specific arguments are retrieved by simply declaring them as part of the lambda expression for the callback: mock.Setup(x => x.Execute( It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>())) .Callback((string arg1, string arg2, string arg3, string arg4, string arg5, string arg6) => Console.WriteLine(arg1 + arg2 + arg3 + arg4 + arg5 + arg6)); Specifies a callback to invoke when the method is called that receives the original arguments. The type of the first argument of the invoked method. The type of the second argument of the invoked method. The type of the third argument of the invoked method. The type of the fourth argument of the invoked method. The type of the fifth argument of the invoked method. The type of the sixth argument of the invoked method. The type of the seventh argument of the invoked method. The callback method to invoke. A reference to interface. Invokes the given callback with the concrete invocation arguments values. Notice how the specific arguments are retrieved by simply declaring them as part of the lambda expression for the callback: mock.Setup(x => x.Execute( It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>())) .Callback((string arg1, string arg2, string arg3, string arg4, string arg5, string arg6, string arg7) => Console.WriteLine(arg1 + arg2 + arg3 + arg4 + arg5 + arg6 + arg7)); Specifies a callback to invoke when the method is called that receives the original arguments. The type of the first argument of the invoked method. The type of the second argument of the invoked method. The type of the third argument of the invoked method. The type of the fourth argument of the invoked method. The type of the fifth argument of the invoked method. The type of the sixth argument of the invoked method. The type of the seventh argument of the invoked method. The type of the eighth argument of the invoked method. The callback method to invoke. A reference to interface. Invokes the given callback with the concrete invocation arguments values. Notice how the specific arguments are retrieved by simply declaring them as part of the lambda expression for the callback: mock.Setup(x => x.Execute( It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>())) .Callback((string arg1, string arg2, string arg3, string arg4, string arg5, string arg6, string arg7, string arg8) => Console.WriteLine(arg1 + arg2 + arg3 + arg4 + arg5 + arg6 + arg7 + arg8)); Specifies a callback to invoke when the method is called that receives the original arguments. The type of the first argument of the invoked method. The type of the second argument of the invoked method. The type of the third argument of the invoked method. The type of the fourth argument of the invoked method. The type of the fifth argument of the invoked method. The type of the sixth argument of the invoked method. The type of the seventh argument of the invoked method. The type of the eighth argument of the invoked method. The type of the nineth argument of the invoked method. The callback method to invoke. A reference to interface. Invokes the given callback with the concrete invocation arguments values. Notice how the specific arguments are retrieved by simply declaring them as part of the lambda expression for the callback: mock.Setup(x => x.Execute( It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>())) .Callback((string arg1, string arg2, string arg3, string arg4, string arg5, string arg6, string arg7, string arg8, string arg9) => Console.WriteLine(arg1 + arg2 + arg3 + arg4 + arg5 + arg6 + arg7 + arg8 + arg9)); Specifies a callback to invoke when the method is called that receives the original arguments. The type of the first argument of the invoked method. The type of the second argument of the invoked method. The type of the third argument of the invoked method. The type of the fourth argument of the invoked method. The type of the fifth argument of the invoked method. The type of the sixth argument of the invoked method. The type of the seventh argument of the invoked method. The type of the eighth argument of the invoked method. The type of the nineth argument of the invoked method. The type of the tenth argument of the invoked method. The callback method to invoke. A reference to interface. Invokes the given callback with the concrete invocation arguments values. Notice how the specific arguments are retrieved by simply declaring them as part of the lambda expression for the callback: mock.Setup(x => x.Execute( It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>())) .Callback((string arg1, string arg2, string arg3, string arg4, string arg5, string arg6, string arg7, string arg8, string arg9, string arg10) => Console.WriteLine(arg1 + arg2 + arg3 + arg4 + arg5 + arg6 + arg7 + arg8 + arg9 + arg10)); Specifies a callback to invoke when the method is called that receives the original arguments. The type of the first argument of the invoked method. The type of the second argument of the invoked method. The type of the third argument of the invoked method. The type of the fourth argument of the invoked method. The type of the fifth argument of the invoked method. The type of the sixth argument of the invoked method. The type of the seventh argument of the invoked method. The type of the eighth argument of the invoked method. The type of the nineth argument of the invoked method. The type of the tenth argument of the invoked method. The type of the eleventh argument of the invoked method. The callback method to invoke. A reference to interface. Invokes the given callback with the concrete invocation arguments values. Notice how the specific arguments are retrieved by simply declaring them as part of the lambda expression for the callback: mock.Setup(x => x.Execute( It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>())) .Callback((string arg1, string arg2, string arg3, string arg4, string arg5, string arg6, string arg7, string arg8, string arg9, string arg10, string arg11) => Console.WriteLine(arg1 + arg2 + arg3 + arg4 + arg5 + arg6 + arg7 + arg8 + arg9 + arg10 + arg11)); Specifies a callback to invoke when the method is called that receives the original arguments. The type of the first argument of the invoked method. The type of the second argument of the invoked method. The type of the third argument of the invoked method. The type of the fourth argument of the invoked method. The type of the fifth argument of the invoked method. The type of the sixth argument of the invoked method. The type of the seventh argument of the invoked method. The type of the eighth argument of the invoked method. The type of the nineth argument of the invoked method. The type of the tenth argument of the invoked method. The type of the eleventh argument of the invoked method. The type of the twelfth argument of the invoked method. The callback method to invoke. A reference to interface. Invokes the given callback with the concrete invocation arguments values. Notice how the specific arguments are retrieved by simply declaring them as part of the lambda expression for the callback: mock.Setup(x => x.Execute( It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>())) .Callback((string arg1, string arg2, string arg3, string arg4, string arg5, string arg6, string arg7, string arg8, string arg9, string arg10, string arg11, string arg12) => Console.WriteLine(arg1 + arg2 + arg3 + arg4 + arg5 + arg6 + arg7 + arg8 + arg9 + arg10 + arg11 + arg12)); Specifies a callback to invoke when the method is called that receives the original arguments. The type of the first argument of the invoked method. The type of the second argument of the invoked method. The type of the third argument of the invoked method. The type of the fourth argument of the invoked method. The type of the fifth argument of the invoked method. The type of the sixth argument of the invoked method. The type of the seventh argument of the invoked method. The type of the eighth argument of the invoked method. The type of the nineth argument of the invoked method. The type of the tenth argument of the invoked method. The type of the eleventh argument of the invoked method. The type of the twelfth argument of the invoked method. The type of the thirteenth argument of the invoked method. The callback method to invoke. A reference to interface. Invokes the given callback with the concrete invocation arguments values. Notice how the specific arguments are retrieved by simply declaring them as part of the lambda expression for the callback: mock.Setup(x => x.Execute( It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>())) .Callback((string arg1, string arg2, string arg3, string arg4, string arg5, string arg6, string arg7, string arg8, string arg9, string arg10, string arg11, string arg12, string arg13) => Console.WriteLine(arg1 + arg2 + arg3 + arg4 + arg5 + arg6 + arg7 + arg8 + arg9 + arg10 + arg11 + arg12 + arg13)); Specifies a callback to invoke when the method is called that receives the original arguments. The type of the first argument of the invoked method. The type of the second argument of the invoked method. The type of the third argument of the invoked method. The type of the fourth argument of the invoked method. The type of the fifth argument of the invoked method. The type of the sixth argument of the invoked method. The type of the seventh argument of the invoked method. The type of the eighth argument of the invoked method. The type of the nineth argument of the invoked method. The type of the tenth argument of the invoked method. The type of the eleventh argument of the invoked method. The type of the twelfth argument of the invoked method. The type of the thirteenth argument of the invoked method. The type of the fourteenth argument of the invoked method. The callback method to invoke. A reference to interface. Invokes the given callback with the concrete invocation arguments values. Notice how the specific arguments are retrieved by simply declaring them as part of the lambda expression for the callback: mock.Setup(x => x.Execute( It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>())) .Callback((string arg1, string arg2, string arg3, string arg4, string arg5, string arg6, string arg7, string arg8, string arg9, string arg10, string arg11, string arg12, string arg13, string arg14) => Console.WriteLine(arg1 + arg2 + arg3 + arg4 + arg5 + arg6 + arg7 + arg8 + arg9 + arg10 + arg11 + arg12 + arg13 + arg14)); Specifies a callback to invoke when the method is called that receives the original arguments. The type of the first argument of the invoked method. The type of the second argument of the invoked method. The type of the third argument of the invoked method. The type of the fourth argument of the invoked method. The type of the fifth argument of the invoked method. The type of the sixth argument of the invoked method. The type of the seventh argument of the invoked method. The type of the eighth argument of the invoked method. The type of the nineth argument of the invoked method. The type of the tenth argument of the invoked method. The type of the eleventh argument of the invoked method. The type of the twelfth argument of the invoked method. The type of the thirteenth argument of the invoked method. The type of the fourteenth argument of the invoked method. The type of the fifteenth argument of the invoked method. The callback method to invoke. A reference to interface. Invokes the given callback with the concrete invocation arguments values. Notice how the specific arguments are retrieved by simply declaring them as part of the lambda expression for the callback: mock.Setup(x => x.Execute( It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>())) .Callback((string arg1, string arg2, string arg3, string arg4, string arg5, string arg6, string arg7, string arg8, string arg9, string arg10, string arg11, string arg12, string arg13, string arg14, string arg15) => Console.WriteLine(arg1 + arg2 + arg3 + arg4 + arg5 + arg6 + arg7 + arg8 + arg9 + arg10 + arg11 + arg12 + arg13 + arg14 + arg15)); Specifies a callback to invoke when the method is called that receives the original arguments. The type of the first argument of the invoked method. The type of the second argument of the invoked method. The type of the third argument of the invoked method. The type of the fourth argument of the invoked method. The type of the fifth argument of the invoked method. The type of the sixth argument of the invoked method. The type of the seventh argument of the invoked method. The type of the eighth argument of the invoked method. The type of the nineth argument of the invoked method. The type of the tenth argument of the invoked method. The type of the eleventh argument of the invoked method. The type of the twelfth argument of the invoked method. The type of the thirteenth argument of the invoked method. The type of the fourteenth argument of the invoked method. The type of the fifteenth argument of the invoked method. The type of the sixteenth argument of the invoked method. The callback method to invoke. A reference to interface. Invokes the given callback with the concrete invocation arguments values. Notice how the specific arguments are retrieved by simply declaring them as part of the lambda expression for the callback: mock.Setup(x => x.Execute( It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>())) .Callback((string arg1, string arg2, string arg3, string arg4, string arg5, string arg6, string arg7, string arg8, string arg9, string arg10, string arg11, string arg12, string arg13, string arg14, string arg15, string arg16) => Console.WriteLine(arg1 + arg2 + arg3 + arg4 + arg5 + arg6 + arg7 + arg8 + arg9 + arg10 + arg11 + arg12 + arg13 + arg14 + arg15 + arg16)); Defines the Callback verb and overloads for callbacks on setups that return a value. Mocked type. Type of the return value of the setup. Specifies a callback to invoke when the method is called. The callback method to invoke. The following example specifies a callback to set a boolean value that can be used later: var called = false; mock.Setup(x => x.Execute()) .Callback(() => called = true) .Returns(true); Note that in the case of value-returning methods, after the Callback call you can still specify the return value. Specifies a callback to invoke when the method is called that receives the original arguments. The type of the argument of the invoked method. Callback method to invoke. Invokes the given callback with the concrete invocation argument value. Notice how the specific string argument is retrieved by simply declaring it as part of the lambda expression for the callback: mock.Setup(x => x.Execute(It.IsAny<string>())) .Callback(command => Console.WriteLine(command)) .Returns(true); Specifies a callback to invoke when the method is called that receives the original arguments. The type of the first argument of the invoked method. The type of the second argument of the invoked method. The callback method to invoke. A reference to interface. Invokes the given callback with the concrete invocation arguments values. Notice how the specific arguments are retrieved by simply declaring them as part of the lambda expression for the callback: mock.Setup(x => x.Execute( It.IsAny<string>(), It.IsAny<string>())) .Callback((arg1, arg2) => Console.WriteLine(arg1 + arg2)); Specifies a callback to invoke when the method is called that receives the original arguments. The type of the first argument of the invoked method. The type of the second argument of the invoked method. The type of the third argument of the invoked method. The callback method to invoke. A reference to interface. Invokes the given callback with the concrete invocation arguments values. Notice how the specific arguments are retrieved by simply declaring them as part of the lambda expression for the callback: mock.Setup(x => x.Execute( It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>())) .Callback((arg1, arg2, arg3) => Console.WriteLine(arg1 + arg2 + arg3)); Specifies a callback to invoke when the method is called that receives the original arguments. The type of the first argument of the invoked method. The type of the second argument of the invoked method. The type of the third argument of the invoked method. The type of the fourth argument of the invoked method. The callback method to invoke. A reference to interface. Invokes the given callback with the concrete invocation arguments values. Notice how the specific arguments are retrieved by simply declaring them as part of the lambda expression for the callback: mock.Setup(x => x.Execute( It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>())) .Callback((arg1, arg2, arg3, arg4) => Console.WriteLine(arg1 + arg2 + arg3 + arg4)); Specifies a callback to invoke when the method is called that receives the original arguments. The type of the first argument of the invoked method. The type of the second argument of the invoked method. The type of the third argument of the invoked method. The type of the fourth argument of the invoked method. The type of the fifth argument of the invoked method. The callback method to invoke. A reference to interface. Invokes the given callback with the concrete invocation arguments values. Notice how the specific arguments are retrieved by simply declaring them as part of the lambda expression for the callback: mock.Setup(x => x.Execute( It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>())) .Callback((arg1, arg2, arg3, arg4, arg5) => Console.WriteLine(arg1 + arg2 + arg3 + arg4 + arg5)); Specifies a callback to invoke when the method is called that receives the original arguments. The type of the first argument of the invoked method. The type of the second argument of the invoked method. The type of the third argument of the invoked method. The type of the fourth argument of the invoked method. The type of the fifth argument of the invoked method. The type of the sixth argument of the invoked method. The callback method to invoke. A reference to interface. Invokes the given callback with the concrete invocation arguments values. Notice how the specific arguments are retrieved by simply declaring them as part of the lambda expression for the callback: mock.Setup(x => x.Execute( It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>())) .Callback((arg1, arg2, arg3, arg4, arg5, arg6) => Console.WriteLine(arg1 + arg2 + arg3 + arg4 + arg5 + arg6)); Specifies a callback to invoke when the method is called that receives the original arguments. The type of the first argument of the invoked method. The type of the second argument of the invoked method. The type of the third argument of the invoked method. The type of the fourth argument of the invoked method. The type of the fifth argument of the invoked method. The type of the sixth argument of the invoked method. The type of the seventh argument of the invoked method. The callback method to invoke. A reference to interface. Invokes the given callback with the concrete invocation arguments values. Notice how the specific arguments are retrieved by simply declaring them as part of the lambda expression for the callback: mock.Setup(x => x.Execute( It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>())) .Callback((arg1, arg2, arg3, arg4, arg5, arg6, arg7) => Console.WriteLine(arg1 + arg2 + arg3 + arg4 + arg5 + arg6 + arg7)); Specifies a callback to invoke when the method is called that receives the original arguments. The type of the first argument of the invoked method. The type of the second argument of the invoked method. The type of the third argument of the invoked method. The type of the fourth argument of the invoked method. The type of the fifth argument of the invoked method. The type of the sixth argument of the invoked method. The type of the seventh argument of the invoked method. The type of the eighth argument of the invoked method. The callback method to invoke. A reference to interface. Invokes the given callback with the concrete invocation arguments values. Notice how the specific arguments are retrieved by simply declaring them as part of the lambda expression for the callback: mock.Setup(x => x.Execute( It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>())) .Callback((arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8) => Console.WriteLine(arg1 + arg2 + arg3 + arg4 + arg5 + arg6 + arg7 + arg8)); Specifies a callback to invoke when the method is called that receives the original arguments. The type of the first argument of the invoked method. The type of the second argument of the invoked method. The type of the third argument of the invoked method. The type of the fourth argument of the invoked method. The type of the fifth argument of the invoked method. The type of the sixth argument of the invoked method. The type of the seventh argument of the invoked method. The type of the eighth argument of the invoked method. The type of the nineth argument of the invoked method. The callback method to invoke. A reference to interface. Invokes the given callback with the concrete invocation arguments values. Notice how the specific arguments are retrieved by simply declaring them as part of the lambda expression for the callback: mock.Setup(x => x.Execute( It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>())) .Callback((arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9) => Console.WriteLine(arg1 + arg2 + arg3 + arg4 + arg5 + arg6 + arg7 + arg8 + arg9)); Specifies a callback to invoke when the method is called that receives the original arguments. The type of the first argument of the invoked method. The type of the second argument of the invoked method. The type of the third argument of the invoked method. The type of the fourth argument of the invoked method. The type of the fifth argument of the invoked method. The type of the sixth argument of the invoked method. The type of the seventh argument of the invoked method. The type of the eighth argument of the invoked method. The type of the nineth argument of the invoked method. The type of the tenth argument of the invoked method. The callback method to invoke. A reference to interface. Invokes the given callback with the concrete invocation arguments values. Notice how the specific arguments are retrieved by simply declaring them as part of the lambda expression for the callback: mock.Setup(x => x.Execute( It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>())) .Callback((arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10) => Console.WriteLine(arg1 + arg2 + arg3 + arg4 + arg5 + arg6 + arg7 + arg8 + arg9 + arg10)); Specifies a callback to invoke when the method is called that receives the original arguments. The type of the first argument of the invoked method. The type of the second argument of the invoked method. The type of the third argument of the invoked method. The type of the fourth argument of the invoked method. The type of the fifth argument of the invoked method. The type of the sixth argument of the invoked method. The type of the seventh argument of the invoked method. The type of the eighth argument of the invoked method. The type of the nineth argument of the invoked method. The type of the tenth argument of the invoked method. The type of the eleventh argument of the invoked method. The callback method to invoke. A reference to interface. Invokes the given callback with the concrete invocation arguments values. Notice how the specific arguments are retrieved by simply declaring them as part of the lambda expression for the callback: mock.Setup(x => x.Execute( It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>())) .Callback((arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11) => Console.WriteLine(arg1 + arg2 + arg3 + arg4 + arg5 + arg6 + arg7 + arg8 + arg9 + arg10 + arg11)); Specifies a callback to invoke when the method is called that receives the original arguments. The type of the first argument of the invoked method. The type of the second argument of the invoked method. The type of the third argument of the invoked method. The type of the fourth argument of the invoked method. The type of the fifth argument of the invoked method. The type of the sixth argument of the invoked method. The type of the seventh argument of the invoked method. The type of the eighth argument of the invoked method. The type of the nineth argument of the invoked method. The type of the tenth argument of the invoked method. The type of the eleventh argument of the invoked method. The type of the twelfth argument of the invoked method. The callback method to invoke. A reference to interface. Invokes the given callback with the concrete invocation arguments values. Notice how the specific arguments are retrieved by simply declaring them as part of the lambda expression for the callback: mock.Setup(x => x.Execute( It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>())) .Callback((arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11, arg12) => Console.WriteLine(arg1 + arg2 + arg3 + arg4 + arg5 + arg6 + arg7 + arg8 + arg9 + arg10 + arg11 + arg12)); Specifies a callback to invoke when the method is called that receives the original arguments. The type of the first argument of the invoked method. The type of the second argument of the invoked method. The type of the third argument of the invoked method. The type of the fourth argument of the invoked method. The type of the fifth argument of the invoked method. The type of the sixth argument of the invoked method. The type of the seventh argument of the invoked method. The type of the eighth argument of the invoked method. The type of the nineth argument of the invoked method. The type of the tenth argument of the invoked method. The type of the eleventh argument of the invoked method. The type of the twelfth argument of the invoked method. The type of the thirteenth argument of the invoked method. The callback method to invoke. A reference to interface. Invokes the given callback with the concrete invocation arguments values. Notice how the specific arguments are retrieved by simply declaring them as part of the lambda expression for the callback: mock.Setup(x => x.Execute( It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>())) .Callback((arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11, arg12, arg13) => Console.WriteLine(arg1 + arg2 + arg3 + arg4 + arg5 + arg6 + arg7 + arg8 + arg9 + arg10 + arg11 + arg12 + arg13)); Specifies a callback to invoke when the method is called that receives the original arguments. The type of the first argument of the invoked method. The type of the second argument of the invoked method. The type of the third argument of the invoked method. The type of the fourth argument of the invoked method. The type of the fifth argument of the invoked method. The type of the sixth argument of the invoked method. The type of the seventh argument of the invoked method. The type of the eighth argument of the invoked method. The type of the nineth argument of the invoked method. The type of the tenth argument of the invoked method. The type of the eleventh argument of the invoked method. The type of the twelfth argument of the invoked method. The type of the thirteenth argument of the invoked method. The type of the fourteenth argument of the invoked method. The callback method to invoke. A reference to interface. Invokes the given callback with the concrete invocation arguments values. Notice how the specific arguments are retrieved by simply declaring them as part of the lambda expression for the callback: mock.Setup(x => x.Execute( It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>())) .Callback((arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11, arg12, arg13, arg14) => Console.WriteLine(arg1 + arg2 + arg3 + arg4 + arg5 + arg6 + arg7 + arg8 + arg9 + arg10 + arg11 + arg12 + arg13 + arg14)); Specifies a callback to invoke when the method is called that receives the original arguments. The type of the first argument of the invoked method. The type of the second argument of the invoked method. The type of the third argument of the invoked method. The type of the fourth argument of the invoked method. The type of the fifth argument of the invoked method. The type of the sixth argument of the invoked method. The type of the seventh argument of the invoked method. The type of the eighth argument of the invoked method. The type of the nineth argument of the invoked method. The type of the tenth argument of the invoked method. The type of the eleventh argument of the invoked method. The type of the twelfth argument of the invoked method. The type of the thirteenth argument of the invoked method. The type of the fourteenth argument of the invoked method. The type of the fifteenth argument of the invoked method. The callback method to invoke. A reference to interface. Invokes the given callback with the concrete invocation arguments values. Notice how the specific arguments are retrieved by simply declaring them as part of the lambda expression for the callback: mock.Setup(x => x.Execute( It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>())) .Callback((arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11, arg12, arg13, arg14, arg15) => Console.WriteLine(arg1 + arg2 + arg3 + arg4 + arg5 + arg6 + arg7 + arg8 + arg9 + arg10 + arg11 + arg12 + arg13 + arg14 + arg15)); Specifies a callback to invoke when the method is called that receives the original arguments. The type of the first argument of the invoked method. The type of the second argument of the invoked method. The type of the third argument of the invoked method. The type of the fourth argument of the invoked method. The type of the fifth argument of the invoked method. The type of the sixth argument of the invoked method. The type of the seventh argument of the invoked method. The type of the eighth argument of the invoked method. The type of the nineth argument of the invoked method. The type of the tenth argument of the invoked method. The type of the eleventh argument of the invoked method. The type of the twelfth argument of the invoked method. The type of the thirteenth argument of the invoked method. The type of the fourteenth argument of the invoked method. The type of the fifteenth argument of the invoked method. The type of the sixteenth argument of the invoked method. The callback method to invoke. A reference to interface. Invokes the given callback with the concrete invocation arguments values. Notice how the specific arguments are retrieved by simply declaring them as part of the lambda expression for the callback: mock.Setup(x => x.Execute( It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>())) .Callback((arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11, arg12, arg13, arg14, arg15, arg16) => Console.WriteLine(arg1 + arg2 + arg3 + arg4 + arg5 + arg6 + arg7 + arg8 + arg9 + arg10 + arg11 + arg12 + arg13 + arg14 + arg15 + arg16)); Defines the Raises verb. Specifies the event that will be raised when the setup is met. An expression that represents an event attach or detach action. The event arguments to pass for the raised event. The following example shows how to raise an event when the setup is met: var mock = new Mock<IContainer>(); mock.Setup(add => add.Add(It.IsAny<string>(), It.IsAny<object>())) .Raises(add => add.Added += null, EventArgs.Empty); Specifies the event that will be raised when the setup is matched. An expression that represents an event attach or detach action. A function that will build the to pass when raising the event. Specifies the custom event that will be raised when the setup is matched. An expression that represents an event attach or detach action. The arguments to pass to the custom delegate (non EventHandler-compatible). Specifies the event that will be raised when the setup is matched. The expression that represents an event attach or detach action. The function that will build the to pass when raising the event. The type of the first argument received by the expected invocation. Specifies the event that will be raised when the setup is matched. The expression that represents an event attach or detach action. The function that will build the to pass when raising the event. The type of the first argument received by the expected invocation. The type of the second argument received by the expected invocation. Specifies the event that will be raised when the setup is matched. The expression that represents an event attach or detach action. The function that will build the to pass when raising the event. The type of the first argument received by the expected invocation. The type of the second argument received by the expected invocation. The type of the third argument received by the expected invocation. Specifies the event that will be raised when the setup is matched. The expression that represents an event attach or detach action. The function that will build the to pass when raising the event. The type of the first argument received by the expected invocation. The type of the second argument received by the expected invocation. The type of the third argument received by the expected invocation. The type of the fourth argument received by the expected invocation. Specifies the event that will be raised when the setup is matched. The expression that represents an event attach or detach action. The function that will build the to pass when raising the event. The type of the first argument received by the expected invocation. The type of the second argument received by the expected invocation. The type of the third argument received by the expected invocation. The type of the fourth argument received by the expected invocation. The type of the fifth argument received by the expected invocation. Specifies the event that will be raised when the setup is matched. The expression that represents an event attach or detach action. The function that will build the to pass when raising the event. The type of the first argument received by the expected invocation. The type of the second argument received by the expected invocation. The type of the third argument received by the expected invocation. The type of the fourth argument received by the expected invocation. The type of the fifth argument received by the expected invocation. The type of the sixth argument received by the expected invocation. Specifies the event that will be raised when the setup is matched. The expression that represents an event attach or detach action. The function that will build the to pass when raising the event. The type of the first argument received by the expected invocation. The type of the second argument received by the expected invocation. The type of the third argument received by the expected invocation. The type of the fourth argument received by the expected invocation. The type of the fifth argument received by the expected invocation. The type of the sixth argument received by the expected invocation. The type of the seventh argument received by the expected invocation. Specifies the event that will be raised when the setup is matched. The expression that represents an event attach or detach action. The function that will build the to pass when raising the event. The type of the first argument received by the expected invocation. The type of the second argument received by the expected invocation. The type of the third argument received by the expected invocation. The type of the fourth argument received by the expected invocation. The type of the fifth argument received by the expected invocation. The type of the sixth argument received by the expected invocation. The type of the seventh argument received by the expected invocation. The type of the eighth argument received by the expected invocation. Specifies the event that will be raised when the setup is matched. The expression that represents an event attach or detach action. The function that will build the to pass when raising the event. The type of the first argument received by the expected invocation. The type of the second argument received by the expected invocation. The type of the third argument received by the expected invocation. The type of the fourth argument received by the expected invocation. The type of the fifth argument received by the expected invocation. The type of the sixth argument received by the expected invocation. The type of the seventh argument received by the expected invocation. The type of the eighth argument received by the expected invocation. The type of the nineth argument received by the expected invocation. Specifies the event that will be raised when the setup is matched. The expression that represents an event attach or detach action. The function that will build the to pass when raising the event. The type of the first argument received by the expected invocation. The type of the second argument received by the expected invocation. The type of the third argument received by the expected invocation. The type of the fourth argument received by the expected invocation. The type of the fifth argument received by the expected invocation. The type of the sixth argument received by the expected invocation. The type of the seventh argument received by the expected invocation. The type of the eighth argument received by the expected invocation. The type of the nineth argument received by the expected invocation. The type of the tenth argument received by the expected invocation. Specifies the event that will be raised when the setup is matched. The expression that represents an event attach or detach action. The function that will build the to pass when raising the event. The type of the first argument received by the expected invocation. The type of the second argument received by the expected invocation. The type of the third argument received by the expected invocation. The type of the fourth argument received by the expected invocation. The type of the fifth argument received by the expected invocation. The type of the sixth argument received by the expected invocation. The type of the seventh argument received by the expected invocation. The type of the eighth argument received by the expected invocation. The type of the nineth argument received by the expected invocation. The type of the tenth argument received by the expected invocation. The type of the eleventh argument received by the expected invocation. Specifies the event that will be raised when the setup is matched. The expression that represents an event attach or detach action. The function that will build the to pass when raising the event. The type of the first argument received by the expected invocation. The type of the second argument received by the expected invocation. The type of the third argument received by the expected invocation. The type of the fourth argument received by the expected invocation. The type of the fifth argument received by the expected invocation. The type of the sixth argument received by the expected invocation. The type of the seventh argument received by the expected invocation. The type of the eighth argument received by the expected invocation. The type of the nineth argument received by the expected invocation. The type of the tenth argument received by the expected invocation. The type of the eleventh argument received by the expected invocation. The type of the twelfth argument received by the expected invocation. Specifies the event that will be raised when the setup is matched. The expression that represents an event attach or detach action. The function that will build the to pass when raising the event. The type of the first argument received by the expected invocation. The type of the second argument received by the expected invocation. The type of the third argument received by the expected invocation. The type of the fourth argument received by the expected invocation. The type of the fifth argument received by the expected invocation. The type of the sixth argument received by the expected invocation. The type of the seventh argument received by the expected invocation. The type of the eighth argument received by the expected invocation. The type of the nineth argument received by the expected invocation. The type of the tenth argument received by the expected invocation. The type of the eleventh argument received by the expected invocation. The type of the twelfth argument received by the expected invocation. The type of the thirteenth argument received by the expected invocation. Specifies the event that will be raised when the setup is matched. The expression that represents an event attach or detach action. The function that will build the to pass when raising the event. The type of the first argument received by the expected invocation. The type of the second argument received by the expected invocation. The type of the third argument received by the expected invocation. The type of the fourth argument received by the expected invocation. The type of the fifth argument received by the expected invocation. The type of the sixth argument received by the expected invocation. The type of the seventh argument received by the expected invocation. The type of the eighth argument received by the expected invocation. The type of the nineth argument received by the expected invocation. The type of the tenth argument received by the expected invocation. The type of the eleventh argument received by the expected invocation. The type of the twelfth argument received by the expected invocation. The type of the thirteenth argument received by the expected invocation. The type of the fourteenth argument received by the expected invocation. Specifies the event that will be raised when the setup is matched. The expression that represents an event attach or detach action. The function that will build the to pass when raising the event. The type of the first argument received by the expected invocation. The type of the second argument received by the expected invocation. The type of the third argument received by the expected invocation. The type of the fourth argument received by the expected invocation. The type of the fifth argument received by the expected invocation. The type of the sixth argument received by the expected invocation. The type of the seventh argument received by the expected invocation. The type of the eighth argument received by the expected invocation. The type of the nineth argument received by the expected invocation. The type of the tenth argument received by the expected invocation. The type of the eleventh argument received by the expected invocation. The type of the twelfth argument received by the expected invocation. The type of the thirteenth argument received by the expected invocation. The type of the fourteenth argument received by the expected invocation. The type of the fifteenth argument received by the expected invocation. Specifies the event that will be raised when the setup is matched. The expression that represents an event attach or detach action. The function that will build the to pass when raising the event. The type of the first argument received by the expected invocation. The type of the second argument received by the expected invocation. The type of the third argument received by the expected invocation. The type of the fourth argument received by the expected invocation. The type of the fifth argument received by the expected invocation. The type of the sixth argument received by the expected invocation. The type of the seventh argument received by the expected invocation. The type of the eighth argument received by the expected invocation. The type of the nineth argument received by the expected invocation. The type of the tenth argument received by the expected invocation. The type of the eleventh argument received by the expected invocation. The type of the twelfth argument received by the expected invocation. The type of the thirteenth argument received by the expected invocation. The type of the fourteenth argument received by the expected invocation. The type of the fifteenth argument received by the expected invocation. The type of the sixteenth argument received by the expected invocation. Defines the Returns verb. Mocked type. Type of the return value from the expression. Specifies the value to return. The value to return, or . Return a true value from the method call: mock.Setup(x => x.Execute("ping")) .Returns(true); Specifies a function that will calculate the value to return from the method. The function that will calculate the return value. Return a calculated value when the method is called: mock.Setup(x => x.Execute("ping")) .Returns(() => returnValues[0]); The lambda expression to retrieve the return value is lazy-executed, meaning that its value may change depending on the moment the method is executed and the value the returnValues array has at that moment. Specifies a function that will calculate the value to return from the method, retrieving the arguments for the invocation. The type of the argument of the invoked method. The function that will calculate the return value. Return a calculated value which is evaluated lazily at the time of the invocation. The lookup list can change between invocations and the setup will return different values accordingly. Also, notice how the specific string argument is retrieved by simply declaring it as part of the lambda expression: mock.Setup(x => x.Execute(It.IsAny<string>())) .Returns((string command) => returnValues[command]); Calls the real method of the object and returns its return value. The value calculated by the real method of the object. Specifies a function that will calculate the value to return from the method, retrieving the arguments for the invocation. The type of the first argument of the invoked method. The type of the second argument of the invoked method. The function that will calculate the return value. Returns a calculated value which is evaluated lazily at the time of the invocation. The return value is calculated from the value of the actual method invocation arguments. Notice how the arguments are retrieved by simply declaring them as part of the lambda expression: mock.Setup(x => x.Execute( It.IsAny<int>(), It.IsAny<int>())) .Returns((string arg1, string arg2) => arg1 + arg2); Specifies a function that will calculate the value to return from the method, retrieving the arguments for the invocation. The type of the first argument of the invoked method. The type of the second argument of the invoked method. The type of the third argument of the invoked method. The function that will calculate the return value. Returns a calculated value which is evaluated lazily at the time of the invocation. The return value is calculated from the value of the actual method invocation arguments. Notice how the arguments are retrieved by simply declaring them as part of the lambda expression: mock.Setup(x => x.Execute( It.IsAny<int>(), It.IsAny<int>(), It.IsAny<int>())) .Returns((string arg1, string arg2, string arg3) => arg1 + arg2 + arg3); Specifies a function that will calculate the value to return from the method, retrieving the arguments for the invocation. The type of the first argument of the invoked method. The type of the second argument of the invoked method. The type of the third argument of the invoked method. The type of the fourth argument of the invoked method. The function that will calculate the return value. Returns a calculated value which is evaluated lazily at the time of the invocation. The return value is calculated from the value of the actual method invocation arguments. Notice how the arguments are retrieved by simply declaring them as part of the lambda expression: mock.Setup(x => x.Execute( It.IsAny<int>(), It.IsAny<int>(), It.IsAny<int>(), It.IsAny<int>())) .Returns((string arg1, string arg2, string arg3, string arg4) => arg1 + arg2 + arg3 + arg4); Specifies a function that will calculate the value to return from the method, retrieving the arguments for the invocation. The type of the first argument of the invoked method. The type of the second argument of the invoked method. The type of the third argument of the invoked method. The type of the fourth argument of the invoked method. The type of the fifth argument of the invoked method. The function that will calculate the return value. Returns a calculated value which is evaluated lazily at the time of the invocation. The return value is calculated from the value of the actual method invocation arguments. Notice how the arguments are retrieved by simply declaring them as part of the lambda expression: mock.Setup(x => x.Execute( It.IsAny<int>(), It.IsAny<int>(), It.IsAny<int>(), It.IsAny<int>(), It.IsAny<int>())) .Returns((string arg1, string arg2, string arg3, string arg4, string arg5) => arg1 + arg2 + arg3 + arg4 + arg5); Specifies a function that will calculate the value to return from the method, retrieving the arguments for the invocation. The type of the first argument of the invoked method. The type of the second argument of the invoked method. The type of the third argument of the invoked method. The type of the fourth argument of the invoked method. The type of the fifth argument of the invoked method. The type of the sixth argument of the invoked method. The function that will calculate the return value. Returns a calculated value which is evaluated lazily at the time of the invocation. The return value is calculated from the value of the actual method invocation arguments. Notice how the arguments are retrieved by simply declaring them as part of the lambda expression: mock.Setup(x => x.Execute( It.IsAny<int>(), It.IsAny<int>(), It.IsAny<int>(), It.IsAny<int>(), It.IsAny<int>(), It.IsAny<int>())) .Returns((string arg1, string arg2, string arg3, string arg4, string arg5, string arg6) => arg1 + arg2 + arg3 + arg4 + arg5 + arg6); Specifies a function that will calculate the value to return from the method, retrieving the arguments for the invocation. The type of the first argument of the invoked method. The type of the second argument of the invoked method. The type of the third argument of the invoked method. The type of the fourth argument of the invoked method. The type of the fifth argument of the invoked method. The type of the sixth argument of the invoked method. The type of the seventh argument of the invoked method. The function that will calculate the return value. Returns a calculated value which is evaluated lazily at the time of the invocation. The return value is calculated from the value of the actual method invocation arguments. Notice how the arguments are retrieved by simply declaring them as part of the lambda expression: mock.Setup(x => x.Execute( It.IsAny<int>(), It.IsAny<int>(), It.IsAny<int>(), It.IsAny<int>(), It.IsAny<int>(), It.IsAny<int>(), It.IsAny<int>())) .Returns((string arg1, string arg2, string arg3, string arg4, string arg5, string arg6, string arg7) => arg1 + arg2 + arg3 + arg4 + arg5 + arg6 + arg7); Specifies a function that will calculate the value to return from the method, retrieving the arguments for the invocation. The type of the first argument of the invoked method. The type of the second argument of the invoked method. The type of the third argument of the invoked method. The type of the fourth argument of the invoked method. The type of the fifth argument of the invoked method. The type of the sixth argument of the invoked method. The type of the seventh argument of the invoked method. The type of the eighth argument of the invoked method. The function that will calculate the return value. Returns a calculated value which is evaluated lazily at the time of the invocation. The return value is calculated from the value of the actual method invocation arguments. Notice how the arguments are retrieved by simply declaring them as part of the lambda expression: mock.Setup(x => x.Execute( It.IsAny<int>(), It.IsAny<int>(), It.IsAny<int>(), It.IsAny<int>(), It.IsAny<int>(), It.IsAny<int>(), It.IsAny<int>(), It.IsAny<int>())) .Returns((string arg1, string arg2, string arg3, string arg4, string arg5, string arg6, string arg7, string arg8) => arg1 + arg2 + arg3 + arg4 + arg5 + arg6 + arg7 + arg8); Specifies a function that will calculate the value to return from the method, retrieving the arguments for the invocation. The type of the first argument of the invoked method. The type of the second argument of the invoked method. The type of the third argument of the invoked method. The type of the fourth argument of the invoked method. The type of the fifth argument of the invoked method. The type of the sixth argument of the invoked method. The type of the seventh argument of the invoked method. The type of the eighth argument of the invoked method. The type of the nineth argument of the invoked method. The function that will calculate the return value. Returns a calculated value which is evaluated lazily at the time of the invocation. The return value is calculated from the value of the actual method invocation arguments. Notice how the arguments are retrieved by simply declaring them as part of the lambda expression: mock.Setup(x => x.Execute( It.IsAny<int>(), It.IsAny<int>(), It.IsAny<int>(), It.IsAny<int>(), It.IsAny<int>(), It.IsAny<int>(), It.IsAny<int>(), It.IsAny<int>(), It.IsAny<int>())) .Returns((string arg1, string arg2, string arg3, string arg4, string arg5, string arg6, string arg7, string arg8, string arg9) => arg1 + arg2 + arg3 + arg4 + arg5 + arg6 + arg7 + arg8 + arg9); Specifies a function that will calculate the value to return from the method, retrieving the arguments for the invocation. The type of the first argument of the invoked method. The type of the second argument of the invoked method. The type of the third argument of the invoked method. The type of the fourth argument of the invoked method. The type of the fifth argument of the invoked method. The type of the sixth argument of the invoked method. The type of the seventh argument of the invoked method. The type of the eighth argument of the invoked method. The type of the nineth argument of the invoked method. The type of the tenth argument of the invoked method. The function that will calculate the return value. Returns a calculated value which is evaluated lazily at the time of the invocation. The return value is calculated from the value of the actual method invocation arguments. Notice how the arguments are retrieved by simply declaring them as part of the lambda expression: mock.Setup(x => x.Execute( It.IsAny<int>(), It.IsAny<int>(), It.IsAny<int>(), It.IsAny<int>(), It.IsAny<int>(), It.IsAny<int>(), It.IsAny<int>(), It.IsAny<int>(), It.IsAny<int>(), It.IsAny<int>())) .Returns((string arg1, string arg2, string arg3, string arg4, string arg5, string arg6, string arg7, string arg8, string arg9, string arg10) => arg1 + arg2 + arg3 + arg4 + arg5 + arg6 + arg7 + arg8 + arg9 + arg10); Specifies a function that will calculate the value to return from the method, retrieving the arguments for the invocation. The type of the first argument of the invoked method. The type of the second argument of the invoked method. The type of the third argument of the invoked method. The type of the fourth argument of the invoked method. The type of the fifth argument of the invoked method. The type of the sixth argument of the invoked method. The type of the seventh argument of the invoked method. The type of the eighth argument of the invoked method. The type of the nineth argument of the invoked method. The type of the tenth argument of the invoked method. The type of the eleventh argument of the invoked method. The function that will calculate the return value. Returns a calculated value which is evaluated lazily at the time of the invocation. The return value is calculated from the value of the actual method invocation arguments. Notice how the arguments are retrieved by simply declaring them as part of the lambda expression: mock.Setup(x => x.Execute( It.IsAny<int>(), It.IsAny<int>(), It.IsAny<int>(), It.IsAny<int>(), It.IsAny<int>(), It.IsAny<int>(), It.IsAny<int>(), It.IsAny<int>(), It.IsAny<int>(), It.IsAny<int>(), It.IsAny<int>())) .Returns((string arg1, string arg2, string arg3, string arg4, string arg5, string arg6, string arg7, string arg8, string arg9, string arg10, string arg11) => arg1 + arg2 + arg3 + arg4 + arg5 + arg6 + arg7 + arg8 + arg9 + arg10 + arg11); Specifies a function that will calculate the value to return from the method, retrieving the arguments for the invocation. The type of the first argument of the invoked method. The type of the second argument of the invoked method. The type of the third argument of the invoked method. The type of the fourth argument of the invoked method. The type of the fifth argument of the invoked method. The type of the sixth argument of the invoked method. The type of the seventh argument of the invoked method. The type of the eighth argument of the invoked method. The type of the nineth argument of the invoked method. The type of the tenth argument of the invoked method. The type of the eleventh argument of the invoked method. The type of the twelfth argument of the invoked method. The function that will calculate the return value. Returns a calculated value which is evaluated lazily at the time of the invocation. The return value is calculated from the value of the actual method invocation arguments. Notice how the arguments are retrieved by simply declaring them as part of the lambda expression: mock.Setup(x => x.Execute( It.IsAny<int>(), It.IsAny<int>(), It.IsAny<int>(), It.IsAny<int>(), It.IsAny<int>(), It.IsAny<int>(), It.IsAny<int>(), It.IsAny<int>(), It.IsAny<int>(), It.IsAny<int>(), It.IsAny<int>(), It.IsAny<int>())) .Returns((string arg1, string arg2, string arg3, string arg4, string arg5, string arg6, string arg7, string arg8, string arg9, string arg10, string arg11, string arg12) => arg1 + arg2 + arg3 + arg4 + arg5 + arg6 + arg7 + arg8 + arg9 + arg10 + arg11 + arg12); Specifies a function that will calculate the value to return from the method, retrieving the arguments for the invocation. The type of the first argument of the invoked method. The type of the second argument of the invoked method. The type of the third argument of the invoked method. The type of the fourth argument of the invoked method. The type of the fifth argument of the invoked method. The type of the sixth argument of the invoked method. The type of the seventh argument of the invoked method. The type of the eighth argument of the invoked method. The type of the nineth argument of the invoked method. The type of the tenth argument of the invoked method. The type of the eleventh argument of the invoked method. The type of the twelfth argument of the invoked method. The type of the thirteenth argument of the invoked method. The function that will calculate the return value. Returns a calculated value which is evaluated lazily at the time of the invocation. The return value is calculated from the value of the actual method invocation arguments. Notice how the arguments are retrieved by simply declaring them as part of the lambda expression: mock.Setup(x => x.Execute( It.IsAny<int>(), It.IsAny<int>(), It.IsAny<int>(), It.IsAny<int>(), It.IsAny<int>(), It.IsAny<int>(), It.IsAny<int>(), It.IsAny<int>(), It.IsAny<int>(), It.IsAny<int>(), It.IsAny<int>(), It.IsAny<int>(), It.IsAny<int>())) .Returns((string arg1, string arg2, string arg3, string arg4, string arg5, string arg6, string arg7, string arg8, string arg9, string arg10, string arg11, string arg12, string arg13) => arg1 + arg2 + arg3 + arg4 + arg5 + arg6 + arg7 + arg8 + arg9 + arg10 + arg11 + arg12 + arg13); Specifies a function that will calculate the value to return from the method, retrieving the arguments for the invocation. The type of the first argument of the invoked method. The type of the second argument of the invoked method. The type of the third argument of the invoked method. The type of the fourth argument of the invoked method. The type of the fifth argument of the invoked method. The type of the sixth argument of the invoked method. The type of the seventh argument of the invoked method. The type of the eighth argument of the invoked method. The type of the nineth argument of the invoked method. The type of the tenth argument of the invoked method. The type of the eleventh argument of the invoked method. The type of the twelfth argument of the invoked method. The type of the thirteenth argument of the invoked method. The type of the fourteenth argument of the invoked method. The function that will calculate the return value. Returns a calculated value which is evaluated lazily at the time of the invocation. The return value is calculated from the value of the actual method invocation arguments. Notice how the arguments are retrieved by simply declaring them as part of the lambda expression: mock.Setup(x => x.Execute( It.IsAny<int>(), It.IsAny<int>(), It.IsAny<int>(), It.IsAny<int>(), It.IsAny<int>(), It.IsAny<int>(), It.IsAny<int>(), It.IsAny<int>(), It.IsAny<int>(), It.IsAny<int>(), It.IsAny<int>(), It.IsAny<int>(), It.IsAny<int>(), It.IsAny<int>())) .Returns((string arg1, string arg2, string arg3, string arg4, string arg5, string arg6, string arg7, string arg8, string arg9, string arg10, string arg11, string arg12, string arg13, string arg14) => arg1 + arg2 + arg3 + arg4 + arg5 + arg6 + arg7 + arg8 + arg9 + arg10 + arg11 + arg12 + arg13 + arg14); Specifies a function that will calculate the value to return from the method, retrieving the arguments for the invocation. The type of the first argument of the invoked method. The type of the second argument of the invoked method. The type of the third argument of the invoked method. The type of the fourth argument of the invoked method. The type of the fifth argument of the invoked method. The type of the sixth argument of the invoked method. The type of the seventh argument of the invoked method. The type of the eighth argument of the invoked method. The type of the nineth argument of the invoked method. The type of the tenth argument of the invoked method. The type of the eleventh argument of the invoked method. The type of the twelfth argument of the invoked method. The type of the thirteenth argument of the invoked method. The type of the fourteenth argument of the invoked method. The type of the fifteenth argument of the invoked method. The function that will calculate the return value. Returns a calculated value which is evaluated lazily at the time of the invocation. The return value is calculated from the value of the actual method invocation arguments. Notice how the arguments are retrieved by simply declaring them as part of the lambda expression: mock.Setup(x => x.Execute( It.IsAny<int>(), It.IsAny<int>(), It.IsAny<int>(), It.IsAny<int>(), It.IsAny<int>(), It.IsAny<int>(), It.IsAny<int>(), It.IsAny<int>(), It.IsAny<int>(), It.IsAny<int>(), It.IsAny<int>(), It.IsAny<int>(), It.IsAny<int>(), It.IsAny<int>(), It.IsAny<int>())) .Returns((string arg1, string arg2, string arg3, string arg4, string arg5, string arg6, string arg7, string arg8, string arg9, string arg10, string arg11, string arg12, string arg13, string arg14, string arg15) => arg1 + arg2 + arg3 + arg4 + arg5 + arg6 + arg7 + arg8 + arg9 + arg10 + arg11 + arg12 + arg13 + arg14 + arg15); Specifies a function that will calculate the value to return from the method, retrieving the arguments for the invocation. The type of the first argument of the invoked method. The type of the second argument of the invoked method. The type of the third argument of the invoked method. The type of the fourth argument of the invoked method. The type of the fifth argument of the invoked method. The type of the sixth argument of the invoked method. The type of the seventh argument of the invoked method. The type of the eighth argument of the invoked method. The type of the nineth argument of the invoked method. The type of the tenth argument of the invoked method. The type of the eleventh argument of the invoked method. The type of the twelfth argument of the invoked method. The type of the thirteenth argument of the invoked method. The type of the fourteenth argument of the invoked method. The type of the fifteenth argument of the invoked method. The type of the sixteenth argument of the invoked method. The function that will calculate the return value. Returns a calculated value which is evaluated lazily at the time of the invocation. The return value is calculated from the value of the actual method invocation arguments. Notice how the arguments are retrieved by simply declaring them as part of the lambda expression: mock.Setup(x => x.Execute( It.IsAny<int>(), It.IsAny<int>(), It.IsAny<int>(), It.IsAny<int>(), It.IsAny<int>(), It.IsAny<int>(), It.IsAny<int>(), It.IsAny<int>(), It.IsAny<int>(), It.IsAny<int>(), It.IsAny<int>(), It.IsAny<int>(), It.IsAny<int>(), It.IsAny<int>(), It.IsAny<int>(), It.IsAny<int>())) .Returns((string arg1, string arg2, string arg3, string arg4, string arg5, string arg6, string arg7, string arg8, string arg9, string arg10, string arg11, string arg12, string arg13, string arg14, string arg15, string arg16) => arg1 + arg2 + arg3 + arg4 + arg5 + arg6 + arg7 + arg8 + arg9 + arg10 + arg11 + arg12 + arg13 + arg14 + arg15 + arg16); Hook used to tells Castle which methods to proxy in mocked classes. Here we proxy the default methods Castle suggests (everything Object's methods) plus Object.ToString(), so we can give mocks useful default names. This is required to allow Moq to mock ToString on proxy *class* implementations. Extends AllMethodsHook.ShouldInterceptMethod to also intercept Object.ToString(). The base class used for all our interface-inheriting proxies, which overrides the default Object.ToString() behavior, to route it via the mock by default, unless overriden by a real implementation. This is required to allow Moq to mock ToString on proxy *interface* implementations. This is internal to Moq and should not be generally used. Unfortunately it must be public, due to cross-assembly visibility issues with reflection, see github.com/Moq/moq4/issues/98 for details. Overrides the default ToString implementation to instead find the mock for this mock.Object, and return MockName + '.Object' as the mocked object's ToString, to make it easy to relate mocks and mock object instances in error messages. Language for ReturnSequence Returns value Throws an exception Throws an exception Calls original method The first method call or member access will be the last segment of the expression (depth-first traversal), which is the one we have to Setup rather than FluentMock. And the last one is the one we have to Mock.Get rather than FluentMock. Base class for mocks and static helper class with methods that apply to mocked objects, such as to retrieve a from an object instance. Creates an mock object of the indicated type. The type of the mocked object. The mocked object created. Creates an mock object of the indicated type. The predicate with the specification of how the mocked object should behave. The type of the mocked object. The mocked object created. Initializes a new instance of the class. Retrieves the mock object for the given object instance. Type of the mock to retrieve. Can be omitted as it's inferred from the object instance passed in as the instance. The instance of the mocked object.The mock associated with the mocked object. The received instance was not created by Moq. The following example shows how to add a new setup to an object instance which is not the original but rather the object associated with it: // Typed instance, not the mock, is retrieved from some test API. HttpContextBase context = GetMockContext(); // context.Request is the typed object from the "real" API // so in order to add a setup to it, we need to get // the mock that "owns" it Mock<HttpRequestBase> request = Mock.Get(context.Request); mock.Setup(req => req.AppRelativeCurrentExecutionFilePath) .Returns(tempUrl); Returns the mocked object value. Verifies that all verifiable expectations have been met. This example sets up an expectation and marks it as verifiable. After the mock is used, a Verify() call is issued on the mock to ensure the method in the setup was invoked: var mock = new Mock<IWarehouse>(); this.Setup(x => x.HasInventory(TALISKER, 50)).Verifiable().Returns(true); ... // other test code ... // Will throw if the test code has didn't call HasInventory. this.Verify(); Not all verifiable expectations were met. Verifies all expectations regardless of whether they have been flagged as verifiable. This example sets up an expectation without marking it as verifiable. After the mock is used, a call is issued on the mock to ensure that all expectations are met: var mock = new Mock<IWarehouse>(); this.Setup(x => x.HasInventory(TALISKER, 50)).Returns(true); ... // other test code ... // Will throw if the test code has didn't call HasInventory, even // that expectation was not marked as verifiable. this.VerifyAll(); At least one expectation was not met. Gets the interceptor target for the given expression and root mock, building the intermediate hierarchy of mock objects if necessary. Raises the associated event with the given event argument data. Raises the associated event with the given event argument data. Adds an interface implementation to the mock, allowing setups to be specified for it. This method can only be called before the first use of the mock property, at which point the runtime type has already been generated and no more interfaces can be added to it. Also, must be an interface and not a class, which must be specified when creating the mock instead. The mock type has already been generated by accessing the property. The specified is not an interface. The following example creates a mock for the main interface and later adds to it to verify it's called by the consumer code: var mock = new Mock<IProcessor>(); mock.Setup(x => x.Execute("ping")); // add IDisposable interface var disposable = mock.As<IDisposable>(); disposable.Setup(d => d.Dispose()).Verifiable(); Type of interface to cast the mock to. Behavior of the mock, according to the value set in the constructor. Whether the base member virtual implementation will be called for mocked classes if no setup is matched. Defaults to . Specifies the behavior to use when returning default values for unexpected invocations on loose mocks. Gets the mocked object instance. Retrieves the type of the mocked object, its generic type argument. This is used in the auto-mocking of hierarchy access. If this is a mock of a delegate, this property contains the method on the autogenerated interface so that we can convert setup + verify expressions on the delegate into expressions on the interface proxy. Allows to check whether expression conversion to the must be performed on the mock, without causing unnecessarily early initialization of the mock instance, which breaks As{T}. Specifies the class that will determine the default value to return when invocations are made that have no setups and need to return a default value (for loose mocks). Exposes the list of extra interfaces implemented by the mock. Utility repository class to use to construct multiple mocks when consistent verification is desired for all of them. If multiple mocks will be created during a test, passing the desired (if different than the or the one passed to the repository constructor) and later verifying each mock can become repetitive and tedious. This repository class helps in that scenario by providing a simplified creation of multiple mocks with a default (unless overriden by calling ) and posterior verification. The following is a straightforward example on how to create and automatically verify strict mocks using a : var repository = new MockRepository(MockBehavior.Strict); var foo = repository.Create<IFoo>(); var bar = repository.Create<IBar>(); // no need to call Verifiable() on the setup // as we'll be validating all of them anyway. foo.Setup(f => f.Do()); bar.Setup(b => b.Redo()); // exercise the mocks here repository.VerifyAll(); // At this point all setups are already checked // and an optional MockException might be thrown. // Note also that because the mocks are strict, any invocation // that doesn't have a matching setup will also throw a MockException. The following examples shows how to setup the repository to create loose mocks and later verify only verifiable setups: var repository = new MockRepository(MockBehavior.Loose); var foo = repository.Create<IFoo>(); var bar = repository.Create<IBar>(); // this setup will be verified when we verify the repository foo.Setup(f => f.Do()).Verifiable(); // this setup will NOT be verified foo.Setup(f => f.Calculate()); // this setup will be verified when we verify the repository bar.Setup(b => b.Redo()).Verifiable(); // exercise the mocks here // note that because the mocks are Loose, members // called in the interfaces for which no matching // setups exist will NOT throw exceptions, // and will rather return default values. repository.Verify(); // At this point verifiable setups are already checked // and an optional MockException might be thrown. The following examples shows how to setup the repository with a default strict behavior, overriding that default for a specific mock: var repository = new MockRepository(MockBehavior.Strict); // this particular one we want loose var foo = repository.Create<IFoo>(MockBehavior.Loose); var bar = repository.Create<IBar>(); // specify setups // exercise the mocks here repository.Verify(); Utility factory class to use to construct multiple mocks when consistent verification is desired for all of them. If multiple mocks will be created during a test, passing the desired (if different than the or the one passed to the factory constructor) and later verifying each mock can become repetitive and tedious. This factory class helps in that scenario by providing a simplified creation of multiple mocks with a default (unless overriden by calling ) and posterior verification. The following is a straightforward example on how to create and automatically verify strict mocks using a : var factory = new MockFactory(MockBehavior.Strict); var foo = factory.Create<IFoo>(); var bar = factory.Create<IBar>(); // no need to call Verifiable() on the setup // as we'll be validating all of them anyway. foo.Setup(f => f.Do()); bar.Setup(b => b.Redo()); // exercise the mocks here factory.VerifyAll(); // At this point all setups are already checked // and an optional MockException might be thrown. // Note also that because the mocks are strict, any invocation // that doesn't have a matching setup will also throw a MockException. The following examples shows how to setup the factory to create loose mocks and later verify only verifiable setups: var factory = new MockFactory(MockBehavior.Loose); var foo = factory.Create<IFoo>(); var bar = factory.Create<IBar>(); // this setup will be verified when we verify the factory foo.Setup(f => f.Do()).Verifiable(); // this setup will NOT be verified foo.Setup(f => f.Calculate()); // this setup will be verified when we verify the factory bar.Setup(b => b.Redo()).Verifiable(); // exercise the mocks here // note that because the mocks are Loose, members // called in the interfaces for which no matching // setups exist will NOT throw exceptions, // and will rather return default values. factory.Verify(); // At this point verifiable setups are already checked // and an optional MockException might be thrown. The following examples shows how to setup the factory with a default strict behavior, overriding that default for a specific mock: var factory = new MockFactory(MockBehavior.Strict); // this particular one we want loose var foo = factory.Create<IFoo>(MockBehavior.Loose); var bar = factory.Create<IBar>(); // specify setups // exercise the mocks here factory.Verify(); Initializes the factory with the given for newly created mocks from the factory. The behavior to use for mocks created using the factory method if not overriden by using the overload. Creates a new mock with the default specified at factory construction time. Type to mock. A new . var factory = new MockFactory(MockBehavior.Strict); var foo = factory.Create<IFoo>(); // use mock on tests factory.VerifyAll(); Creates a new mock with the default specified at factory construction time and with the the given constructor arguments for the class. The mock will try to find the best match constructor given the constructor arguments, and invoke that to initialize the instance. This applies only to classes, not interfaces. Type to mock. Constructor arguments for mocked classes. A new . var factory = new MockFactory(MockBehavior.Default); var mock = factory.Create<MyBase>("Foo", 25, true); // use mock on tests factory.Verify(); Creates a new mock with the given . Type to mock. Behavior to use for the mock, which overrides the default behavior specified at factory construction time. A new . The following example shows how to create a mock with a different behavior to that specified as the default for the factory: var factory = new MockFactory(MockBehavior.Strict); var foo = factory.Create<IFoo>(MockBehavior.Loose); Creates a new mock with the given and with the the given constructor arguments for the class. The mock will try to find the best match constructor given the constructor arguments, and invoke that to initialize the instance. This applies only to classes, not interfaces. Type to mock. Behavior to use for the mock, which overrides the default behavior specified at factory construction time. Constructor arguments for mocked classes. A new . The following example shows how to create a mock with a different behavior to that specified as the default for the factory, passing constructor arguments: var factory = new MockFactory(MockBehavior.Default); var mock = factory.Create<MyBase>(MockBehavior.Strict, "Foo", 25, true); Implements creation of a new mock within the factory. Type to mock. The behavior for the new mock. Optional arguments for the construction of the mock. Verifies all verifiable expectations on all mocks created by this factory. One or more mocks had expectations that were not satisfied. Verifies all verifiable expectations on all mocks created by this factory. One or more mocks had expectations that were not satisfied. Invokes for each mock in , and accumulates the resulting that might be thrown from the action. The action to execute against each mock. Whether the base member virtual implementation will be called for mocked classes if no setup is matched. Defaults to . Specifies the behavior to use when returning default values for unexpected invocations on loose mocks. Gets the mocks that have been created by this factory and that will get verified together. Access the universe of mocks of the given type, to retrieve those that behave according to the LINQ query specification. The type of the mocked object to query. Access the universe of mocks of the given type, to retrieve those that behave according to the LINQ query specification. The predicate with the setup expressions. The type of the mocked object to query. Creates an mock object of the indicated type. The type of the mocked object. The mocked object created. Creates an mock object of the indicated type. The predicate with the setup expressions. The type of the mocked object. The mocked object created. Creates the mock query with the underlying queriable implementation. Wraps the enumerator inside a queryable. Method that is turned into the actual call from .Query{T}, to transform the queryable query into a normal enumerable query. This method is never used directly by consumers. Initializes the repository with the given for newly created mocks from the repository. The behavior to use for mocks created using the repository method if not overriden by using the overload. A that returns an empty default value for invocations that do not have setups or return values, with loose mocks. This is the default behavior for a mock. Interface to be implemented by classes that determine the default value of non-expected invocations. Defines the default value to return in all the methods returning . The type of the return value.The value to set as default. Provides a value for the given member and arguments. The member to provide a default value for. The intention of is to create a more readable string representation for the failure message. Implements the fluent API. Defines the Throws verb. Specifies the exception to throw when the method is invoked. Exception instance to throw. This example shows how to throw an exception when the method is invoked with an empty string argument: mock.Setup(x => x.Execute("")) .Throws(new ArgumentException()); Specifies the type of exception to throw when the method is invoked. Type of exception to instantiate and throw when the setup is matched. This example shows how to throw an exception when the method is invoked with an empty string argument: mock.Setup(x => x.Execute("")) .Throws<ArgumentException>(); Implements the fluent API. Defines occurrence members to constraint setups. The expected invocation can happen at most once. var mock = new Mock<ICommand>(); mock.Setup(foo => foo.Execute("ping")) .AtMostOnce(); The expected invocation can happen at most specified number of times. The number of times to accept calls. var mock = new Mock<ICommand>(); mock.Setup(foo => foo.Execute("ping")) .AtMost( 5 ); Defines the Verifiable verb. Marks the expectation as verifiable, meaning that a call to will check if this particular expectation was met. The following example marks the expectation as verifiable: mock.Expect(x => x.Execute("ping")) .Returns(true) .Verifiable(); Marks the expectation as verifiable, meaning that a call to will check if this particular expectation was met, and specifies a message for failures. The following example marks the expectation as verifiable: mock.Expect(x => x.Execute("ping")) .Returns(true) .Verifiable("Ping should be executed always!"); Implements the fluent API. We need this non-generics base class so that we can use from generic code. Implements the fluent API. Implements the fluent API. Implements the fluent API. Defines the Callback verb for property getter setups. Mocked type. Type of the property. Specifies a callback to invoke when the property is retrieved. Callback method to invoke. Invokes the given callback with the property value being set. mock.SetupGet(x => x.Suspended) .Callback(() => called = true) .Returns(true); Implements the fluent API. Defines the Returns verb for property get setups. Mocked type. Type of the property. Specifies the value to return. The value to return, or . Return a true value from the property getter call: mock.SetupGet(x => x.Suspended) .Returns(true); Specifies a function that will calculate the value to return for the property. The function that will calculate the return value. Return a calculated value when the property is retrieved: mock.SetupGet(x => x.Suspended) .Returns(() => returnValues[0]); The lambda expression to retrieve the return value is lazy-executed, meaning that its value may change depending on the moment the property is retrieved and the value the returnValues array has at that moment. Calls the real property of the object and returns its return value. The value calculated by the real property of the object. Implements the fluent API. Encapsulates a method that has five parameters and does not return a value. The type of the first parameter of the method that this delegate encapsulates. The type of the second parameter of the method that this delegate encapsulates. The type of the third parameter of the method that this delegate encapsulates. The type of the fourth parameter of the method that this delegate encapsulates. The type of the fifth parameter of the method that this delegate encapsulates. The first parameter of the method that this delegate encapsulates. The second parameter of the method that this delegate encapsulates. The third parameter of the method that this delegate encapsulates. The fourth parameter of the method that this delegate encapsulates. The fifth parameter of the method that this delegate encapsulates. Encapsulates a method that has five parameters and returns a value of the type specified by the parameter. The type of the first parameter of the method that this delegate encapsulates. The type of the second parameter of the method that this delegate encapsulates. The type of the third parameter of the method that this delegate encapsulates. The type of the fourth parameter of the method that this delegate encapsulates. The type of the fifth parameter of the method that this delegate encapsulates. The type of the return value of the method that this delegate encapsulates. The first parameter of the method that this delegate encapsulates. The second parameter of the method that this delegate encapsulates. The third parameter of the method that this delegate encapsulates. The fourth parameter of the method that this delegate encapsulates. The fifth parameter of the method that this delegate encapsulates. The return value of the method that this delegate encapsulates. Encapsulates a method that has six parameters and does not return a value. The type of the first parameter of the method that this delegate encapsulates. The type of the second parameter of the method that this delegate encapsulates. The type of the third parameter of the method that this delegate encapsulates. The type of the fourth parameter of the method that this delegate encapsulates. The type of the fifth parameter of the method that this delegate encapsulates. The type of the sixth parameter of the method that this delegate encapsulates. The first parameter of the method that this delegate encapsulates. The second parameter of the method that this delegate encapsulates. The third parameter of the method that this delegate encapsulates. The fourth parameter of the method that this delegate encapsulates. The fifth parameter of the method that this delegate encapsulates. The sixth parameter of the method that this delegate encapsulates. Encapsulates a method that has six parameters and returns a value of the type specified by the parameter. The type of the first parameter of the method that this delegate encapsulates. The type of the second parameter of the method that this delegate encapsulates. The type of the third parameter of the method that this delegate encapsulates. The type of the fourth parameter of the method that this delegate encapsulates. The type of the fifth parameter of the method that this delegate encapsulates. The type of the sixth parameter of the method that this delegate encapsulates. The type of the return value of the method that this delegate encapsulates. The first parameter of the method that this delegate encapsulates. The second parameter of the method that this delegate encapsulates. The third parameter of the method that this delegate encapsulates. The fourth parameter of the method that this delegate encapsulates. The fifth parameter of the method that this delegate encapsulates. The sixth parameter of the method that this delegate encapsulates. The return value of the method that this delegate encapsulates. Encapsulates a method that has seven parameters and does not return a value. The type of the first parameter of the method that this delegate encapsulates. The type of the second parameter of the method that this delegate encapsulates. The type of the third parameter of the method that this delegate encapsulates. The type of the fourth parameter of the method that this delegate encapsulates. The type of the fifth parameter of the method that this delegate encapsulates. The type of the sixth parameter of the method that this delegate encapsulates. The type of the seventh parameter of the method that this delegate encapsulates. The first parameter of the method that this delegate encapsulates. The second parameter of the method that this delegate encapsulates. The third parameter of the method that this delegate encapsulates. The fourth parameter of the method that this delegate encapsulates. The fifth parameter of the method that this delegate encapsulates. The sixth parameter of the method that this delegate encapsulates. The seventh parameter of the method that this delegate encapsulates. Encapsulates a method that has seven parameters and returns a value of the type specified by the parameter. The type of the first parameter of the method that this delegate encapsulates. The type of the second parameter of the method that this delegate encapsulates. The type of the third parameter of the method that this delegate encapsulates. The type of the fourth parameter of the method that this delegate encapsulates. The type of the fifth parameter of the method that this delegate encapsulates. The type of the sixth parameter of the method that this delegate encapsulates. The type of the seventh parameter of the method that this delegate encapsulates. The type of the return value of the method that this delegate encapsulates. The first parameter of the method that this delegate encapsulates. The second parameter of the method that this delegate encapsulates. The third parameter of the method that this delegate encapsulates. The fourth parameter of the method that this delegate encapsulates. The fifth parameter of the method that this delegate encapsulates. The sixth parameter of the method that this delegate encapsulates. The seventh parameter of the method that this delegate encapsulates. The return value of the method that this delegate encapsulates. Encapsulates a method that has eight parameters and does not return a value. The type of the first parameter of the method that this delegate encapsulates. The type of the second parameter of the method that this delegate encapsulates. The type of the third parameter of the method that this delegate encapsulates. The type of the fourth parameter of the method that this delegate encapsulates. The type of the fifth parameter of the method that this delegate encapsulates. The type of the sixth parameter of the method that this delegate encapsulates. The type of the seventh parameter of the method that this delegate encapsulates. The type of the eighth parameter of the method that this delegate encapsulates. The first parameter of the method that this delegate encapsulates. The second parameter of the method that this delegate encapsulates. The third parameter of the method that this delegate encapsulates. The fourth parameter of the method that this delegate encapsulates. The fifth parameter of the method that this delegate encapsulates. The sixth parameter of the method that this delegate encapsulates. The seventh parameter of the method that this delegate encapsulates. The eighth parameter of the method that this delegate encapsulates. Encapsulates a method that has eight parameters and returns a value of the type specified by the parameter. The type of the first parameter of the method that this delegate encapsulates. The type of the second parameter of the method that this delegate encapsulates. The type of the third parameter of the method that this delegate encapsulates. The type of the fourth parameter of the method that this delegate encapsulates. The type of the fifth parameter of the method that this delegate encapsulates. The type of the sixth parameter of the method that this delegate encapsulates. The type of the seventh parameter of the method that this delegate encapsulates. The type of the eighth parameter of the method that this delegate encapsulates. The type of the return value of the method that this delegate encapsulates. The first parameter of the method that this delegate encapsulates. The second parameter of the method that this delegate encapsulates. The third parameter of the method that this delegate encapsulates. The fourth parameter of the method that this delegate encapsulates. The fifth parameter of the method that this delegate encapsulates. The sixth parameter of the method that this delegate encapsulates. The seventh parameter of the method that this delegate encapsulates. The eighth parameter of the method that this delegate encapsulates. The return value of the method that this delegate encapsulates. Encapsulates a method that has nine parameters and does not return a value. The type of the first parameter of the method that this delegate encapsulates. The type of the second parameter of the method that this delegate encapsulates. The type of the third parameter of the method that this delegate encapsulates. The type of the fourth parameter of the method that this delegate encapsulates. The type of the fifth parameter of the method that this delegate encapsulates. The type of the sixth parameter of the method that this delegate encapsulates. The type of the seventh parameter of the method that this delegate encapsulates. The type of the eighth parameter of the method that this delegate encapsulates. The type of the nineth parameter of the method that this delegate encapsulates. The first parameter of the method that this delegate encapsulates. The second parameter of the method that this delegate encapsulates. The third parameter of the method that this delegate encapsulates. The fourth parameter of the method that this delegate encapsulates. The fifth parameter of the method that this delegate encapsulates. The sixth parameter of the method that this delegate encapsulates. The seventh parameter of the method that this delegate encapsulates. The eighth parameter of the method that this delegate encapsulates. The nineth parameter of the method that this delegate encapsulates. Encapsulates a method that has nine parameters and returns a value of the type specified by the parameter. The type of the first parameter of the method that this delegate encapsulates. The type of the second parameter of the method that this delegate encapsulates. The type of the third parameter of the method that this delegate encapsulates. The type of the fourth parameter of the method that this delegate encapsulates. The type of the fifth parameter of the method that this delegate encapsulates. The type of the sixth parameter of the method that this delegate encapsulates. The type of the seventh parameter of the method that this delegate encapsulates. The type of the eighth parameter of the method that this delegate encapsulates. The type of the nineth parameter of the method that this delegate encapsulates. The type of the return value of the method that this delegate encapsulates. The first parameter of the method that this delegate encapsulates. The second parameter of the method that this delegate encapsulates. The third parameter of the method that this delegate encapsulates. The fourth parameter of the method that this delegate encapsulates. The fifth parameter of the method that this delegate encapsulates. The sixth parameter of the method that this delegate encapsulates. The seventh parameter of the method that this delegate encapsulates. The eighth parameter of the method that this delegate encapsulates. The nineth parameter of the method that this delegate encapsulates. The return value of the method that this delegate encapsulates. Encapsulates a method that has ten parameters and does not return a value. The type of the first parameter of the method that this delegate encapsulates. The type of the second parameter of the method that this delegate encapsulates. The type of the third parameter of the method that this delegate encapsulates. The type of the fourth parameter of the method that this delegate encapsulates. The type of the fifth parameter of the method that this delegate encapsulates. The type of the sixth parameter of the method that this delegate encapsulates. The type of the seventh parameter of the method that this delegate encapsulates. The type of the eighth parameter of the method that this delegate encapsulates. The type of the nineth parameter of the method that this delegate encapsulates. The type of the tenth parameter of the method that this delegate encapsulates. The first parameter of the method that this delegate encapsulates. The second parameter of the method that this delegate encapsulates. The third parameter of the method that this delegate encapsulates. The fourth parameter of the method that this delegate encapsulates. The fifth parameter of the method that this delegate encapsulates. The sixth parameter of the method that this delegate encapsulates. The seventh parameter of the method that this delegate encapsulates. The eighth parameter of the method that this delegate encapsulates. The nineth parameter of the method that this delegate encapsulates. The tenth parameter of the method that this delegate encapsulates. Encapsulates a method that has ten parameters and returns a value of the type specified by the parameter. The type of the first parameter of the method that this delegate encapsulates. The type of the second parameter of the method that this delegate encapsulates. The type of the third parameter of the method that this delegate encapsulates. The type of the fourth parameter of the method that this delegate encapsulates. The type of the fifth parameter of the method that this delegate encapsulates. The type of the sixth parameter of the method that this delegate encapsulates. The type of the seventh parameter of the method that this delegate encapsulates. The type of the eighth parameter of the method that this delegate encapsulates. The type of the nineth parameter of the method that this delegate encapsulates. The type of the tenth parameter of the method that this delegate encapsulates. The type of the return value of the method that this delegate encapsulates. The first parameter of the method that this delegate encapsulates. The second parameter of the method that this delegate encapsulates. The third parameter of the method that this delegate encapsulates. The fourth parameter of the method that this delegate encapsulates. The fifth parameter of the method that this delegate encapsulates. The sixth parameter of the method that this delegate encapsulates. The seventh parameter of the method that this delegate encapsulates. The eighth parameter of the method that this delegate encapsulates. The nineth parameter of the method that this delegate encapsulates. The tenth parameter of the method that this delegate encapsulates. The return value of the method that this delegate encapsulates. Encapsulates a method that has eleven parameters and does not return a value. The type of the first parameter of the method that this delegate encapsulates. The type of the second parameter of the method that this delegate encapsulates. The type of the third parameter of the method that this delegate encapsulates. The type of the fourth parameter of the method that this delegate encapsulates. The type of the fifth parameter of the method that this delegate encapsulates. The type of the sixth parameter of the method that this delegate encapsulates. The type of the seventh parameter of the method that this delegate encapsulates. The type of the eighth parameter of the method that this delegate encapsulates. The type of the nineth parameter of the method that this delegate encapsulates. The type of the tenth parameter of the method that this delegate encapsulates. The type of the eleventh parameter of the method that this delegate encapsulates. The first parameter of the method that this delegate encapsulates. The second parameter of the method that this delegate encapsulates. The third parameter of the method that this delegate encapsulates. The fourth parameter of the method that this delegate encapsulates. The fifth parameter of the method that this delegate encapsulates. The sixth parameter of the method that this delegate encapsulates. The seventh parameter of the method that this delegate encapsulates. The eighth parameter of the method that this delegate encapsulates. The nineth parameter of the method that this delegate encapsulates. The tenth parameter of the method that this delegate encapsulates. The eleventh parameter of the method that this delegate encapsulates. Encapsulates a method that has eleven parameters and returns a value of the type specified by the parameter. The type of the first parameter of the method that this delegate encapsulates. The type of the second parameter of the method that this delegate encapsulates. The type of the third parameter of the method that this delegate encapsulates. The type of the fourth parameter of the method that this delegate encapsulates. The type of the fifth parameter of the method that this delegate encapsulates. The type of the sixth parameter of the method that this delegate encapsulates. The type of the seventh parameter of the method that this delegate encapsulates. The type of the eighth parameter of the method that this delegate encapsulates. The type of the nineth parameter of the method that this delegate encapsulates. The type of the tenth parameter of the method that this delegate encapsulates. The type of the eleventh parameter of the method that this delegate encapsulates. The type of the return value of the method that this delegate encapsulates. The first parameter of the method that this delegate encapsulates. The second parameter of the method that this delegate encapsulates. The third parameter of the method that this delegate encapsulates. The fourth parameter of the method that this delegate encapsulates. The fifth parameter of the method that this delegate encapsulates. The sixth parameter of the method that this delegate encapsulates. The seventh parameter of the method that this delegate encapsulates. The eighth parameter of the method that this delegate encapsulates. The nineth parameter of the method that this delegate encapsulates. The tenth parameter of the method that this delegate encapsulates. The eleventh parameter of the method that this delegate encapsulates. The return value of the method that this delegate encapsulates. Encapsulates a method that has twelve parameters and does not return a value. The type of the first parameter of the method that this delegate encapsulates. The type of the second parameter of the method that this delegate encapsulates. The type of the third parameter of the method that this delegate encapsulates. The type of the fourth parameter of the method that this delegate encapsulates. The type of the fifth parameter of the method that this delegate encapsulates. The type of the sixth parameter of the method that this delegate encapsulates. The type of the seventh parameter of the method that this delegate encapsulates. The type of the eighth parameter of the method that this delegate encapsulates. The type of the nineth parameter of the method that this delegate encapsulates. The type of the tenth parameter of the method that this delegate encapsulates. The type of the eleventh parameter of the method that this delegate encapsulates. The type of the twelfth parameter of the method that this delegate encapsulates. The first parameter of the method that this delegate encapsulates. The second parameter of the method that this delegate encapsulates. The third parameter of the method that this delegate encapsulates. The fourth parameter of the method that this delegate encapsulates. The fifth parameter of the method that this delegate encapsulates. The sixth parameter of the method that this delegate encapsulates. The seventh parameter of the method that this delegate encapsulates. The eighth parameter of the method that this delegate encapsulates. The nineth parameter of the method that this delegate encapsulates. The tenth parameter of the method that this delegate encapsulates. The eleventh parameter of the method that this delegate encapsulates. The twelfth parameter of the method that this delegate encapsulates. Encapsulates a method that has twelve parameters and returns a value of the type specified by the parameter. The type of the first parameter of the method that this delegate encapsulates. The type of the second parameter of the method that this delegate encapsulates. The type of the third parameter of the method that this delegate encapsulates. The type of the fourth parameter of the method that this delegate encapsulates. The type of the fifth parameter of the method that this delegate encapsulates. The type of the sixth parameter of the method that this delegate encapsulates. The type of the seventh parameter of the method that this delegate encapsulates. The type of the eighth parameter of the method that this delegate encapsulates. The type of the nineth parameter of the method that this delegate encapsulates. The type of the tenth parameter of the method that this delegate encapsulates. The type of the eleventh parameter of the method that this delegate encapsulates. The type of the twelfth parameter of the method that this delegate encapsulates. The type of the return value of the method that this delegate encapsulates. The first parameter of the method that this delegate encapsulates. The second parameter of the method that this delegate encapsulates. The third parameter of the method that this delegate encapsulates. The fourth parameter of the method that this delegate encapsulates. The fifth parameter of the method that this delegate encapsulates. The sixth parameter of the method that this delegate encapsulates. The seventh parameter of the method that this delegate encapsulates. The eighth parameter of the method that this delegate encapsulates. The nineth parameter of the method that this delegate encapsulates. The tenth parameter of the method that this delegate encapsulates. The eleventh parameter of the method that this delegate encapsulates. The twelfth parameter of the method that this delegate encapsulates. The return value of the method that this delegate encapsulates. Encapsulates a method that has thirteen parameters and does not return a value. The type of the first parameter of the method that this delegate encapsulates. The type of the second parameter of the method that this delegate encapsulates. The type of the third parameter of the method that this delegate encapsulates. The type of the fourth parameter of the method that this delegate encapsulates. The type of the fifth parameter of the method that this delegate encapsulates. The type of the sixth parameter of the method that this delegate encapsulates. The type of the seventh parameter of the method that this delegate encapsulates. The type of the eighth parameter of the method that this delegate encapsulates. The type of the nineth parameter of the method that this delegate encapsulates. The type of the tenth parameter of the method that this delegate encapsulates. The type of the eleventh parameter of the method that this delegate encapsulates. The type of the twelfth parameter of the method that this delegate encapsulates. The type of the thirteenth parameter of the method that this delegate encapsulates. The first parameter of the method that this delegate encapsulates. The second parameter of the method that this delegate encapsulates. The third parameter of the method that this delegate encapsulates. The fourth parameter of the method that this delegate encapsulates. The fifth parameter of the method that this delegate encapsulates. The sixth parameter of the method that this delegate encapsulates. The seventh parameter of the method that this delegate encapsulates. The eighth parameter of the method that this delegate encapsulates. The nineth parameter of the method that this delegate encapsulates. The tenth parameter of the method that this delegate encapsulates. The eleventh parameter of the method that this delegate encapsulates. The twelfth parameter of the method that this delegate encapsulates. The thirteenth parameter of the method that this delegate encapsulates. Encapsulates a method that has thirteen parameters and returns a value of the type specified by the parameter. The type of the first parameter of the method that this delegate encapsulates. The type of the second parameter of the method that this delegate encapsulates. The type of the third parameter of the method that this delegate encapsulates. The type of the fourth parameter of the method that this delegate encapsulates. The type of the fifth parameter of the method that this delegate encapsulates. The type of the sixth parameter of the method that this delegate encapsulates. The type of the seventh parameter of the method that this delegate encapsulates. The type of the eighth parameter of the method that this delegate encapsulates. The type of the nineth parameter of the method that this delegate encapsulates. The type of the tenth parameter of the method that this delegate encapsulates. The type of the eleventh parameter of the method that this delegate encapsulates. The type of the twelfth parameter of the method that this delegate encapsulates. The type of the thirteenth parameter of the method that this delegate encapsulates. The type of the return value of the method that this delegate encapsulates. The first parameter of the method that this delegate encapsulates. The second parameter of the method that this delegate encapsulates. The third parameter of the method that this delegate encapsulates. The fourth parameter of the method that this delegate encapsulates. The fifth parameter of the method that this delegate encapsulates. The sixth parameter of the method that this delegate encapsulates. The seventh parameter of the method that this delegate encapsulates. The eighth parameter of the method that this delegate encapsulates. The nineth parameter of the method that this delegate encapsulates. The tenth parameter of the method that this delegate encapsulates. The eleventh parameter of the method that this delegate encapsulates. The twelfth parameter of the method that this delegate encapsulates. The thirteenth parameter of the method that this delegate encapsulates. The return value of the method that this delegate encapsulates. Encapsulates a method that has fourteen parameters and does not return a value. The type of the first parameter of the method that this delegate encapsulates. The type of the second parameter of the method that this delegate encapsulates. The type of the third parameter of the method that this delegate encapsulates. The type of the fourth parameter of the method that this delegate encapsulates. The type of the fifth parameter of the method that this delegate encapsulates. The type of the sixth parameter of the method that this delegate encapsulates. The type of the seventh parameter of the method that this delegate encapsulates. The type of the eighth parameter of the method that this delegate encapsulates. The type of the nineth parameter of the method that this delegate encapsulates. The type of the tenth parameter of the method that this delegate encapsulates. The type of the eleventh parameter of the method that this delegate encapsulates. The type of the twelfth parameter of the method that this delegate encapsulates. The type of the thirteenth parameter of the method that this delegate encapsulates. The type of the fourteenth parameter of the method that this delegate encapsulates. The first parameter of the method that this delegate encapsulates. The second parameter of the method that this delegate encapsulates. The third parameter of the method that this delegate encapsulates. The fourth parameter of the method that this delegate encapsulates. The fifth parameter of the method that this delegate encapsulates. The sixth parameter of the method that this delegate encapsulates. The seventh parameter of the method that this delegate encapsulates. The eighth parameter of the method that this delegate encapsulates. The nineth parameter of the method that this delegate encapsulates. The tenth parameter of the method that this delegate encapsulates. The eleventh parameter of the method that this delegate encapsulates. The twelfth parameter of the method that this delegate encapsulates. The thirteenth parameter of the method that this delegate encapsulates. The fourteenth parameter of the method that this delegate encapsulates. Encapsulates a method that has fourteen parameters and returns a value of the type specified by the parameter. The type of the first parameter of the method that this delegate encapsulates. The type of the second parameter of the method that this delegate encapsulates. The type of the third parameter of the method that this delegate encapsulates. The type of the fourth parameter of the method that this delegate encapsulates. The type of the fifth parameter of the method that this delegate encapsulates. The type of the sixth parameter of the method that this delegate encapsulates. The type of the seventh parameter of the method that this delegate encapsulates. The type of the eighth parameter of the method that this delegate encapsulates. The type of the nineth parameter of the method that this delegate encapsulates. The type of the tenth parameter of the method that this delegate encapsulates. The type of the eleventh parameter of the method that this delegate encapsulates. The type of the twelfth parameter of the method that this delegate encapsulates. The type of the thirteenth parameter of the method that this delegate encapsulates. The type of the fourteenth parameter of the method that this delegate encapsulates. The type of the return value of the method that this delegate encapsulates. The first parameter of the method that this delegate encapsulates. The second parameter of the method that this delegate encapsulates. The third parameter of the method that this delegate encapsulates. The fourth parameter of the method that this delegate encapsulates. The fifth parameter of the method that this delegate encapsulates. The sixth parameter of the method that this delegate encapsulates. The seventh parameter of the method that this delegate encapsulates. The eighth parameter of the method that this delegate encapsulates. The nineth parameter of the method that this delegate encapsulates. The tenth parameter of the method that this delegate encapsulates. The eleventh parameter of the method that this delegate encapsulates. The twelfth parameter of the method that this delegate encapsulates. The thirteenth parameter of the method that this delegate encapsulates. The fourteenth parameter of the method that this delegate encapsulates. The return value of the method that this delegate encapsulates. Encapsulates a method that has fifteen parameters and does not return a value. The type of the first parameter of the method that this delegate encapsulates. The type of the second parameter of the method that this delegate encapsulates. The type of the third parameter of the method that this delegate encapsulates. The type of the fourth parameter of the method that this delegate encapsulates. The type of the fifth parameter of the method that this delegate encapsulates. The type of the sixth parameter of the method that this delegate encapsulates. The type of the seventh parameter of the method that this delegate encapsulates. The type of the eighth parameter of the method that this delegate encapsulates. The type of the nineth parameter of the method that this delegate encapsulates. The type of the tenth parameter of the method that this delegate encapsulates. The type of the eleventh parameter of the method that this delegate encapsulates. The type of the twelfth parameter of the method that this delegate encapsulates. The type of the thirteenth parameter of the method that this delegate encapsulates. The type of the fourteenth parameter of the method that this delegate encapsulates. The type of the fifteenth parameter of the method that this delegate encapsulates. The first parameter of the method that this delegate encapsulates. The second parameter of the method that this delegate encapsulates. The third parameter of the method that this delegate encapsulates. The fourth parameter of the method that this delegate encapsulates. The fifth parameter of the method that this delegate encapsulates. The sixth parameter of the method that this delegate encapsulates. The seventh parameter of the method that this delegate encapsulates. The eighth parameter of the method that this delegate encapsulates. The nineth parameter of the method that this delegate encapsulates. The tenth parameter of the method that this delegate encapsulates. The eleventh parameter of the method that this delegate encapsulates. The twelfth parameter of the method that this delegate encapsulates. The thirteenth parameter of the method that this delegate encapsulates. The fourteenth parameter of the method that this delegate encapsulates. The fifteenth parameter of the method that this delegate encapsulates. Encapsulates a method that has fifteen parameters and returns a value of the type specified by the parameter. The type of the first parameter of the method that this delegate encapsulates. The type of the second parameter of the method that this delegate encapsulates. The type of the third parameter of the method that this delegate encapsulates. The type of the fourth parameter of the method that this delegate encapsulates. The type of the fifth parameter of the method that this delegate encapsulates. The type of the sixth parameter of the method that this delegate encapsulates. The type of the seventh parameter of the method that this delegate encapsulates. The type of the eighth parameter of the method that this delegate encapsulates. The type of the nineth parameter of the method that this delegate encapsulates. The type of the tenth parameter of the method that this delegate encapsulates. The type of the eleventh parameter of the method that this delegate encapsulates. The type of the twelfth parameter of the method that this delegate encapsulates. The type of the thirteenth parameter of the method that this delegate encapsulates. The type of the fourteenth parameter of the method that this delegate encapsulates. The type of the fifteenth parameter of the method that this delegate encapsulates. The type of the return value of the method that this delegate encapsulates. The first parameter of the method that this delegate encapsulates. The second parameter of the method that this delegate encapsulates. The third parameter of the method that this delegate encapsulates. The fourth parameter of the method that this delegate encapsulates. The fifth parameter of the method that this delegate encapsulates. The sixth parameter of the method that this delegate encapsulates. The seventh parameter of the method that this delegate encapsulates. The eighth parameter of the method that this delegate encapsulates. The nineth parameter of the method that this delegate encapsulates. The tenth parameter of the method that this delegate encapsulates. The eleventh parameter of the method that this delegate encapsulates. The twelfth parameter of the method that this delegate encapsulates. The thirteenth parameter of the method that this delegate encapsulates. The fourteenth parameter of the method that this delegate encapsulates. The fifteenth parameter of the method that this delegate encapsulates. The return value of the method that this delegate encapsulates. Encapsulates a method that has sixteen parameters and does not return a value. The type of the first parameter of the method that this delegate encapsulates. The type of the second parameter of the method that this delegate encapsulates. The type of the third parameter of the method that this delegate encapsulates. The type of the fourth parameter of the method that this delegate encapsulates. The type of the fifth parameter of the method that this delegate encapsulates. The type of the sixth parameter of the method that this delegate encapsulates. The type of the seventh parameter of the method that this delegate encapsulates. The type of the eighth parameter of the method that this delegate encapsulates. The type of the nineth parameter of the method that this delegate encapsulates. The type of the tenth parameter of the method that this delegate encapsulates. The type of the eleventh parameter of the method that this delegate encapsulates. The type of the twelfth parameter of the method that this delegate encapsulates. The type of the thirteenth parameter of the method that this delegate encapsulates. The type of the fourteenth parameter of the method that this delegate encapsulates. The type of the fifteenth parameter of the method that this delegate encapsulates. The type of the sixteenth parameter of the method that this delegate encapsulates. The first parameter of the method that this delegate encapsulates. The second parameter of the method that this delegate encapsulates. The third parameter of the method that this delegate encapsulates. The fourth parameter of the method that this delegate encapsulates. The fifth parameter of the method that this delegate encapsulates. The sixth parameter of the method that this delegate encapsulates. The seventh parameter of the method that this delegate encapsulates. The eighth parameter of the method that this delegate encapsulates. The nineth parameter of the method that this delegate encapsulates. The tenth parameter of the method that this delegate encapsulates. The eleventh parameter of the method that this delegate encapsulates. The twelfth parameter of the method that this delegate encapsulates. The thirteenth parameter of the method that this delegate encapsulates. The fourteenth parameter of the method that this delegate encapsulates. The fifteenth parameter of the method that this delegate encapsulates. The sixteenth parameter of the method that this delegate encapsulates. Encapsulates a method that has sixteen parameters and returns a value of the type specified by the parameter. The type of the first parameter of the method that this delegate encapsulates. The type of the second parameter of the method that this delegate encapsulates. The type of the third parameter of the method that this delegate encapsulates. The type of the fourth parameter of the method that this delegate encapsulates. The type of the fifth parameter of the method that this delegate encapsulates. The type of the sixth parameter of the method that this delegate encapsulates. The type of the seventh parameter of the method that this delegate encapsulates. The type of the eighth parameter of the method that this delegate encapsulates. The type of the nineth parameter of the method that this delegate encapsulates. The type of the tenth parameter of the method that this delegate encapsulates. The type of the eleventh parameter of the method that this delegate encapsulates. The type of the twelfth parameter of the method that this delegate encapsulates. The type of the thirteenth parameter of the method that this delegate encapsulates. The type of the fourteenth parameter of the method that this delegate encapsulates. The type of the fifteenth parameter of the method that this delegate encapsulates. The type of the sixteenth parameter of the method that this delegate encapsulates. The type of the return value of the method that this delegate encapsulates. The first parameter of the method that this delegate encapsulates. The second parameter of the method that this delegate encapsulates. The third parameter of the method that this delegate encapsulates. The fourth parameter of the method that this delegate encapsulates. The fifth parameter of the method that this delegate encapsulates. The sixth parameter of the method that this delegate encapsulates. The seventh parameter of the method that this delegate encapsulates. The eighth parameter of the method that this delegate encapsulates. The nineth parameter of the method that this delegate encapsulates. The tenth parameter of the method that this delegate encapsulates. The eleventh parameter of the method that this delegate encapsulates. The twelfth parameter of the method that this delegate encapsulates. The thirteenth parameter of the method that this delegate encapsulates. The fourteenth parameter of the method that this delegate encapsulates. The fifteenth parameter of the method that this delegate encapsulates. The sixteenth parameter of the method that this delegate encapsulates. The return value of the method that this delegate encapsulates. Provides additional methods on mocks. Those methods are useful for Testeroids support. Resets the calls previously made on the specified mock. The mock whose calls need to be reset. Helper class to setup a full trace between many mocks Initialize a trace setup Allow sequence to be repeated define nice api Perform an expectation in the trace. Marks a method as a matcher, which allows complete replacement of the built-in class with your own argument matching rules. This feature has been deprecated in favor of the new and simpler . The argument matching is used to determine whether a concrete invocation in the mock matches a given setup. This matching mechanism is fully extensible. There are two parts of a matcher: the compiler matcher and the runtime matcher. Compiler matcher Used to satisfy the compiler requirements for the argument. Needs to be a method optionally receiving any arguments you might need for the matching, but with a return type that matches that of the argument. Let's say I want to match a lists of orders that contains a particular one. I might create a compiler matcher like the following: public static class Orders { [Matcher] public static IEnumerable<Order> Contains(Order order) { return null; } } Now we can invoke this static method instead of an argument in an invocation: var order = new Order { ... }; var mock = new Mock<IRepository<Order>>(); mock.Setup(x => x.Save(Orders.Contains(order))) .Throws<ArgumentException>(); Note that the return value from the compiler matcher is irrelevant. This method will never be called, and is just used to satisfy the compiler and to signal Moq that this is not a method that we want to be invoked at runtime. Runtime matcher The runtime matcher is the one that will actually perform evaluation when the test is run, and is defined by convention to have the same signature as the compiler matcher, but where the return value is the first argument to the call, which contains the object received by the actual invocation at runtime: public static bool Contains(IEnumerable<Order> orders, Order order) { return orders.Contains(order); } At runtime, the mocked method will be invoked with a specific list of orders. This value will be passed to this runtime matcher as the first argument, while the second argument is the one specified in the setup (x.Save(Orders.Contains(order))). The boolean returned determines whether the given argument has been matched. If all arguments to the expected method are matched, then the setup matches and is evaluated. Using this extensible infrastructure, you can easily replace the entire set of matchers with your own. You can also avoid the typical (and annoying) lengthy expressions that result when you have multiple arguments that use generics. The following is the complete example explained above: public static class Orders { [Matcher] public static IEnumerable<Order> Contains(Order order) { return null; } public static bool Contains(IEnumerable<Order> orders, Order order) { return orders.Contains(order); } } And the concrete test using this matcher: var order = new Order { ... }; var mock = new Mock<IRepository<Order>>(); mock.Setup(x => x.Save(Orders.Contains(order))) .Throws<ArgumentException>(); // use mock, invoke Save, and have the matcher filter. Provides a mock implementation of . Any interface type can be used for mocking, but for classes, only abstract and virtual members can be mocked. The behavior of the mock with regards to the setups and the actual calls is determined by the optional that can be passed to the constructor. Type to mock, which can be an interface or a class. The following example shows establishing setups with specific values for method invocations: // Arrange var order = new Order(TALISKER, 50); var mock = new Mock<IWarehouse>(); mock.Setup(x => x.HasInventory(TALISKER, 50)).Returns(true); // Act order.Fill(mock.Object); // Assert Assert.True(order.IsFilled); The following example shows how to use the class to specify conditions for arguments instead of specific values: // Arrange var order = new Order(TALISKER, 50); var mock = new Mock<IWarehouse>(); // shows how to expect a value within a range mock.Setup(x => x.HasInventory( It.IsAny<string>(), It.IsInRange(0, 100, Range.Inclusive))) .Returns(false); // shows how to throw for unexpected calls. mock.Setup(x => x.Remove( It.IsAny<string>(), It.IsAny<int>())) .Throws(new InvalidOperationException()); // Act order.Fill(mock.Object); // Assert Assert.False(order.IsFilled); Obsolete. Obsolete. Obsolete. Obsolete. Obsolete. Ctor invoked by AsTInterface exclusively. Initializes an instance of the mock with default behavior. var mock = new Mock<IFormatProvider>(); Initializes an instance of the mock with default behavior and with the given constructor arguments for the class. (Only valid when is a class) The mock will try to find the best match constructor given the constructor arguments, and invoke that to initialize the instance. This applies only for classes, not interfaces. var mock = new Mock<MyProvider>(someArgument, 25); Optional constructor arguments if the mocked type is a class. Initializes an instance of the mock with the specified behavior. var mock = new Mock<IFormatProvider>(MockBehavior.Relaxed); Behavior of the mock. Initializes an instance of the mock with a specific behavior with the given constructor arguments for the class. The mock will try to find the best match constructor given the constructor arguments, and invoke that to initialize the instance. This applies only to classes, not interfaces. var mock = new Mock<MyProvider>(someArgument, 25); Behavior of the mock.Optional constructor arguments if the mocked type is a class. Returns the name of the mock Returns the mocked object value. Specifies a setup on the mocked type for a call to to a void method. If more than one setup is specified for the same method or property, the latest one wins and is the one that will be executed. Lambda expression that specifies the expected method invocation. var mock = new Mock<IProcessor>(); mock.Setup(x => x.Execute("ping")); Specifies a setup on the mocked type for a call to to a value returning method. Type of the return value. Typically omitted as it can be inferred from the expression. If more than one setup is specified for the same method or property, the latest one wins and is the one that will be executed. Lambda expression that specifies the method invocation. mock.Setup(x => x.HasInventory("Talisker", 50)).Returns(true); Specifies a setup on the mocked type for a call to to a property getter. If more than one setup is set for the same property getter, the latest one wins and is the one that will be executed. Type of the property. Typically omitted as it can be inferred from the expression.Lambda expression that specifies the property getter. mock.SetupGet(x => x.Suspended) .Returns(true); Specifies a setup on the mocked type for a call to to a property setter. If more than one setup is set for the same property setter, the latest one wins and is the one that will be executed. This overloads allows the use of a callback already typed for the property type. Type of the property. Typically omitted as it can be inferred from the expression.The Lambda expression that sets a property to a value. mock.SetupSet(x => x.Suspended = true); Specifies a setup on the mocked type for a call to to a property setter. If more than one setup is set for the same property setter, the latest one wins and is the one that will be executed. Lambda expression that sets a property to a value. mock.SetupSet(x => x.Suspended = true); Specifies that the given property should have "property behavior", meaning that setting its value will cause it to be saved and later returned when the property is requested. (this is also known as "stubbing"). Type of the property, inferred from the property expression (does not need to be specified). Property expression to stub. If you have an interface with an int property Value, you might stub it using the following straightforward call: var mock = new Mock<IHaveValue>(); mock.Stub(v => v.Value); After the Stub call has been issued, setting and retrieving the object value will behave as expected: IHaveValue v = mock.Object; v.Value = 5; Assert.Equal(5, v.Value); Specifies that the given property should have "property behavior", meaning that setting its value will cause it to be saved and later returned when the property is requested. This overload allows setting the initial value for the property. (this is also known as "stubbing"). Type of the property, inferred from the property expression (does not need to be specified). Property expression to stub.Initial value for the property. If you have an interface with an int property Value, you might stub it using the following straightforward call: var mock = new Mock<IHaveValue>(); mock.SetupProperty(v => v.Value, 5); After the SetupProperty call has been issued, setting and retrieving the object value will behave as expected: IHaveValue v = mock.Object; // Initial value was stored Assert.Equal(5, v.Value); // New value set which changes the initial value v.Value = 6; Assert.Equal(6, v.Value); Specifies that the all properties on the mock should have "property behavior", meaning that setting its value will cause it to be saved and later returned when the property is requested. (this is also known as "stubbing"). The default value for each property will be the one generated as specified by the property for the mock. If the mock is set to , the mocked default values will also get all properties setup recursively. Verifies that a specific invocation matching the given expression was performed on the mock. Use in conjuntion with the default . This example assumes that the mock has been used, and later we want to verify that a given invocation with specific parameters was performed: var mock = new Mock<IProcessor>(); // exercise mock //... // Will throw if the test code didn't call Execute with a "ping" string argument. mock.Verify(proc => proc.Execute("ping")); The invocation was not performed on the mock.Expression to verify. Verifies that a specific invocation matching the given expression was performed on the mock. Use in conjuntion with the default . The invocation was not call the times specified by . Expression to verify.The number of times a method is allowed to be called. Verifies that a specific invocation matching the given expression was performed on the mock. Use in conjuntion with the default . The invocation was not call the times specified by . Expression to verify.The number of times a method is allowed to be called. Verifies that a specific invocation matching the given expression was performed on the mock, specifying a failure error message. Use in conjuntion with the default . This example assumes that the mock has been used, and later we want to verify that a given invocation with specific parameters was performed: var mock = new Mock<IProcessor>(); // exercise mock //... // Will throw if the test code didn't call Execute with a "ping" string argument. mock.Verify(proc => proc.Execute("ping")); The invocation was not performed on the mock.Expression to verify.Message to show if verification fails. Verifies that a specific invocation matching the given expression was performed on the mock, specifying a failure error message. Use in conjuntion with the default . The invocation was not call the times specified by . Expression to verify.The number of times a method is allowed to be called.Message to show if verification fails. Verifies that a specific invocation matching the given expression was performed on the mock, specifying a failure error message. Use in conjuntion with the default . The invocation was not call the times specified by . Expression to verify.The number of times a method is allowed to be called.Message to show if verification fails. Verifies that a specific invocation matching the given expression was performed on the mock. Use in conjuntion with the default . This example assumes that the mock has been used, and later we want to verify that a given invocation with specific parameters was performed: var mock = new Mock<IWarehouse>(); // exercise mock //... // Will throw if the test code didn't call HasInventory. mock.Verify(warehouse => warehouse.HasInventory(TALISKER, 50)); The invocation was not performed on the mock.Expression to verify.Type of return value from the expression. Verifies that a specific invocation matching the given expression was performed on the mock. Use in conjuntion with the default . The invocation was not call the times specified by . Expression to verify.The number of times a method is allowed to be called.Type of return value from the expression. Verifies that a specific invocation matching the given expression was performed on the mock. Use in conjuntion with the default . The invocation was not call the times specified by . Expression to verify.The number of times a method is allowed to be called.Type of return value from the expression. Verifies that a specific invocation matching the given expression was performed on the mock, specifying a failure error message. This example assumes that the mock has been used, and later we want to verify that a given invocation with specific parameters was performed: var mock = new Mock<IWarehouse>(); // exercise mock //... // Will throw if the test code didn't call HasInventory. mock.Verify(warehouse => warehouse.HasInventory(TALISKER, 50), "When filling orders, inventory has to be checked"); The invocation was not performed on the mock.Expression to verify.Message to show if verification fails.Type of return value from the expression. Verifies that a specific invocation matching the given expression was performed on the mock, specifying a failure error message. The invocation was not call the times specified by . Expression to verify.The number of times a method is allowed to be called.Message to show if verification fails.Type of return value from the expression. Verifies that a property was read on the mock. This example assumes that the mock has been used, and later we want to verify that a given property was retrieved from it: var mock = new Mock<IWarehouse>(); // exercise mock //... // Will throw if the test code didn't retrieve the IsClosed property. mock.VerifyGet(warehouse => warehouse.IsClosed); The invocation was not performed on the mock.Expression to verify. Type of the property to verify. Typically omitted as it can be inferred from the expression's return type. Verifies that a property was read on the mock. The invocation was not call the times specified by . The number of times a method is allowed to be called.Expression to verify. Type of the property to verify. Typically omitted as it can be inferred from the expression's return type. Verifies that a property was read on the mock. The invocation was not call the times specified by . The number of times a method is allowed to be called.Expression to verify. Type of the property to verify. Typically omitted as it can be inferred from the expression's return type. Verifies that a property was read on the mock, specifying a failure error message. This example assumes that the mock has been used, and later we want to verify that a given property was retrieved from it: var mock = new Mock<IWarehouse>(); // exercise mock //... // Will throw if the test code didn't retrieve the IsClosed property. mock.VerifyGet(warehouse => warehouse.IsClosed); The invocation was not performed on the mock.Expression to verify.Message to show if verification fails. Type of the property to verify. Typically omitted as it can be inferred from the expression's return type. Verifies that a property was read on the mock, specifying a failure error message. The invocation was not call the times specified by . The number of times a method is allowed to be called.Expression to verify.Message to show if verification fails. Type of the property to verify. Typically omitted as it can be inferred from the expression's return type. Verifies that a property was read on the mock, specifying a failure error message. The invocation was not call the times specified by . The number of times a method is allowed to be called.Expression to verify.Message to show if verification fails. Type of the property to verify. Typically omitted as it can be inferred from the expression's return type. Verifies that a property was set on the mock. This example assumes that the mock has been used, and later we want to verify that a given property was set on it: var mock = new Mock<IWarehouse>(); // exercise mock //... // Will throw if the test code didn't set the IsClosed property. mock.VerifySet(warehouse => warehouse.IsClosed = true); The invocation was not performed on the mock.Expression to verify. Verifies that a property was set on the mock. The invocation was not call the times specified by . The number of times a method is allowed to be called.Expression to verify. Verifies that a property was set on the mock. The invocation was not call the times specified by . The number of times a method is allowed to be called.Expression to verify. Verifies that a property was set on the mock, specifying a failure message. This example assumes that the mock has been used, and later we want to verify that a given property was set on it: var mock = new Mock<IWarehouse>(); // exercise mock //... // Will throw if the test code didn't set the IsClosed property. mock.VerifySet(warehouse => warehouse.IsClosed = true, "Warehouse should always be closed after the action"); The invocation was not performed on the mock.Expression to verify.Message to show if verification fails. Verifies that a property was set on the mock, specifying a failure message. The invocation was not call the times specified by . The number of times a method is allowed to be called.Expression to verify.Message to show if verification fails. Verifies that a property was set on the mock, specifying a failure message. The invocation was not call the times specified by . The number of times a method is allowed to be called.Expression to verify.Message to show if verification fails. Raises the event referenced in using the given argument. The argument is invalid for the target event invocation, or the is not an event attach or detach expression. The following example shows how to raise a event: var mock = new Mock<IViewModel>(); mock.Raise(x => x.PropertyChanged -= null, new PropertyChangedEventArgs("Name")); This example shows how to invoke an event with a custom event arguments class in a view that will cause its corresponding presenter to react by changing its state: var mockView = new Mock<IOrdersView>(); var presenter = new OrdersPresenter(mockView.Object); // Check that the presenter has no selection by default Assert.Null(presenter.SelectedOrder); // Raise the event with a specific arguments data mockView.Raise(v => v.SelectionChanged += null, new OrderEventArgs { Order = new Order("moq", 500) }); // Now the presenter reacted to the event, and we have a selected order Assert.NotNull(presenter.SelectedOrder); Assert.Equal("moq", presenter.SelectedOrder.ProductName); Raises the event referenced in using the given argument for a non-EventHandler typed event. The arguments are invalid for the target event invocation, or the is not an event attach or detach expression. The following example shows how to raise a custom event that does not adhere to the standard EventHandler: var mock = new Mock<IViewModel>(); mock.Raise(x => x.MyEvent -= null, "Name", bool, 25); Exposes the mocked object instance. Allows naming of your mocks, so they can be easily identified in error messages (e.g. from failed assertions). Provides legacy API members as extensions so that existing code continues to compile, but new code doesn't see then. Obsolete. Obsolete. Obsolete. Provides additional methods on mocks. Provided as extension methods as they confuse the compiler with the overloads taking Action. Specifies a setup on the mocked type for a call to to a property setter, regardless of its value. If more than one setup is set for the same property setter, the latest one wins and is the one that will be executed. Type of the property. Typically omitted as it can be inferred from the expression. Type of the mock. The target mock for the setup. Lambda expression that specifies the property setter. mock.SetupSet(x => x.Suspended); This method is not legacy, but must be on an extension method to avoid confusing the compiler with the new Action syntax. Verifies that a property has been set on the mock, regarless of its value. This example assumes that the mock has been used, and later we want to verify that a given invocation with specific parameters was performed: var mock = new Mock<IWarehouse>(); // exercise mock //... // Will throw if the test code didn't set the IsClosed property. mock.VerifySet(warehouse => warehouse.IsClosed); The invocation was not performed on the mock. Expression to verify. The mock instance. Mocked type. Type of the property to verify. Typically omitted as it can be inferred from the expression's return type. Verifies that a property has been set on the mock, specifying a failure error message. This example assumes that the mock has been used, and later we want to verify that a given invocation with specific parameters was performed: var mock = new Mock<IWarehouse>(); // exercise mock //... // Will throw if the test code didn't set the IsClosed property. mock.VerifySet(warehouse => warehouse.IsClosed); The invocation was not performed on the mock. Expression to verify. Message to show if verification fails. The mock instance. Mocked type. Type of the property to verify. Typically omitted as it can be inferred from the expression's return type. Verifies that a property has been set on the mock, regardless of the value but only the specified number of times. This example assumes that the mock has been used, and later we want to verify that a given invocation with specific parameters was performed: var mock = new Mock<IWarehouse>(); // exercise mock //... // Will throw if the test code didn't set the IsClosed property. mock.VerifySet(warehouse => warehouse.IsClosed); The invocation was not performed on the mock. The invocation was not call the times specified by . The mock instance. Mocked type. The number of times a method is allowed to be called. Expression to verify. Type of the property to verify. Typically omitted as it can be inferred from the expression's return type. Verifies that a property has been set on the mock, regardless of the value but only the specified number of times, and specifying a failure error message. This example assumes that the mock has been used, and later we want to verify that a given invocation with specific parameters was performed: var mock = new Mock<IWarehouse>(); // exercise mock //... // Will throw if the test code didn't set the IsClosed property. mock.VerifySet(warehouse => warehouse.IsClosed); The invocation was not performed on the mock. The invocation was not call the times specified by . The mock instance. Mocked type. The number of times a method is allowed to be called. Message to show if verification fails. Expression to verify. Type of the property to verify. Typically omitted as it can be inferred from the expression's return type. Helper for sequencing return values in the same method. Return a sequence of values, once per call. Casts the expression to a lambda expression, removing a cast if there's any. Casts the body of the lambda expression to a . If the body is not a method call. Converts the body of the lambda expression into the referenced by it. Checks whether the body of the lambda expression is a property access. Checks whether the expression is a property access. Checks whether the body of the lambda expression is a property indexer, which is true when the expression is an whose has equal to . Checks whether the expression is a property indexer, which is true when the expression is an whose has equal to . Creates an expression that casts the given expression to the type. TODO: remove this code when https://connect.microsoft.com/VisualStudio/feedback/ViewFeedback.aspx?FeedbackID=331583 is fixed. Extracts, into a common form, information from a around either a (for a normal method call) or a (for a delegate invocation). Tests if a type is a delegate type (subclasses ). Provides partial evaluation of subtrees, whenever they can be evaluated locally. Matt Warren: http://blogs.msdn.com/mattwar Documented by InSTEDD: http://www.instedd.org Performs evaluation and replacement of independent sub-trees The root of the expression tree. A function that decides whether a given expression node can be part of the local function. A new tree with sub-trees evaluated and replaced. Performs evaluation and replacement of independent sub-trees The root of the expression tree. A new tree with sub-trees evaluated and replaced. Evaluates and replaces sub-trees when first candidate is reached (top-down) Performs bottom-up analysis to determine which nodes can possibly be part of an evaluated sub-tree. Ensures the given is not null. Throws otherwise. Ensures the given string is not null or empty. Throws in the first case, or in the latter. Checks an argument to ensure it is in the specified range including the edges. Type of the argument to check, it must be an type. The expression containing the name of the argument. The argument value to check. The minimun allowed value for the argument. The maximun allowed value for the argument. Checks an argument to ensure it is in the specified range excluding the edges. Type of the argument to check, it must be an type. The expression containing the name of the argument. The argument value to check. The minimun allowed value for the argument. The maximun allowed value for the argument. Implemented by all generated mock object instances. Implemented by all generated mock object instances. Reference the Mock that contains this as the mock.Object value. Reference the Mock that contains this as the mock.Object value. Implements the actual interception and method invocation for all mocks. Implements the fluent API. Defines the Callback verb for property setter setups. Type of the property. Specifies a callback to invoke when the property is set that receives the property value being set. Callback method to invoke. Invokes the given callback with the property value being set. mock.SetupSet(x => x.Suspended) .Callback((bool state) => Console.WriteLine(state)); Allows the specification of a matching condition for an argument in a method invocation, rather than a specific argument value. "It" refers to the argument being matched. This class allows the setup to match a method invocation with an arbitrary value, with a value in a specified range, or even one that matches a given predicate. Matches any value of the given type. Typically used when the actual argument value for a method call is not relevant. // Throws an exception for a call to Remove with any string value. mock.Setup(x => x.Remove(It.IsAny<string>())).Throws(new InvalidOperationException()); Type of the value. Matches any value of the given type, except null. Type of the value. Matches any value that satisfies the given predicate. Type of the argument to check.The predicate used to match the method argument. Allows the specification of a predicate to perform matching of method call arguments. This example shows how to return the value 1 whenever the argument to the Do method is an even number. mock.Setup(x => x.Do(It.Is<int>(i => i % 2 == 0))) .Returns(1); This example shows how to throw an exception if the argument to the method is a negative number: mock.Setup(x => x.GetUser(It.Is<int>(i => i < 0))) .Throws(new ArgumentException()); Matches any value that is in the range specified. Type of the argument to check.The lower bound of the range.The upper bound of the range. The kind of range. See . The following example shows how to expect a method call with an integer argument within the 0..100 range. mock.Setup(x => x.HasInventory( It.IsAny<string>(), It.IsInRange(0, 100, Range.Inclusive))) .Returns(false); Matches any value that is present in the sequence specified. Type of the argument to check.The sequence of possible values. The following example shows how to expect a method call with an integer argument with value from a list. var values = new List<int> { 1, 2, 3 }; mock.Setup(x => x.HasInventory( It.IsAny<string>(), It.IsIn(values))) .Returns(false); Matches any value that is present in the sequence specified. Type of the argument to check.The sequence of possible values. The following example shows how to expect a method call with an integer argument with a value of 1, 2, or 3. mock.Setup(x => x.HasInventory( It.IsAny<string>(), It.IsIn(1, 2, 3))) .Returns(false); Matches any value that is not found in the sequence specified. Type of the argument to check.The sequence of disallowed values. The following example shows how to expect a method call with an integer argument with value not found from a list. var values = new List<int> { 1, 2, 3 }; mock.Setup(x => x.HasInventory( It.IsAny<string>(), It.IsNotIn(values))) .Returns(false); Matches any value that is not found in the sequence specified. Type of the argument to check.The sequence of disallowed values. The following example shows how to expect a method call with an integer argument of any value except 1, 2, or 3. mock.Setup(x => x.HasInventory( It.IsAny<string>(), It.IsNotIn(1, 2, 3))) .Returns(false); Matches a string argument if it matches the given regular expression pattern. The pattern to use to match the string argument value. The following example shows how to expect a call to a method where the string argument matches the given regular expression: mock.Setup(x => x.Check(It.IsRegex("[a-z]+"))).Returns(1); Matches a string argument if it matches the given regular expression pattern. The pattern to use to match the string argument value.The options used to interpret the pattern. The following example shows how to expect a call to a method where the string argument matches the given regular expression, in a case insensitive way: mock.Setup(x => x.Check(It.IsRegex("[a-z]+", RegexOptions.IgnoreCase))).Returns(1); Matcher to treat static functions as matchers. mock.Setup(x => x.StringMethod(A.MagicString())); public static class A { [Matcher] public static string MagicString() { return null; } public static bool MagicString(string arg) { return arg == "magic"; } } Will succeed if: mock.Object.StringMethod("magic"); and fail with any other call. Options to customize the behavior of the mock. Causes the mock to always throw an exception for invocations that don't have a corresponding setup. Will never throw exceptions, returning default values when necessary (null for reference types, zero for value types or empty enumerables and arrays). Default mock behavior, which equals . Exception thrown by mocks when setups are not matched, the mock is not properly setup, etc. A distinct exception type is provided so that exceptions thrown by the mock can be differentiated in tests that expect other exceptions to be thrown (i.e. ArgumentException). Richer exception hierarchy/types are not provided as tests typically should not catch or expect exceptions from the mocks. These are typically the result of changes in the tested class or its collaborators implementation, and result in fixes in the mock setup so that they dissapear and allow the test to pass. Supports the serialization infrastructure. Serialization information. Streaming context. Supports the serialization infrastructure. Serialization information. Streaming context. Indicates whether this exception is a verification fault raised by Verify() Made internal as it's of no use for consumers, but it's important for our own tests. Used by the mock factory to accumulate verification failures. Supports the serialization infrastructure. A strongly-typed resource class, for looking up localized strings, etc. Returns the cached ResourceManager instance used by this class. Overrides the current thread's CurrentUICulture property for all resource lookups using this strongly typed resource class. Looks up a localized string similar to Mock type has already been initialized by accessing its Object property. Adding interfaces must be done before that.. Looks up a localized string similar to Value cannot be an empty string.. Looks up a localized string similar to Can only add interfaces to the mock.. Looks up a localized string similar to Can't set return value for void method {0}.. Looks up a localized string similar to Constructor arguments cannot be passed for delegate mocks.. Looks up a localized string similar to Constructor arguments cannot be passed for interface mocks.. Looks up a localized string similar to A matching constructor for the given arguments was not found on the mocked type.. Looks up a localized string similar to Could not locate event for attach or detach method {0}.. Looks up a localized string similar to Expression {0} involves a field access, which is not supported. Use properties instead.. Looks up a localized string similar to Type to mock must be an interface or an abstract or non-sealed class. . Looks up a localized string similar to Cannot retrieve a mock with the given object type {0} as it's not the main type of the mock or any of its additional interfaces. Please cast the argument to one of the supported types: {1}. Remember that there's no generics covariance in the CLR, so your object must be one of these types in order for the call to succeed.. Looks up a localized string similar to The equals ("==" or "=" in VB) and the conditional 'and' ("&&" or "AndAlso" in VB) operators are the only ones supported in the query specification expression. Unsupported expression: {0}. Looks up a localized string similar to LINQ method '{0}' not supported.. Looks up a localized string similar to Expression contains a call to a method which is not virtual (overridable in VB) or abstract. Unsupported expression: {0}. Looks up a localized string similar to Member {0}.{1} does not exist.. Looks up a localized string similar to Method {0}.{1} is public. Use strong-typed Expect overload instead: mock.Setup(x => x.{1}()); . Looks up a localized string similar to {0} invocation failed with mock behavior {1}. {2}. Looks up a localized string similar to Expected only {0} calls to {1}.. Looks up a localized string similar to Expected only one call to {0}.. Looks up a localized string similar to {0} Expected invocation on the mock at least {2} times, but was {4} times: {1}. Looks up a localized string similar to {0} Expected invocation on the mock at least once, but was never performed: {1}. Looks up a localized string similar to {0} Expected invocation on the mock at most {3} times, but was {4} times: {1}. Looks up a localized string similar to {0} Expected invocation on the mock at most once, but was {4} times: {1}. Looks up a localized string similar to {0} Expected invocation on the mock between {2} and {3} times (Exclusive), but was {4} times: {1}. Looks up a localized string similar to {0} Expected invocation on the mock between {2} and {3} times (Inclusive), but was {4} times: {1}. Looks up a localized string similar to {0} Expected invocation on the mock exactly {2} times, but was {4} times: {1}. Looks up a localized string similar to {0} Expected invocation on the mock should never have been performed, but was {4} times: {1}. Looks up a localized string similar to {0} Expected invocation on the mock once, but was {4} times: {1}. Looks up a localized string similar to All invocations on the mock must have a corresponding setup.. Looks up a localized string similar to Object instance was not created by Moq.. Looks up a localized string similar to Out expression must evaluate to a constant value.. Looks up a localized string similar to Property {0}.{1} does not have a getter.. Looks up a localized string similar to Property {0}.{1} does not exist.. Looks up a localized string similar to Property {0}.{1} is write-only.. Looks up a localized string similar to Property {0}.{1} is read-only.. Looks up a localized string similar to Property {0}.{1} does not have a setter.. Looks up a localized string similar to Cannot raise a mocked event unless it has been associated (attached) to a concrete event in a mocked object.. Looks up a localized string similar to Ref expression must evaluate to a constant value.. Looks up a localized string similar to Invocation needs to return a value and therefore must have a corresponding setup that provides it.. Looks up a localized string similar to A lambda expression is expected as the argument to It.Is<T>.. Looks up a localized string similar to Invocation {0} should not have been made.. Looks up a localized string similar to Expression is not a method invocation: {0}. Looks up a localized string similar to Expression is not a property access: {0}. Looks up a localized string similar to Expression is not a property setter invocation.. Looks up a localized string similar to Expression references a method that does not belong to the mocked object: {0}. Looks up a localized string similar to Invalid setup on a non-virtual (overridable in VB) member: {0}. Looks up a localized string similar to Type {0} does not implement required interface {1}. Looks up a localized string similar to Type {0} does not from required type {1}. Looks up a localized string similar to To specify a setup for public property {0}.{1}, use the typed overloads, such as: mock.Setup(x => x.{1}).Returns(value); mock.SetupGet(x => x.{1}).Returns(value); //equivalent to previous one mock.SetupSet(x => x.{1}).Callback(callbackDelegate); . Looks up a localized string similar to Unsupported expression: {0}. Looks up a localized string similar to Only property accesses are supported in intermediate invocations on a setup. Unsupported expression {0}.. Looks up a localized string similar to Expression contains intermediate property access {0}.{1} which is of type {2} and cannot be mocked. Unsupported expression {3}.. Looks up a localized string similar to Setter expression cannot use argument matchers that receive parameters.. Looks up a localized string similar to Member {0} is not supported for protected mocking.. Looks up a localized string similar to Setter expression can only use static custom matchers.. Looks up a localized string similar to The following setups were not matched: {0}. Looks up a localized string similar to Invalid verify on a non-virtual (overridable in VB) member: {0}. Allows setups to be specified for protected members by using their name as a string, rather than strong-typing them which is not possible due to their visibility. Specifies a setup for a void method invocation with the given , optionally specifying arguments for the method call. The name of the void method to be invoked. The optional arguments for the invocation. If argument matchers are used, remember to use rather than . Specifies a setup for an invocation on a property or a non void method with the given , optionally specifying arguments for the method call. The name of the method or property to be invoked. The optional arguments for the invocation. If argument matchers are used, remember to use rather than . The return type of the method or property. Specifies a setup for an invocation on a property getter with the given . The name of the property. The type of the property. Specifies a setup for an invocation on a property setter with the given . The name of the property. The property value. If argument matchers are used, remember to use rather than . The type of the property. Specifies a verify for a void method with the given , optionally specifying arguments for the method call. Use in conjuntion with the default . The invocation was not call the times specified by . The name of the void method to be verified. The number of times a method is allowed to be called. The optional arguments for the invocation. If argument matchers are used, remember to use rather than . Specifies a verify for an invocation on a property or a non void method with the given , optionally specifying arguments for the method call. The invocation was not call the times specified by . The name of the method or property to be invoked. The optional arguments for the invocation. If argument matchers are used, remember to use rather than . The number of times a method is allowed to be called. The type of return value from the expression. Specifies a verify for an invocation on a property getter with the given . The invocation was not call the times specified by . The name of the property. The number of times a method is allowed to be called. The type of the property. Specifies a setup for an invocation on a property setter with the given . The invocation was not call the times specified by . The name of the property. The number of times a method is allowed to be called. The property value. The type of the property. If argument matchers are used, remember to use rather than . Allows the specification of a matching condition for an argument in a protected member setup, rather than a specific argument value. "ItExpr" refers to the argument being matched. Use this variant of argument matching instead of for protected setups. This class allows the setup to match a method invocation with an arbitrary value, with a value in a specified range, or even one that matches a given predicate, or null. Matches a null value of the given type. Required for protected mocks as the null value cannot be used directly as it prevents proper method overload selection. // Throws an exception for a call to Remove with a null string value. mock.Protected() .Setup("Remove", ItExpr.IsNull<string>()) .Throws(new InvalidOperationException()); Type of the value. Matches any value of the given type. Typically used when the actual argument value for a method call is not relevant. // Throws an exception for a call to Remove with any string value. mock.Protected() .Setup("Remove", ItExpr.IsAny<string>()) .Throws(new InvalidOperationException()); Type of the value. Matches any value that satisfies the given predicate. Type of the argument to check. The predicate used to match the method argument. Allows the specification of a predicate to perform matching of method call arguments. This example shows how to return the value 1 whenever the argument to the Do method is an even number. mock.Protected() .Setup("Do", ItExpr.Is<int>(i => i % 2 == 0)) .Returns(1); This example shows how to throw an exception if the argument to the method is a negative number: mock.Protected() .Setup("GetUser", ItExpr.Is<int>(i => i < 0)) .Throws(new ArgumentException()); Matches any value that is in the range specified. Type of the argument to check. The lower bound of the range. The upper bound of the range. The kind of range. See . The following example shows how to expect a method call with an integer argument within the 0..100 range. mock.Protected() .Setup("HasInventory", ItExpr.IsAny<string>(), ItExpr.IsInRange(0, 100, Range.Inclusive)) .Returns(false); Matches a string argument if it matches the given regular expression pattern. The pattern to use to match the string argument value. The following example shows how to expect a call to a method where the string argument matches the given regular expression: mock.Protected() .Setup("Check", ItExpr.IsRegex("[a-z]+")) .Returns(1); Matches a string argument if it matches the given regular expression pattern. The pattern to use to match the string argument value. The options used to interpret the pattern. The following example shows how to expect a call to a method where the string argument matches the given regular expression, in a case insensitive way: mock.Protected() .Setup("Check", ItExpr.IsRegex("[a-z]+", RegexOptions.IgnoreCase)) .Returns(1); Enables the Protected() method on , allowing setups to be set for protected members by using their name as a string, rather than strong-typing them which is not possible due to their visibility. Enable protected setups for the mock. Mocked object type. Typically omitted as it can be inferred from the mock instance. The mock to set the protected setups on. Kind of range to use in a filter specified through . The range includes the to and from values. The range does not include the to and from values. Determines the way default values are generated calculated for loose mocks. Default behavior, which generates empty values for value types (i.e. default(int)), empty array and enumerables, and nulls for all other reference types. Whenever the default value generated by is null, replaces this value with a mock (if the type can be mocked). For sealed classes, a null value will be generated. A default implementation of IQueryable for use with QueryProvider The is a static method that returns an IQueryable of Mocks of T which is used to apply the linq specification to. Allows creation custom value matchers that can be used on setups and verification, completely replacing the built-in class with your own argument matching rules. See also . Provided for the sole purpose of rendering the delegate passed to the matcher constructor if no friendly render lambda is provided. Initializes the match with the condition that will be checked in order to match invocation values. The condition to match against actual values. This method is used to set an expression as the last matcher invoked, which is used in the SetupSet to allow matchers in the prop = value delegate expression. This delegate is executed in "fluent" mode in order to capture the value being set, and construct the corresponding methodcall. This is also used in the MatcherFactory for each argument expression. This method ensures that when we execute the delegate, we also track the matcher that was invoked, so that when we create the methodcall we build the expression using it, rather than the null/default value returned from the actual invocation. Allows creation custom value matchers that can be used on setups and verification, completely replacing the built-in class with your own argument matching rules. Type of the value to match. The argument matching is used to determine whether a concrete invocation in the mock matches a given setup. This matching mechanism is fully extensible. Creating a custom matcher is straightforward. You just need to create a method that returns a value from a call to with your matching condition and optional friendly render expression: [Matcher] public Order IsBigOrder() { return Match<Order>.Create( o => o.GrandTotal >= 5000, /* a friendly expression to render on failures */ () => IsBigOrder()); } This method can be used in any mock setup invocation: mock.Setup(m => m.Submit(IsBigOrder()).Throws<UnauthorizedAccessException>(); At runtime, Moq knows that the return value was a matcher (note that the method MUST be annotated with the [Matcher] attribute in order to determine this) and evaluates your predicate with the actual value passed into your predicate. Another example might be a case where you want to match a lists of orders that contains a particular one. You might create matcher like the following: public static class Orders { [Matcher] public static IEnumerable<Order> Contains(Order order) { return Match<IEnumerable<Order>>.Create(orders => orders.Contains(order)); } } Now we can invoke this static method instead of an argument in an invocation: var order = new Order { ... }; var mock = new Mock<IRepository<Order>>(); mock.Setup(x => x.Save(Orders.Contains(order))) .Throws<ArgumentException>(); Tracks the current mock and interception context. Having an active fluent mock context means that the invocation is being performed in "trial" mode, just to gather the target method and arguments that need to be matched later when the actual invocation is made. A that returns an empty default value for non-mockeable types, and mocks for all other types (interfaces and non-sealed classes) that can be mocked. Allows querying the universe of mocks for those that behave according to the LINQ query specification. This entry-point into Linq to Mocks is the only one in the root Moq namespace to ease discovery. But to get all the mocking extension methods on Object, a using of Moq.Linq must be done, so that the polluting of the intellisense for all objects is an explicit opt-in. Access the universe of mocks of the given type, to retrieve those that behave according to the LINQ query specification. The type of the mocked object to query. Access the universe of mocks of the given type, to retrieve those that behave according to the LINQ query specification. The predicate with the setup expressions. The type of the mocked object to query. Creates an mock object of the indicated type. The type of the mocked object. The mocked object created. Creates an mock object of the indicated type. The predicate with the setup expressions. The type of the mocked object. The mocked object created. Creates the mock query with the underlying queriable implementation. Wraps the enumerator inside a queryable. Method that is turned into the actual call from .Query{T}, to transform the queryable query into a normal enumerable query. This method is never used directly by consumers. Extension method used to support Linq-like setup properties that are not virtual but do have a getter and a setter, thereby allowing the use of Linq to Mocks to quickly initialize Dtos too :) Helper extensions that are used by the query translator. Retrieves a fluent mock from the given setup expression. Gets an autogenerated interface with a method on it that matches the signature of the specified . Such an interface can then be mocked, and a delegate pointed at the method on the mocked instance. This is how we support delegate mocking. The factory caches such interfaces and reuses them for repeated requests for the same delegate type. The delegate type for which an interface is required. The method on the autogenerated interface. Defines the number of invocations allowed by a mocked method. Specifies that a mocked method should be invoked times as minimum. The minimun number of times.An object defining the allowed number of invocations. Specifies that a mocked method should be invoked one time as minimum. An object defining the allowed number of invocations. Specifies that a mocked method should be invoked time as maximun. The maximun number of times.An object defining the allowed number of invocations. Specifies that a mocked method should be invoked one time as maximun. An object defining the allowed number of invocations. Specifies that a mocked method should be invoked between and times. The minimun number of times.The maximun number of times. The kind of range. See . An object defining the allowed number of invocations. Specifies that a mocked method should be invoked exactly times. The times that a method or property can be called.An object defining the allowed number of invocations. Specifies that a mocked method should not be invoked. An object defining the allowed number of invocations. Specifies that a mocked method should be invoked exactly one time. An object defining the allowed number of invocations. Determines whether the specified is equal to this instance. The to compare with this instance. true if the specified is equal to this instance; otherwise, false. Returns a hash code for this instance. A hash code for this instance, suitable for use in hashing algorithms and data structures like a hash table. Determines whether two specified objects have the same value. The first . The second . true if the value of left is the same as the value of right; otherwise, false. Determines whether two specified objects have different values. The first . The second . true if the value of left is different from the value of right; otherwise, false. ================================================ FILE: packages/Moq.4.2.1402.2112/lib/net40/Moq.xml ================================================ Moq Implements the fluent API. The expectation will be considered only in the former condition. The expectation will be considered only in the former condition. Setups the get. The type of the property. The expression. Setups the set. The type of the property. The setter expression. Setups the set. The setter expression. Handle interception the current invocation context shared data for the interceptor as a whole shared data among the strategies during a single interception InterceptionAction.Continue if further interception has to be processed, otherwise InterceptionAction.Stop Covarient interface for Mock<T> such that casts between IMock<Employee> to IMock<Person> are possible. Only covers the covariant members of Mock<T>. Exposes the mocked object instance. Behavior of the mock, according to the value set in the constructor. Whether the base member virtual implementation will be called for mocked classes if no setup is matched. Defaults to . Specifies the behavior to use when returning default values for unexpected invocations on loose mocks. Get an eventInfo for a given event name. Search type ancestors depth first if necessary. Name of the event, with the set_ or get_ prefix already removed Get an eventInfo for a given event name. Search type ancestors depth first if necessary. Searches also in non public events. Name of the event, with the set_ or get_ prefix already removed Given a type return all of its ancestors, both types and interfaces. The type to find immediate ancestors of Defines the Callback verb and overloads. Helper interface used to hide the base members from the fluent API to make it much cleaner in Visual Studio intellisense. Specifies a callback to invoke when the method is called. The callback method to invoke. The following example specifies a callback to set a boolean value that can be used later: var called = false; mock.Setup(x => x.Execute()) .Callback(() => called = true); Specifies a callback to invoke when the method is called that receives the original arguments. The argument type of the invoked method. The callback method to invoke. Invokes the given callback with the concrete invocation argument value. Notice how the specific string argument is retrieved by simply declaring it as part of the lambda expression for the callback: mock.Setup(x => x.Execute(It.IsAny<string>())) .Callback((string command) => Console.WriteLine(command)); Specifies a callback to invoke when the method is called that receives the original arguments. The type of the first argument of the invoked method. The type of the second argument of the invoked method. The callback method to invoke. A reference to interface. Invokes the given callback with the concrete invocation arguments values. Notice how the specific arguments are retrieved by simply declaring them as part of the lambda expression for the callback: mock.Setup(x => x.Execute( It.IsAny<string>(), It.IsAny<string>())) .Callback((string arg1, string arg2) => Console.WriteLine(arg1 + arg2)); Specifies a callback to invoke when the method is called that receives the original arguments. The type of the first argument of the invoked method. The type of the second argument of the invoked method. The type of the third argument of the invoked method. The callback method to invoke. A reference to interface. Invokes the given callback with the concrete invocation arguments values. Notice how the specific arguments are retrieved by simply declaring them as part of the lambda expression for the callback: mock.Setup(x => x.Execute( It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>())) .Callback((string arg1, string arg2, string arg3) => Console.WriteLine(arg1 + arg2 + arg3)); Specifies a callback to invoke when the method is called that receives the original arguments. The type of the first argument of the invoked method. The type of the second argument of the invoked method. The type of the third argument of the invoked method. The type of the fourth argument of the invoked method. The callback method to invoke. A reference to interface. Invokes the given callback with the concrete invocation arguments values. Notice how the specific arguments are retrieved by simply declaring them as part of the lambda expression for the callback: mock.Setup(x => x.Execute( It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>())) .Callback((string arg1, string arg2, string arg3, string arg4) => Console.WriteLine(arg1 + arg2 + arg3 + arg4)); Specifies a callback to invoke when the method is called that receives the original arguments. The type of the first argument of the invoked method. The type of the second argument of the invoked method. The type of the third argument of the invoked method. The type of the fourth argument of the invoked method. The type of the fifth argument of the invoked method. The callback method to invoke. A reference to interface. Invokes the given callback with the concrete invocation arguments values. Notice how the specific arguments are retrieved by simply declaring them as part of the lambda expression for the callback: mock.Setup(x => x.Execute( It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>())) .Callback((string arg1, string arg2, string arg3, string arg4, string arg5) => Console.WriteLine(arg1 + arg2 + arg3 + arg4 + arg5)); Specifies a callback to invoke when the method is called that receives the original arguments. The type of the first argument of the invoked method. The type of the second argument of the invoked method. The type of the third argument of the invoked method. The type of the fourth argument of the invoked method. The type of the fifth argument of the invoked method. The type of the sixth argument of the invoked method. The callback method to invoke. A reference to interface. Invokes the given callback with the concrete invocation arguments values. Notice how the specific arguments are retrieved by simply declaring them as part of the lambda expression for the callback: mock.Setup(x => x.Execute( It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>())) .Callback((string arg1, string arg2, string arg3, string arg4, string arg5, string arg6) => Console.WriteLine(arg1 + arg2 + arg3 + arg4 + arg5 + arg6)); Specifies a callback to invoke when the method is called that receives the original arguments. The type of the first argument of the invoked method. The type of the second argument of the invoked method. The type of the third argument of the invoked method. The type of the fourth argument of the invoked method. The type of the fifth argument of the invoked method. The type of the sixth argument of the invoked method. The type of the seventh argument of the invoked method. The callback method to invoke. A reference to interface. Invokes the given callback with the concrete invocation arguments values. Notice how the specific arguments are retrieved by simply declaring them as part of the lambda expression for the callback: mock.Setup(x => x.Execute( It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>())) .Callback((string arg1, string arg2, string arg3, string arg4, string arg5, string arg6, string arg7) => Console.WriteLine(arg1 + arg2 + arg3 + arg4 + arg5 + arg6 + arg7)); Specifies a callback to invoke when the method is called that receives the original arguments. The type of the first argument of the invoked method. The type of the second argument of the invoked method. The type of the third argument of the invoked method. The type of the fourth argument of the invoked method. The type of the fifth argument of the invoked method. The type of the sixth argument of the invoked method. The type of the seventh argument of the invoked method. The type of the eighth argument of the invoked method. The callback method to invoke. A reference to interface. Invokes the given callback with the concrete invocation arguments values. Notice how the specific arguments are retrieved by simply declaring them as part of the lambda expression for the callback: mock.Setup(x => x.Execute( It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>())) .Callback((string arg1, string arg2, string arg3, string arg4, string arg5, string arg6, string arg7, string arg8) => Console.WriteLine(arg1 + arg2 + arg3 + arg4 + arg5 + arg6 + arg7 + arg8)); Specifies a callback to invoke when the method is called that receives the original arguments. The type of the first argument of the invoked method. The type of the second argument of the invoked method. The type of the third argument of the invoked method. The type of the fourth argument of the invoked method. The type of the fifth argument of the invoked method. The type of the sixth argument of the invoked method. The type of the seventh argument of the invoked method. The type of the eighth argument of the invoked method. The type of the nineth argument of the invoked method. The callback method to invoke. A reference to interface. Invokes the given callback with the concrete invocation arguments values. Notice how the specific arguments are retrieved by simply declaring them as part of the lambda expression for the callback: mock.Setup(x => x.Execute( It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>())) .Callback((string arg1, string arg2, string arg3, string arg4, string arg5, string arg6, string arg7, string arg8, string arg9) => Console.WriteLine(arg1 + arg2 + arg3 + arg4 + arg5 + arg6 + arg7 + arg8 + arg9)); Specifies a callback to invoke when the method is called that receives the original arguments. The type of the first argument of the invoked method. The type of the second argument of the invoked method. The type of the third argument of the invoked method. The type of the fourth argument of the invoked method. The type of the fifth argument of the invoked method. The type of the sixth argument of the invoked method. The type of the seventh argument of the invoked method. The type of the eighth argument of the invoked method. The type of the nineth argument of the invoked method. The type of the tenth argument of the invoked method. The callback method to invoke. A reference to interface. Invokes the given callback with the concrete invocation arguments values. Notice how the specific arguments are retrieved by simply declaring them as part of the lambda expression for the callback: mock.Setup(x => x.Execute( It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>())) .Callback((string arg1, string arg2, string arg3, string arg4, string arg5, string arg6, string arg7, string arg8, string arg9, string arg10) => Console.WriteLine(arg1 + arg2 + arg3 + arg4 + arg5 + arg6 + arg7 + arg8 + arg9 + arg10)); Specifies a callback to invoke when the method is called that receives the original arguments. The type of the first argument of the invoked method. The type of the second argument of the invoked method. The type of the third argument of the invoked method. The type of the fourth argument of the invoked method. The type of the fifth argument of the invoked method. The type of the sixth argument of the invoked method. The type of the seventh argument of the invoked method. The type of the eighth argument of the invoked method. The type of the nineth argument of the invoked method. The type of the tenth argument of the invoked method. The type of the eleventh argument of the invoked method. The callback method to invoke. A reference to interface. Invokes the given callback with the concrete invocation arguments values. Notice how the specific arguments are retrieved by simply declaring them as part of the lambda expression for the callback: mock.Setup(x => x.Execute( It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>())) .Callback((string arg1, string arg2, string arg3, string arg4, string arg5, string arg6, string arg7, string arg8, string arg9, string arg10, string arg11) => Console.WriteLine(arg1 + arg2 + arg3 + arg4 + arg5 + arg6 + arg7 + arg8 + arg9 + arg10 + arg11)); Specifies a callback to invoke when the method is called that receives the original arguments. The type of the first argument of the invoked method. The type of the second argument of the invoked method. The type of the third argument of the invoked method. The type of the fourth argument of the invoked method. The type of the fifth argument of the invoked method. The type of the sixth argument of the invoked method. The type of the seventh argument of the invoked method. The type of the eighth argument of the invoked method. The type of the nineth argument of the invoked method. The type of the tenth argument of the invoked method. The type of the eleventh argument of the invoked method. The type of the twelfth argument of the invoked method. The callback method to invoke. A reference to interface. Invokes the given callback with the concrete invocation arguments values. Notice how the specific arguments are retrieved by simply declaring them as part of the lambda expression for the callback: mock.Setup(x => x.Execute( It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>())) .Callback((string arg1, string arg2, string arg3, string arg4, string arg5, string arg6, string arg7, string arg8, string arg9, string arg10, string arg11, string arg12) => Console.WriteLine(arg1 + arg2 + arg3 + arg4 + arg5 + arg6 + arg7 + arg8 + arg9 + arg10 + arg11 + arg12)); Specifies a callback to invoke when the method is called that receives the original arguments. The type of the first argument of the invoked method. The type of the second argument of the invoked method. The type of the third argument of the invoked method. The type of the fourth argument of the invoked method. The type of the fifth argument of the invoked method. The type of the sixth argument of the invoked method. The type of the seventh argument of the invoked method. The type of the eighth argument of the invoked method. The type of the nineth argument of the invoked method. The type of the tenth argument of the invoked method. The type of the eleventh argument of the invoked method. The type of the twelfth argument of the invoked method. The type of the thirteenth argument of the invoked method. The callback method to invoke. A reference to interface. Invokes the given callback with the concrete invocation arguments values. Notice how the specific arguments are retrieved by simply declaring them as part of the lambda expression for the callback: mock.Setup(x => x.Execute( It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>())) .Callback((string arg1, string arg2, string arg3, string arg4, string arg5, string arg6, string arg7, string arg8, string arg9, string arg10, string arg11, string arg12, string arg13) => Console.WriteLine(arg1 + arg2 + arg3 + arg4 + arg5 + arg6 + arg7 + arg8 + arg9 + arg10 + arg11 + arg12 + arg13)); Specifies a callback to invoke when the method is called that receives the original arguments. The type of the first argument of the invoked method. The type of the second argument of the invoked method. The type of the third argument of the invoked method. The type of the fourth argument of the invoked method. The type of the fifth argument of the invoked method. The type of the sixth argument of the invoked method. The type of the seventh argument of the invoked method. The type of the eighth argument of the invoked method. The type of the nineth argument of the invoked method. The type of the tenth argument of the invoked method. The type of the eleventh argument of the invoked method. The type of the twelfth argument of the invoked method. The type of the thirteenth argument of the invoked method. The type of the fourteenth argument of the invoked method. The callback method to invoke. A reference to interface. Invokes the given callback with the concrete invocation arguments values. Notice how the specific arguments are retrieved by simply declaring them as part of the lambda expression for the callback: mock.Setup(x => x.Execute( It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>())) .Callback((string arg1, string arg2, string arg3, string arg4, string arg5, string arg6, string arg7, string arg8, string arg9, string arg10, string arg11, string arg12, string arg13, string arg14) => Console.WriteLine(arg1 + arg2 + arg3 + arg4 + arg5 + arg6 + arg7 + arg8 + arg9 + arg10 + arg11 + arg12 + arg13 + arg14)); Specifies a callback to invoke when the method is called that receives the original arguments. The type of the first argument of the invoked method. The type of the second argument of the invoked method. The type of the third argument of the invoked method. The type of the fourth argument of the invoked method. The type of the fifth argument of the invoked method. The type of the sixth argument of the invoked method. The type of the seventh argument of the invoked method. The type of the eighth argument of the invoked method. The type of the nineth argument of the invoked method. The type of the tenth argument of the invoked method. The type of the eleventh argument of the invoked method. The type of the twelfth argument of the invoked method. The type of the thirteenth argument of the invoked method. The type of the fourteenth argument of the invoked method. The type of the fifteenth argument of the invoked method. The callback method to invoke. A reference to interface. Invokes the given callback with the concrete invocation arguments values. Notice how the specific arguments are retrieved by simply declaring them as part of the lambda expression for the callback: mock.Setup(x => x.Execute( It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>())) .Callback((string arg1, string arg2, string arg3, string arg4, string arg5, string arg6, string arg7, string arg8, string arg9, string arg10, string arg11, string arg12, string arg13, string arg14, string arg15) => Console.WriteLine(arg1 + arg2 + arg3 + arg4 + arg5 + arg6 + arg7 + arg8 + arg9 + arg10 + arg11 + arg12 + arg13 + arg14 + arg15)); Specifies a callback to invoke when the method is called that receives the original arguments. The type of the first argument of the invoked method. The type of the second argument of the invoked method. The type of the third argument of the invoked method. The type of the fourth argument of the invoked method. The type of the fifth argument of the invoked method. The type of the sixth argument of the invoked method. The type of the seventh argument of the invoked method. The type of the eighth argument of the invoked method. The type of the nineth argument of the invoked method. The type of the tenth argument of the invoked method. The type of the eleventh argument of the invoked method. The type of the twelfth argument of the invoked method. The type of the thirteenth argument of the invoked method. The type of the fourteenth argument of the invoked method. The type of the fifteenth argument of the invoked method. The type of the sixteenth argument of the invoked method. The callback method to invoke. A reference to interface. Invokes the given callback with the concrete invocation arguments values. Notice how the specific arguments are retrieved by simply declaring them as part of the lambda expression for the callback: mock.Setup(x => x.Execute( It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>())) .Callback((string arg1, string arg2, string arg3, string arg4, string arg5, string arg6, string arg7, string arg8, string arg9, string arg10, string arg11, string arg12, string arg13, string arg14, string arg15, string arg16) => Console.WriteLine(arg1 + arg2 + arg3 + arg4 + arg5 + arg6 + arg7 + arg8 + arg9 + arg10 + arg11 + arg12 + arg13 + arg14 + arg15 + arg16)); Defines the Callback verb and overloads for callbacks on setups that return a value. Mocked type. Type of the return value of the setup. Specifies a callback to invoke when the method is called. The callback method to invoke. The following example specifies a callback to set a boolean value that can be used later: var called = false; mock.Setup(x => x.Execute()) .Callback(() => called = true) .Returns(true); Note that in the case of value-returning methods, after the Callback call you can still specify the return value. Specifies a callback to invoke when the method is called that receives the original arguments. The type of the argument of the invoked method. Callback method to invoke. Invokes the given callback with the concrete invocation argument value. Notice how the specific string argument is retrieved by simply declaring it as part of the lambda expression for the callback: mock.Setup(x => x.Execute(It.IsAny<string>())) .Callback(command => Console.WriteLine(command)) .Returns(true); Specifies a callback to invoke when the method is called that receives the original arguments. The type of the first argument of the invoked method. The type of the second argument of the invoked method. The callback method to invoke. A reference to interface. Invokes the given callback with the concrete invocation arguments values. Notice how the specific arguments are retrieved by simply declaring them as part of the lambda expression for the callback: mock.Setup(x => x.Execute( It.IsAny<string>(), It.IsAny<string>())) .Callback((arg1, arg2) => Console.WriteLine(arg1 + arg2)); Specifies a callback to invoke when the method is called that receives the original arguments. The type of the first argument of the invoked method. The type of the second argument of the invoked method. The type of the third argument of the invoked method. The callback method to invoke. A reference to interface. Invokes the given callback with the concrete invocation arguments values. Notice how the specific arguments are retrieved by simply declaring them as part of the lambda expression for the callback: mock.Setup(x => x.Execute( It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>())) .Callback((arg1, arg2, arg3) => Console.WriteLine(arg1 + arg2 + arg3)); Specifies a callback to invoke when the method is called that receives the original arguments. The type of the first argument of the invoked method. The type of the second argument of the invoked method. The type of the third argument of the invoked method. The type of the fourth argument of the invoked method. The callback method to invoke. A reference to interface. Invokes the given callback with the concrete invocation arguments values. Notice how the specific arguments are retrieved by simply declaring them as part of the lambda expression for the callback: mock.Setup(x => x.Execute( It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>())) .Callback((arg1, arg2, arg3, arg4) => Console.WriteLine(arg1 + arg2 + arg3 + arg4)); Specifies a callback to invoke when the method is called that receives the original arguments. The type of the first argument of the invoked method. The type of the second argument of the invoked method. The type of the third argument of the invoked method. The type of the fourth argument of the invoked method. The type of the fifth argument of the invoked method. The callback method to invoke. A reference to interface. Invokes the given callback with the concrete invocation arguments values. Notice how the specific arguments are retrieved by simply declaring them as part of the lambda expression for the callback: mock.Setup(x => x.Execute( It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>())) .Callback((arg1, arg2, arg3, arg4, arg5) => Console.WriteLine(arg1 + arg2 + arg3 + arg4 + arg5)); Specifies a callback to invoke when the method is called that receives the original arguments. The type of the first argument of the invoked method. The type of the second argument of the invoked method. The type of the third argument of the invoked method. The type of the fourth argument of the invoked method. The type of the fifth argument of the invoked method. The type of the sixth argument of the invoked method. The callback method to invoke. A reference to interface. Invokes the given callback with the concrete invocation arguments values. Notice how the specific arguments are retrieved by simply declaring them as part of the lambda expression for the callback: mock.Setup(x => x.Execute( It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>())) .Callback((arg1, arg2, arg3, arg4, arg5, arg6) => Console.WriteLine(arg1 + arg2 + arg3 + arg4 + arg5 + arg6)); Specifies a callback to invoke when the method is called that receives the original arguments. The type of the first argument of the invoked method. The type of the second argument of the invoked method. The type of the third argument of the invoked method. The type of the fourth argument of the invoked method. The type of the fifth argument of the invoked method. The type of the sixth argument of the invoked method. The type of the seventh argument of the invoked method. The callback method to invoke. A reference to interface. Invokes the given callback with the concrete invocation arguments values. Notice how the specific arguments are retrieved by simply declaring them as part of the lambda expression for the callback: mock.Setup(x => x.Execute( It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>())) .Callback((arg1, arg2, arg3, arg4, arg5, arg6, arg7) => Console.WriteLine(arg1 + arg2 + arg3 + arg4 + arg5 + arg6 + arg7)); Specifies a callback to invoke when the method is called that receives the original arguments. The type of the first argument of the invoked method. The type of the second argument of the invoked method. The type of the third argument of the invoked method. The type of the fourth argument of the invoked method. The type of the fifth argument of the invoked method. The type of the sixth argument of the invoked method. The type of the seventh argument of the invoked method. The type of the eighth argument of the invoked method. The callback method to invoke. A reference to interface. Invokes the given callback with the concrete invocation arguments values. Notice how the specific arguments are retrieved by simply declaring them as part of the lambda expression for the callback: mock.Setup(x => x.Execute( It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>())) .Callback((arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8) => Console.WriteLine(arg1 + arg2 + arg3 + arg4 + arg5 + arg6 + arg7 + arg8)); Specifies a callback to invoke when the method is called that receives the original arguments. The type of the first argument of the invoked method. The type of the second argument of the invoked method. The type of the third argument of the invoked method. The type of the fourth argument of the invoked method. The type of the fifth argument of the invoked method. The type of the sixth argument of the invoked method. The type of the seventh argument of the invoked method. The type of the eighth argument of the invoked method. The type of the nineth argument of the invoked method. The callback method to invoke. A reference to interface. Invokes the given callback with the concrete invocation arguments values. Notice how the specific arguments are retrieved by simply declaring them as part of the lambda expression for the callback: mock.Setup(x => x.Execute( It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>())) .Callback((arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9) => Console.WriteLine(arg1 + arg2 + arg3 + arg4 + arg5 + arg6 + arg7 + arg8 + arg9)); Specifies a callback to invoke when the method is called that receives the original arguments. The type of the first argument of the invoked method. The type of the second argument of the invoked method. The type of the third argument of the invoked method. The type of the fourth argument of the invoked method. The type of the fifth argument of the invoked method. The type of the sixth argument of the invoked method. The type of the seventh argument of the invoked method. The type of the eighth argument of the invoked method. The type of the nineth argument of the invoked method. The type of the tenth argument of the invoked method. The callback method to invoke. A reference to interface. Invokes the given callback with the concrete invocation arguments values. Notice how the specific arguments are retrieved by simply declaring them as part of the lambda expression for the callback: mock.Setup(x => x.Execute( It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>())) .Callback((arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10) => Console.WriteLine(arg1 + arg2 + arg3 + arg4 + arg5 + arg6 + arg7 + arg8 + arg9 + arg10)); Specifies a callback to invoke when the method is called that receives the original arguments. The type of the first argument of the invoked method. The type of the second argument of the invoked method. The type of the third argument of the invoked method. The type of the fourth argument of the invoked method. The type of the fifth argument of the invoked method. The type of the sixth argument of the invoked method. The type of the seventh argument of the invoked method. The type of the eighth argument of the invoked method. The type of the nineth argument of the invoked method. The type of the tenth argument of the invoked method. The type of the eleventh argument of the invoked method. The callback method to invoke. A reference to interface. Invokes the given callback with the concrete invocation arguments values. Notice how the specific arguments are retrieved by simply declaring them as part of the lambda expression for the callback: mock.Setup(x => x.Execute( It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>())) .Callback((arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11) => Console.WriteLine(arg1 + arg2 + arg3 + arg4 + arg5 + arg6 + arg7 + arg8 + arg9 + arg10 + arg11)); Specifies a callback to invoke when the method is called that receives the original arguments. The type of the first argument of the invoked method. The type of the second argument of the invoked method. The type of the third argument of the invoked method. The type of the fourth argument of the invoked method. The type of the fifth argument of the invoked method. The type of the sixth argument of the invoked method. The type of the seventh argument of the invoked method. The type of the eighth argument of the invoked method. The type of the nineth argument of the invoked method. The type of the tenth argument of the invoked method. The type of the eleventh argument of the invoked method. The type of the twelfth argument of the invoked method. The callback method to invoke. A reference to interface. Invokes the given callback with the concrete invocation arguments values. Notice how the specific arguments are retrieved by simply declaring them as part of the lambda expression for the callback: mock.Setup(x => x.Execute( It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>())) .Callback((arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11, arg12) => Console.WriteLine(arg1 + arg2 + arg3 + arg4 + arg5 + arg6 + arg7 + arg8 + arg9 + arg10 + arg11 + arg12)); Specifies a callback to invoke when the method is called that receives the original arguments. The type of the first argument of the invoked method. The type of the second argument of the invoked method. The type of the third argument of the invoked method. The type of the fourth argument of the invoked method. The type of the fifth argument of the invoked method. The type of the sixth argument of the invoked method. The type of the seventh argument of the invoked method. The type of the eighth argument of the invoked method. The type of the nineth argument of the invoked method. The type of the tenth argument of the invoked method. The type of the eleventh argument of the invoked method. The type of the twelfth argument of the invoked method. The type of the thirteenth argument of the invoked method. The callback method to invoke. A reference to interface. Invokes the given callback with the concrete invocation arguments values. Notice how the specific arguments are retrieved by simply declaring them as part of the lambda expression for the callback: mock.Setup(x => x.Execute( It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>())) .Callback((arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11, arg12, arg13) => Console.WriteLine(arg1 + arg2 + arg3 + arg4 + arg5 + arg6 + arg7 + arg8 + arg9 + arg10 + arg11 + arg12 + arg13)); Specifies a callback to invoke when the method is called that receives the original arguments. The type of the first argument of the invoked method. The type of the second argument of the invoked method. The type of the third argument of the invoked method. The type of the fourth argument of the invoked method. The type of the fifth argument of the invoked method. The type of the sixth argument of the invoked method. The type of the seventh argument of the invoked method. The type of the eighth argument of the invoked method. The type of the nineth argument of the invoked method. The type of the tenth argument of the invoked method. The type of the eleventh argument of the invoked method. The type of the twelfth argument of the invoked method. The type of the thirteenth argument of the invoked method. The type of the fourteenth argument of the invoked method. The callback method to invoke. A reference to interface. Invokes the given callback with the concrete invocation arguments values. Notice how the specific arguments are retrieved by simply declaring them as part of the lambda expression for the callback: mock.Setup(x => x.Execute( It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>())) .Callback((arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11, arg12, arg13, arg14) => Console.WriteLine(arg1 + arg2 + arg3 + arg4 + arg5 + arg6 + arg7 + arg8 + arg9 + arg10 + arg11 + arg12 + arg13 + arg14)); Specifies a callback to invoke when the method is called that receives the original arguments. The type of the first argument of the invoked method. The type of the second argument of the invoked method. The type of the third argument of the invoked method. The type of the fourth argument of the invoked method. The type of the fifth argument of the invoked method. The type of the sixth argument of the invoked method. The type of the seventh argument of the invoked method. The type of the eighth argument of the invoked method. The type of the nineth argument of the invoked method. The type of the tenth argument of the invoked method. The type of the eleventh argument of the invoked method. The type of the twelfth argument of the invoked method. The type of the thirteenth argument of the invoked method. The type of the fourteenth argument of the invoked method. The type of the fifteenth argument of the invoked method. The callback method to invoke. A reference to interface. Invokes the given callback with the concrete invocation arguments values. Notice how the specific arguments are retrieved by simply declaring them as part of the lambda expression for the callback: mock.Setup(x => x.Execute( It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>())) .Callback((arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11, arg12, arg13, arg14, arg15) => Console.WriteLine(arg1 + arg2 + arg3 + arg4 + arg5 + arg6 + arg7 + arg8 + arg9 + arg10 + arg11 + arg12 + arg13 + arg14 + arg15)); Specifies a callback to invoke when the method is called that receives the original arguments. The type of the first argument of the invoked method. The type of the second argument of the invoked method. The type of the third argument of the invoked method. The type of the fourth argument of the invoked method. The type of the fifth argument of the invoked method. The type of the sixth argument of the invoked method. The type of the seventh argument of the invoked method. The type of the eighth argument of the invoked method. The type of the nineth argument of the invoked method. The type of the tenth argument of the invoked method. The type of the eleventh argument of the invoked method. The type of the twelfth argument of the invoked method. The type of the thirteenth argument of the invoked method. The type of the fourteenth argument of the invoked method. The type of the fifteenth argument of the invoked method. The type of the sixteenth argument of the invoked method. The callback method to invoke. A reference to interface. Invokes the given callback with the concrete invocation arguments values. Notice how the specific arguments are retrieved by simply declaring them as part of the lambda expression for the callback: mock.Setup(x => x.Execute( It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>())) .Callback((arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11, arg12, arg13, arg14, arg15, arg16) => Console.WriteLine(arg1 + arg2 + arg3 + arg4 + arg5 + arg6 + arg7 + arg8 + arg9 + arg10 + arg11 + arg12 + arg13 + arg14 + arg15 + arg16)); Defines the Raises verb. Specifies the event that will be raised when the setup is met. An expression that represents an event attach or detach action. The event arguments to pass for the raised event. The following example shows how to raise an event when the setup is met: var mock = new Mock<IContainer>(); mock.Setup(add => add.Add(It.IsAny<string>(), It.IsAny<object>())) .Raises(add => add.Added += null, EventArgs.Empty); Specifies the event that will be raised when the setup is matched. An expression that represents an event attach or detach action. A function that will build the to pass when raising the event. Specifies the custom event that will be raised when the setup is matched. An expression that represents an event attach or detach action. The arguments to pass to the custom delegate (non EventHandler-compatible). Specifies the event that will be raised when the setup is matched. The expression that represents an event attach or detach action. The function that will build the to pass when raising the event. The type of the first argument received by the expected invocation. Specifies the event that will be raised when the setup is matched. The expression that represents an event attach or detach action. The function that will build the to pass when raising the event. The type of the first argument received by the expected invocation. The type of the second argument received by the expected invocation. Specifies the event that will be raised when the setup is matched. The expression that represents an event attach or detach action. The function that will build the to pass when raising the event. The type of the first argument received by the expected invocation. The type of the second argument received by the expected invocation. The type of the third argument received by the expected invocation. Specifies the event that will be raised when the setup is matched. The expression that represents an event attach or detach action. The function that will build the to pass when raising the event. The type of the first argument received by the expected invocation. The type of the second argument received by the expected invocation. The type of the third argument received by the expected invocation. The type of the fourth argument received by the expected invocation. Specifies the event that will be raised when the setup is matched. The expression that represents an event attach or detach action. The function that will build the to pass when raising the event. The type of the first argument received by the expected invocation. The type of the second argument received by the expected invocation. The type of the third argument received by the expected invocation. The type of the fourth argument received by the expected invocation. The type of the fifth argument received by the expected invocation. Specifies the event that will be raised when the setup is matched. The expression that represents an event attach or detach action. The function that will build the to pass when raising the event. The type of the first argument received by the expected invocation. The type of the second argument received by the expected invocation. The type of the third argument received by the expected invocation. The type of the fourth argument received by the expected invocation. The type of the fifth argument received by the expected invocation. The type of the sixth argument received by the expected invocation. Specifies the event that will be raised when the setup is matched. The expression that represents an event attach or detach action. The function that will build the to pass when raising the event. The type of the first argument received by the expected invocation. The type of the second argument received by the expected invocation. The type of the third argument received by the expected invocation. The type of the fourth argument received by the expected invocation. The type of the fifth argument received by the expected invocation. The type of the sixth argument received by the expected invocation. The type of the seventh argument received by the expected invocation. Specifies the event that will be raised when the setup is matched. The expression that represents an event attach or detach action. The function that will build the to pass when raising the event. The type of the first argument received by the expected invocation. The type of the second argument received by the expected invocation. The type of the third argument received by the expected invocation. The type of the fourth argument received by the expected invocation. The type of the fifth argument received by the expected invocation. The type of the sixth argument received by the expected invocation. The type of the seventh argument received by the expected invocation. The type of the eighth argument received by the expected invocation. Specifies the event that will be raised when the setup is matched. The expression that represents an event attach or detach action. The function that will build the to pass when raising the event. The type of the first argument received by the expected invocation. The type of the second argument received by the expected invocation. The type of the third argument received by the expected invocation. The type of the fourth argument received by the expected invocation. The type of the fifth argument received by the expected invocation. The type of the sixth argument received by the expected invocation. The type of the seventh argument received by the expected invocation. The type of the eighth argument received by the expected invocation. The type of the nineth argument received by the expected invocation. Specifies the event that will be raised when the setup is matched. The expression that represents an event attach or detach action. The function that will build the to pass when raising the event. The type of the first argument received by the expected invocation. The type of the second argument received by the expected invocation. The type of the third argument received by the expected invocation. The type of the fourth argument received by the expected invocation. The type of the fifth argument received by the expected invocation. The type of the sixth argument received by the expected invocation. The type of the seventh argument received by the expected invocation. The type of the eighth argument received by the expected invocation. The type of the nineth argument received by the expected invocation. The type of the tenth argument received by the expected invocation. Specifies the event that will be raised when the setup is matched. The expression that represents an event attach or detach action. The function that will build the to pass when raising the event. The type of the first argument received by the expected invocation. The type of the second argument received by the expected invocation. The type of the third argument received by the expected invocation. The type of the fourth argument received by the expected invocation. The type of the fifth argument received by the expected invocation. The type of the sixth argument received by the expected invocation. The type of the seventh argument received by the expected invocation. The type of the eighth argument received by the expected invocation. The type of the nineth argument received by the expected invocation. The type of the tenth argument received by the expected invocation. The type of the eleventh argument received by the expected invocation. Specifies the event that will be raised when the setup is matched. The expression that represents an event attach or detach action. The function that will build the to pass when raising the event. The type of the first argument received by the expected invocation. The type of the second argument received by the expected invocation. The type of the third argument received by the expected invocation. The type of the fourth argument received by the expected invocation. The type of the fifth argument received by the expected invocation. The type of the sixth argument received by the expected invocation. The type of the seventh argument received by the expected invocation. The type of the eighth argument received by the expected invocation. The type of the nineth argument received by the expected invocation. The type of the tenth argument received by the expected invocation. The type of the eleventh argument received by the expected invocation. The type of the twelfth argument received by the expected invocation. Specifies the event that will be raised when the setup is matched. The expression that represents an event attach or detach action. The function that will build the to pass when raising the event. The type of the first argument received by the expected invocation. The type of the second argument received by the expected invocation. The type of the third argument received by the expected invocation. The type of the fourth argument received by the expected invocation. The type of the fifth argument received by the expected invocation. The type of the sixth argument received by the expected invocation. The type of the seventh argument received by the expected invocation. The type of the eighth argument received by the expected invocation. The type of the nineth argument received by the expected invocation. The type of the tenth argument received by the expected invocation. The type of the eleventh argument received by the expected invocation. The type of the twelfth argument received by the expected invocation. The type of the thirteenth argument received by the expected invocation. Specifies the event that will be raised when the setup is matched. The expression that represents an event attach or detach action. The function that will build the to pass when raising the event. The type of the first argument received by the expected invocation. The type of the second argument received by the expected invocation. The type of the third argument received by the expected invocation. The type of the fourth argument received by the expected invocation. The type of the fifth argument received by the expected invocation. The type of the sixth argument received by the expected invocation. The type of the seventh argument received by the expected invocation. The type of the eighth argument received by the expected invocation. The type of the nineth argument received by the expected invocation. The type of the tenth argument received by the expected invocation. The type of the eleventh argument received by the expected invocation. The type of the twelfth argument received by the expected invocation. The type of the thirteenth argument received by the expected invocation. The type of the fourteenth argument received by the expected invocation. Specifies the event that will be raised when the setup is matched. The expression that represents an event attach or detach action. The function that will build the to pass when raising the event. The type of the first argument received by the expected invocation. The type of the second argument received by the expected invocation. The type of the third argument received by the expected invocation. The type of the fourth argument received by the expected invocation. The type of the fifth argument received by the expected invocation. The type of the sixth argument received by the expected invocation. The type of the seventh argument received by the expected invocation. The type of the eighth argument received by the expected invocation. The type of the nineth argument received by the expected invocation. The type of the tenth argument received by the expected invocation. The type of the eleventh argument received by the expected invocation. The type of the twelfth argument received by the expected invocation. The type of the thirteenth argument received by the expected invocation. The type of the fourteenth argument received by the expected invocation. The type of the fifteenth argument received by the expected invocation. Specifies the event that will be raised when the setup is matched. The expression that represents an event attach or detach action. The function that will build the to pass when raising the event. The type of the first argument received by the expected invocation. The type of the second argument received by the expected invocation. The type of the third argument received by the expected invocation. The type of the fourth argument received by the expected invocation. The type of the fifth argument received by the expected invocation. The type of the sixth argument received by the expected invocation. The type of the seventh argument received by the expected invocation. The type of the eighth argument received by the expected invocation. The type of the nineth argument received by the expected invocation. The type of the tenth argument received by the expected invocation. The type of the eleventh argument received by the expected invocation. The type of the twelfth argument received by the expected invocation. The type of the thirteenth argument received by the expected invocation. The type of the fourteenth argument received by the expected invocation. The type of the fifteenth argument received by the expected invocation. The type of the sixteenth argument received by the expected invocation. Defines the Returns verb. Mocked type. Type of the return value from the expression. Specifies the value to return. The value to return, or . Return a true value from the method call: mock.Setup(x => x.Execute("ping")) .Returns(true); Specifies a function that will calculate the value to return from the method. The function that will calculate the return value. Return a calculated value when the method is called: mock.Setup(x => x.Execute("ping")) .Returns(() => returnValues[0]); The lambda expression to retrieve the return value is lazy-executed, meaning that its value may change depending on the moment the method is executed and the value the returnValues array has at that moment. Specifies a function that will calculate the value to return from the method, retrieving the arguments for the invocation. The type of the argument of the invoked method. The function that will calculate the return value. Return a calculated value which is evaluated lazily at the time of the invocation. The lookup list can change between invocations and the setup will return different values accordingly. Also, notice how the specific string argument is retrieved by simply declaring it as part of the lambda expression: mock.Setup(x => x.Execute(It.IsAny<string>())) .Returns((string command) => returnValues[command]); Calls the real method of the object and returns its return value. The value calculated by the real method of the object. Specifies a function that will calculate the value to return from the method, retrieving the arguments for the invocation. The type of the first argument of the invoked method. The type of the second argument of the invoked method. The function that will calculate the return value. Returns a calculated value which is evaluated lazily at the time of the invocation. The return value is calculated from the value of the actual method invocation arguments. Notice how the arguments are retrieved by simply declaring them as part of the lambda expression: mock.Setup(x => x.Execute( It.IsAny<int>(), It.IsAny<int>())) .Returns((string arg1, string arg2) => arg1 + arg2); Specifies a function that will calculate the value to return from the method, retrieving the arguments for the invocation. The type of the first argument of the invoked method. The type of the second argument of the invoked method. The type of the third argument of the invoked method. The function that will calculate the return value. Returns a calculated value which is evaluated lazily at the time of the invocation. The return value is calculated from the value of the actual method invocation arguments. Notice how the arguments are retrieved by simply declaring them as part of the lambda expression: mock.Setup(x => x.Execute( It.IsAny<int>(), It.IsAny<int>(), It.IsAny<int>())) .Returns((string arg1, string arg2, string arg3) => arg1 + arg2 + arg3); Specifies a function that will calculate the value to return from the method, retrieving the arguments for the invocation. The type of the first argument of the invoked method. The type of the second argument of the invoked method. The type of the third argument of the invoked method. The type of the fourth argument of the invoked method. The function that will calculate the return value. Returns a calculated value which is evaluated lazily at the time of the invocation. The return value is calculated from the value of the actual method invocation arguments. Notice how the arguments are retrieved by simply declaring them as part of the lambda expression: mock.Setup(x => x.Execute( It.IsAny<int>(), It.IsAny<int>(), It.IsAny<int>(), It.IsAny<int>())) .Returns((string arg1, string arg2, string arg3, string arg4) => arg1 + arg2 + arg3 + arg4); Specifies a function that will calculate the value to return from the method, retrieving the arguments for the invocation. The type of the first argument of the invoked method. The type of the second argument of the invoked method. The type of the third argument of the invoked method. The type of the fourth argument of the invoked method. The type of the fifth argument of the invoked method. The function that will calculate the return value. Returns a calculated value which is evaluated lazily at the time of the invocation. The return value is calculated from the value of the actual method invocation arguments. Notice how the arguments are retrieved by simply declaring them as part of the lambda expression: mock.Setup(x => x.Execute( It.IsAny<int>(), It.IsAny<int>(), It.IsAny<int>(), It.IsAny<int>(), It.IsAny<int>())) .Returns((string arg1, string arg2, string arg3, string arg4, string arg5) => arg1 + arg2 + arg3 + arg4 + arg5); Specifies a function that will calculate the value to return from the method, retrieving the arguments for the invocation. The type of the first argument of the invoked method. The type of the second argument of the invoked method. The type of the third argument of the invoked method. The type of the fourth argument of the invoked method. The type of the fifth argument of the invoked method. The type of the sixth argument of the invoked method. The function that will calculate the return value. Returns a calculated value which is evaluated lazily at the time of the invocation. The return value is calculated from the value of the actual method invocation arguments. Notice how the arguments are retrieved by simply declaring them as part of the lambda expression: mock.Setup(x => x.Execute( It.IsAny<int>(), It.IsAny<int>(), It.IsAny<int>(), It.IsAny<int>(), It.IsAny<int>(), It.IsAny<int>())) .Returns((string arg1, string arg2, string arg3, string arg4, string arg5, string arg6) => arg1 + arg2 + arg3 + arg4 + arg5 + arg6); Specifies a function that will calculate the value to return from the method, retrieving the arguments for the invocation. The type of the first argument of the invoked method. The type of the second argument of the invoked method. The type of the third argument of the invoked method. The type of the fourth argument of the invoked method. The type of the fifth argument of the invoked method. The type of the sixth argument of the invoked method. The type of the seventh argument of the invoked method. The function that will calculate the return value. Returns a calculated value which is evaluated lazily at the time of the invocation. The return value is calculated from the value of the actual method invocation arguments. Notice how the arguments are retrieved by simply declaring them as part of the lambda expression: mock.Setup(x => x.Execute( It.IsAny<int>(), It.IsAny<int>(), It.IsAny<int>(), It.IsAny<int>(), It.IsAny<int>(), It.IsAny<int>(), It.IsAny<int>())) .Returns((string arg1, string arg2, string arg3, string arg4, string arg5, string arg6, string arg7) => arg1 + arg2 + arg3 + arg4 + arg5 + arg6 + arg7); Specifies a function that will calculate the value to return from the method, retrieving the arguments for the invocation. The type of the first argument of the invoked method. The type of the second argument of the invoked method. The type of the third argument of the invoked method. The type of the fourth argument of the invoked method. The type of the fifth argument of the invoked method. The type of the sixth argument of the invoked method. The type of the seventh argument of the invoked method. The type of the eighth argument of the invoked method. The function that will calculate the return value. Returns a calculated value which is evaluated lazily at the time of the invocation. The return value is calculated from the value of the actual method invocation arguments. Notice how the arguments are retrieved by simply declaring them as part of the lambda expression: mock.Setup(x => x.Execute( It.IsAny<int>(), It.IsAny<int>(), It.IsAny<int>(), It.IsAny<int>(), It.IsAny<int>(), It.IsAny<int>(), It.IsAny<int>(), It.IsAny<int>())) .Returns((string arg1, string arg2, string arg3, string arg4, string arg5, string arg6, string arg7, string arg8) => arg1 + arg2 + arg3 + arg4 + arg5 + arg6 + arg7 + arg8); Specifies a function that will calculate the value to return from the method, retrieving the arguments for the invocation. The type of the first argument of the invoked method. The type of the second argument of the invoked method. The type of the third argument of the invoked method. The type of the fourth argument of the invoked method. The type of the fifth argument of the invoked method. The type of the sixth argument of the invoked method. The type of the seventh argument of the invoked method. The type of the eighth argument of the invoked method. The type of the nineth argument of the invoked method. The function that will calculate the return value. Returns a calculated value which is evaluated lazily at the time of the invocation. The return value is calculated from the value of the actual method invocation arguments. Notice how the arguments are retrieved by simply declaring them as part of the lambda expression: mock.Setup(x => x.Execute( It.IsAny<int>(), It.IsAny<int>(), It.IsAny<int>(), It.IsAny<int>(), It.IsAny<int>(), It.IsAny<int>(), It.IsAny<int>(), It.IsAny<int>(), It.IsAny<int>())) .Returns((string arg1, string arg2, string arg3, string arg4, string arg5, string arg6, string arg7, string arg8, string arg9) => arg1 + arg2 + arg3 + arg4 + arg5 + arg6 + arg7 + arg8 + arg9); Specifies a function that will calculate the value to return from the method, retrieving the arguments for the invocation. The type of the first argument of the invoked method. The type of the second argument of the invoked method. The type of the third argument of the invoked method. The type of the fourth argument of the invoked method. The type of the fifth argument of the invoked method. The type of the sixth argument of the invoked method. The type of the seventh argument of the invoked method. The type of the eighth argument of the invoked method. The type of the nineth argument of the invoked method. The type of the tenth argument of the invoked method. The function that will calculate the return value. Returns a calculated value which is evaluated lazily at the time of the invocation. The return value is calculated from the value of the actual method invocation arguments. Notice how the arguments are retrieved by simply declaring them as part of the lambda expression: mock.Setup(x => x.Execute( It.IsAny<int>(), It.IsAny<int>(), It.IsAny<int>(), It.IsAny<int>(), It.IsAny<int>(), It.IsAny<int>(), It.IsAny<int>(), It.IsAny<int>(), It.IsAny<int>(), It.IsAny<int>())) .Returns((string arg1, string arg2, string arg3, string arg4, string arg5, string arg6, string arg7, string arg8, string arg9, string arg10) => arg1 + arg2 + arg3 + arg4 + arg5 + arg6 + arg7 + arg8 + arg9 + arg10); Specifies a function that will calculate the value to return from the method, retrieving the arguments for the invocation. The type of the first argument of the invoked method. The type of the second argument of the invoked method. The type of the third argument of the invoked method. The type of the fourth argument of the invoked method. The type of the fifth argument of the invoked method. The type of the sixth argument of the invoked method. The type of the seventh argument of the invoked method. The type of the eighth argument of the invoked method. The type of the nineth argument of the invoked method. The type of the tenth argument of the invoked method. The type of the eleventh argument of the invoked method. The function that will calculate the return value. Returns a calculated value which is evaluated lazily at the time of the invocation. The return value is calculated from the value of the actual method invocation arguments. Notice how the arguments are retrieved by simply declaring them as part of the lambda expression: mock.Setup(x => x.Execute( It.IsAny<int>(), It.IsAny<int>(), It.IsAny<int>(), It.IsAny<int>(), It.IsAny<int>(), It.IsAny<int>(), It.IsAny<int>(), It.IsAny<int>(), It.IsAny<int>(), It.IsAny<int>(), It.IsAny<int>())) .Returns((string arg1, string arg2, string arg3, string arg4, string arg5, string arg6, string arg7, string arg8, string arg9, string arg10, string arg11) => arg1 + arg2 + arg3 + arg4 + arg5 + arg6 + arg7 + arg8 + arg9 + arg10 + arg11); Specifies a function that will calculate the value to return from the method, retrieving the arguments for the invocation. The type of the first argument of the invoked method. The type of the second argument of the invoked method. The type of the third argument of the invoked method. The type of the fourth argument of the invoked method. The type of the fifth argument of the invoked method. The type of the sixth argument of the invoked method. The type of the seventh argument of the invoked method. The type of the eighth argument of the invoked method. The type of the nineth argument of the invoked method. The type of the tenth argument of the invoked method. The type of the eleventh argument of the invoked method. The type of the twelfth argument of the invoked method. The function that will calculate the return value. Returns a calculated value which is evaluated lazily at the time of the invocation. The return value is calculated from the value of the actual method invocation arguments. Notice how the arguments are retrieved by simply declaring them as part of the lambda expression: mock.Setup(x => x.Execute( It.IsAny<int>(), It.IsAny<int>(), It.IsAny<int>(), It.IsAny<int>(), It.IsAny<int>(), It.IsAny<int>(), It.IsAny<int>(), It.IsAny<int>(), It.IsAny<int>(), It.IsAny<int>(), It.IsAny<int>(), It.IsAny<int>())) .Returns((string arg1, string arg2, string arg3, string arg4, string arg5, string arg6, string arg7, string arg8, string arg9, string arg10, string arg11, string arg12) => arg1 + arg2 + arg3 + arg4 + arg5 + arg6 + arg7 + arg8 + arg9 + arg10 + arg11 + arg12); Specifies a function that will calculate the value to return from the method, retrieving the arguments for the invocation. The type of the first argument of the invoked method. The type of the second argument of the invoked method. The type of the third argument of the invoked method. The type of the fourth argument of the invoked method. The type of the fifth argument of the invoked method. The type of the sixth argument of the invoked method. The type of the seventh argument of the invoked method. The type of the eighth argument of the invoked method. The type of the nineth argument of the invoked method. The type of the tenth argument of the invoked method. The type of the eleventh argument of the invoked method. The type of the twelfth argument of the invoked method. The type of the thirteenth argument of the invoked method. The function that will calculate the return value. Returns a calculated value which is evaluated lazily at the time of the invocation. The return value is calculated from the value of the actual method invocation arguments. Notice how the arguments are retrieved by simply declaring them as part of the lambda expression: mock.Setup(x => x.Execute( It.IsAny<int>(), It.IsAny<int>(), It.IsAny<int>(), It.IsAny<int>(), It.IsAny<int>(), It.IsAny<int>(), It.IsAny<int>(), It.IsAny<int>(), It.IsAny<int>(), It.IsAny<int>(), It.IsAny<int>(), It.IsAny<int>(), It.IsAny<int>())) .Returns((string arg1, string arg2, string arg3, string arg4, string arg5, string arg6, string arg7, string arg8, string arg9, string arg10, string arg11, string arg12, string arg13) => arg1 + arg2 + arg3 + arg4 + arg5 + arg6 + arg7 + arg8 + arg9 + arg10 + arg11 + arg12 + arg13); Specifies a function that will calculate the value to return from the method, retrieving the arguments for the invocation. The type of the first argument of the invoked method. The type of the second argument of the invoked method. The type of the third argument of the invoked method. The type of the fourth argument of the invoked method. The type of the fifth argument of the invoked method. The type of the sixth argument of the invoked method. The type of the seventh argument of the invoked method. The type of the eighth argument of the invoked method. The type of the nineth argument of the invoked method. The type of the tenth argument of the invoked method. The type of the eleventh argument of the invoked method. The type of the twelfth argument of the invoked method. The type of the thirteenth argument of the invoked method. The type of the fourteenth argument of the invoked method. The function that will calculate the return value. Returns a calculated value which is evaluated lazily at the time of the invocation. The return value is calculated from the value of the actual method invocation arguments. Notice how the arguments are retrieved by simply declaring them as part of the lambda expression: mock.Setup(x => x.Execute( It.IsAny<int>(), It.IsAny<int>(), It.IsAny<int>(), It.IsAny<int>(), It.IsAny<int>(), It.IsAny<int>(), It.IsAny<int>(), It.IsAny<int>(), It.IsAny<int>(), It.IsAny<int>(), It.IsAny<int>(), It.IsAny<int>(), It.IsAny<int>(), It.IsAny<int>())) .Returns((string arg1, string arg2, string arg3, string arg4, string arg5, string arg6, string arg7, string arg8, string arg9, string arg10, string arg11, string arg12, string arg13, string arg14) => arg1 + arg2 + arg3 + arg4 + arg5 + arg6 + arg7 + arg8 + arg9 + arg10 + arg11 + arg12 + arg13 + arg14); Specifies a function that will calculate the value to return from the method, retrieving the arguments for the invocation. The type of the first argument of the invoked method. The type of the second argument of the invoked method. The type of the third argument of the invoked method. The type of the fourth argument of the invoked method. The type of the fifth argument of the invoked method. The type of the sixth argument of the invoked method. The type of the seventh argument of the invoked method. The type of the eighth argument of the invoked method. The type of the nineth argument of the invoked method. The type of the tenth argument of the invoked method. The type of the eleventh argument of the invoked method. The type of the twelfth argument of the invoked method. The type of the thirteenth argument of the invoked method. The type of the fourteenth argument of the invoked method. The type of the fifteenth argument of the invoked method. The function that will calculate the return value. Returns a calculated value which is evaluated lazily at the time of the invocation. The return value is calculated from the value of the actual method invocation arguments. Notice how the arguments are retrieved by simply declaring them as part of the lambda expression: mock.Setup(x => x.Execute( It.IsAny<int>(), It.IsAny<int>(), It.IsAny<int>(), It.IsAny<int>(), It.IsAny<int>(), It.IsAny<int>(), It.IsAny<int>(), It.IsAny<int>(), It.IsAny<int>(), It.IsAny<int>(), It.IsAny<int>(), It.IsAny<int>(), It.IsAny<int>(), It.IsAny<int>(), It.IsAny<int>())) .Returns((string arg1, string arg2, string arg3, string arg4, string arg5, string arg6, string arg7, string arg8, string arg9, string arg10, string arg11, string arg12, string arg13, string arg14, string arg15) => arg1 + arg2 + arg3 + arg4 + arg5 + arg6 + arg7 + arg8 + arg9 + arg10 + arg11 + arg12 + arg13 + arg14 + arg15); Specifies a function that will calculate the value to return from the method, retrieving the arguments for the invocation. The type of the first argument of the invoked method. The type of the second argument of the invoked method. The type of the third argument of the invoked method. The type of the fourth argument of the invoked method. The type of the fifth argument of the invoked method. The type of the sixth argument of the invoked method. The type of the seventh argument of the invoked method. The type of the eighth argument of the invoked method. The type of the nineth argument of the invoked method. The type of the tenth argument of the invoked method. The type of the eleventh argument of the invoked method. The type of the twelfth argument of the invoked method. The type of the thirteenth argument of the invoked method. The type of the fourteenth argument of the invoked method. The type of the fifteenth argument of the invoked method. The type of the sixteenth argument of the invoked method. The function that will calculate the return value. Returns a calculated value which is evaluated lazily at the time of the invocation. The return value is calculated from the value of the actual method invocation arguments. Notice how the arguments are retrieved by simply declaring them as part of the lambda expression: mock.Setup(x => x.Execute( It.IsAny<int>(), It.IsAny<int>(), It.IsAny<int>(), It.IsAny<int>(), It.IsAny<int>(), It.IsAny<int>(), It.IsAny<int>(), It.IsAny<int>(), It.IsAny<int>(), It.IsAny<int>(), It.IsAny<int>(), It.IsAny<int>(), It.IsAny<int>(), It.IsAny<int>(), It.IsAny<int>(), It.IsAny<int>())) .Returns((string arg1, string arg2, string arg3, string arg4, string arg5, string arg6, string arg7, string arg8, string arg9, string arg10, string arg11, string arg12, string arg13, string arg14, string arg15, string arg16) => arg1 + arg2 + arg3 + arg4 + arg5 + arg6 + arg7 + arg8 + arg9 + arg10 + arg11 + arg12 + arg13 + arg14 + arg15 + arg16); Hook used to tells Castle which methods to proxy in mocked classes. Here we proxy the default methods Castle suggests (everything Object's methods) plus Object.ToString(), so we can give mocks useful default names. This is required to allow Moq to mock ToString on proxy *class* implementations. Extends AllMethodsHook.ShouldInterceptMethod to also intercept Object.ToString(). The base class used for all our interface-inheriting proxies, which overrides the default Object.ToString() behavior, to route it via the mock by default, unless overriden by a real implementation. This is required to allow Moq to mock ToString on proxy *interface* implementations. This is internal to Moq and should not be generally used. Unfortunately it must be public, due to cross-assembly visibility issues with reflection, see github.com/Moq/moq4/issues/98 for details. Overrides the default ToString implementation to instead find the mock for this mock.Object, and return MockName + '.Object' as the mocked object's ToString, to make it easy to relate mocks and mock object instances in error messages. Defines async extension methods on IReturns. Allows to specify the return value of an asynchronous method. Allows to specify the exception thrown by an asynchronous method. Language for ReturnSequence Returns value Throws an exception Throws an exception Calls original method The first method call or member access will be the last segment of the expression (depth-first traversal), which is the one we have to Setup rather than FluentMock. And the last one is the one we have to Mock.Get rather than FluentMock. Base class for mocks and static helper class with methods that apply to mocked objects, such as to retrieve a from an object instance. Creates an mock object of the indicated type. The type of the mocked object. The mocked object created. Creates an mock object of the indicated type. The predicate with the specification of how the mocked object should behave. The type of the mocked object. The mocked object created. Initializes a new instance of the class. Retrieves the mock object for the given object instance. Type of the mock to retrieve. Can be omitted as it's inferred from the object instance passed in as the instance. The instance of the mocked object.The mock associated with the mocked object. The received instance was not created by Moq. The following example shows how to add a new setup to an object instance which is not the original but rather the object associated with it: // Typed instance, not the mock, is retrieved from some test API. HttpContextBase context = GetMockContext(); // context.Request is the typed object from the "real" API // so in order to add a setup to it, we need to get // the mock that "owns" it Mock<HttpRequestBase> request = Mock.Get(context.Request); mock.Setup(req => req.AppRelativeCurrentExecutionFilePath) .Returns(tempUrl); Returns the mocked object value. Verifies that all verifiable expectations have been met. This example sets up an expectation and marks it as verifiable. After the mock is used, a Verify() call is issued on the mock to ensure the method in the setup was invoked: var mock = new Mock<IWarehouse>(); this.Setup(x => x.HasInventory(TALISKER, 50)).Verifiable().Returns(true); ... // other test code ... // Will throw if the test code has didn't call HasInventory. this.Verify(); Not all verifiable expectations were met. Verifies all expectations regardless of whether they have been flagged as verifiable. This example sets up an expectation without marking it as verifiable. After the mock is used, a call is issued on the mock to ensure that all expectations are met: var mock = new Mock<IWarehouse>(); this.Setup(x => x.HasInventory(TALISKER, 50)).Returns(true); ... // other test code ... // Will throw if the test code has didn't call HasInventory, even // that expectation was not marked as verifiable. this.VerifyAll(); At least one expectation was not met. Gets the interceptor target for the given expression and root mock, building the intermediate hierarchy of mock objects if necessary. Raises the associated event with the given event argument data. Raises the associated event with the given event argument data. Adds an interface implementation to the mock, allowing setups to be specified for it. This method can only be called before the first use of the mock property, at which point the runtime type has already been generated and no more interfaces can be added to it. Also, must be an interface and not a class, which must be specified when creating the mock instead. The mock type has already been generated by accessing the property. The specified is not an interface. The following example creates a mock for the main interface and later adds to it to verify it's called by the consumer code: var mock = new Mock<IProcessor>(); mock.Setup(x => x.Execute("ping")); // add IDisposable interface var disposable = mock.As<IDisposable>(); disposable.Setup(d => d.Dispose()).Verifiable(); Type of interface to cast the mock to. Behavior of the mock, according to the value set in the constructor. Whether the base member virtual implementation will be called for mocked classes if no setup is matched. Defaults to . Specifies the behavior to use when returning default values for unexpected invocations on loose mocks. Gets the mocked object instance. Retrieves the type of the mocked object, its generic type argument. This is used in the auto-mocking of hierarchy access. If this is a mock of a delegate, this property contains the method on the autogenerated interface so that we can convert setup + verify expressions on the delegate into expressions on the interface proxy. Allows to check whether expression conversion to the must be performed on the mock, without causing unnecessarily early initialization of the mock instance, which breaks As{T}. Specifies the class that will determine the default value to return when invocations are made that have no setups and need to return a default value (for loose mocks). Exposes the list of extra interfaces implemented by the mock. Utility repository class to use to construct multiple mocks when consistent verification is desired for all of them. If multiple mocks will be created during a test, passing the desired (if different than the or the one passed to the repository constructor) and later verifying each mock can become repetitive and tedious. This repository class helps in that scenario by providing a simplified creation of multiple mocks with a default (unless overriden by calling ) and posterior verification. The following is a straightforward example on how to create and automatically verify strict mocks using a : var repository = new MockRepository(MockBehavior.Strict); var foo = repository.Create<IFoo>(); var bar = repository.Create<IBar>(); // no need to call Verifiable() on the setup // as we'll be validating all of them anyway. foo.Setup(f => f.Do()); bar.Setup(b => b.Redo()); // exercise the mocks here repository.VerifyAll(); // At this point all setups are already checked // and an optional MockException might be thrown. // Note also that because the mocks are strict, any invocation // that doesn't have a matching setup will also throw a MockException. The following examples shows how to setup the repository to create loose mocks and later verify only verifiable setups: var repository = new MockRepository(MockBehavior.Loose); var foo = repository.Create<IFoo>(); var bar = repository.Create<IBar>(); // this setup will be verified when we verify the repository foo.Setup(f => f.Do()).Verifiable(); // this setup will NOT be verified foo.Setup(f => f.Calculate()); // this setup will be verified when we verify the repository bar.Setup(b => b.Redo()).Verifiable(); // exercise the mocks here // note that because the mocks are Loose, members // called in the interfaces for which no matching // setups exist will NOT throw exceptions, // and will rather return default values. repository.Verify(); // At this point verifiable setups are already checked // and an optional MockException might be thrown. The following examples shows how to setup the repository with a default strict behavior, overriding that default for a specific mock: var repository = new MockRepository(MockBehavior.Strict); // this particular one we want loose var foo = repository.Create<IFoo>(MockBehavior.Loose); var bar = repository.Create<IBar>(); // specify setups // exercise the mocks here repository.Verify(); Utility factory class to use to construct multiple mocks when consistent verification is desired for all of them. If multiple mocks will be created during a test, passing the desired (if different than the or the one passed to the factory constructor) and later verifying each mock can become repetitive and tedious. This factory class helps in that scenario by providing a simplified creation of multiple mocks with a default (unless overriden by calling ) and posterior verification. The following is a straightforward example on how to create and automatically verify strict mocks using a : var factory = new MockFactory(MockBehavior.Strict); var foo = factory.Create<IFoo>(); var bar = factory.Create<IBar>(); // no need to call Verifiable() on the setup // as we'll be validating all of them anyway. foo.Setup(f => f.Do()); bar.Setup(b => b.Redo()); // exercise the mocks here factory.VerifyAll(); // At this point all setups are already checked // and an optional MockException might be thrown. // Note also that because the mocks are strict, any invocation // that doesn't have a matching setup will also throw a MockException. The following examples shows how to setup the factory to create loose mocks and later verify only verifiable setups: var factory = new MockFactory(MockBehavior.Loose); var foo = factory.Create<IFoo>(); var bar = factory.Create<IBar>(); // this setup will be verified when we verify the factory foo.Setup(f => f.Do()).Verifiable(); // this setup will NOT be verified foo.Setup(f => f.Calculate()); // this setup will be verified when we verify the factory bar.Setup(b => b.Redo()).Verifiable(); // exercise the mocks here // note that because the mocks are Loose, members // called in the interfaces for which no matching // setups exist will NOT throw exceptions, // and will rather return default values. factory.Verify(); // At this point verifiable setups are already checked // and an optional MockException might be thrown. The following examples shows how to setup the factory with a default strict behavior, overriding that default for a specific mock: var factory = new MockFactory(MockBehavior.Strict); // this particular one we want loose var foo = factory.Create<IFoo>(MockBehavior.Loose); var bar = factory.Create<IBar>(); // specify setups // exercise the mocks here factory.Verify(); Initializes the factory with the given for newly created mocks from the factory. The behavior to use for mocks created using the factory method if not overriden by using the overload. Creates a new mock with the default specified at factory construction time. Type to mock. A new . var factory = new MockFactory(MockBehavior.Strict); var foo = factory.Create<IFoo>(); // use mock on tests factory.VerifyAll(); Creates a new mock with the default specified at factory construction time and with the the given constructor arguments for the class. The mock will try to find the best match constructor given the constructor arguments, and invoke that to initialize the instance. This applies only to classes, not interfaces. Type to mock. Constructor arguments for mocked classes. A new . var factory = new MockFactory(MockBehavior.Default); var mock = factory.Create<MyBase>("Foo", 25, true); // use mock on tests factory.Verify(); Creates a new mock with the given . Type to mock. Behavior to use for the mock, which overrides the default behavior specified at factory construction time. A new . The following example shows how to create a mock with a different behavior to that specified as the default for the factory: var factory = new MockFactory(MockBehavior.Strict); var foo = factory.Create<IFoo>(MockBehavior.Loose); Creates a new mock with the given and with the the given constructor arguments for the class. The mock will try to find the best match constructor given the constructor arguments, and invoke that to initialize the instance. This applies only to classes, not interfaces. Type to mock. Behavior to use for the mock, which overrides the default behavior specified at factory construction time. Constructor arguments for mocked classes. A new . The following example shows how to create a mock with a different behavior to that specified as the default for the factory, passing constructor arguments: var factory = new MockFactory(MockBehavior.Default); var mock = factory.Create<MyBase>(MockBehavior.Strict, "Foo", 25, true); Implements creation of a new mock within the factory. Type to mock. The behavior for the new mock. Optional arguments for the construction of the mock. Verifies all verifiable expectations on all mocks created by this factory. One or more mocks had expectations that were not satisfied. Verifies all verifiable expectations on all mocks created by this factory. One or more mocks had expectations that were not satisfied. Invokes for each mock in , and accumulates the resulting that might be thrown from the action. The action to execute against each mock. Whether the base member virtual implementation will be called for mocked classes if no setup is matched. Defaults to . Specifies the behavior to use when returning default values for unexpected invocations on loose mocks. Gets the mocks that have been created by this factory and that will get verified together. Access the universe of mocks of the given type, to retrieve those that behave according to the LINQ query specification. The type of the mocked object to query. Access the universe of mocks of the given type, to retrieve those that behave according to the LINQ query specification. The predicate with the setup expressions. The type of the mocked object to query. Creates an mock object of the indicated type. The type of the mocked object. The mocked object created. Creates an mock object of the indicated type. The predicate with the setup expressions. The type of the mocked object. The mocked object created. Creates the mock query with the underlying queriable implementation. Wraps the enumerator inside a queryable. Method that is turned into the actual call from .Query{T}, to transform the queryable query into a normal enumerable query. This method is never used directly by consumers. Initializes the repository with the given for newly created mocks from the repository. The behavior to use for mocks created using the repository method if not overriden by using the overload. A that returns an empty default value for invocations that do not have setups or return values, with loose mocks. This is the default behavior for a mock. Interface to be implemented by classes that determine the default value of non-expected invocations. Defines the default value to return in all the methods returning . The type of the return value.The value to set as default. Provides a value for the given member and arguments. The member to provide a default value for. The intention of is to create a more readable string representation for the failure message. Implements the fluent API. Defines the Throws verb. Specifies the exception to throw when the method is invoked. Exception instance to throw. This example shows how to throw an exception when the method is invoked with an empty string argument: mock.Setup(x => x.Execute("")) .Throws(new ArgumentException()); Specifies the type of exception to throw when the method is invoked. Type of exception to instantiate and throw when the setup is matched. This example shows how to throw an exception when the method is invoked with an empty string argument: mock.Setup(x => x.Execute("")) .Throws<ArgumentException>(); Implements the fluent API. Defines occurrence members to constraint setups. The expected invocation can happen at most once. var mock = new Mock<ICommand>(); mock.Setup(foo => foo.Execute("ping")) .AtMostOnce(); The expected invocation can happen at most specified number of times. The number of times to accept calls. var mock = new Mock<ICommand>(); mock.Setup(foo => foo.Execute("ping")) .AtMost( 5 ); Defines the Verifiable verb. Marks the expectation as verifiable, meaning that a call to will check if this particular expectation was met. The following example marks the expectation as verifiable: mock.Expect(x => x.Execute("ping")) .Returns(true) .Verifiable(); Marks the expectation as verifiable, meaning that a call to will check if this particular expectation was met, and specifies a message for failures. The following example marks the expectation as verifiable: mock.Expect(x => x.Execute("ping")) .Returns(true) .Verifiable("Ping should be executed always!"); Implements the fluent API. We need this non-generics base class so that we can use from generic code. Implements the fluent API. Implements the fluent API. Implements the fluent API. Defines the Callback verb for property getter setups. Mocked type. Type of the property. Specifies a callback to invoke when the property is retrieved. Callback method to invoke. Invokes the given callback with the property value being set. mock.SetupGet(x => x.Suspended) .Callback(() => called = true) .Returns(true); Implements the fluent API. Defines the Returns verb for property get setups. Mocked type. Type of the property. Specifies the value to return. The value to return, or . Return a true value from the property getter call: mock.SetupGet(x => x.Suspended) .Returns(true); Specifies a function that will calculate the value to return for the property. The function that will calculate the return value. Return a calculated value when the property is retrieved: mock.SetupGet(x => x.Suspended) .Returns(() => returnValues[0]); The lambda expression to retrieve the return value is lazy-executed, meaning that its value may change depending on the moment the property is retrieved and the value the returnValues array has at that moment. Calls the real property of the object and returns its return value. The value calculated by the real property of the object. Implements the fluent API. Provides additional methods on mocks. Those methods are useful for Testeroids support. Resets the calls previously made on the specified mock. The mock whose calls need to be reset. Helper class to setup a full trace between many mocks Initialize a trace setup Allow sequence to be repeated define nice api Perform an expectation in the trace. Marks a method as a matcher, which allows complete replacement of the built-in class with your own argument matching rules. This feature has been deprecated in favor of the new and simpler . The argument matching is used to determine whether a concrete invocation in the mock matches a given setup. This matching mechanism is fully extensible. There are two parts of a matcher: the compiler matcher and the runtime matcher. Compiler matcher Used to satisfy the compiler requirements for the argument. Needs to be a method optionally receiving any arguments you might need for the matching, but with a return type that matches that of the argument. Let's say I want to match a lists of orders that contains a particular one. I might create a compiler matcher like the following: public static class Orders { [Matcher] public static IEnumerable<Order> Contains(Order order) { return null; } } Now we can invoke this static method instead of an argument in an invocation: var order = new Order { ... }; var mock = new Mock<IRepository<Order>>(); mock.Setup(x => x.Save(Orders.Contains(order))) .Throws<ArgumentException>(); Note that the return value from the compiler matcher is irrelevant. This method will never be called, and is just used to satisfy the compiler and to signal Moq that this is not a method that we want to be invoked at runtime. Runtime matcher The runtime matcher is the one that will actually perform evaluation when the test is run, and is defined by convention to have the same signature as the compiler matcher, but where the return value is the first argument to the call, which contains the object received by the actual invocation at runtime: public static bool Contains(IEnumerable<Order> orders, Order order) { return orders.Contains(order); } At runtime, the mocked method will be invoked with a specific list of orders. This value will be passed to this runtime matcher as the first argument, while the second argument is the one specified in the setup (x.Save(Orders.Contains(order))). The boolean returned determines whether the given argument has been matched. If all arguments to the expected method are matched, then the setup matches and is evaluated. Using this extensible infrastructure, you can easily replace the entire set of matchers with your own. You can also avoid the typical (and annoying) lengthy expressions that result when you have multiple arguments that use generics. The following is the complete example explained above: public static class Orders { [Matcher] public static IEnumerable<Order> Contains(Order order) { return null; } public static bool Contains(IEnumerable<Order> orders, Order order) { return orders.Contains(order); } } And the concrete test using this matcher: var order = new Order { ... }; var mock = new Mock<IRepository<Order>>(); mock.Setup(x => x.Save(Orders.Contains(order))) .Throws<ArgumentException>(); // use mock, invoke Save, and have the matcher filter. Provides a mock implementation of . Any interface type can be used for mocking, but for classes, only abstract and virtual members can be mocked. The behavior of the mock with regards to the setups and the actual calls is determined by the optional that can be passed to the constructor. Type to mock, which can be an interface or a class. The following example shows establishing setups with specific values for method invocations: // Arrange var order = new Order(TALISKER, 50); var mock = new Mock<IWarehouse>(); mock.Setup(x => x.HasInventory(TALISKER, 50)).Returns(true); // Act order.Fill(mock.Object); // Assert Assert.True(order.IsFilled); The following example shows how to use the class to specify conditions for arguments instead of specific values: // Arrange var order = new Order(TALISKER, 50); var mock = new Mock<IWarehouse>(); // shows how to expect a value within a range mock.Setup(x => x.HasInventory( It.IsAny<string>(), It.IsInRange(0, 100, Range.Inclusive))) .Returns(false); // shows how to throw for unexpected calls. mock.Setup(x => x.Remove( It.IsAny<string>(), It.IsAny<int>())) .Throws(new InvalidOperationException()); // Act order.Fill(mock.Object); // Assert Assert.False(order.IsFilled); Obsolete. Obsolete. Obsolete. Obsolete. Obsolete. Ctor invoked by AsTInterface exclusively. Initializes an instance of the mock with default behavior. var mock = new Mock<IFormatProvider>(); Initializes an instance of the mock with default behavior and with the given constructor arguments for the class. (Only valid when is a class) The mock will try to find the best match constructor given the constructor arguments, and invoke that to initialize the instance. This applies only for classes, not interfaces. var mock = new Mock<MyProvider>(someArgument, 25); Optional constructor arguments if the mocked type is a class. Initializes an instance of the mock with the specified behavior. var mock = new Mock<IFormatProvider>(MockBehavior.Relaxed); Behavior of the mock. Initializes an instance of the mock with a specific behavior with the given constructor arguments for the class. The mock will try to find the best match constructor given the constructor arguments, and invoke that to initialize the instance. This applies only to classes, not interfaces. var mock = new Mock<MyProvider>(someArgument, 25); Behavior of the mock.Optional constructor arguments if the mocked type is a class. Returns the name of the mock Returns the mocked object value. Specifies a setup on the mocked type for a call to to a void method. If more than one setup is specified for the same method or property, the latest one wins and is the one that will be executed. Lambda expression that specifies the expected method invocation. var mock = new Mock<IProcessor>(); mock.Setup(x => x.Execute("ping")); Specifies a setup on the mocked type for a call to to a value returning method. Type of the return value. Typically omitted as it can be inferred from the expression. If more than one setup is specified for the same method or property, the latest one wins and is the one that will be executed. Lambda expression that specifies the method invocation. mock.Setup(x => x.HasInventory("Talisker", 50)).Returns(true); Specifies a setup on the mocked type for a call to to a property getter. If more than one setup is set for the same property getter, the latest one wins and is the one that will be executed. Type of the property. Typically omitted as it can be inferred from the expression.Lambda expression that specifies the property getter. mock.SetupGet(x => x.Suspended) .Returns(true); Specifies a setup on the mocked type for a call to to a property setter. If more than one setup is set for the same property setter, the latest one wins and is the one that will be executed. This overloads allows the use of a callback already typed for the property type. Type of the property. Typically omitted as it can be inferred from the expression.The Lambda expression that sets a property to a value. mock.SetupSet(x => x.Suspended = true); Specifies a setup on the mocked type for a call to to a property setter. If more than one setup is set for the same property setter, the latest one wins and is the one that will be executed. Lambda expression that sets a property to a value. mock.SetupSet(x => x.Suspended = true); Specifies that the given property should have "property behavior", meaning that setting its value will cause it to be saved and later returned when the property is requested. (this is also known as "stubbing"). Type of the property, inferred from the property expression (does not need to be specified). Property expression to stub. If you have an interface with an int property Value, you might stub it using the following straightforward call: var mock = new Mock<IHaveValue>(); mock.Stub(v => v.Value); After the Stub call has been issued, setting and retrieving the object value will behave as expected: IHaveValue v = mock.Object; v.Value = 5; Assert.Equal(5, v.Value); Specifies that the given property should have "property behavior", meaning that setting its value will cause it to be saved and later returned when the property is requested. This overload allows setting the initial value for the property. (this is also known as "stubbing"). Type of the property, inferred from the property expression (does not need to be specified). Property expression to stub.Initial value for the property. If you have an interface with an int property Value, you might stub it using the following straightforward call: var mock = new Mock<IHaveValue>(); mock.SetupProperty(v => v.Value, 5); After the SetupProperty call has been issued, setting and retrieving the object value will behave as expected: IHaveValue v = mock.Object; // Initial value was stored Assert.Equal(5, v.Value); // New value set which changes the initial value v.Value = 6; Assert.Equal(6, v.Value); Specifies that the all properties on the mock should have "property behavior", meaning that setting its value will cause it to be saved and later returned when the property is requested. (this is also known as "stubbing"). The default value for each property will be the one generated as specified by the property for the mock. If the mock is set to , the mocked default values will also get all properties setup recursively. Verifies that a specific invocation matching the given expression was performed on the mock. Use in conjuntion with the default . This example assumes that the mock has been used, and later we want to verify that a given invocation with specific parameters was performed: var mock = new Mock<IProcessor>(); // exercise mock //... // Will throw if the test code didn't call Execute with a "ping" string argument. mock.Verify(proc => proc.Execute("ping")); The invocation was not performed on the mock.Expression to verify. Verifies that a specific invocation matching the given expression was performed on the mock. Use in conjuntion with the default . The invocation was not call the times specified by . Expression to verify.The number of times a method is allowed to be called. Verifies that a specific invocation matching the given expression was performed on the mock. Use in conjuntion with the default . The invocation was not call the times specified by . Expression to verify.The number of times a method is allowed to be called. Verifies that a specific invocation matching the given expression was performed on the mock, specifying a failure error message. Use in conjuntion with the default . This example assumes that the mock has been used, and later we want to verify that a given invocation with specific parameters was performed: var mock = new Mock<IProcessor>(); // exercise mock //... // Will throw if the test code didn't call Execute with a "ping" string argument. mock.Verify(proc => proc.Execute("ping")); The invocation was not performed on the mock.Expression to verify.Message to show if verification fails. Verifies that a specific invocation matching the given expression was performed on the mock, specifying a failure error message. Use in conjuntion with the default . The invocation was not call the times specified by . Expression to verify.The number of times a method is allowed to be called.Message to show if verification fails. Verifies that a specific invocation matching the given expression was performed on the mock, specifying a failure error message. Use in conjuntion with the default . The invocation was not call the times specified by . Expression to verify.The number of times a method is allowed to be called.Message to show if verification fails. Verifies that a specific invocation matching the given expression was performed on the mock. Use in conjuntion with the default . This example assumes that the mock has been used, and later we want to verify that a given invocation with specific parameters was performed: var mock = new Mock<IWarehouse>(); // exercise mock //... // Will throw if the test code didn't call HasInventory. mock.Verify(warehouse => warehouse.HasInventory(TALISKER, 50)); The invocation was not performed on the mock.Expression to verify.Type of return value from the expression. Verifies that a specific invocation matching the given expression was performed on the mock. Use in conjuntion with the default . The invocation was not call the times specified by . Expression to verify.The number of times a method is allowed to be called.Type of return value from the expression. Verifies that a specific invocation matching the given expression was performed on the mock. Use in conjuntion with the default . The invocation was not call the times specified by . Expression to verify.The number of times a method is allowed to be called.Type of return value from the expression. Verifies that a specific invocation matching the given expression was performed on the mock, specifying a failure error message. This example assumes that the mock has been used, and later we want to verify that a given invocation with specific parameters was performed: var mock = new Mock<IWarehouse>(); // exercise mock //... // Will throw if the test code didn't call HasInventory. mock.Verify(warehouse => warehouse.HasInventory(TALISKER, 50), "When filling orders, inventory has to be checked"); The invocation was not performed on the mock.Expression to verify.Message to show if verification fails.Type of return value from the expression. Verifies that a specific invocation matching the given expression was performed on the mock, specifying a failure error message. The invocation was not call the times specified by . Expression to verify.The number of times a method is allowed to be called.Message to show if verification fails.Type of return value from the expression. Verifies that a property was read on the mock. This example assumes that the mock has been used, and later we want to verify that a given property was retrieved from it: var mock = new Mock<IWarehouse>(); // exercise mock //... // Will throw if the test code didn't retrieve the IsClosed property. mock.VerifyGet(warehouse => warehouse.IsClosed); The invocation was not performed on the mock.Expression to verify. Type of the property to verify. Typically omitted as it can be inferred from the expression's return type. Verifies that a property was read on the mock. The invocation was not call the times specified by . The number of times a method is allowed to be called.Expression to verify. Type of the property to verify. Typically omitted as it can be inferred from the expression's return type. Verifies that a property was read on the mock. The invocation was not call the times specified by . The number of times a method is allowed to be called.Expression to verify. Type of the property to verify. Typically omitted as it can be inferred from the expression's return type. Verifies that a property was read on the mock, specifying a failure error message. This example assumes that the mock has been used, and later we want to verify that a given property was retrieved from it: var mock = new Mock<IWarehouse>(); // exercise mock //... // Will throw if the test code didn't retrieve the IsClosed property. mock.VerifyGet(warehouse => warehouse.IsClosed); The invocation was not performed on the mock.Expression to verify.Message to show if verification fails. Type of the property to verify. Typically omitted as it can be inferred from the expression's return type. Verifies that a property was read on the mock, specifying a failure error message. The invocation was not call the times specified by . The number of times a method is allowed to be called.Expression to verify.Message to show if verification fails. Type of the property to verify. Typically omitted as it can be inferred from the expression's return type. Verifies that a property was read on the mock, specifying a failure error message. The invocation was not call the times specified by . The number of times a method is allowed to be called.Expression to verify.Message to show if verification fails. Type of the property to verify. Typically omitted as it can be inferred from the expression's return type. Verifies that a property was set on the mock. This example assumes that the mock has been used, and later we want to verify that a given property was set on it: var mock = new Mock<IWarehouse>(); // exercise mock //... // Will throw if the test code didn't set the IsClosed property. mock.VerifySet(warehouse => warehouse.IsClosed = true); The invocation was not performed on the mock.Expression to verify. Verifies that a property was set on the mock. The invocation was not call the times specified by . The number of times a method is allowed to be called.Expression to verify. Verifies that a property was set on the mock. The invocation was not call the times specified by . The number of times a method is allowed to be called.Expression to verify. Verifies that a property was set on the mock, specifying a failure message. This example assumes that the mock has been used, and later we want to verify that a given property was set on it: var mock = new Mock<IWarehouse>(); // exercise mock //... // Will throw if the test code didn't set the IsClosed property. mock.VerifySet(warehouse => warehouse.IsClosed = true, "Warehouse should always be closed after the action"); The invocation was not performed on the mock.Expression to verify.Message to show if verification fails. Verifies that a property was set on the mock, specifying a failure message. The invocation was not call the times specified by . The number of times a method is allowed to be called.Expression to verify.Message to show if verification fails. Verifies that a property was set on the mock, specifying a failure message. The invocation was not call the times specified by . The number of times a method is allowed to be called.Expression to verify.Message to show if verification fails. Raises the event referenced in using the given argument. The argument is invalid for the target event invocation, or the is not an event attach or detach expression. The following example shows how to raise a event: var mock = new Mock<IViewModel>(); mock.Raise(x => x.PropertyChanged -= null, new PropertyChangedEventArgs("Name")); This example shows how to invoke an event with a custom event arguments class in a view that will cause its corresponding presenter to react by changing its state: var mockView = new Mock<IOrdersView>(); var presenter = new OrdersPresenter(mockView.Object); // Check that the presenter has no selection by default Assert.Null(presenter.SelectedOrder); // Raise the event with a specific arguments data mockView.Raise(v => v.SelectionChanged += null, new OrderEventArgs { Order = new Order("moq", 500) }); // Now the presenter reacted to the event, and we have a selected order Assert.NotNull(presenter.SelectedOrder); Assert.Equal("moq", presenter.SelectedOrder.ProductName); Raises the event referenced in using the given argument for a non-EventHandler typed event. The arguments are invalid for the target event invocation, or the is not an event attach or detach expression. The following example shows how to raise a custom event that does not adhere to the standard EventHandler: var mock = new Mock<IViewModel>(); mock.Raise(x => x.MyEvent -= null, "Name", bool, 25); Exposes the mocked object instance. Allows naming of your mocks, so they can be easily identified in error messages (e.g. from failed assertions). Provides legacy API members as extensions so that existing code continues to compile, but new code doesn't see then. Obsolete. Obsolete. Obsolete. Provides additional methods on mocks. Provided as extension methods as they confuse the compiler with the overloads taking Action. Specifies a setup on the mocked type for a call to to a property setter, regardless of its value. If more than one setup is set for the same property setter, the latest one wins and is the one that will be executed. Type of the property. Typically omitted as it can be inferred from the expression. Type of the mock. The target mock for the setup. Lambda expression that specifies the property setter. mock.SetupSet(x => x.Suspended); This method is not legacy, but must be on an extension method to avoid confusing the compiler with the new Action syntax. Verifies that a property has been set on the mock, regarless of its value. This example assumes that the mock has been used, and later we want to verify that a given invocation with specific parameters was performed: var mock = new Mock<IWarehouse>(); // exercise mock //... // Will throw if the test code didn't set the IsClosed property. mock.VerifySet(warehouse => warehouse.IsClosed); The invocation was not performed on the mock. Expression to verify. The mock instance. Mocked type. Type of the property to verify. Typically omitted as it can be inferred from the expression's return type. Verifies that a property has been set on the mock, specifying a failure error message. This example assumes that the mock has been used, and later we want to verify that a given invocation with specific parameters was performed: var mock = new Mock<IWarehouse>(); // exercise mock //... // Will throw if the test code didn't set the IsClosed property. mock.VerifySet(warehouse => warehouse.IsClosed); The invocation was not performed on the mock. Expression to verify. Message to show if verification fails. The mock instance. Mocked type. Type of the property to verify. Typically omitted as it can be inferred from the expression's return type. Verifies that a property has been set on the mock, regardless of the value but only the specified number of times. This example assumes that the mock has been used, and later we want to verify that a given invocation with specific parameters was performed: var mock = new Mock<IWarehouse>(); // exercise mock //... // Will throw if the test code didn't set the IsClosed property. mock.VerifySet(warehouse => warehouse.IsClosed); The invocation was not performed on the mock. The invocation was not call the times specified by . The mock instance. Mocked type. The number of times a method is allowed to be called. Expression to verify. Type of the property to verify. Typically omitted as it can be inferred from the expression's return type. Verifies that a property has been set on the mock, regardless of the value but only the specified number of times, and specifying a failure error message. This example assumes that the mock has been used, and later we want to verify that a given invocation with specific parameters was performed: var mock = new Mock<IWarehouse>(); // exercise mock //... // Will throw if the test code didn't set the IsClosed property. mock.VerifySet(warehouse => warehouse.IsClosed); The invocation was not performed on the mock. The invocation was not call the times specified by . The mock instance. Mocked type. The number of times a method is allowed to be called. Message to show if verification fails. Expression to verify. Type of the property to verify. Typically omitted as it can be inferred from the expression's return type. Helper for sequencing return values in the same method. Return a sequence of values, once per call. Casts the expression to a lambda expression, removing a cast if there's any. Casts the body of the lambda expression to a . If the body is not a method call. Converts the body of the lambda expression into the referenced by it. Checks whether the body of the lambda expression is a property access. Checks whether the expression is a property access. Checks whether the body of the lambda expression is a property indexer, which is true when the expression is an whose has equal to . Checks whether the expression is a property indexer, which is true when the expression is an whose has equal to . Creates an expression that casts the given expression to the type. TODO: remove this code when https://connect.microsoft.com/VisualStudio/feedback/ViewFeedback.aspx?FeedbackID=331583 is fixed. Extracts, into a common form, information from a around either a (for a normal method call) or a (for a delegate invocation). Tests if a type is a delegate type (subclasses ). Provides partial evaluation of subtrees, whenever they can be evaluated locally. Matt Warren: http://blogs.msdn.com/mattwar Documented by InSTEDD: http://www.instedd.org Performs evaluation and replacement of independent sub-trees The root of the expression tree. A function that decides whether a given expression node can be part of the local function. A new tree with sub-trees evaluated and replaced. Performs evaluation and replacement of independent sub-trees The root of the expression tree. A new tree with sub-trees evaluated and replaced. Evaluates and replaces sub-trees when first candidate is reached (top-down) Performs bottom-up analysis to determine which nodes can possibly be part of an evaluated sub-tree. Ensures the given is not null. Throws otherwise. Ensures the given string is not null or empty. Throws in the first case, or in the latter. Checks an argument to ensure it is in the specified range including the edges. Type of the argument to check, it must be an type. The expression containing the name of the argument. The argument value to check. The minimun allowed value for the argument. The maximun allowed value for the argument. Checks an argument to ensure it is in the specified range excluding the edges. Type of the argument to check, it must be an type. The expression containing the name of the argument. The argument value to check. The minimun allowed value for the argument. The maximun allowed value for the argument. Implemented by all generated mock object instances. Implemented by all generated mock object instances. Reference the Mock that contains this as the mock.Object value. Reference the Mock that contains this as the mock.Object value. Implements the actual interception and method invocation for all mocks. Implements the fluent API. Defines the Callback verb for property setter setups. Type of the property. Specifies a callback to invoke when the property is set that receives the property value being set. Callback method to invoke. Invokes the given callback with the property value being set. mock.SetupSet(x => x.Suspended) .Callback((bool state) => Console.WriteLine(state)); Allows the specification of a matching condition for an argument in a method invocation, rather than a specific argument value. "It" refers to the argument being matched. This class allows the setup to match a method invocation with an arbitrary value, with a value in a specified range, or even one that matches a given predicate. Matches any value of the given type. Typically used when the actual argument value for a method call is not relevant. // Throws an exception for a call to Remove with any string value. mock.Setup(x => x.Remove(It.IsAny<string>())).Throws(new InvalidOperationException()); Type of the value. Matches any value of the given type, except null. Type of the value. Matches any value that satisfies the given predicate. Type of the argument to check.The predicate used to match the method argument. Allows the specification of a predicate to perform matching of method call arguments. This example shows how to return the value 1 whenever the argument to the Do method is an even number. mock.Setup(x => x.Do(It.Is<int>(i => i % 2 == 0))) .Returns(1); This example shows how to throw an exception if the argument to the method is a negative number: mock.Setup(x => x.GetUser(It.Is<int>(i => i < 0))) .Throws(new ArgumentException()); Matches any value that is in the range specified. Type of the argument to check.The lower bound of the range.The upper bound of the range. The kind of range. See . The following example shows how to expect a method call with an integer argument within the 0..100 range. mock.Setup(x => x.HasInventory( It.IsAny<string>(), It.IsInRange(0, 100, Range.Inclusive))) .Returns(false); Matches any value that is present in the sequence specified. Type of the argument to check.The sequence of possible values. The following example shows how to expect a method call with an integer argument with value from a list. var values = new List<int> { 1, 2, 3 }; mock.Setup(x => x.HasInventory( It.IsAny<string>(), It.IsIn(values))) .Returns(false); Matches any value that is present in the sequence specified. Type of the argument to check.The sequence of possible values. The following example shows how to expect a method call with an integer argument with a value of 1, 2, or 3. mock.Setup(x => x.HasInventory( It.IsAny<string>(), It.IsIn(1, 2, 3))) .Returns(false); Matches any value that is not found in the sequence specified. Type of the argument to check.The sequence of disallowed values. The following example shows how to expect a method call with an integer argument with value not found from a list. var values = new List<int> { 1, 2, 3 }; mock.Setup(x => x.HasInventory( It.IsAny<string>(), It.IsNotIn(values))) .Returns(false); Matches any value that is not found in the sequence specified. Type of the argument to check.The sequence of disallowed values. The following example shows how to expect a method call with an integer argument of any value except 1, 2, or 3. mock.Setup(x => x.HasInventory( It.IsAny<string>(), It.IsNotIn(1, 2, 3))) .Returns(false); Matches a string argument if it matches the given regular expression pattern. The pattern to use to match the string argument value. The following example shows how to expect a call to a method where the string argument matches the given regular expression: mock.Setup(x => x.Check(It.IsRegex("[a-z]+"))).Returns(1); Matches a string argument if it matches the given regular expression pattern. The pattern to use to match the string argument value.The options used to interpret the pattern. The following example shows how to expect a call to a method where the string argument matches the given regular expression, in a case insensitive way: mock.Setup(x => x.Check(It.IsRegex("[a-z]+", RegexOptions.IgnoreCase))).Returns(1); Matcher to treat static functions as matchers. mock.Setup(x => x.StringMethod(A.MagicString())); public static class A { [Matcher] public static string MagicString() { return null; } public static bool MagicString(string arg) { return arg == "magic"; } } Will succeed if: mock.Object.StringMethod("magic"); and fail with any other call. Options to customize the behavior of the mock. Causes the mock to always throw an exception for invocations that don't have a corresponding setup. Will never throw exceptions, returning default values when necessary (null for reference types, zero for value types or empty enumerables and arrays). Default mock behavior, which equals . Exception thrown by mocks when setups are not matched, the mock is not properly setup, etc. A distinct exception type is provided so that exceptions thrown by the mock can be differentiated in tests that expect other exceptions to be thrown (i.e. ArgumentException). Richer exception hierarchy/types are not provided as tests typically should not catch or expect exceptions from the mocks. These are typically the result of changes in the tested class or its collaborators implementation, and result in fixes in the mock setup so that they dissapear and allow the test to pass. Supports the serialization infrastructure. Serialization information. Streaming context. Supports the serialization infrastructure. Serialization information. Streaming context. Indicates whether this exception is a verification fault raised by Verify() Made internal as it's of no use for consumers, but it's important for our own tests. Used by the mock factory to accumulate verification failures. Supports the serialization infrastructure. A strongly-typed resource class, for looking up localized strings, etc. Returns the cached ResourceManager instance used by this class. Overrides the current thread's CurrentUICulture property for all resource lookups using this strongly typed resource class. Looks up a localized string similar to Mock type has already been initialized by accessing its Object property. Adding interfaces must be done before that.. Looks up a localized string similar to Value cannot be an empty string.. Looks up a localized string similar to Can only add interfaces to the mock.. Looks up a localized string similar to Can't set return value for void method {0}.. Looks up a localized string similar to Constructor arguments cannot be passed for delegate mocks.. Looks up a localized string similar to Constructor arguments cannot be passed for interface mocks.. Looks up a localized string similar to A matching constructor for the given arguments was not found on the mocked type.. Looks up a localized string similar to Could not locate event for attach or detach method {0}.. Looks up a localized string similar to Expression {0} involves a field access, which is not supported. Use properties instead.. Looks up a localized string similar to Type to mock must be an interface or an abstract or non-sealed class. . Looks up a localized string similar to Cannot retrieve a mock with the given object type {0} as it's not the main type of the mock or any of its additional interfaces. Please cast the argument to one of the supported types: {1}. Remember that there's no generics covariance in the CLR, so your object must be one of these types in order for the call to succeed.. Looks up a localized string similar to The equals ("==" or "=" in VB) and the conditional 'and' ("&&" or "AndAlso" in VB) operators are the only ones supported in the query specification expression. Unsupported expression: {0}. Looks up a localized string similar to LINQ method '{0}' not supported.. Looks up a localized string similar to Expression contains a call to a method which is not virtual (overridable in VB) or abstract. Unsupported expression: {0}. Looks up a localized string similar to Member {0}.{1} does not exist.. Looks up a localized string similar to Method {0}.{1} is public. Use strong-typed Expect overload instead: mock.Setup(x => x.{1}()); . Looks up a localized string similar to {0} invocation failed with mock behavior {1}. {2}. Looks up a localized string similar to Expected only {0} calls to {1}.. Looks up a localized string similar to Expected only one call to {0}.. Looks up a localized string similar to {0} Expected invocation on the mock at least {2} times, but was {4} times: {1}. Looks up a localized string similar to {0} Expected invocation on the mock at least once, but was never performed: {1}. Looks up a localized string similar to {0} Expected invocation on the mock at most {3} times, but was {4} times: {1}. Looks up a localized string similar to {0} Expected invocation on the mock at most once, but was {4} times: {1}. Looks up a localized string similar to {0} Expected invocation on the mock between {2} and {3} times (Exclusive), but was {4} times: {1}. Looks up a localized string similar to {0} Expected invocation on the mock between {2} and {3} times (Inclusive), but was {4} times: {1}. Looks up a localized string similar to {0} Expected invocation on the mock exactly {2} times, but was {4} times: {1}. Looks up a localized string similar to {0} Expected invocation on the mock should never have been performed, but was {4} times: {1}. Looks up a localized string similar to {0} Expected invocation on the mock once, but was {4} times: {1}. Looks up a localized string similar to All invocations on the mock must have a corresponding setup.. Looks up a localized string similar to Object instance was not created by Moq.. Looks up a localized string similar to Out expression must evaluate to a constant value.. Looks up a localized string similar to Property {0}.{1} does not have a getter.. Looks up a localized string similar to Property {0}.{1} does not exist.. Looks up a localized string similar to Property {0}.{1} is write-only.. Looks up a localized string similar to Property {0}.{1} is read-only.. Looks up a localized string similar to Property {0}.{1} does not have a setter.. Looks up a localized string similar to Cannot raise a mocked event unless it has been associated (attached) to a concrete event in a mocked object.. Looks up a localized string similar to Ref expression must evaluate to a constant value.. Looks up a localized string similar to Invocation needs to return a value and therefore must have a corresponding setup that provides it.. Looks up a localized string similar to A lambda expression is expected as the argument to It.Is<T>.. Looks up a localized string similar to Invocation {0} should not have been made.. Looks up a localized string similar to Expression is not a method invocation: {0}. Looks up a localized string similar to Expression is not a property access: {0}. Looks up a localized string similar to Expression is not a property setter invocation.. Looks up a localized string similar to Expression references a method that does not belong to the mocked object: {0}. Looks up a localized string similar to Invalid setup on a non-virtual (overridable in VB) member: {0}. Looks up a localized string similar to Type {0} does not implement required interface {1}. Looks up a localized string similar to Type {0} does not from required type {1}. Looks up a localized string similar to To specify a setup for public property {0}.{1}, use the typed overloads, such as: mock.Setup(x => x.{1}).Returns(value); mock.SetupGet(x => x.{1}).Returns(value); //equivalent to previous one mock.SetupSet(x => x.{1}).Callback(callbackDelegate); . Looks up a localized string similar to Unsupported expression: {0}. Looks up a localized string similar to Only property accesses are supported in intermediate invocations on a setup. Unsupported expression {0}.. Looks up a localized string similar to Expression contains intermediate property access {0}.{1} which is of type {2} and cannot be mocked. Unsupported expression {3}.. Looks up a localized string similar to Setter expression cannot use argument matchers that receive parameters.. Looks up a localized string similar to Member {0} is not supported for protected mocking.. Looks up a localized string similar to Setter expression can only use static custom matchers.. Looks up a localized string similar to The following setups were not matched: {0}. Looks up a localized string similar to Invalid verify on a non-virtual (overridable in VB) member: {0}. Allows setups to be specified for protected members by using their name as a string, rather than strong-typing them which is not possible due to their visibility. Specifies a setup for a void method invocation with the given , optionally specifying arguments for the method call. The name of the void method to be invoked. The optional arguments for the invocation. If argument matchers are used, remember to use rather than . Specifies a setup for an invocation on a property or a non void method with the given , optionally specifying arguments for the method call. The name of the method or property to be invoked. The optional arguments for the invocation. If argument matchers are used, remember to use rather than . The return type of the method or property. Specifies a setup for an invocation on a property getter with the given . The name of the property. The type of the property. Specifies a setup for an invocation on a property setter with the given . The name of the property. The property value. If argument matchers are used, remember to use rather than . The type of the property. Specifies a verify for a void method with the given , optionally specifying arguments for the method call. Use in conjuntion with the default . The invocation was not call the times specified by . The name of the void method to be verified. The number of times a method is allowed to be called. The optional arguments for the invocation. If argument matchers are used, remember to use rather than . Specifies a verify for an invocation on a property or a non void method with the given , optionally specifying arguments for the method call. The invocation was not call the times specified by . The name of the method or property to be invoked. The optional arguments for the invocation. If argument matchers are used, remember to use rather than . The number of times a method is allowed to be called. The type of return value from the expression. Specifies a verify for an invocation on a property getter with the given . The invocation was not call the times specified by . The name of the property. The number of times a method is allowed to be called. The type of the property. Specifies a setup for an invocation on a property setter with the given . The invocation was not call the times specified by . The name of the property. The number of times a method is allowed to be called. The property value. The type of the property. If argument matchers are used, remember to use rather than . Allows the specification of a matching condition for an argument in a protected member setup, rather than a specific argument value. "ItExpr" refers to the argument being matched. Use this variant of argument matching instead of for protected setups. This class allows the setup to match a method invocation with an arbitrary value, with a value in a specified range, or even one that matches a given predicate, or null. Matches a null value of the given type. Required for protected mocks as the null value cannot be used directly as it prevents proper method overload selection. // Throws an exception for a call to Remove with a null string value. mock.Protected() .Setup("Remove", ItExpr.IsNull<string>()) .Throws(new InvalidOperationException()); Type of the value. Matches any value of the given type. Typically used when the actual argument value for a method call is not relevant. // Throws an exception for a call to Remove with any string value. mock.Protected() .Setup("Remove", ItExpr.IsAny<string>()) .Throws(new InvalidOperationException()); Type of the value. Matches any value that satisfies the given predicate. Type of the argument to check. The predicate used to match the method argument. Allows the specification of a predicate to perform matching of method call arguments. This example shows how to return the value 1 whenever the argument to the Do method is an even number. mock.Protected() .Setup("Do", ItExpr.Is<int>(i => i % 2 == 0)) .Returns(1); This example shows how to throw an exception if the argument to the method is a negative number: mock.Protected() .Setup("GetUser", ItExpr.Is<int>(i => i < 0)) .Throws(new ArgumentException()); Matches any value that is in the range specified. Type of the argument to check. The lower bound of the range. The upper bound of the range. The kind of range. See . The following example shows how to expect a method call with an integer argument within the 0..100 range. mock.Protected() .Setup("HasInventory", ItExpr.IsAny<string>(), ItExpr.IsInRange(0, 100, Range.Inclusive)) .Returns(false); Matches a string argument if it matches the given regular expression pattern. The pattern to use to match the string argument value. The following example shows how to expect a call to a method where the string argument matches the given regular expression: mock.Protected() .Setup("Check", ItExpr.IsRegex("[a-z]+")) .Returns(1); Matches a string argument if it matches the given regular expression pattern. The pattern to use to match the string argument value. The options used to interpret the pattern. The following example shows how to expect a call to a method where the string argument matches the given regular expression, in a case insensitive way: mock.Protected() .Setup("Check", ItExpr.IsRegex("[a-z]+", RegexOptions.IgnoreCase)) .Returns(1); Enables the Protected() method on , allowing setups to be set for protected members by using their name as a string, rather than strong-typing them which is not possible due to their visibility. Enable protected setups for the mock. Mocked object type. Typically omitted as it can be inferred from the mock instance. The mock to set the protected setups on. Kind of range to use in a filter specified through . The range includes the to and from values. The range does not include the to and from values. Determines the way default values are generated calculated for loose mocks. Default behavior, which generates empty values for value types (i.e. default(int)), empty array and enumerables, and nulls for all other reference types. Whenever the default value generated by is null, replaces this value with a mock (if the type can be mocked). For sealed classes, a null value will be generated. A default implementation of IQueryable for use with QueryProvider The is a static method that returns an IQueryable of Mocks of T which is used to apply the linq specification to. Allows creation custom value matchers that can be used on setups and verification, completely replacing the built-in class with your own argument matching rules. See also . Provided for the sole purpose of rendering the delegate passed to the matcher constructor if no friendly render lambda is provided. Initializes the match with the condition that will be checked in order to match invocation values. The condition to match against actual values. This method is used to set an expression as the last matcher invoked, which is used in the SetupSet to allow matchers in the prop = value delegate expression. This delegate is executed in "fluent" mode in order to capture the value being set, and construct the corresponding methodcall. This is also used in the MatcherFactory for each argument expression. This method ensures that when we execute the delegate, we also track the matcher that was invoked, so that when we create the methodcall we build the expression using it, rather than the null/default value returned from the actual invocation. Allows creation custom value matchers that can be used on setups and verification, completely replacing the built-in class with your own argument matching rules. Type of the value to match. The argument matching is used to determine whether a concrete invocation in the mock matches a given setup. This matching mechanism is fully extensible. Creating a custom matcher is straightforward. You just need to create a method that returns a value from a call to with your matching condition and optional friendly render expression: [Matcher] public Order IsBigOrder() { return Match<Order>.Create( o => o.GrandTotal >= 5000, /* a friendly expression to render on failures */ () => IsBigOrder()); } This method can be used in any mock setup invocation: mock.Setup(m => m.Submit(IsBigOrder()).Throws<UnauthorizedAccessException>(); At runtime, Moq knows that the return value was a matcher (note that the method MUST be annotated with the [Matcher] attribute in order to determine this) and evaluates your predicate with the actual value passed into your predicate. Another example might be a case where you want to match a lists of orders that contains a particular one. You might create matcher like the following: public static class Orders { [Matcher] public static IEnumerable<Order> Contains(Order order) { return Match<IEnumerable<Order>>.Create(orders => orders.Contains(order)); } } Now we can invoke this static method instead of an argument in an invocation: var order = new Order { ... }; var mock = new Mock<IRepository<Order>>(); mock.Setup(x => x.Save(Orders.Contains(order))) .Throws<ArgumentException>(); Tracks the current mock and interception context. Having an active fluent mock context means that the invocation is being performed in "trial" mode, just to gather the target method and arguments that need to be matched later when the actual invocation is made. A that returns an empty default value for non-mockeable types, and mocks for all other types (interfaces and non-sealed classes) that can be mocked. Allows querying the universe of mocks for those that behave according to the LINQ query specification. This entry-point into Linq to Mocks is the only one in the root Moq namespace to ease discovery. But to get all the mocking extension methods on Object, a using of Moq.Linq must be done, so that the polluting of the intellisense for all objects is an explicit opt-in. Access the universe of mocks of the given type, to retrieve those that behave according to the LINQ query specification. The type of the mocked object to query. Access the universe of mocks of the given type, to retrieve those that behave according to the LINQ query specification. The predicate with the setup expressions. The type of the mocked object to query. Creates an mock object of the indicated type. The type of the mocked object. The mocked object created. Creates an mock object of the indicated type. The predicate with the setup expressions. The type of the mocked object. The mocked object created. Creates the mock query with the underlying queriable implementation. Wraps the enumerator inside a queryable. Method that is turned into the actual call from .Query{T}, to transform the queryable query into a normal enumerable query. This method is never used directly by consumers. Extension method used to support Linq-like setup properties that are not virtual but do have a getter and a setter, thereby allowing the use of Linq to Mocks to quickly initialize Dtos too :) Helper extensions that are used by the query translator. Retrieves a fluent mock from the given setup expression. Gets an autogenerated interface with a method on it that matches the signature of the specified . Such an interface can then be mocked, and a delegate pointed at the method on the mocked instance. This is how we support delegate mocking. The factory caches such interfaces and reuses them for repeated requests for the same delegate type. The delegate type for which an interface is required. The method on the autogenerated interface. Defines the number of invocations allowed by a mocked method. Specifies that a mocked method should be invoked times as minimum. The minimun number of times.An object defining the allowed number of invocations. Specifies that a mocked method should be invoked one time as minimum. An object defining the allowed number of invocations. Specifies that a mocked method should be invoked time as maximun. The maximun number of times.An object defining the allowed number of invocations. Specifies that a mocked method should be invoked one time as maximun. An object defining the allowed number of invocations. Specifies that a mocked method should be invoked between and times. The minimun number of times.The maximun number of times. The kind of range. See . An object defining the allowed number of invocations. Specifies that a mocked method should be invoked exactly times. The times that a method or property can be called.An object defining the allowed number of invocations. Specifies that a mocked method should not be invoked. An object defining the allowed number of invocations. Specifies that a mocked method should be invoked exactly one time. An object defining the allowed number of invocations. Determines whether the specified is equal to this instance. The to compare with this instance. true if the specified is equal to this instance; otherwise, false. Returns a hash code for this instance. A hash code for this instance, suitable for use in hashing algorithms and data structures like a hash table. Determines whether two specified objects have the same value. The first . The second . true if the value of left is the same as the value of right; otherwise, false. Determines whether two specified objects have different values. The first . The second . true if the value of left is different from the value of right; otherwise, false. ================================================ FILE: packages/Moq.4.2.1402.2112/lib/sl4/Moq.Silverlight.xml ================================================ Moq.Silverlight Provides a mock implementation of . Any interface type can be used for mocking, but for classes, only abstract and virtual members can be mocked. The behavior of the mock with regards to the setups and the actual calls is determined by the optional that can be passed to the constructor. Type to mock, which can be an interface or a class. The following example shows establishing setups with specific values for method invocations: // Arrange var order = new Order(TALISKER, 50); var mock = new Mock<IWarehouse>(); mock.Setup(x => x.HasInventory(TALISKER, 50)).Returns(true); // Act order.Fill(mock.Object); // Assert Assert.True(order.IsFilled); The following example shows how to use the class to specify conditions for arguments instead of specific values: // Arrange var order = new Order(TALISKER, 50); var mock = new Mock<IWarehouse>(); // shows how to expect a value within a range mock.Setup(x => x.HasInventory( It.IsAny<string>(), It.IsInRange(0, 100, Range.Inclusive))) .Returns(false); // shows how to throw for unexpected calls. mock.Setup(x => x.Remove( It.IsAny<string>(), It.IsAny<int>())) .Throws(new InvalidOperationException()); // Act order.Fill(mock.Object); // Assert Assert.False(order.IsFilled); Base class for mocks and static helper class with methods that apply to mocked objects, such as to retrieve a from an object instance. Helper interface used to hide the base members from the fluent API to make it much cleaner in Visual Studio intellisense. Creates an mock object of the indicated type. The type of the mocked object. The mocked object created. Creates an mock object of the indicated type. The predicate with the specification of how the mocked object should behave. The type of the mocked object. The mocked object created. Initializes a new instance of the class. Retrieves the mock object for the given object instance. Type of the mock to retrieve. Can be omitted as it's inferred from the object instance passed in as the instance. The instance of the mocked object.The mock associated with the mocked object. The received instance was not created by Moq. The following example shows how to add a new setup to an object instance which is not the original but rather the object associated with it: // Typed instance, not the mock, is retrieved from some test API. HttpContextBase context = GetMockContext(); // context.Request is the typed object from the "real" API // so in order to add a setup to it, we need to get // the mock that "owns" it Mock<HttpRequestBase> request = Mock.Get(context.Request); mock.Setup(req => req.AppRelativeCurrentExecutionFilePath) .Returns(tempUrl); Returns the mocked object value. Verifies that all verifiable expectations have been met. This example sets up an expectation and marks it as verifiable. After the mock is used, a Verify() call is issued on the mock to ensure the method in the setup was invoked: var mock = new Mock<IWarehouse>(); this.Setup(x => x.HasInventory(TALISKER, 50)).Verifiable().Returns(true); ... // other test code ... // Will throw if the test code has didn't call HasInventory. this.Verify(); Not all verifiable expectations were met. Verifies all expectations regardless of whether they have been flagged as verifiable. This example sets up an expectation without marking it as verifiable. After the mock is used, a call is issued on the mock to ensure that all expectations are met: var mock = new Mock<IWarehouse>(); this.Setup(x => x.HasInventory(TALISKER, 50)).Returns(true); ... // other test code ... // Will throw if the test code has didn't call HasInventory, even // that expectation was not marked as verifiable. this.VerifyAll(); At least one expectation was not met. Gets the interceptor target for the given expression and root mock, building the intermediate hierarchy of mock objects if necessary. Raises the associated event with the given event argument data. Raises the associated event with the given event argument data. Adds an interface implementation to the mock, allowing setups to be specified for it. This method can only be called before the first use of the mock property, at which point the runtime type has already been generated and no more interfaces can be added to it. Also, must be an interface and not a class, which must be specified when creating the mock instead. The mock type has already been generated by accessing the property. The specified is not an interface. The following example creates a mock for the main interface and later adds to it to verify it's called by the consumer code: var mock = new Mock<IProcessor>(); mock.Setup(x => x.Execute("ping")); // add IDisposable interface var disposable = mock.As<IDisposable>(); disposable.Setup(d => d.Dispose()).Verifiable(); Type of interface to cast the mock to. Behavior of the mock, according to the value set in the constructor. Whether the base member virtual implementation will be called for mocked classes if no setup is matched. Defaults to . Specifies the behavior to use when returning default values for unexpected invocations on loose mocks. Gets the mocked object instance. Retrieves the type of the mocked object, its generic type argument. This is used in the auto-mocking of hierarchy access. If this is a mock of a delegate, this property contains the method on the autogenerated interface so that we can convert setup + verify expressions on the delegate into expressions on the interface proxy. Allows to check whether expression conversion to the must be performed on the mock, without causing unnecessarily early initialization of the mock instance, which breaks As{T}. Specifies the class that will determine the default value to return when invocations are made that have no setups and need to return a default value (for loose mocks). Exposes the list of extra interfaces implemented by the mock. Covarient interface for Mock<T> such that casts between IMock<Employee> to IMock<Person> are possible. Only covers the covariant members of Mock<T>. Exposes the mocked object instance. Behavior of the mock, according to the value set in the constructor. Whether the base member virtual implementation will be called for mocked classes if no setup is matched. Defaults to . Specifies the behavior to use when returning default values for unexpected invocations on loose mocks. Ctor invoked by AsTInterface exclusively. Initializes an instance of the mock with default behavior. var mock = new Mock<IFormatProvider>(); Initializes an instance of the mock with default behavior and with the given constructor arguments for the class. (Only valid when is a class) The mock will try to find the best match constructor given the constructor arguments, and invoke that to initialize the instance. This applies only for classes, not interfaces. var mock = new Mock<MyProvider>(someArgument, 25); Optional constructor arguments if the mocked type is a class. Initializes an instance of the mock with the specified behavior. var mock = new Mock<IFormatProvider>(MockBehavior.Relaxed); Behavior of the mock. Initializes an instance of the mock with a specific behavior with the given constructor arguments for the class. The mock will try to find the best match constructor given the constructor arguments, and invoke that to initialize the instance. This applies only to classes, not interfaces. var mock = new Mock<MyProvider>(someArgument, 25); Behavior of the mock.Optional constructor arguments if the mocked type is a class. Returns the name of the mock Returns the mocked object value. Specifies a setup on the mocked type for a call to to a void method. If more than one setup is specified for the same method or property, the latest one wins and is the one that will be executed. Lambda expression that specifies the expected method invocation. var mock = new Mock<IProcessor>(); mock.Setup(x => x.Execute("ping")); Specifies a setup on the mocked type for a call to to a value returning method. Type of the return value. Typically omitted as it can be inferred from the expression. If more than one setup is specified for the same method or property, the latest one wins and is the one that will be executed. Lambda expression that specifies the method invocation. mock.Setup(x => x.HasInventory("Talisker", 50)).Returns(true); Specifies a setup on the mocked type for a call to to a property getter. If more than one setup is set for the same property getter, the latest one wins and is the one that will be executed. Type of the property. Typically omitted as it can be inferred from the expression.Lambda expression that specifies the property getter. mock.SetupGet(x => x.Suspended) .Returns(true); Specifies a setup on the mocked type for a call to to a property setter. If more than one setup is set for the same property setter, the latest one wins and is the one that will be executed. This overloads allows the use of a callback already typed for the property type. Type of the property. Typically omitted as it can be inferred from the expression.The Lambda expression that sets a property to a value. mock.SetupSet(x => x.Suspended = true); Specifies a setup on the mocked type for a call to to a property setter. If more than one setup is set for the same property setter, the latest one wins and is the one that will be executed. Lambda expression that sets a property to a value. mock.SetupSet(x => x.Suspended = true); Specifies that the given property should have "property behavior", meaning that setting its value will cause it to be saved and later returned when the property is requested. (this is also known as "stubbing"). Type of the property, inferred from the property expression (does not need to be specified). Property expression to stub. If you have an interface with an int property Value, you might stub it using the following straightforward call: var mock = new Mock<IHaveValue>(); mock.Stub(v => v.Value); After the Stub call has been issued, setting and retrieving the object value will behave as expected: IHaveValue v = mock.Object; v.Value = 5; Assert.Equal(5, v.Value); Specifies that the given property should have "property behavior", meaning that setting its value will cause it to be saved and later returned when the property is requested. This overload allows setting the initial value for the property. (this is also known as "stubbing"). Type of the property, inferred from the property expression (does not need to be specified). Property expression to stub.Initial value for the property. If you have an interface with an int property Value, you might stub it using the following straightforward call: var mock = new Mock<IHaveValue>(); mock.SetupProperty(v => v.Value, 5); After the SetupProperty call has been issued, setting and retrieving the object value will behave as expected: IHaveValue v = mock.Object; // Initial value was stored Assert.Equal(5, v.Value); // New value set which changes the initial value v.Value = 6; Assert.Equal(6, v.Value); Specifies that the all properties on the mock should have "property behavior", meaning that setting its value will cause it to be saved and later returned when the property is requested. (this is also known as "stubbing"). The default value for each property will be the one generated as specified by the property for the mock. If the mock is set to , the mocked default values will also get all properties setup recursively. Verifies that a specific invocation matching the given expression was performed on the mock. Use in conjuntion with the default . This example assumes that the mock has been used, and later we want to verify that a given invocation with specific parameters was performed: var mock = new Mock<IProcessor>(); // exercise mock //... // Will throw if the test code didn't call Execute with a "ping" string argument. mock.Verify(proc => proc.Execute("ping")); The invocation was not performed on the mock.Expression to verify. Verifies that a specific invocation matching the given expression was performed on the mock. Use in conjuntion with the default . The invocation was not call the times specified by . Expression to verify.The number of times a method is allowed to be called. Verifies that a specific invocation matching the given expression was performed on the mock. Use in conjuntion with the default . The invocation was not call the times specified by . Expression to verify.The number of times a method is allowed to be called. Verifies that a specific invocation matching the given expression was performed on the mock, specifying a failure error message. Use in conjuntion with the default . This example assumes that the mock has been used, and later we want to verify that a given invocation with specific parameters was performed: var mock = new Mock<IProcessor>(); // exercise mock //... // Will throw if the test code didn't call Execute with a "ping" string argument. mock.Verify(proc => proc.Execute("ping")); The invocation was not performed on the mock.Expression to verify.Message to show if verification fails. Verifies that a specific invocation matching the given expression was performed on the mock, specifying a failure error message. Use in conjuntion with the default . The invocation was not call the times specified by . Expression to verify.The number of times a method is allowed to be called.Message to show if verification fails. Verifies that a specific invocation matching the given expression was performed on the mock, specifying a failure error message. Use in conjuntion with the default . The invocation was not call the times specified by . Expression to verify.The number of times a method is allowed to be called.Message to show if verification fails. Verifies that a specific invocation matching the given expression was performed on the mock. Use in conjuntion with the default . This example assumes that the mock has been used, and later we want to verify that a given invocation with specific parameters was performed: var mock = new Mock<IWarehouse>(); // exercise mock //... // Will throw if the test code didn't call HasInventory. mock.Verify(warehouse => warehouse.HasInventory(TALISKER, 50)); The invocation was not performed on the mock.Expression to verify.Type of return value from the expression. Verifies that a specific invocation matching the given expression was performed on the mock. Use in conjuntion with the default . The invocation was not call the times specified by . Expression to verify.The number of times a method is allowed to be called.Type of return value from the expression. Verifies that a specific invocation matching the given expression was performed on the mock. Use in conjuntion with the default . The invocation was not call the times specified by . Expression to verify.The number of times a method is allowed to be called.Type of return value from the expression. Verifies that a specific invocation matching the given expression was performed on the mock, specifying a failure error message. This example assumes that the mock has been used, and later we want to verify that a given invocation with specific parameters was performed: var mock = new Mock<IWarehouse>(); // exercise mock //... // Will throw if the test code didn't call HasInventory. mock.Verify(warehouse => warehouse.HasInventory(TALISKER, 50), "When filling orders, inventory has to be checked"); The invocation was not performed on the mock.Expression to verify.Message to show if verification fails.Type of return value from the expression. Verifies that a specific invocation matching the given expression was performed on the mock, specifying a failure error message. The invocation was not call the times specified by . Expression to verify.The number of times a method is allowed to be called.Message to show if verification fails.Type of return value from the expression. Verifies that a property was read on the mock. This example assumes that the mock has been used, and later we want to verify that a given property was retrieved from it: var mock = new Mock<IWarehouse>(); // exercise mock //... // Will throw if the test code didn't retrieve the IsClosed property. mock.VerifyGet(warehouse => warehouse.IsClosed); The invocation was not performed on the mock.Expression to verify. Type of the property to verify. Typically omitted as it can be inferred from the expression's return type. Verifies that a property was read on the mock. The invocation was not call the times specified by . The number of times a method is allowed to be called.Expression to verify. Type of the property to verify. Typically omitted as it can be inferred from the expression's return type. Verifies that a property was read on the mock. The invocation was not call the times specified by . The number of times a method is allowed to be called.Expression to verify. Type of the property to verify. Typically omitted as it can be inferred from the expression's return type. Verifies that a property was read on the mock, specifying a failure error message. This example assumes that the mock has been used, and later we want to verify that a given property was retrieved from it: var mock = new Mock<IWarehouse>(); // exercise mock //... // Will throw if the test code didn't retrieve the IsClosed property. mock.VerifyGet(warehouse => warehouse.IsClosed); The invocation was not performed on the mock.Expression to verify.Message to show if verification fails. Type of the property to verify. Typically omitted as it can be inferred from the expression's return type. Verifies that a property was read on the mock, specifying a failure error message. The invocation was not call the times specified by . The number of times a method is allowed to be called.Expression to verify.Message to show if verification fails. Type of the property to verify. Typically omitted as it can be inferred from the expression's return type. Verifies that a property was read on the mock, specifying a failure error message. The invocation was not call the times specified by . The number of times a method is allowed to be called.Expression to verify.Message to show if verification fails. Type of the property to verify. Typically omitted as it can be inferred from the expression's return type. Verifies that a property was set on the mock. This example assumes that the mock has been used, and later we want to verify that a given property was set on it: var mock = new Mock<IWarehouse>(); // exercise mock //... // Will throw if the test code didn't set the IsClosed property. mock.VerifySet(warehouse => warehouse.IsClosed = true); The invocation was not performed on the mock.Expression to verify. Verifies that a property was set on the mock. The invocation was not call the times specified by . The number of times a method is allowed to be called.Expression to verify. Verifies that a property was set on the mock. The invocation was not call the times specified by . The number of times a method is allowed to be called.Expression to verify. Verifies that a property was set on the mock, specifying a failure message. This example assumes that the mock has been used, and later we want to verify that a given property was set on it: var mock = new Mock<IWarehouse>(); // exercise mock //... // Will throw if the test code didn't set the IsClosed property. mock.VerifySet(warehouse => warehouse.IsClosed = true, "Warehouse should always be closed after the action"); The invocation was not performed on the mock.Expression to verify.Message to show if verification fails. Verifies that a property was set on the mock, specifying a failure message. The invocation was not call the times specified by . The number of times a method is allowed to be called.Expression to verify.Message to show if verification fails. Verifies that a property was set on the mock, specifying a failure message. The invocation was not call the times specified by . The number of times a method is allowed to be called.Expression to verify.Message to show if verification fails. Raises the event referenced in using the given argument. The argument is invalid for the target event invocation, or the is not an event attach or detach expression. The following example shows how to raise a event: var mock = new Mock<IViewModel>(); mock.Raise(x => x.PropertyChanged -= null, new PropertyChangedEventArgs("Name")); This example shows how to invoke an event with a custom event arguments class in a view that will cause its corresponding presenter to react by changing its state: var mockView = new Mock<IOrdersView>(); var presenter = new OrdersPresenter(mockView.Object); // Check that the presenter has no selection by default Assert.Null(presenter.SelectedOrder); // Raise the event with a specific arguments data mockView.Raise(v => v.SelectionChanged += null, new OrderEventArgs { Order = new Order("moq", 500) }); // Now the presenter reacted to the event, and we have a selected order Assert.NotNull(presenter.SelectedOrder); Assert.Equal("moq", presenter.SelectedOrder.ProductName); Raises the event referenced in using the given argument for a non-EventHandler typed event. The arguments are invalid for the target event invocation, or the is not an event attach or detach expression. The following example shows how to raise a custom event that does not adhere to the standard EventHandler: var mock = new Mock<IViewModel>(); mock.Raise(x => x.MyEvent -= null, "Name", bool, 25); Obsolete. Obsolete. Obsolete. Obsolete. Obsolete. Exposes the mocked object instance. Allows naming of your mocks, so they can be easily identified in error messages (e.g. from failed assertions). Implements the fluent API. The expectation will be considered only in the former condition. The expectation will be considered only in the former condition. Setups the get. The type of the property. The expression. Setups the set. The type of the property. The setter expression. Setups the set. The setter expression. Determines the way default values are generated calculated for loose mocks. Default behavior, which generates empty values for value types (i.e. default(int)), empty array and enumerables, and nulls for all other reference types. Whenever the default value generated by is null, replaces this value with a mock (if the type can be mocked). For sealed classes, a null value will be generated. A that returns an empty default value for invocations that do not have setups or return values, with loose mocks. This is the default behavior for a mock. Interface to be implemented by classes that determine the default value of non-expected invocations. Defines the default value to return in all the methods returning . The type of the return value.The value to set as default. Provides a value for the given member and arguments. The member to provide a default value for. Provides partial evaluation of subtrees, whenever they can be evaluated locally. Matt Warren: http://blogs.msdn.com/mattwar Documented by InSTEDD: http://www.instedd.org Performs evaluation and replacement of independent sub-trees The root of the expression tree. A function that decides whether a given expression node can be part of the local function. A new tree with sub-trees evaluated and replaced. Performs evaluation and replacement of independent sub-trees The root of the expression tree. A new tree with sub-trees evaluated and replaced. Evaluates and replaces sub-trees when first candidate is reached (top-down) Performs bottom-up analysis to determine which nodes can possibly be part of an evaluated sub-tree. Casts the expression to a lambda expression, removing a cast if there's any. Casts the body of the lambda expression to a . If the body is not a method call. Converts the body of the lambda expression into the referenced by it. Checks whether the body of the lambda expression is a property access. Checks whether the expression is a property access. Checks whether the body of the lambda expression is a property indexer, which is true when the expression is an whose has equal to . Checks whether the expression is a property indexer, which is true when the expression is an whose has equal to . Creates an expression that casts the given expression to the type. TODO: remove this code when https://connect.microsoft.com/VisualStudio/feedback/ViewFeedback.aspx?FeedbackID=331583 is fixed. Extracts, into a common form, information from a around either a (for a normal method call) or a (for a delegate invocation). The intention of is to create a more readable string representation for the failure message. Tests if a type is a delegate type (subclasses ). Tracks the current mock and interception context. Having an active fluent mock context means that the invocation is being performed in "trial" mode, just to gather the target method and arguments that need to be matched later when the actual invocation is made. Ensures the given is not null. Throws otherwise. Ensures the given string is not null or empty. Throws in the first case, or in the latter. Checks an argument to ensure it is in the specified range including the edges. Type of the argument to check, it must be an type. The expression containing the name of the argument. The argument value to check. The minimun allowed value for the argument. The maximun allowed value for the argument. Checks an argument to ensure it is in the specified range excluding the edges. Type of the argument to check, it must be an type. The expression containing the name of the argument. The argument value to check. The minimun allowed value for the argument. The maximun allowed value for the argument. Handle interception the current invocation context shared data for the interceptor as a whole shared data among the strategies during a single interception InterceptionAction.Continue if further interception has to be processed, otherwise InterceptionAction.Stop Implemented by all generated mock object instances. Implemented by all generated mock object instances. Reference the Mock that contains this as the mock.Object value. Reference the Mock that contains this as the mock.Object value. Implements the actual interception and method invocation for all mocks. Get an eventInfo for a given event name. Search type ancestors depth first if necessary. Name of the event, with the set_ or get_ prefix already removed Get an eventInfo for a given event name. Search type ancestors depth first if necessary. Searches also in non public events. Name of the event, with the set_ or get_ prefix already removed Given a type return all of its ancestors, both types and interfaces. The type to find immediate ancestors of Allows the specification of a matching condition for an argument in a method invocation, rather than a specific argument value. "It" refers to the argument being matched. This class allows the setup to match a method invocation with an arbitrary value, with a value in a specified range, or even one that matches a given predicate. Matches any value of the given type. Typically used when the actual argument value for a method call is not relevant. // Throws an exception for a call to Remove with any string value. mock.Setup(x => x.Remove(It.IsAny<string>())).Throws(new InvalidOperationException()); Type of the value. Matches any value of the given type, except null. Type of the value. Matches any value that satisfies the given predicate. Type of the argument to check.The predicate used to match the method argument. Allows the specification of a predicate to perform matching of method call arguments. This example shows how to return the value 1 whenever the argument to the Do method is an even number. mock.Setup(x => x.Do(It.Is<int>(i => i % 2 == 0))) .Returns(1); This example shows how to throw an exception if the argument to the method is a negative number: mock.Setup(x => x.GetUser(It.Is<int>(i => i < 0))) .Throws(new ArgumentException()); Matches any value that is in the range specified. Type of the argument to check.The lower bound of the range.The upper bound of the range. The kind of range. See . The following example shows how to expect a method call with an integer argument within the 0..100 range. mock.Setup(x => x.HasInventory( It.IsAny<string>(), It.IsInRange(0, 100, Range.Inclusive))) .Returns(false); Matches any value that is present in the sequence specified. Type of the argument to check.The sequence of possible values. The following example shows how to expect a method call with an integer argument with value from a list. var values = new List<int> { 1, 2, 3 }; mock.Setup(x => x.HasInventory( It.IsAny<string>(), It.IsIn(values))) .Returns(false); Matches any value that is present in the sequence specified. Type of the argument to check.The sequence of possible values. The following example shows how to expect a method call with an integer argument with a value of 1, 2, or 3. mock.Setup(x => x.HasInventory( It.IsAny<string>(), It.IsIn(1, 2, 3))) .Returns(false); Matches any value that is not found in the sequence specified. Type of the argument to check.The sequence of disallowed values. The following example shows how to expect a method call with an integer argument with value not found from a list. var values = new List<int> { 1, 2, 3 }; mock.Setup(x => x.HasInventory( It.IsAny<string>(), It.IsNotIn(values))) .Returns(false); Matches any value that is not found in the sequence specified. Type of the argument to check.The sequence of disallowed values. The following example shows how to expect a method call with an integer argument of any value except 1, 2, or 3. mock.Setup(x => x.HasInventory( It.IsAny<string>(), It.IsNotIn(1, 2, 3))) .Returns(false); Matches a string argument if it matches the given regular expression pattern. The pattern to use to match the string argument value. The following example shows how to expect a call to a method where the string argument matches the given regular expression: mock.Setup(x => x.Check(It.IsRegex("[a-z]+"))).Returns(1); Matches a string argument if it matches the given regular expression pattern. The pattern to use to match the string argument value.The options used to interpret the pattern. The following example shows how to expect a call to a method where the string argument matches the given regular expression, in a case insensitive way: mock.Setup(x => x.Check(It.IsRegex("[a-z]+", RegexOptions.IgnoreCase))).Returns(1); Implements the fluent API. Defines the Callback verb and overloads. Specifies a callback to invoke when the method is called that receives the original arguments. The type of the first argument of the invoked method. The type of the second argument of the invoked method. The callback method to invoke. A reference to interface. Invokes the given callback with the concrete invocation arguments values. Notice how the specific arguments are retrieved by simply declaring them as part of the lambda expression for the callback: mock.Setup(x => x.Execute( It.IsAny<string>(), It.IsAny<string>())) .Callback((string arg1, string arg2) => Console.WriteLine(arg1 + arg2)); Specifies a callback to invoke when the method is called that receives the original arguments. The type of the first argument of the invoked method. The type of the second argument of the invoked method. The type of the third argument of the invoked method. The callback method to invoke. A reference to interface. Invokes the given callback with the concrete invocation arguments values. Notice how the specific arguments are retrieved by simply declaring them as part of the lambda expression for the callback: mock.Setup(x => x.Execute( It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>())) .Callback((string arg1, string arg2, string arg3) => Console.WriteLine(arg1 + arg2 + arg3)); Specifies a callback to invoke when the method is called that receives the original arguments. The type of the first argument of the invoked method. The type of the second argument of the invoked method. The type of the third argument of the invoked method. The type of the fourth argument of the invoked method. The callback method to invoke. A reference to interface. Invokes the given callback with the concrete invocation arguments values. Notice how the specific arguments are retrieved by simply declaring them as part of the lambda expression for the callback: mock.Setup(x => x.Execute( It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>())) .Callback((string arg1, string arg2, string arg3, string arg4) => Console.WriteLine(arg1 + arg2 + arg3 + arg4)); Specifies a callback to invoke when the method is called that receives the original arguments. The type of the first argument of the invoked method. The type of the second argument of the invoked method. The type of the third argument of the invoked method. The type of the fourth argument of the invoked method. The type of the fifth argument of the invoked method. The callback method to invoke. A reference to interface. Invokes the given callback with the concrete invocation arguments values. Notice how the specific arguments are retrieved by simply declaring them as part of the lambda expression for the callback: mock.Setup(x => x.Execute( It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>())) .Callback((string arg1, string arg2, string arg3, string arg4, string arg5) => Console.WriteLine(arg1 + arg2 + arg3 + arg4 + arg5)); Specifies a callback to invoke when the method is called that receives the original arguments. The type of the first argument of the invoked method. The type of the second argument of the invoked method. The type of the third argument of the invoked method. The type of the fourth argument of the invoked method. The type of the fifth argument of the invoked method. The type of the sixth argument of the invoked method. The callback method to invoke. A reference to interface. Invokes the given callback with the concrete invocation arguments values. Notice how the specific arguments are retrieved by simply declaring them as part of the lambda expression for the callback: mock.Setup(x => x.Execute( It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>())) .Callback((string arg1, string arg2, string arg3, string arg4, string arg5, string arg6) => Console.WriteLine(arg1 + arg2 + arg3 + arg4 + arg5 + arg6)); Specifies a callback to invoke when the method is called that receives the original arguments. The type of the first argument of the invoked method. The type of the second argument of the invoked method. The type of the third argument of the invoked method. The type of the fourth argument of the invoked method. The type of the fifth argument of the invoked method. The type of the sixth argument of the invoked method. The type of the seventh argument of the invoked method. The callback method to invoke. A reference to interface. Invokes the given callback with the concrete invocation arguments values. Notice how the specific arguments are retrieved by simply declaring them as part of the lambda expression for the callback: mock.Setup(x => x.Execute( It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>())) .Callback((string arg1, string arg2, string arg3, string arg4, string arg5, string arg6, string arg7) => Console.WriteLine(arg1 + arg2 + arg3 + arg4 + arg5 + arg6 + arg7)); Specifies a callback to invoke when the method is called that receives the original arguments. The type of the first argument of the invoked method. The type of the second argument of the invoked method. The type of the third argument of the invoked method. The type of the fourth argument of the invoked method. The type of the fifth argument of the invoked method. The type of the sixth argument of the invoked method. The type of the seventh argument of the invoked method. The type of the eighth argument of the invoked method. The callback method to invoke. A reference to interface. Invokes the given callback with the concrete invocation arguments values. Notice how the specific arguments are retrieved by simply declaring them as part of the lambda expression for the callback: mock.Setup(x => x.Execute( It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>())) .Callback((string arg1, string arg2, string arg3, string arg4, string arg5, string arg6, string arg7, string arg8) => Console.WriteLine(arg1 + arg2 + arg3 + arg4 + arg5 + arg6 + arg7 + arg8)); Specifies a callback to invoke when the method is called that receives the original arguments. The type of the first argument of the invoked method. The type of the second argument of the invoked method. The type of the third argument of the invoked method. The type of the fourth argument of the invoked method. The type of the fifth argument of the invoked method. The type of the sixth argument of the invoked method. The type of the seventh argument of the invoked method. The type of the eighth argument of the invoked method. The type of the nineth argument of the invoked method. The callback method to invoke. A reference to interface. Invokes the given callback with the concrete invocation arguments values. Notice how the specific arguments are retrieved by simply declaring them as part of the lambda expression for the callback: mock.Setup(x => x.Execute( It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>())) .Callback((string arg1, string arg2, string arg3, string arg4, string arg5, string arg6, string arg7, string arg8, string arg9) => Console.WriteLine(arg1 + arg2 + arg3 + arg4 + arg5 + arg6 + arg7 + arg8 + arg9)); Specifies a callback to invoke when the method is called that receives the original arguments. The type of the first argument of the invoked method. The type of the second argument of the invoked method. The type of the third argument of the invoked method. The type of the fourth argument of the invoked method. The type of the fifth argument of the invoked method. The type of the sixth argument of the invoked method. The type of the seventh argument of the invoked method. The type of the eighth argument of the invoked method. The type of the nineth argument of the invoked method. The type of the tenth argument of the invoked method. The callback method to invoke. A reference to interface. Invokes the given callback with the concrete invocation arguments values. Notice how the specific arguments are retrieved by simply declaring them as part of the lambda expression for the callback: mock.Setup(x => x.Execute( It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>())) .Callback((string arg1, string arg2, string arg3, string arg4, string arg5, string arg6, string arg7, string arg8, string arg9, string arg10) => Console.WriteLine(arg1 + arg2 + arg3 + arg4 + arg5 + arg6 + arg7 + arg8 + arg9 + arg10)); Specifies a callback to invoke when the method is called that receives the original arguments. The type of the first argument of the invoked method. The type of the second argument of the invoked method. The type of the third argument of the invoked method. The type of the fourth argument of the invoked method. The type of the fifth argument of the invoked method. The type of the sixth argument of the invoked method. The type of the seventh argument of the invoked method. The type of the eighth argument of the invoked method. The type of the nineth argument of the invoked method. The type of the tenth argument of the invoked method. The type of the eleventh argument of the invoked method. The callback method to invoke. A reference to interface. Invokes the given callback with the concrete invocation arguments values. Notice how the specific arguments are retrieved by simply declaring them as part of the lambda expression for the callback: mock.Setup(x => x.Execute( It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>())) .Callback((string arg1, string arg2, string arg3, string arg4, string arg5, string arg6, string arg7, string arg8, string arg9, string arg10, string arg11) => Console.WriteLine(arg1 + arg2 + arg3 + arg4 + arg5 + arg6 + arg7 + arg8 + arg9 + arg10 + arg11)); Specifies a callback to invoke when the method is called that receives the original arguments. The type of the first argument of the invoked method. The type of the second argument of the invoked method. The type of the third argument of the invoked method. The type of the fourth argument of the invoked method. The type of the fifth argument of the invoked method. The type of the sixth argument of the invoked method. The type of the seventh argument of the invoked method. The type of the eighth argument of the invoked method. The type of the nineth argument of the invoked method. The type of the tenth argument of the invoked method. The type of the eleventh argument of the invoked method. The type of the twelfth argument of the invoked method. The callback method to invoke. A reference to interface. Invokes the given callback with the concrete invocation arguments values. Notice how the specific arguments are retrieved by simply declaring them as part of the lambda expression for the callback: mock.Setup(x => x.Execute( It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>())) .Callback((string arg1, string arg2, string arg3, string arg4, string arg5, string arg6, string arg7, string arg8, string arg9, string arg10, string arg11, string arg12) => Console.WriteLine(arg1 + arg2 + arg3 + arg4 + arg5 + arg6 + arg7 + arg8 + arg9 + arg10 + arg11 + arg12)); Specifies a callback to invoke when the method is called that receives the original arguments. The type of the first argument of the invoked method. The type of the second argument of the invoked method. The type of the third argument of the invoked method. The type of the fourth argument of the invoked method. The type of the fifth argument of the invoked method. The type of the sixth argument of the invoked method. The type of the seventh argument of the invoked method. The type of the eighth argument of the invoked method. The type of the nineth argument of the invoked method. The type of the tenth argument of the invoked method. The type of the eleventh argument of the invoked method. The type of the twelfth argument of the invoked method. The type of the thirteenth argument of the invoked method. The callback method to invoke. A reference to interface. Invokes the given callback with the concrete invocation arguments values. Notice how the specific arguments are retrieved by simply declaring them as part of the lambda expression for the callback: mock.Setup(x => x.Execute( It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>())) .Callback((string arg1, string arg2, string arg3, string arg4, string arg5, string arg6, string arg7, string arg8, string arg9, string arg10, string arg11, string arg12, string arg13) => Console.WriteLine(arg1 + arg2 + arg3 + arg4 + arg5 + arg6 + arg7 + arg8 + arg9 + arg10 + arg11 + arg12 + arg13)); Specifies a callback to invoke when the method is called that receives the original arguments. The type of the first argument of the invoked method. The type of the second argument of the invoked method. The type of the third argument of the invoked method. The type of the fourth argument of the invoked method. The type of the fifth argument of the invoked method. The type of the sixth argument of the invoked method. The type of the seventh argument of the invoked method. The type of the eighth argument of the invoked method. The type of the nineth argument of the invoked method. The type of the tenth argument of the invoked method. The type of the eleventh argument of the invoked method. The type of the twelfth argument of the invoked method. The type of the thirteenth argument of the invoked method. The type of the fourteenth argument of the invoked method. The callback method to invoke. A reference to interface. Invokes the given callback with the concrete invocation arguments values. Notice how the specific arguments are retrieved by simply declaring them as part of the lambda expression for the callback: mock.Setup(x => x.Execute( It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>())) .Callback((string arg1, string arg2, string arg3, string arg4, string arg5, string arg6, string arg7, string arg8, string arg9, string arg10, string arg11, string arg12, string arg13, string arg14) => Console.WriteLine(arg1 + arg2 + arg3 + arg4 + arg5 + arg6 + arg7 + arg8 + arg9 + arg10 + arg11 + arg12 + arg13 + arg14)); Specifies a callback to invoke when the method is called that receives the original arguments. The type of the first argument of the invoked method. The type of the second argument of the invoked method. The type of the third argument of the invoked method. The type of the fourth argument of the invoked method. The type of the fifth argument of the invoked method. The type of the sixth argument of the invoked method. The type of the seventh argument of the invoked method. The type of the eighth argument of the invoked method. The type of the nineth argument of the invoked method. The type of the tenth argument of the invoked method. The type of the eleventh argument of the invoked method. The type of the twelfth argument of the invoked method. The type of the thirteenth argument of the invoked method. The type of the fourteenth argument of the invoked method. The type of the fifteenth argument of the invoked method. The callback method to invoke. A reference to interface. Invokes the given callback with the concrete invocation arguments values. Notice how the specific arguments are retrieved by simply declaring them as part of the lambda expression for the callback: mock.Setup(x => x.Execute( It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>())) .Callback((string arg1, string arg2, string arg3, string arg4, string arg5, string arg6, string arg7, string arg8, string arg9, string arg10, string arg11, string arg12, string arg13, string arg14, string arg15) => Console.WriteLine(arg1 + arg2 + arg3 + arg4 + arg5 + arg6 + arg7 + arg8 + arg9 + arg10 + arg11 + arg12 + arg13 + arg14 + arg15)); Specifies a callback to invoke when the method is called that receives the original arguments. The type of the first argument of the invoked method. The type of the second argument of the invoked method. The type of the third argument of the invoked method. The type of the fourth argument of the invoked method. The type of the fifth argument of the invoked method. The type of the sixth argument of the invoked method. The type of the seventh argument of the invoked method. The type of the eighth argument of the invoked method. The type of the nineth argument of the invoked method. The type of the tenth argument of the invoked method. The type of the eleventh argument of the invoked method. The type of the twelfth argument of the invoked method. The type of the thirteenth argument of the invoked method. The type of the fourteenth argument of the invoked method. The type of the fifteenth argument of the invoked method. The type of the sixteenth argument of the invoked method. The callback method to invoke. A reference to interface. Invokes the given callback with the concrete invocation arguments values. Notice how the specific arguments are retrieved by simply declaring them as part of the lambda expression for the callback: mock.Setup(x => x.Execute( It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>())) .Callback((string arg1, string arg2, string arg3, string arg4, string arg5, string arg6, string arg7, string arg8, string arg9, string arg10, string arg11, string arg12, string arg13, string arg14, string arg15, string arg16) => Console.WriteLine(arg1 + arg2 + arg3 + arg4 + arg5 + arg6 + arg7 + arg8 + arg9 + arg10 + arg11 + arg12 + arg13 + arg14 + arg15 + arg16)); Specifies a callback to invoke when the method is called. The callback method to invoke. The following example specifies a callback to set a boolean value that can be used later: var called = false; mock.Setup(x => x.Execute()) .Callback(() => called = true); Specifies a callback to invoke when the method is called that receives the original arguments. The argument type of the invoked method. The callback method to invoke. Invokes the given callback with the concrete invocation argument value. Notice how the specific string argument is retrieved by simply declaring it as part of the lambda expression for the callback: mock.Setup(x => x.Execute(It.IsAny<string>())) .Callback((string command) => Console.WriteLine(command)); Defines occurrence members to constraint setups. The expected invocation can happen at most once. var mock = new Mock<ICommand>(); mock.Setup(foo => foo.Execute("ping")) .AtMostOnce(); The expected invocation can happen at most specified number of times. The number of times to accept calls. var mock = new Mock<ICommand>(); mock.Setup(foo => foo.Execute("ping")) .AtMost( 5 ); Defines the Raises verb. Specifies the event that will be raised when the setup is met. An expression that represents an event attach or detach action. The event arguments to pass for the raised event. The following example shows how to raise an event when the setup is met: var mock = new Mock<IContainer>(); mock.Setup(add => add.Add(It.IsAny<string>(), It.IsAny<object>())) .Raises(add => add.Added += null, EventArgs.Empty); Specifies the event that will be raised when the setup is matched. An expression that represents an event attach or detach action. A function that will build the to pass when raising the event. Specifies the custom event that will be raised when the setup is matched. An expression that represents an event attach or detach action. The arguments to pass to the custom delegate (non EventHandler-compatible). Specifies the event that will be raised when the setup is matched. The expression that represents an event attach or detach action. The function that will build the to pass when raising the event. The type of the first argument received by the expected invocation. Specifies the event that will be raised when the setup is matched. The expression that represents an event attach or detach action. The function that will build the to pass when raising the event. The type of the first argument received by the expected invocation. The type of the second argument received by the expected invocation. Specifies the event that will be raised when the setup is matched. The expression that represents an event attach or detach action. The function that will build the to pass when raising the event. The type of the first argument received by the expected invocation. The type of the second argument received by the expected invocation. The type of the third argument received by the expected invocation. Specifies the event that will be raised when the setup is matched. The expression that represents an event attach or detach action. The function that will build the to pass when raising the event. The type of the first argument received by the expected invocation. The type of the second argument received by the expected invocation. The type of the third argument received by the expected invocation. The type of the fourth argument received by the expected invocation. Specifies the event that will be raised when the setup is matched. The expression that represents an event attach or detach action. The function that will build the to pass when raising the event. The type of the first argument received by the expected invocation. The type of the second argument received by the expected invocation. The type of the third argument received by the expected invocation. The type of the fourth argument received by the expected invocation. The type of the fifth argument received by the expected invocation. Specifies the event that will be raised when the setup is matched. The expression that represents an event attach or detach action. The function that will build the to pass when raising the event. The type of the first argument received by the expected invocation. The type of the second argument received by the expected invocation. The type of the third argument received by the expected invocation. The type of the fourth argument received by the expected invocation. The type of the fifth argument received by the expected invocation. The type of the sixth argument received by the expected invocation. Specifies the event that will be raised when the setup is matched. The expression that represents an event attach or detach action. The function that will build the to pass when raising the event. The type of the first argument received by the expected invocation. The type of the second argument received by the expected invocation. The type of the third argument received by the expected invocation. The type of the fourth argument received by the expected invocation. The type of the fifth argument received by the expected invocation. The type of the sixth argument received by the expected invocation. The type of the seventh argument received by the expected invocation. Specifies the event that will be raised when the setup is matched. The expression that represents an event attach or detach action. The function that will build the to pass when raising the event. The type of the first argument received by the expected invocation. The type of the second argument received by the expected invocation. The type of the third argument received by the expected invocation. The type of the fourth argument received by the expected invocation. The type of the fifth argument received by the expected invocation. The type of the sixth argument received by the expected invocation. The type of the seventh argument received by the expected invocation. The type of the eighth argument received by the expected invocation. Specifies the event that will be raised when the setup is matched. The expression that represents an event attach or detach action. The function that will build the to pass when raising the event. The type of the first argument received by the expected invocation. The type of the second argument received by the expected invocation. The type of the third argument received by the expected invocation. The type of the fourth argument received by the expected invocation. The type of the fifth argument received by the expected invocation. The type of the sixth argument received by the expected invocation. The type of the seventh argument received by the expected invocation. The type of the eighth argument received by the expected invocation. The type of the nineth argument received by the expected invocation. Specifies the event that will be raised when the setup is matched. The expression that represents an event attach or detach action. The function that will build the to pass when raising the event. The type of the first argument received by the expected invocation. The type of the second argument received by the expected invocation. The type of the third argument received by the expected invocation. The type of the fourth argument received by the expected invocation. The type of the fifth argument received by the expected invocation. The type of the sixth argument received by the expected invocation. The type of the seventh argument received by the expected invocation. The type of the eighth argument received by the expected invocation. The type of the nineth argument received by the expected invocation. The type of the tenth argument received by the expected invocation. Specifies the event that will be raised when the setup is matched. The expression that represents an event attach or detach action. The function that will build the to pass when raising the event. The type of the first argument received by the expected invocation. The type of the second argument received by the expected invocation. The type of the third argument received by the expected invocation. The type of the fourth argument received by the expected invocation. The type of the fifth argument received by the expected invocation. The type of the sixth argument received by the expected invocation. The type of the seventh argument received by the expected invocation. The type of the eighth argument received by the expected invocation. The type of the nineth argument received by the expected invocation. The type of the tenth argument received by the expected invocation. The type of the eleventh argument received by the expected invocation. Specifies the event that will be raised when the setup is matched. The expression that represents an event attach or detach action. The function that will build the to pass when raising the event. The type of the first argument received by the expected invocation. The type of the second argument received by the expected invocation. The type of the third argument received by the expected invocation. The type of the fourth argument received by the expected invocation. The type of the fifth argument received by the expected invocation. The type of the sixth argument received by the expected invocation. The type of the seventh argument received by the expected invocation. The type of the eighth argument received by the expected invocation. The type of the nineth argument received by the expected invocation. The type of the tenth argument received by the expected invocation. The type of the eleventh argument received by the expected invocation. The type of the twelfth argument received by the expected invocation. Specifies the event that will be raised when the setup is matched. The expression that represents an event attach or detach action. The function that will build the to pass when raising the event. The type of the first argument received by the expected invocation. The type of the second argument received by the expected invocation. The type of the third argument received by the expected invocation. The type of the fourth argument received by the expected invocation. The type of the fifth argument received by the expected invocation. The type of the sixth argument received by the expected invocation. The type of the seventh argument received by the expected invocation. The type of the eighth argument received by the expected invocation. The type of the nineth argument received by the expected invocation. The type of the tenth argument received by the expected invocation. The type of the eleventh argument received by the expected invocation. The type of the twelfth argument received by the expected invocation. The type of the thirteenth argument received by the expected invocation. Specifies the event that will be raised when the setup is matched. The expression that represents an event attach or detach action. The function that will build the to pass when raising the event. The type of the first argument received by the expected invocation. The type of the second argument received by the expected invocation. The type of the third argument received by the expected invocation. The type of the fourth argument received by the expected invocation. The type of the fifth argument received by the expected invocation. The type of the sixth argument received by the expected invocation. The type of the seventh argument received by the expected invocation. The type of the eighth argument received by the expected invocation. The type of the nineth argument received by the expected invocation. The type of the tenth argument received by the expected invocation. The type of the eleventh argument received by the expected invocation. The type of the twelfth argument received by the expected invocation. The type of the thirteenth argument received by the expected invocation. The type of the fourteenth argument received by the expected invocation. Specifies the event that will be raised when the setup is matched. The expression that represents an event attach or detach action. The function that will build the to pass when raising the event. The type of the first argument received by the expected invocation. The type of the second argument received by the expected invocation. The type of the third argument received by the expected invocation. The type of the fourth argument received by the expected invocation. The type of the fifth argument received by the expected invocation. The type of the sixth argument received by the expected invocation. The type of the seventh argument received by the expected invocation. The type of the eighth argument received by the expected invocation. The type of the nineth argument received by the expected invocation. The type of the tenth argument received by the expected invocation. The type of the eleventh argument received by the expected invocation. The type of the twelfth argument received by the expected invocation. The type of the thirteenth argument received by the expected invocation. The type of the fourteenth argument received by the expected invocation. The type of the fifteenth argument received by the expected invocation. Specifies the event that will be raised when the setup is matched. The expression that represents an event attach or detach action. The function that will build the to pass when raising the event. The type of the first argument received by the expected invocation. The type of the second argument received by the expected invocation. The type of the third argument received by the expected invocation. The type of the fourth argument received by the expected invocation. The type of the fifth argument received by the expected invocation. The type of the sixth argument received by the expected invocation. The type of the seventh argument received by the expected invocation. The type of the eighth argument received by the expected invocation. The type of the nineth argument received by the expected invocation. The type of the tenth argument received by the expected invocation. The type of the eleventh argument received by the expected invocation. The type of the twelfth argument received by the expected invocation. The type of the thirteenth argument received by the expected invocation. The type of the fourteenth argument received by the expected invocation. The type of the fifteenth argument received by the expected invocation. The type of the sixteenth argument received by the expected invocation. Defines the Verifiable verb. Marks the expectation as verifiable, meaning that a call to will check if this particular expectation was met. The following example marks the expectation as verifiable: mock.Expect(x => x.Execute("ping")) .Returns(true) .Verifiable(); Marks the expectation as verifiable, meaning that a call to will check if this particular expectation was met, and specifies a message for failures. The following example marks the expectation as verifiable: mock.Expect(x => x.Execute("ping")) .Returns(true) .Verifiable("Ping should be executed always!"); Implements the fluent API. Implements the fluent API. Defines the Throws verb. Specifies the exception to throw when the method is invoked. Exception instance to throw. This example shows how to throw an exception when the method is invoked with an empty string argument: mock.Setup(x => x.Execute("")) .Throws(new ArgumentException()); Specifies the type of exception to throw when the method is invoked. Type of exception to instantiate and throw when the setup is matched. This example shows how to throw an exception when the method is invoked with an empty string argument: mock.Setup(x => x.Execute("")) .Throws<ArgumentException>(); Implements the fluent API. Implements the fluent API. Defines the Callback verb and overloads for callbacks on setups that return a value. Mocked type. Type of the return value of the setup. Specifies a callback to invoke when the method is called that receives the original arguments. The type of the first argument of the invoked method. The type of the second argument of the invoked method. The callback method to invoke. A reference to interface. Invokes the given callback with the concrete invocation arguments values. Notice how the specific arguments are retrieved by simply declaring them as part of the lambda expression for the callback: mock.Setup(x => x.Execute( It.IsAny<string>(), It.IsAny<string>())) .Callback((arg1, arg2) => Console.WriteLine(arg1 + arg2)); Specifies a callback to invoke when the method is called that receives the original arguments. The type of the first argument of the invoked method. The type of the second argument of the invoked method. The type of the third argument of the invoked method. The callback method to invoke. A reference to interface. Invokes the given callback with the concrete invocation arguments values. Notice how the specific arguments are retrieved by simply declaring them as part of the lambda expression for the callback: mock.Setup(x => x.Execute( It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>())) .Callback((arg1, arg2, arg3) => Console.WriteLine(arg1 + arg2 + arg3)); Specifies a callback to invoke when the method is called that receives the original arguments. The type of the first argument of the invoked method. The type of the second argument of the invoked method. The type of the third argument of the invoked method. The type of the fourth argument of the invoked method. The callback method to invoke. A reference to interface. Invokes the given callback with the concrete invocation arguments values. Notice how the specific arguments are retrieved by simply declaring them as part of the lambda expression for the callback: mock.Setup(x => x.Execute( It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>())) .Callback((arg1, arg2, arg3, arg4) => Console.WriteLine(arg1 + arg2 + arg3 + arg4)); Specifies a callback to invoke when the method is called that receives the original arguments. The type of the first argument of the invoked method. The type of the second argument of the invoked method. The type of the third argument of the invoked method. The type of the fourth argument of the invoked method. The type of the fifth argument of the invoked method. The callback method to invoke. A reference to interface. Invokes the given callback with the concrete invocation arguments values. Notice how the specific arguments are retrieved by simply declaring them as part of the lambda expression for the callback: mock.Setup(x => x.Execute( It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>())) .Callback((arg1, arg2, arg3, arg4, arg5) => Console.WriteLine(arg1 + arg2 + arg3 + arg4 + arg5)); Specifies a callback to invoke when the method is called that receives the original arguments. The type of the first argument of the invoked method. The type of the second argument of the invoked method. The type of the third argument of the invoked method. The type of the fourth argument of the invoked method. The type of the fifth argument of the invoked method. The type of the sixth argument of the invoked method. The callback method to invoke. A reference to interface. Invokes the given callback with the concrete invocation arguments values. Notice how the specific arguments are retrieved by simply declaring them as part of the lambda expression for the callback: mock.Setup(x => x.Execute( It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>())) .Callback((arg1, arg2, arg3, arg4, arg5, arg6) => Console.WriteLine(arg1 + arg2 + arg3 + arg4 + arg5 + arg6)); Specifies a callback to invoke when the method is called that receives the original arguments. The type of the first argument of the invoked method. The type of the second argument of the invoked method. The type of the third argument of the invoked method. The type of the fourth argument of the invoked method. The type of the fifth argument of the invoked method. The type of the sixth argument of the invoked method. The type of the seventh argument of the invoked method. The callback method to invoke. A reference to interface. Invokes the given callback with the concrete invocation arguments values. Notice how the specific arguments are retrieved by simply declaring them as part of the lambda expression for the callback: mock.Setup(x => x.Execute( It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>())) .Callback((arg1, arg2, arg3, arg4, arg5, arg6, arg7) => Console.WriteLine(arg1 + arg2 + arg3 + arg4 + arg5 + arg6 + arg7)); Specifies a callback to invoke when the method is called that receives the original arguments. The type of the first argument of the invoked method. The type of the second argument of the invoked method. The type of the third argument of the invoked method. The type of the fourth argument of the invoked method. The type of the fifth argument of the invoked method. The type of the sixth argument of the invoked method. The type of the seventh argument of the invoked method. The type of the eighth argument of the invoked method. The callback method to invoke. A reference to interface. Invokes the given callback with the concrete invocation arguments values. Notice how the specific arguments are retrieved by simply declaring them as part of the lambda expression for the callback: mock.Setup(x => x.Execute( It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>())) .Callback((arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8) => Console.WriteLine(arg1 + arg2 + arg3 + arg4 + arg5 + arg6 + arg7 + arg8)); Specifies a callback to invoke when the method is called that receives the original arguments. The type of the first argument of the invoked method. The type of the second argument of the invoked method. The type of the third argument of the invoked method. The type of the fourth argument of the invoked method. The type of the fifth argument of the invoked method. The type of the sixth argument of the invoked method. The type of the seventh argument of the invoked method. The type of the eighth argument of the invoked method. The type of the nineth argument of the invoked method. The callback method to invoke. A reference to interface. Invokes the given callback with the concrete invocation arguments values. Notice how the specific arguments are retrieved by simply declaring them as part of the lambda expression for the callback: mock.Setup(x => x.Execute( It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>())) .Callback((arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9) => Console.WriteLine(arg1 + arg2 + arg3 + arg4 + arg5 + arg6 + arg7 + arg8 + arg9)); Specifies a callback to invoke when the method is called that receives the original arguments. The type of the first argument of the invoked method. The type of the second argument of the invoked method. The type of the third argument of the invoked method. The type of the fourth argument of the invoked method. The type of the fifth argument of the invoked method. The type of the sixth argument of the invoked method. The type of the seventh argument of the invoked method. The type of the eighth argument of the invoked method. The type of the nineth argument of the invoked method. The type of the tenth argument of the invoked method. The callback method to invoke. A reference to interface. Invokes the given callback with the concrete invocation arguments values. Notice how the specific arguments are retrieved by simply declaring them as part of the lambda expression for the callback: mock.Setup(x => x.Execute( It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>())) .Callback((arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10) => Console.WriteLine(arg1 + arg2 + arg3 + arg4 + arg5 + arg6 + arg7 + arg8 + arg9 + arg10)); Specifies a callback to invoke when the method is called that receives the original arguments. The type of the first argument of the invoked method. The type of the second argument of the invoked method. The type of the third argument of the invoked method. The type of the fourth argument of the invoked method. The type of the fifth argument of the invoked method. The type of the sixth argument of the invoked method. The type of the seventh argument of the invoked method. The type of the eighth argument of the invoked method. The type of the nineth argument of the invoked method. The type of the tenth argument of the invoked method. The type of the eleventh argument of the invoked method. The callback method to invoke. A reference to interface. Invokes the given callback with the concrete invocation arguments values. Notice how the specific arguments are retrieved by simply declaring them as part of the lambda expression for the callback: mock.Setup(x => x.Execute( It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>())) .Callback((arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11) => Console.WriteLine(arg1 + arg2 + arg3 + arg4 + arg5 + arg6 + arg7 + arg8 + arg9 + arg10 + arg11)); Specifies a callback to invoke when the method is called that receives the original arguments. The type of the first argument of the invoked method. The type of the second argument of the invoked method. The type of the third argument of the invoked method. The type of the fourth argument of the invoked method. The type of the fifth argument of the invoked method. The type of the sixth argument of the invoked method. The type of the seventh argument of the invoked method. The type of the eighth argument of the invoked method. The type of the nineth argument of the invoked method. The type of the tenth argument of the invoked method. The type of the eleventh argument of the invoked method. The type of the twelfth argument of the invoked method. The callback method to invoke. A reference to interface. Invokes the given callback with the concrete invocation arguments values. Notice how the specific arguments are retrieved by simply declaring them as part of the lambda expression for the callback: mock.Setup(x => x.Execute( It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>())) .Callback((arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11, arg12) => Console.WriteLine(arg1 + arg2 + arg3 + arg4 + arg5 + arg6 + arg7 + arg8 + arg9 + arg10 + arg11 + arg12)); Specifies a callback to invoke when the method is called that receives the original arguments. The type of the first argument of the invoked method. The type of the second argument of the invoked method. The type of the third argument of the invoked method. The type of the fourth argument of the invoked method. The type of the fifth argument of the invoked method. The type of the sixth argument of the invoked method. The type of the seventh argument of the invoked method. The type of the eighth argument of the invoked method. The type of the nineth argument of the invoked method. The type of the tenth argument of the invoked method. The type of the eleventh argument of the invoked method. The type of the twelfth argument of the invoked method. The type of the thirteenth argument of the invoked method. The callback method to invoke. A reference to interface. Invokes the given callback with the concrete invocation arguments values. Notice how the specific arguments are retrieved by simply declaring them as part of the lambda expression for the callback: mock.Setup(x => x.Execute( It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>())) .Callback((arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11, arg12, arg13) => Console.WriteLine(arg1 + arg2 + arg3 + arg4 + arg5 + arg6 + arg7 + arg8 + arg9 + arg10 + arg11 + arg12 + arg13)); Specifies a callback to invoke when the method is called that receives the original arguments. The type of the first argument of the invoked method. The type of the second argument of the invoked method. The type of the third argument of the invoked method. The type of the fourth argument of the invoked method. The type of the fifth argument of the invoked method. The type of the sixth argument of the invoked method. The type of the seventh argument of the invoked method. The type of the eighth argument of the invoked method. The type of the nineth argument of the invoked method. The type of the tenth argument of the invoked method. The type of the eleventh argument of the invoked method. The type of the twelfth argument of the invoked method. The type of the thirteenth argument of the invoked method. The type of the fourteenth argument of the invoked method. The callback method to invoke. A reference to interface. Invokes the given callback with the concrete invocation arguments values. Notice how the specific arguments are retrieved by simply declaring them as part of the lambda expression for the callback: mock.Setup(x => x.Execute( It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>())) .Callback((arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11, arg12, arg13, arg14) => Console.WriteLine(arg1 + arg2 + arg3 + arg4 + arg5 + arg6 + arg7 + arg8 + arg9 + arg10 + arg11 + arg12 + arg13 + arg14)); Specifies a callback to invoke when the method is called that receives the original arguments. The type of the first argument of the invoked method. The type of the second argument of the invoked method. The type of the third argument of the invoked method. The type of the fourth argument of the invoked method. The type of the fifth argument of the invoked method. The type of the sixth argument of the invoked method. The type of the seventh argument of the invoked method. The type of the eighth argument of the invoked method. The type of the nineth argument of the invoked method. The type of the tenth argument of the invoked method. The type of the eleventh argument of the invoked method. The type of the twelfth argument of the invoked method. The type of the thirteenth argument of the invoked method. The type of the fourteenth argument of the invoked method. The type of the fifteenth argument of the invoked method. The callback method to invoke. A reference to interface. Invokes the given callback with the concrete invocation arguments values. Notice how the specific arguments are retrieved by simply declaring them as part of the lambda expression for the callback: mock.Setup(x => x.Execute( It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>())) .Callback((arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11, arg12, arg13, arg14, arg15) => Console.WriteLine(arg1 + arg2 + arg3 + arg4 + arg5 + arg6 + arg7 + arg8 + arg9 + arg10 + arg11 + arg12 + arg13 + arg14 + arg15)); Specifies a callback to invoke when the method is called that receives the original arguments. The type of the first argument of the invoked method. The type of the second argument of the invoked method. The type of the third argument of the invoked method. The type of the fourth argument of the invoked method. The type of the fifth argument of the invoked method. The type of the sixth argument of the invoked method. The type of the seventh argument of the invoked method. The type of the eighth argument of the invoked method. The type of the nineth argument of the invoked method. The type of the tenth argument of the invoked method. The type of the eleventh argument of the invoked method. The type of the twelfth argument of the invoked method. The type of the thirteenth argument of the invoked method. The type of the fourteenth argument of the invoked method. The type of the fifteenth argument of the invoked method. The type of the sixteenth argument of the invoked method. The callback method to invoke. A reference to interface. Invokes the given callback with the concrete invocation arguments values. Notice how the specific arguments are retrieved by simply declaring them as part of the lambda expression for the callback: mock.Setup(x => x.Execute( It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>())) .Callback((arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11, arg12, arg13, arg14, arg15, arg16) => Console.WriteLine(arg1 + arg2 + arg3 + arg4 + arg5 + arg6 + arg7 + arg8 + arg9 + arg10 + arg11 + arg12 + arg13 + arg14 + arg15 + arg16)); Specifies a callback to invoke when the method is called. The callback method to invoke. The following example specifies a callback to set a boolean value that can be used later: var called = false; mock.Setup(x => x.Execute()) .Callback(() => called = true) .Returns(true); Note that in the case of value-returning methods, after the Callback call you can still specify the return value. Specifies a callback to invoke when the method is called that receives the original arguments. The type of the argument of the invoked method. Callback method to invoke. Invokes the given callback with the concrete invocation argument value. Notice how the specific string argument is retrieved by simply declaring it as part of the lambda expression for the callback: mock.Setup(x => x.Execute(It.IsAny<string>())) .Callback(command => Console.WriteLine(command)) .Returns(true); Implements the fluent API. Defines the Returns verb. Mocked type. Type of the return value from the expression. Specifies a function that will calculate the value to return from the method, retrieving the arguments for the invocation. The type of the first argument of the invoked method. The type of the second argument of the invoked method. The function that will calculate the return value. Returns a calculated value which is evaluated lazily at the time of the invocation. The return value is calculated from the value of the actual method invocation arguments. Notice how the arguments are retrieved by simply declaring them as part of the lambda expression: mock.Setup(x => x.Execute( It.IsAny<int>(), It.IsAny<int>())) .Returns((string arg1, string arg2) => arg1 + arg2); Specifies a function that will calculate the value to return from the method, retrieving the arguments for the invocation. The type of the first argument of the invoked method. The type of the second argument of the invoked method. The type of the third argument of the invoked method. The function that will calculate the return value. Returns a calculated value which is evaluated lazily at the time of the invocation. The return value is calculated from the value of the actual method invocation arguments. Notice how the arguments are retrieved by simply declaring them as part of the lambda expression: mock.Setup(x => x.Execute( It.IsAny<int>(), It.IsAny<int>(), It.IsAny<int>())) .Returns((string arg1, string arg2, string arg3) => arg1 + arg2 + arg3); Specifies a function that will calculate the value to return from the method, retrieving the arguments for the invocation. The type of the first argument of the invoked method. The type of the second argument of the invoked method. The type of the third argument of the invoked method. The type of the fourth argument of the invoked method. The function that will calculate the return value. Returns a calculated value which is evaluated lazily at the time of the invocation. The return value is calculated from the value of the actual method invocation arguments. Notice how the arguments are retrieved by simply declaring them as part of the lambda expression: mock.Setup(x => x.Execute( It.IsAny<int>(), It.IsAny<int>(), It.IsAny<int>(), It.IsAny<int>())) .Returns((string arg1, string arg2, string arg3, string arg4) => arg1 + arg2 + arg3 + arg4); Specifies a function that will calculate the value to return from the method, retrieving the arguments for the invocation. The type of the first argument of the invoked method. The type of the second argument of the invoked method. The type of the third argument of the invoked method. The type of the fourth argument of the invoked method. The type of the fifth argument of the invoked method. The function that will calculate the return value. Returns a calculated value which is evaluated lazily at the time of the invocation. The return value is calculated from the value of the actual method invocation arguments. Notice how the arguments are retrieved by simply declaring them as part of the lambda expression: mock.Setup(x => x.Execute( It.IsAny<int>(), It.IsAny<int>(), It.IsAny<int>(), It.IsAny<int>(), It.IsAny<int>())) .Returns((string arg1, string arg2, string arg3, string arg4, string arg5) => arg1 + arg2 + arg3 + arg4 + arg5); Specifies a function that will calculate the value to return from the method, retrieving the arguments for the invocation. The type of the first argument of the invoked method. The type of the second argument of the invoked method. The type of the third argument of the invoked method. The type of the fourth argument of the invoked method. The type of the fifth argument of the invoked method. The type of the sixth argument of the invoked method. The function that will calculate the return value. Returns a calculated value which is evaluated lazily at the time of the invocation. The return value is calculated from the value of the actual method invocation arguments. Notice how the arguments are retrieved by simply declaring them as part of the lambda expression: mock.Setup(x => x.Execute( It.IsAny<int>(), It.IsAny<int>(), It.IsAny<int>(), It.IsAny<int>(), It.IsAny<int>(), It.IsAny<int>())) .Returns((string arg1, string arg2, string arg3, string arg4, string arg5, string arg6) => arg1 + arg2 + arg3 + arg4 + arg5 + arg6); Specifies a function that will calculate the value to return from the method, retrieving the arguments for the invocation. The type of the first argument of the invoked method. The type of the second argument of the invoked method. The type of the third argument of the invoked method. The type of the fourth argument of the invoked method. The type of the fifth argument of the invoked method. The type of the sixth argument of the invoked method. The type of the seventh argument of the invoked method. The function that will calculate the return value. Returns a calculated value which is evaluated lazily at the time of the invocation. The return value is calculated from the value of the actual method invocation arguments. Notice how the arguments are retrieved by simply declaring them as part of the lambda expression: mock.Setup(x => x.Execute( It.IsAny<int>(), It.IsAny<int>(), It.IsAny<int>(), It.IsAny<int>(), It.IsAny<int>(), It.IsAny<int>(), It.IsAny<int>())) .Returns((string arg1, string arg2, string arg3, string arg4, string arg5, string arg6, string arg7) => arg1 + arg2 + arg3 + arg4 + arg5 + arg6 + arg7); Specifies a function that will calculate the value to return from the method, retrieving the arguments for the invocation. The type of the first argument of the invoked method. The type of the second argument of the invoked method. The type of the third argument of the invoked method. The type of the fourth argument of the invoked method. The type of the fifth argument of the invoked method. The type of the sixth argument of the invoked method. The type of the seventh argument of the invoked method. The type of the eighth argument of the invoked method. The function that will calculate the return value. Returns a calculated value which is evaluated lazily at the time of the invocation. The return value is calculated from the value of the actual method invocation arguments. Notice how the arguments are retrieved by simply declaring them as part of the lambda expression: mock.Setup(x => x.Execute( It.IsAny<int>(), It.IsAny<int>(), It.IsAny<int>(), It.IsAny<int>(), It.IsAny<int>(), It.IsAny<int>(), It.IsAny<int>(), It.IsAny<int>())) .Returns((string arg1, string arg2, string arg3, string arg4, string arg5, string arg6, string arg7, string arg8) => arg1 + arg2 + arg3 + arg4 + arg5 + arg6 + arg7 + arg8); Specifies a function that will calculate the value to return from the method, retrieving the arguments for the invocation. The type of the first argument of the invoked method. The type of the second argument of the invoked method. The type of the third argument of the invoked method. The type of the fourth argument of the invoked method. The type of the fifth argument of the invoked method. The type of the sixth argument of the invoked method. The type of the seventh argument of the invoked method. The type of the eighth argument of the invoked method. The type of the nineth argument of the invoked method. The function that will calculate the return value. Returns a calculated value which is evaluated lazily at the time of the invocation. The return value is calculated from the value of the actual method invocation arguments. Notice how the arguments are retrieved by simply declaring them as part of the lambda expression: mock.Setup(x => x.Execute( It.IsAny<int>(), It.IsAny<int>(), It.IsAny<int>(), It.IsAny<int>(), It.IsAny<int>(), It.IsAny<int>(), It.IsAny<int>(), It.IsAny<int>(), It.IsAny<int>())) .Returns((string arg1, string arg2, string arg3, string arg4, string arg5, string arg6, string arg7, string arg8, string arg9) => arg1 + arg2 + arg3 + arg4 + arg5 + arg6 + arg7 + arg8 + arg9); Specifies a function that will calculate the value to return from the method, retrieving the arguments for the invocation. The type of the first argument of the invoked method. The type of the second argument of the invoked method. The type of the third argument of the invoked method. The type of the fourth argument of the invoked method. The type of the fifth argument of the invoked method. The type of the sixth argument of the invoked method. The type of the seventh argument of the invoked method. The type of the eighth argument of the invoked method. The type of the nineth argument of the invoked method. The type of the tenth argument of the invoked method. The function that will calculate the return value. Returns a calculated value which is evaluated lazily at the time of the invocation. The return value is calculated from the value of the actual method invocation arguments. Notice how the arguments are retrieved by simply declaring them as part of the lambda expression: mock.Setup(x => x.Execute( It.IsAny<int>(), It.IsAny<int>(), It.IsAny<int>(), It.IsAny<int>(), It.IsAny<int>(), It.IsAny<int>(), It.IsAny<int>(), It.IsAny<int>(), It.IsAny<int>(), It.IsAny<int>())) .Returns((string arg1, string arg2, string arg3, string arg4, string arg5, string arg6, string arg7, string arg8, string arg9, string arg10) => arg1 + arg2 + arg3 + arg4 + arg5 + arg6 + arg7 + arg8 + arg9 + arg10); Specifies a function that will calculate the value to return from the method, retrieving the arguments for the invocation. The type of the first argument of the invoked method. The type of the second argument of the invoked method. The type of the third argument of the invoked method. The type of the fourth argument of the invoked method. The type of the fifth argument of the invoked method. The type of the sixth argument of the invoked method. The type of the seventh argument of the invoked method. The type of the eighth argument of the invoked method. The type of the nineth argument of the invoked method. The type of the tenth argument of the invoked method. The type of the eleventh argument of the invoked method. The function that will calculate the return value. Returns a calculated value which is evaluated lazily at the time of the invocation. The return value is calculated from the value of the actual method invocation arguments. Notice how the arguments are retrieved by simply declaring them as part of the lambda expression: mock.Setup(x => x.Execute( It.IsAny<int>(), It.IsAny<int>(), It.IsAny<int>(), It.IsAny<int>(), It.IsAny<int>(), It.IsAny<int>(), It.IsAny<int>(), It.IsAny<int>(), It.IsAny<int>(), It.IsAny<int>(), It.IsAny<int>())) .Returns((string arg1, string arg2, string arg3, string arg4, string arg5, string arg6, string arg7, string arg8, string arg9, string arg10, string arg11) => arg1 + arg2 + arg3 + arg4 + arg5 + arg6 + arg7 + arg8 + arg9 + arg10 + arg11); Specifies a function that will calculate the value to return from the method, retrieving the arguments for the invocation. The type of the first argument of the invoked method. The type of the second argument of the invoked method. The type of the third argument of the invoked method. The type of the fourth argument of the invoked method. The type of the fifth argument of the invoked method. The type of the sixth argument of the invoked method. The type of the seventh argument of the invoked method. The type of the eighth argument of the invoked method. The type of the nineth argument of the invoked method. The type of the tenth argument of the invoked method. The type of the eleventh argument of the invoked method. The type of the twelfth argument of the invoked method. The function that will calculate the return value. Returns a calculated value which is evaluated lazily at the time of the invocation. The return value is calculated from the value of the actual method invocation arguments. Notice how the arguments are retrieved by simply declaring them as part of the lambda expression: mock.Setup(x => x.Execute( It.IsAny<int>(), It.IsAny<int>(), It.IsAny<int>(), It.IsAny<int>(), It.IsAny<int>(), It.IsAny<int>(), It.IsAny<int>(), It.IsAny<int>(), It.IsAny<int>(), It.IsAny<int>(), It.IsAny<int>(), It.IsAny<int>())) .Returns((string arg1, string arg2, string arg3, string arg4, string arg5, string arg6, string arg7, string arg8, string arg9, string arg10, string arg11, string arg12) => arg1 + arg2 + arg3 + arg4 + arg5 + arg6 + arg7 + arg8 + arg9 + arg10 + arg11 + arg12); Specifies a function that will calculate the value to return from the method, retrieving the arguments for the invocation. The type of the first argument of the invoked method. The type of the second argument of the invoked method. The type of the third argument of the invoked method. The type of the fourth argument of the invoked method. The type of the fifth argument of the invoked method. The type of the sixth argument of the invoked method. The type of the seventh argument of the invoked method. The type of the eighth argument of the invoked method. The type of the nineth argument of the invoked method. The type of the tenth argument of the invoked method. The type of the eleventh argument of the invoked method. The type of the twelfth argument of the invoked method. The type of the thirteenth argument of the invoked method. The function that will calculate the return value. Returns a calculated value which is evaluated lazily at the time of the invocation. The return value is calculated from the value of the actual method invocation arguments. Notice how the arguments are retrieved by simply declaring them as part of the lambda expression: mock.Setup(x => x.Execute( It.IsAny<int>(), It.IsAny<int>(), It.IsAny<int>(), It.IsAny<int>(), It.IsAny<int>(), It.IsAny<int>(), It.IsAny<int>(), It.IsAny<int>(), It.IsAny<int>(), It.IsAny<int>(), It.IsAny<int>(), It.IsAny<int>(), It.IsAny<int>())) .Returns((string arg1, string arg2, string arg3, string arg4, string arg5, string arg6, string arg7, string arg8, string arg9, string arg10, string arg11, string arg12, string arg13) => arg1 + arg2 + arg3 + arg4 + arg5 + arg6 + arg7 + arg8 + arg9 + arg10 + arg11 + arg12 + arg13); Specifies a function that will calculate the value to return from the method, retrieving the arguments for the invocation. The type of the first argument of the invoked method. The type of the second argument of the invoked method. The type of the third argument of the invoked method. The type of the fourth argument of the invoked method. The type of the fifth argument of the invoked method. The type of the sixth argument of the invoked method. The type of the seventh argument of the invoked method. The type of the eighth argument of the invoked method. The type of the nineth argument of the invoked method. The type of the tenth argument of the invoked method. The type of the eleventh argument of the invoked method. The type of the twelfth argument of the invoked method. The type of the thirteenth argument of the invoked method. The type of the fourteenth argument of the invoked method. The function that will calculate the return value. Returns a calculated value which is evaluated lazily at the time of the invocation. The return value is calculated from the value of the actual method invocation arguments. Notice how the arguments are retrieved by simply declaring them as part of the lambda expression: mock.Setup(x => x.Execute( It.IsAny<int>(), It.IsAny<int>(), It.IsAny<int>(), It.IsAny<int>(), It.IsAny<int>(), It.IsAny<int>(), It.IsAny<int>(), It.IsAny<int>(), It.IsAny<int>(), It.IsAny<int>(), It.IsAny<int>(), It.IsAny<int>(), It.IsAny<int>(), It.IsAny<int>())) .Returns((string arg1, string arg2, string arg3, string arg4, string arg5, string arg6, string arg7, string arg8, string arg9, string arg10, string arg11, string arg12, string arg13, string arg14) => arg1 + arg2 + arg3 + arg4 + arg5 + arg6 + arg7 + arg8 + arg9 + arg10 + arg11 + arg12 + arg13 + arg14); Specifies a function that will calculate the value to return from the method, retrieving the arguments for the invocation. The type of the first argument of the invoked method. The type of the second argument of the invoked method. The type of the third argument of the invoked method. The type of the fourth argument of the invoked method. The type of the fifth argument of the invoked method. The type of the sixth argument of the invoked method. The type of the seventh argument of the invoked method. The type of the eighth argument of the invoked method. The type of the nineth argument of the invoked method. The type of the tenth argument of the invoked method. The type of the eleventh argument of the invoked method. The type of the twelfth argument of the invoked method. The type of the thirteenth argument of the invoked method. The type of the fourteenth argument of the invoked method. The type of the fifteenth argument of the invoked method. The function that will calculate the return value. Returns a calculated value which is evaluated lazily at the time of the invocation. The return value is calculated from the value of the actual method invocation arguments. Notice how the arguments are retrieved by simply declaring them as part of the lambda expression: mock.Setup(x => x.Execute( It.IsAny<int>(), It.IsAny<int>(), It.IsAny<int>(), It.IsAny<int>(), It.IsAny<int>(), It.IsAny<int>(), It.IsAny<int>(), It.IsAny<int>(), It.IsAny<int>(), It.IsAny<int>(), It.IsAny<int>(), It.IsAny<int>(), It.IsAny<int>(), It.IsAny<int>(), It.IsAny<int>())) .Returns((string arg1, string arg2, string arg3, string arg4, string arg5, string arg6, string arg7, string arg8, string arg9, string arg10, string arg11, string arg12, string arg13, string arg14, string arg15) => arg1 + arg2 + arg3 + arg4 + arg5 + arg6 + arg7 + arg8 + arg9 + arg10 + arg11 + arg12 + arg13 + arg14 + arg15); Specifies a function that will calculate the value to return from the method, retrieving the arguments for the invocation. The type of the first argument of the invoked method. The type of the second argument of the invoked method. The type of the third argument of the invoked method. The type of the fourth argument of the invoked method. The type of the fifth argument of the invoked method. The type of the sixth argument of the invoked method. The type of the seventh argument of the invoked method. The type of the eighth argument of the invoked method. The type of the nineth argument of the invoked method. The type of the tenth argument of the invoked method. The type of the eleventh argument of the invoked method. The type of the twelfth argument of the invoked method. The type of the thirteenth argument of the invoked method. The type of the fourteenth argument of the invoked method. The type of the fifteenth argument of the invoked method. The type of the sixteenth argument of the invoked method. The function that will calculate the return value. Returns a calculated value which is evaluated lazily at the time of the invocation. The return value is calculated from the value of the actual method invocation arguments. Notice how the arguments are retrieved by simply declaring them as part of the lambda expression: mock.Setup(x => x.Execute( It.IsAny<int>(), It.IsAny<int>(), It.IsAny<int>(), It.IsAny<int>(), It.IsAny<int>(), It.IsAny<int>(), It.IsAny<int>(), It.IsAny<int>(), It.IsAny<int>(), It.IsAny<int>(), It.IsAny<int>(), It.IsAny<int>(), It.IsAny<int>(), It.IsAny<int>(), It.IsAny<int>(), It.IsAny<int>())) .Returns((string arg1, string arg2, string arg3, string arg4, string arg5, string arg6, string arg7, string arg8, string arg9, string arg10, string arg11, string arg12, string arg13, string arg14, string arg15, string arg16) => arg1 + arg2 + arg3 + arg4 + arg5 + arg6 + arg7 + arg8 + arg9 + arg10 + arg11 + arg12 + arg13 + arg14 + arg15 + arg16); Specifies the value to return. The value to return, or . Return a true value from the method call: mock.Setup(x => x.Execute("ping")) .Returns(true); Specifies a function that will calculate the value to return from the method. The function that will calculate the return value. Return a calculated value when the method is called: mock.Setup(x => x.Execute("ping")) .Returns(() => returnValues[0]); The lambda expression to retrieve the return value is lazy-executed, meaning that its value may change depending on the moment the method is executed and the value the returnValues array has at that moment. Specifies a function that will calculate the value to return from the method, retrieving the arguments for the invocation. The type of the argument of the invoked method. The function that will calculate the return value. Return a calculated value which is evaluated lazily at the time of the invocation. The lookup list can change between invocations and the setup will return different values accordingly. Also, notice how the specific string argument is retrieved by simply declaring it as part of the lambda expression: mock.Setup(x => x.Execute(It.IsAny<string>())) .Returns((string command) => returnValues[command]); Calls the real method of the object and returns its return value. The value calculated by the real method of the object. Implements the fluent API. Defines the Callback verb for property getter setups. Mocked type. Type of the property. Specifies a callback to invoke when the property is retrieved. Callback method to invoke. Invokes the given callback with the property value being set. mock.SetupGet(x => x.Suspended) .Callback(() => called = true) .Returns(true); Implements the fluent API. Defines the Returns verb for property get setups. Mocked type. Type of the property. Specifies the value to return. The value to return, or . Return a true value from the property getter call: mock.SetupGet(x => x.Suspended) .Returns(true); Specifies a function that will calculate the value to return for the property. The function that will calculate the return value. Return a calculated value when the property is retrieved: mock.SetupGet(x => x.Suspended) .Returns(() => returnValues[0]); The lambda expression to retrieve the return value is lazy-executed, meaning that its value may change depending on the moment the property is retrieved and the value the returnValues array has at that moment. Calls the real property of the object and returns its return value. The value calculated by the real property of the object. Implements the fluent API. Defines the Callback verb for property setter setups. Type of the property. Specifies a callback to invoke when the property is set that receives the property value being set. Callback method to invoke. Invokes the given callback with the property value being set. mock.SetupSet(x => x.Suspended) .Callback((bool state) => Console.WriteLine(state)); Language for ReturnSequence Returns value Throws an exception Throws an exception Calls original method The first method call or member access will be the last segment of the expression (depth-first traversal), which is the one we have to Setup rather than FluentMock. And the last one is the one we have to Mock.Get rather than FluentMock. A default implementation of IQueryable for use with QueryProvider The is a static method that returns an IQueryable of Mocks of T which is used to apply the linq specification to. Utility repository class to use to construct multiple mocks when consistent verification is desired for all of them. If multiple mocks will be created during a test, passing the desired (if different than the or the one passed to the repository constructor) and later verifying each mock can become repetitive and tedious. This repository class helps in that scenario by providing a simplified creation of multiple mocks with a default (unless overriden by calling ) and posterior verification. The following is a straightforward example on how to create and automatically verify strict mocks using a : var repository = new MockRepository(MockBehavior.Strict); var foo = repository.Create<IFoo>(); var bar = repository.Create<IBar>(); // no need to call Verifiable() on the setup // as we'll be validating all of them anyway. foo.Setup(f => f.Do()); bar.Setup(b => b.Redo()); // exercise the mocks here repository.VerifyAll(); // At this point all setups are already checked // and an optional MockException might be thrown. // Note also that because the mocks are strict, any invocation // that doesn't have a matching setup will also throw a MockException. The following examples shows how to setup the repository to create loose mocks and later verify only verifiable setups: var repository = new MockRepository(MockBehavior.Loose); var foo = repository.Create<IFoo>(); var bar = repository.Create<IBar>(); // this setup will be verified when we verify the repository foo.Setup(f => f.Do()).Verifiable(); // this setup will NOT be verified foo.Setup(f => f.Calculate()); // this setup will be verified when we verify the repository bar.Setup(b => b.Redo()).Verifiable(); // exercise the mocks here // note that because the mocks are Loose, members // called in the interfaces for which no matching // setups exist will NOT throw exceptions, // and will rather return default values. repository.Verify(); // At this point verifiable setups are already checked // and an optional MockException might be thrown. The following examples shows how to setup the repository with a default strict behavior, overriding that default for a specific mock: var repository = new MockRepository(MockBehavior.Strict); // this particular one we want loose var foo = repository.Create<IFoo>(MockBehavior.Loose); var bar = repository.Create<IBar>(); // specify setups // exercise the mocks here repository.Verify(); Utility factory class to use to construct multiple mocks when consistent verification is desired for all of them. If multiple mocks will be created during a test, passing the desired (if different than the or the one passed to the factory constructor) and later verifying each mock can become repetitive and tedious. This factory class helps in that scenario by providing a simplified creation of multiple mocks with a default (unless overriden by calling ) and posterior verification. The following is a straightforward example on how to create and automatically verify strict mocks using a : var factory = new MockFactory(MockBehavior.Strict); var foo = factory.Create<IFoo>(); var bar = factory.Create<IBar>(); // no need to call Verifiable() on the setup // as we'll be validating all of them anyway. foo.Setup(f => f.Do()); bar.Setup(b => b.Redo()); // exercise the mocks here factory.VerifyAll(); // At this point all setups are already checked // and an optional MockException might be thrown. // Note also that because the mocks are strict, any invocation // that doesn't have a matching setup will also throw a MockException. The following examples shows how to setup the factory to create loose mocks and later verify only verifiable setups: var factory = new MockFactory(MockBehavior.Loose); var foo = factory.Create<IFoo>(); var bar = factory.Create<IBar>(); // this setup will be verified when we verify the factory foo.Setup(f => f.Do()).Verifiable(); // this setup will NOT be verified foo.Setup(f => f.Calculate()); // this setup will be verified when we verify the factory bar.Setup(b => b.Redo()).Verifiable(); // exercise the mocks here // note that because the mocks are Loose, members // called in the interfaces for which no matching // setups exist will NOT throw exceptions, // and will rather return default values. factory.Verify(); // At this point verifiable setups are already checked // and an optional MockException might be thrown. The following examples shows how to setup the factory with a default strict behavior, overriding that default for a specific mock: var factory = new MockFactory(MockBehavior.Strict); // this particular one we want loose var foo = factory.Create<IFoo>(MockBehavior.Loose); var bar = factory.Create<IBar>(); // specify setups // exercise the mocks here factory.Verify(); Initializes the factory with the given for newly created mocks from the factory. The behavior to use for mocks created using the factory method if not overriden by using the overload. Creates a new mock with the default specified at factory construction time. Type to mock. A new . var factory = new MockFactory(MockBehavior.Strict); var foo = factory.Create<IFoo>(); // use mock on tests factory.VerifyAll(); Creates a new mock with the default specified at factory construction time and with the the given constructor arguments for the class. The mock will try to find the best match constructor given the constructor arguments, and invoke that to initialize the instance. This applies only to classes, not interfaces. Type to mock. Constructor arguments for mocked classes. A new . var factory = new MockFactory(MockBehavior.Default); var mock = factory.Create<MyBase>("Foo", 25, true); // use mock on tests factory.Verify(); Creates a new mock with the given . Type to mock. Behavior to use for the mock, which overrides the default behavior specified at factory construction time. A new . The following example shows how to create a mock with a different behavior to that specified as the default for the factory: var factory = new MockFactory(MockBehavior.Strict); var foo = factory.Create<IFoo>(MockBehavior.Loose); Creates a new mock with the given and with the the given constructor arguments for the class. The mock will try to find the best match constructor given the constructor arguments, and invoke that to initialize the instance. This applies only to classes, not interfaces. Type to mock. Behavior to use for the mock, which overrides the default behavior specified at factory construction time. Constructor arguments for mocked classes. A new . The following example shows how to create a mock with a different behavior to that specified as the default for the factory, passing constructor arguments: var factory = new MockFactory(MockBehavior.Default); var mock = factory.Create<MyBase>(MockBehavior.Strict, "Foo", 25, true); Implements creation of a new mock within the factory. Type to mock. The behavior for the new mock. Optional arguments for the construction of the mock. Verifies all verifiable expectations on all mocks created by this factory. One or more mocks had expectations that were not satisfied. Verifies all verifiable expectations on all mocks created by this factory. One or more mocks had expectations that were not satisfied. Invokes for each mock in , and accumulates the resulting that might be thrown from the action. The action to execute against each mock. Whether the base member virtual implementation will be called for mocked classes if no setup is matched. Defaults to . Specifies the behavior to use when returning default values for unexpected invocations on loose mocks. Gets the mocks that have been created by this factory and that will get verified together. Access the universe of mocks of the given type, to retrieve those that behave according to the LINQ query specification. The type of the mocked object to query. Access the universe of mocks of the given type, to retrieve those that behave according to the LINQ query specification. The predicate with the setup expressions. The type of the mocked object to query. Creates an mock object of the indicated type. The type of the mocked object. The mocked object created. Creates an mock object of the indicated type. The predicate with the setup expressions. The type of the mocked object. The mocked object created. Creates the mock query with the underlying queriable implementation. Wraps the enumerator inside a queryable. Method that is turned into the actual call from .Query{T}, to transform the queryable query into a normal enumerable query. This method is never used directly by consumers. Initializes the repository with the given for newly created mocks from the repository. The behavior to use for mocks created using the repository method if not overriden by using the overload. Allows querying the universe of mocks for those that behave according to the LINQ query specification. This entry-point into Linq to Mocks is the only one in the root Moq namespace to ease discovery. But to get all the mocking extension methods on Object, a using of Moq.Linq must be done, so that the polluting of the intellisense for all objects is an explicit opt-in. Access the universe of mocks of the given type, to retrieve those that behave according to the LINQ query specification. The type of the mocked object to query. Access the universe of mocks of the given type, to retrieve those that behave according to the LINQ query specification. The predicate with the setup expressions. The type of the mocked object to query. Creates an mock object of the indicated type. The type of the mocked object. The mocked object created. Creates an mock object of the indicated type. The predicate with the setup expressions. The type of the mocked object. The mocked object created. Creates the mock query with the underlying queriable implementation. Wraps the enumerator inside a queryable. Method that is turned into the actual call from .Query{T}, to transform the queryable query into a normal enumerable query. This method is never used directly by consumers. Extension method used to support Linq-like setup properties that are not virtual but do have a getter and a setter, thereby allowing the use of Linq to Mocks to quickly initialize Dtos too :) Helper extensions that are used by the query translator. Retrieves a fluent mock from the given setup expression. Allows creation custom value matchers that can be used on setups and verification, completely replacing the built-in class with your own argument matching rules. See also . Provided for the sole purpose of rendering the delegate passed to the matcher constructor if no friendly render lambda is provided. Initializes the match with the condition that will be checked in order to match invocation values. The condition to match against actual values. This method is used to set an expression as the last matcher invoked, which is used in the SetupSet to allow matchers in the prop = value delegate expression. This delegate is executed in "fluent" mode in order to capture the value being set, and construct the corresponding methodcall. This is also used in the MatcherFactory for each argument expression. This method ensures that when we execute the delegate, we also track the matcher that was invoked, so that when we create the methodcall we build the expression using it, rather than the null/default value returned from the actual invocation. Allows creation custom value matchers that can be used on setups and verification, completely replacing the built-in class with your own argument matching rules. Type of the value to match. The argument matching is used to determine whether a concrete invocation in the mock matches a given setup. This matching mechanism is fully extensible. Creating a custom matcher is straightforward. You just need to create a method that returns a value from a call to with your matching condition and optional friendly render expression: [Matcher] public Order IsBigOrder() { return Match<Order>.Create( o => o.GrandTotal >= 5000, /* a friendly expression to render on failures */ () => IsBigOrder()); } This method can be used in any mock setup invocation: mock.Setup(m => m.Submit(IsBigOrder()).Throws<UnauthorizedAccessException>(); At runtime, Moq knows that the return value was a matcher (note that the method MUST be annotated with the [Matcher] attribute in order to determine this) and evaluates your predicate with the actual value passed into your predicate. Another example might be a case where you want to match a lists of orders that contains a particular one. You might create matcher like the following: public static class Orders { [Matcher] public static IEnumerable<Order> Contains(Order order) { return Match<IEnumerable<Order>>.Create(orders => orders.Contains(order)); } } Now we can invoke this static method instead of an argument in an invocation: var order = new Order { ... }; var mock = new Mock<IRepository<Order>>(); mock.Setup(x => x.Save(Orders.Contains(order))) .Throws<ArgumentException>(); Marks a method as a matcher, which allows complete replacement of the built-in class with your own argument matching rules. This feature has been deprecated in favor of the new and simpler . The argument matching is used to determine whether a concrete invocation in the mock matches a given setup. This matching mechanism is fully extensible. There are two parts of a matcher: the compiler matcher and the runtime matcher. Compiler matcher Used to satisfy the compiler requirements for the argument. Needs to be a method optionally receiving any arguments you might need for the matching, but with a return type that matches that of the argument. Let's say I want to match a lists of orders that contains a particular one. I might create a compiler matcher like the following: public static class Orders { [Matcher] public static IEnumerable<Order> Contains(Order order) { return null; } } Now we can invoke this static method instead of an argument in an invocation: var order = new Order { ... }; var mock = new Mock<IRepository<Order>>(); mock.Setup(x => x.Save(Orders.Contains(order))) .Throws<ArgumentException>(); Note that the return value from the compiler matcher is irrelevant. This method will never be called, and is just used to satisfy the compiler and to signal Moq that this is not a method that we want to be invoked at runtime. Runtime matcher The runtime matcher is the one that will actually perform evaluation when the test is run, and is defined by convention to have the same signature as the compiler matcher, but where the return value is the first argument to the call, which contains the object received by the actual invocation at runtime: public static bool Contains(IEnumerable<Order> orders, Order order) { return orders.Contains(order); } At runtime, the mocked method will be invoked with a specific list of orders. This value will be passed to this runtime matcher as the first argument, while the second argument is the one specified in the setup (x.Save(Orders.Contains(order))). The boolean returned determines whether the given argument has been matched. If all arguments to the expected method are matched, then the setup matches and is evaluated. Using this extensible infrastructure, you can easily replace the entire set of matchers with your own. You can also avoid the typical (and annoying) lengthy expressions that result when you have multiple arguments that use generics. The following is the complete example explained above: public static class Orders { [Matcher] public static IEnumerable<Order> Contains(Order order) { return null; } public static bool Contains(IEnumerable<Order> orders, Order order) { return orders.Contains(order); } } And the concrete test using this matcher: var order = new Order { ... }; var mock = new Mock<IRepository<Order>>(); mock.Setup(x => x.Save(Orders.Contains(order))) .Throws<ArgumentException>(); // use mock, invoke Save, and have the matcher filter. Matcher to treat static functions as matchers. mock.Setup(x => x.StringMethod(A.MagicString())); public static class A { [Matcher] public static string MagicString() { return null; } public static bool MagicString(string arg) { return arg == "magic"; } } Will succeed if: mock.Object.StringMethod("magic"); and fail with any other call. We need this non-generics base class so that we can use from generic code. Options to customize the behavior of the mock. Causes the mock to always throw an exception for invocations that don't have a corresponding setup. Will never throw exceptions, returning default values when necessary (null for reference types, zero for value types or empty enumerables and arrays). Default mock behavior, which equals . A that returns an empty default value for non-mockeable types, and mocks for all other types (interfaces and non-sealed classes) that can be mocked. Exception thrown by mocks when setups are not matched, the mock is not properly setup, etc. A distinct exception type is provided so that exceptions thrown by the mock can be differentiated in tests that expect other exceptions to be thrown (i.e. ArgumentException). Richer exception hierarchy/types are not provided as tests typically should not catch or expect exceptions from the mocks. These are typically the result of changes in the tested class or its collaborators implementation, and result in fixes in the mock setup so that they dissapear and allow the test to pass. Indicates whether this exception is a verification fault raised by Verify() Made internal as it's of no use for consumers, but it's important for our own tests. Used by the mock factory to accumulate verification failures. Helper class to setup a full trace between many mocks Initialize a trace setup Allow sequence to be repeated define nice api Perform an expectation in the trace. Provides legacy API members as extensions so that existing code continues to compile, but new code doesn't see then. Obsolete. Obsolete. Obsolete. Provides additional methods on mocks. Provided as extension methods as they confuse the compiler with the overloads taking Action. Specifies a setup on the mocked type for a call to to a property setter, regardless of its value. If more than one setup is set for the same property setter, the latest one wins and is the one that will be executed. Type of the property. Typically omitted as it can be inferred from the expression. Type of the mock. The target mock for the setup. Lambda expression that specifies the property setter. mock.SetupSet(x => x.Suspended); This method is not legacy, but must be on an extension method to avoid confusing the compiler with the new Action syntax. Verifies that a property has been set on the mock, regarless of its value. This example assumes that the mock has been used, and later we want to verify that a given invocation with specific parameters was performed: var mock = new Mock<IWarehouse>(); // exercise mock //... // Will throw if the test code didn't set the IsClosed property. mock.VerifySet(warehouse => warehouse.IsClosed); The invocation was not performed on the mock. Expression to verify. The mock instance. Mocked type. Type of the property to verify. Typically omitted as it can be inferred from the expression's return type. Verifies that a property has been set on the mock, specifying a failure error message. This example assumes that the mock has been used, and later we want to verify that a given invocation with specific parameters was performed: var mock = new Mock<IWarehouse>(); // exercise mock //... // Will throw if the test code didn't set the IsClosed property. mock.VerifySet(warehouse => warehouse.IsClosed); The invocation was not performed on the mock. Expression to verify. Message to show if verification fails. The mock instance. Mocked type. Type of the property to verify. Typically omitted as it can be inferred from the expression's return type. Verifies that a property has been set on the mock, regardless of the value but only the specified number of times. This example assumes that the mock has been used, and later we want to verify that a given invocation with specific parameters was performed: var mock = new Mock<IWarehouse>(); // exercise mock //... // Will throw if the test code didn't set the IsClosed property. mock.VerifySet(warehouse => warehouse.IsClosed); The invocation was not performed on the mock. The invocation was not call the times specified by . The mock instance. Mocked type. The number of times a method is allowed to be called. Expression to verify. Type of the property to verify. Typically omitted as it can be inferred from the expression's return type. Verifies that a property has been set on the mock, regardless of the value but only the specified number of times, and specifying a failure error message. This example assumes that the mock has been used, and later we want to verify that a given invocation with specific parameters was performed: var mock = new Mock<IWarehouse>(); // exercise mock //... // Will throw if the test code didn't set the IsClosed property. mock.VerifySet(warehouse => warehouse.IsClosed); The invocation was not performed on the mock. The invocation was not call the times specified by . The mock instance. Mocked type. The number of times a method is allowed to be called. Message to show if verification fails. Expression to verify. Type of the property to verify. Typically omitted as it can be inferred from the expression's return type. Allows setups to be specified for protected members by using their name as a string, rather than strong-typing them which is not possible due to their visibility. Specifies a setup for a void method invocation with the given , optionally specifying arguments for the method call. The name of the void method to be invoked. The optional arguments for the invocation. If argument matchers are used, remember to use rather than . Specifies a setup for an invocation on a property or a non void method with the given , optionally specifying arguments for the method call. The name of the method or property to be invoked. The optional arguments for the invocation. If argument matchers are used, remember to use rather than . The return type of the method or property. Specifies a setup for an invocation on a property getter with the given . The name of the property. The type of the property. Specifies a setup for an invocation on a property setter with the given . The name of the property. The property value. If argument matchers are used, remember to use rather than . The type of the property. Specifies a verify for a void method with the given , optionally specifying arguments for the method call. Use in conjuntion with the default . The invocation was not call the times specified by . The name of the void method to be verified. The number of times a method is allowed to be called. The optional arguments for the invocation. If argument matchers are used, remember to use rather than . Specifies a verify for an invocation on a property or a non void method with the given , optionally specifying arguments for the method call. The invocation was not call the times specified by . The name of the method or property to be invoked. The optional arguments for the invocation. If argument matchers are used, remember to use rather than . The number of times a method is allowed to be called. The type of return value from the expression. Specifies a verify for an invocation on a property getter with the given . The invocation was not call the times specified by . The name of the property. The number of times a method is allowed to be called. The type of the property. Specifies a setup for an invocation on a property setter with the given . The invocation was not call the times specified by . The name of the property. The number of times a method is allowed to be called. The property value. The type of the property. If argument matchers are used, remember to use rather than . Allows the specification of a matching condition for an argument in a protected member setup, rather than a specific argument value. "ItExpr" refers to the argument being matched. Use this variant of argument matching instead of for protected setups. This class allows the setup to match a method invocation with an arbitrary value, with a value in a specified range, or even one that matches a given predicate, or null. Matches a null value of the given type. Required for protected mocks as the null value cannot be used directly as it prevents proper method overload selection. // Throws an exception for a call to Remove with a null string value. mock.Protected() .Setup("Remove", ItExpr.IsNull<string>()) .Throws(new InvalidOperationException()); Type of the value. Matches any value of the given type. Typically used when the actual argument value for a method call is not relevant. // Throws an exception for a call to Remove with any string value. mock.Protected() .Setup("Remove", ItExpr.IsAny<string>()) .Throws(new InvalidOperationException()); Type of the value. Matches any value that satisfies the given predicate. Type of the argument to check. The predicate used to match the method argument. Allows the specification of a predicate to perform matching of method call arguments. This example shows how to return the value 1 whenever the argument to the Do method is an even number. mock.Protected() .Setup("Do", ItExpr.Is<int>(i => i % 2 == 0)) .Returns(1); This example shows how to throw an exception if the argument to the method is a negative number: mock.Protected() .Setup("GetUser", ItExpr.Is<int>(i => i < 0)) .Throws(new ArgumentException()); Matches any value that is in the range specified. Type of the argument to check. The lower bound of the range. The upper bound of the range. The kind of range. See . The following example shows how to expect a method call with an integer argument within the 0..100 range. mock.Protected() .Setup("HasInventory", ItExpr.IsAny<string>(), ItExpr.IsInRange(0, 100, Range.Inclusive)) .Returns(false); Matches a string argument if it matches the given regular expression pattern. The pattern to use to match the string argument value. The following example shows how to expect a call to a method where the string argument matches the given regular expression: mock.Protected() .Setup("Check", ItExpr.IsRegex("[a-z]+")) .Returns(1); Matches a string argument if it matches the given regular expression pattern. The pattern to use to match the string argument value. The options used to interpret the pattern. The following example shows how to expect a call to a method where the string argument matches the given regular expression, in a case insensitive way: mock.Protected() .Setup("Check", ItExpr.IsRegex("[a-z]+", RegexOptions.IgnoreCase)) .Returns(1); Enables the Protected() method on , allowing setups to be set for protected members by using their name as a string, rather than strong-typing them which is not possible due to their visibility. Enable protected setups for the mock. Mocked object type. Typically omitted as it can be inferred from the mock instance. The mock to set the protected setups on. A strongly-typed resource class, for looking up localized strings, etc. Returns the cached ResourceManager instance used by this class. Overrides the current thread's CurrentUICulture property for all resource lookups using this strongly typed resource class. Looks up a localized string similar to Mock type has already been initialized by accessing its Object property. Adding interfaces must be done before that.. Looks up a localized string similar to Value cannot be an empty string.. Looks up a localized string similar to Can only add interfaces to the mock.. Looks up a localized string similar to Can't set return value for void method {0}.. Looks up a localized string similar to Constructor arguments cannot be passed for delegate mocks.. Looks up a localized string similar to Constructor arguments cannot be passed for interface mocks.. Looks up a localized string similar to A matching constructor for the given arguments was not found on the mocked type.. Looks up a localized string similar to Could not locate event for attach or detach method {0}.. Looks up a localized string similar to Expression {0} involves a field access, which is not supported. Use properties instead.. Looks up a localized string similar to Type to mock must be an interface or an abstract or non-sealed class. . Looks up a localized string similar to Cannot retrieve a mock with the given object type {0} as it's not the main type of the mock or any of its additional interfaces. Please cast the argument to one of the supported types: {1}. Remember that there's no generics covariance in the CLR, so your object must be one of these types in order for the call to succeed.. Looks up a localized string similar to The equals ("==" or "=" in VB) and the conditional 'and' ("&&" or "AndAlso" in VB) operators are the only ones supported in the query specification expression. Unsupported expression: {0}. Looks up a localized string similar to LINQ method '{0}' not supported.. Looks up a localized string similar to Expression contains a call to a method which is not virtual (overridable in VB) or abstract. Unsupported expression: {0}. Looks up a localized string similar to Member {0}.{1} does not exist.. Looks up a localized string similar to Method {0}.{1} is public. Use strong-typed Expect overload instead: mock.Setup(x => x.{1}()); . Looks up a localized string similar to {0} invocation failed with mock behavior {1}. {2}. Looks up a localized string similar to Expected only {0} calls to {1}.. Looks up a localized string similar to Expected only one call to {0}.. Looks up a localized string similar to {0} Expected invocation on the mock at least {2} times, but was {4} times: {1}. Looks up a localized string similar to {0} Expected invocation on the mock at least once, but was never performed: {1}. Looks up a localized string similar to {0} Expected invocation on the mock at most {3} times, but was {4} times: {1}. Looks up a localized string similar to {0} Expected invocation on the mock at most once, but was {4} times: {1}. Looks up a localized string similar to {0} Expected invocation on the mock between {2} and {3} times (Exclusive), but was {4} times: {1}. Looks up a localized string similar to {0} Expected invocation on the mock between {2} and {3} times (Inclusive), but was {4} times: {1}. Looks up a localized string similar to {0} Expected invocation on the mock exactly {2} times, but was {4} times: {1}. Looks up a localized string similar to {0} Expected invocation on the mock should never have been performed, but was {4} times: {1}. Looks up a localized string similar to {0} Expected invocation on the mock once, but was {4} times: {1}. Looks up a localized string similar to All invocations on the mock must have a corresponding setup.. Looks up a localized string similar to Object instance was not created by Moq.. Looks up a localized string similar to Out expression must evaluate to a constant value.. Looks up a localized string similar to Property {0}.{1} does not have a getter.. Looks up a localized string similar to Property {0}.{1} does not exist.. Looks up a localized string similar to Property {0}.{1} is write-only.. Looks up a localized string similar to Property {0}.{1} is read-only.. Looks up a localized string similar to Property {0}.{1} does not have a setter.. Looks up a localized string similar to Cannot raise a mocked event unless it has been associated (attached) to a concrete event in a mocked object.. Looks up a localized string similar to Ref expression must evaluate to a constant value.. Looks up a localized string similar to Invocation needs to return a value and therefore must have a corresponding setup that provides it.. Looks up a localized string similar to A lambda expression is expected as the argument to It.Is<T>.. Looks up a localized string similar to Invocation {0} should not have been made.. Looks up a localized string similar to Expression is not a method invocation: {0}. Looks up a localized string similar to Expression is not a property access: {0}. Looks up a localized string similar to Expression is not a property setter invocation.. Looks up a localized string similar to Expression references a method that does not belong to the mocked object: {0}. Looks up a localized string similar to Invalid setup on a non-virtual (overridable in VB) member: {0}. Looks up a localized string similar to Type {0} does not implement required interface {1}. Looks up a localized string similar to Type {0} does not from required type {1}. Looks up a localized string similar to To specify a setup for public property {0}.{1}, use the typed overloads, such as: mock.Setup(x => x.{1}).Returns(value); mock.SetupGet(x => x.{1}).Returns(value); //equivalent to previous one mock.SetupSet(x => x.{1}).Callback(callbackDelegate); . Looks up a localized string similar to Unsupported expression: {0}. Looks up a localized string similar to Only property accesses are supported in intermediate invocations on a setup. Unsupported expression {0}.. Looks up a localized string similar to Expression contains intermediate property access {0}.{1} which is of type {2} and cannot be mocked. Unsupported expression {3}.. Looks up a localized string similar to Setter expression cannot use argument matchers that receive parameters.. Looks up a localized string similar to Member {0} is not supported for protected mocking.. Looks up a localized string similar to Setter expression can only use static custom matchers.. Looks up a localized string similar to The following setups were not matched: {0}. Looks up a localized string similar to Invalid verify on a non-virtual (overridable in VB) member: {0}. Gets an autogenerated interface with a method on it that matches the signature of the specified . Such an interface can then be mocked, and a delegate pointed at the method on the mocked instance. This is how we support delegate mocking. The factory caches such interfaces and reuses them for repeated requests for the same delegate type. The delegate type for which an interface is required. The method on the autogenerated interface. Hook used to tells Castle which methods to proxy in mocked classes. Here we proxy the default methods Castle suggests (everything Object's methods) plus Object.ToString(), so we can give mocks useful default names. This is required to allow Moq to mock ToString on proxy *class* implementations. Extends AllMethodsHook.ShouldInterceptMethod to also intercept Object.ToString(). The base class used for all our interface-inheriting proxies, which overrides the default Object.ToString() behavior, to route it via the mock by default, unless overriden by a real implementation. This is required to allow Moq to mock ToString on proxy *interface* implementations. This is internal to Moq and should not be generally used. Unfortunately it must be public, due to cross-assembly visibility issues with reflection, see github.com/Moq/moq4/issues/98 for details. Overrides the default ToString implementation to instead find the mock for this mock.Object, and return MockName + '.Object' as the mocked object's ToString, to make it easy to relate mocks and mock object instances in error messages. Kind of range to use in a filter specified through . The range includes the to and from values. The range does not include the to and from values. Helper for sequencing return values in the same method. Return a sequence of values, once per call. Defines the number of invocations allowed by a mocked method. Specifies that a mocked method should be invoked times as minimum. The minimun number of times.An object defining the allowed number of invocations. Specifies that a mocked method should be invoked one time as minimum. An object defining the allowed number of invocations. Specifies that a mocked method should be invoked time as maximun. The maximun number of times.An object defining the allowed number of invocations. Specifies that a mocked method should be invoked one time as maximun. An object defining the allowed number of invocations. Specifies that a mocked method should be invoked between and times. The minimun number of times.The maximun number of times. The kind of range. See . An object defining the allowed number of invocations. Specifies that a mocked method should be invoked exactly times. The times that a method or property can be called.An object defining the allowed number of invocations. Specifies that a mocked method should not be invoked. An object defining the allowed number of invocations. Specifies that a mocked method should be invoked exactly one time. An object defining the allowed number of invocations. Determines whether the specified is equal to this instance. The to compare with this instance. true if the specified is equal to this instance; otherwise, false. Returns a hash code for this instance. A hash code for this instance, suitable for use in hashing algorithms and data structures like a hash table. Determines whether two specified objects have the same value. The first . The second . true if the value of left is the same as the value of right; otherwise, false. Determines whether two specified objects have different values. The first . The second . true if the value of left is different from the value of right; otherwise, false. ================================================ FILE: packages/Newtonsoft.Json.6.0.2/Newtonsoft.Json.6.0.2.nuspec ================================================ Newtonsoft.Json 6.0.2 Json.NET James Newton-King James Newton-King https://raw.github.com/JamesNK/Newtonsoft.Json/master/LICENSE.md http://james.newtonking.com/json false Json.NET is a popular high-performance JSON framework for .NET en-US json ================================================ FILE: packages/Newtonsoft.Json.6.0.2/lib/net20/Newtonsoft.Json.xml ================================================ Newtonsoft.Json Represents a BSON Oid (object id). Initializes a new instance of the class. The Oid value. Gets or sets the value of the Oid. The value of the Oid. Represents a reader that provides fast, non-cached, forward-only access to serialized Json data. Represents a reader that provides fast, non-cached, forward-only access to serialized Json data. Initializes a new instance of the class with the specified . Reads the next JSON token from the stream. true if the next token was read successfully; false if there are no more tokens to read. Reads the next JSON token from the stream as a . A . This method will return null at the end of an array. Reads the next JSON token from the stream as a . A . This method will return null at the end of an array. Reads the next JSON token from the stream as a . A or a null reference if the next JSON token is null. This method will return null at the end of an array. Reads the next JSON token from the stream as a . A . This method will return null at the end of an array. Reads the next JSON token from the stream as a . A . This method will return null at the end of an array. Skips the children of the current token. Sets the current token. The new token. Sets the current token and value. The new token. The value. Sets the state based on current token type. Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources. Releases unmanaged and - optionally - managed resources true to release both managed and unmanaged resources; false to release only unmanaged resources. Changes the to Closed. Gets the current reader state. The current reader state. Gets or sets a value indicating whether the underlying stream or should be closed when the reader is closed. true to close the underlying stream or when the reader is closed; otherwise false. The default is true. Gets or sets a value indicating whether multiple pieces of JSON content can be read from a continuous stream without erroring. true to support reading multiple pieces of JSON content; otherwise false. The default is false. Gets the quotation mark character used to enclose the value of a string. Get or set how time zones are handling when reading JSON. Get or set how date formatted strings, e.g. "\/Date(1198908717056)\/" and "2012-03-21T05:40Z", are parsed when reading JSON. Get or set how floating point numbers, e.g. 1.0 and 9.9, are parsed when reading JSON text. Gets or sets the maximum depth allowed when reading JSON. Reading past this depth will throw a . Gets the type of the current JSON token. Gets the text value of the current JSON token. Gets The Common Language Runtime (CLR) type for the current JSON token. Gets the depth of the current token in the JSON document. The depth of the current token in the JSON document. Gets the path of the current JSON token. Gets or sets the culture used when reading JSON. Defaults to . Specifies the state of the reader. The Read method has not been called. The end of the file has been reached successfully. Reader is at a property. Reader is at the start of an object. Reader is in an object. Reader is at the start of an array. Reader is in an array. The Close method has been called. Reader has just read a value. Reader is at the start of a constructor. Reader in a constructor. An error occurred that prevents the read operation from continuing. The end of the file has been reached successfully. Initializes a new instance of the class. The stream. Initializes a new instance of the class. The reader. Initializes a new instance of the class. The stream. if set to true the root object will be read as a JSON array. The used when reading values from BSON. Initializes a new instance of the class. The reader. if set to true the root object will be read as a JSON array. The used when reading values from BSON. Reads the next JSON token from the stream as a . A or a null reference if the next JSON token is null. This method will return null at the end of an array. Reads the next JSON token from the stream as a . A . This method will return null at the end of an array. Reads the next JSON token from the stream as a . A . This method will return null at the end of an array. Reads the next JSON token from the stream as a . A . This method will return null at the end of an array. Reads the next JSON token from the stream as a . A . This method will return null at the end of an array. Reads the next JSON token from the stream. true if the next token was read successfully; false if there are no more tokens to read. Changes the to Closed. Gets or sets a value indicating whether binary data reading should compatible with incorrect Json.NET 3.5 written binary. true if binary data reading will be compatible with incorrect Json.NET 3.5 written binary; otherwise, false. Gets or sets a value indicating whether the root object will be read as a JSON array. true if the root object will be read as a JSON array; otherwise, false. Gets or sets the used when reading values from BSON. The used when reading values from BSON. Represents a writer that provides a fast, non-cached, forward-only way of generating JSON data. Represents a writer that provides a fast, non-cached, forward-only way of generating Json data. Creates an instance of the JsonWriter class. Flushes whatever is in the buffer to the underlying streams and also flushes the underlying stream. Closes this stream and the underlying stream. Writes the beginning of a Json object. Writes the end of a Json object. Writes the beginning of a Json array. Writes the end of an array. Writes the start of a constructor with the given name. The name of the constructor. Writes the end constructor. Writes the property name of a name/value pair on a JSON object. The name of the property. Writes the property name of a name/value pair on a JSON object. The name of the property. A flag to indicate whether the text should be escaped when it is written as a JSON property name. Writes the end of the current Json object or array. Writes the current token and its children. The to read the token from. Writes the current token. The to read the token from. A flag indicating whether the current token's children should be written. Writes the specified end token. The end token to write. Writes indent characters. Writes the JSON value delimiter. Writes an indent space. Writes a null value. Writes an undefined value. Writes raw JSON without changing the writer's state. The raw JSON to write. Writes raw JSON where a value is expected and updates the writer's state. The raw JSON to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. An error will raised if the value cannot be written as a single JSON token. The value to write. Writes out a comment /*...*/ containing the specified text. Text to place inside the comment. Writes out the given white space. The string of white space characters. Sets the state of the JsonWriter, The JsonToken being written. The value being written. Gets or sets a value indicating whether the underlying stream or should be closed when the writer is closed. true to close the underlying stream or when the writer is closed; otherwise false. The default is true. Gets the top. The top. Gets the state of the writer. Gets the path of the writer. Indicates how JSON text output is formatted. Get or set how dates are written to JSON text. Get or set how time zones are handling when writing JSON text. Get or set how strings are escaped when writing JSON text. Get or set how special floating point numbers, e.g. , and , are written to JSON text. Get or set how and values are formatting when writing JSON text. Gets or sets the culture used when writing JSON. Defaults to . Initializes a new instance of the class. The stream. Initializes a new instance of the class. The writer. Flushes whatever is in the buffer to the underlying streams and also flushes the underlying stream. Writes the end. The token. Writes out a comment /*...*/ containing the specified text. Text to place inside the comment. Writes the start of a constructor with the given name. The name of the constructor. Writes raw JSON. The raw JSON to write. Writes raw JSON where a value is expected and updates the writer's state. The raw JSON to write. Writes the beginning of a Json array. Writes the beginning of a Json object. Writes the property name of a name/value pair on a Json object. The name of the property. Closes this stream and the underlying stream. Writes a value. An error will raised if the value cannot be written as a single JSON token. The value to write. Writes a null value. Writes an undefined value. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value that represents a BSON object id. The Object ID value to write. Writes a BSON regex. The regex pattern. The regex options. Gets or sets the used when writing values to BSON. When set to no conversion will occur. The used when writing values to BSON. Specifies how constructors are used when initializing objects during deserialization by the . First attempt to use the public default constructor, then fall back to single paramatized constructor, then the non-public default constructor. Json.NET will use a non-public default constructor before falling back to a paramatized constructor. Converts a binary value to and from a base 64 string value. Converts an object to and from JSON. Writes the JSON representation of the object. The to write to. The value. The calling serializer. Reads the JSON representation of the object. The to read from. Type of the object. The existing value of object being read. The calling serializer. The object value. Determines whether this instance can convert the specified object type. Type of the object. true if this instance can convert the specified object type; otherwise, false. Gets the of the JSON produced by the JsonConverter. The of the JSON produced by the JsonConverter. Gets a value indicating whether this can read JSON. true if this can read JSON; otherwise, false. Gets a value indicating whether this can write JSON. true if this can write JSON; otherwise, false. Writes the JSON representation of the object. The to write to. The value. The calling serializer. Reads the JSON representation of the object. The to read from. Type of the object. The existing value of object being read. The calling serializer. The object value. Determines whether this instance can convert the specified object type. Type of the object. true if this instance can convert the specified object type; otherwise, false. Converts a to and from JSON and BSON. Writes the JSON representation of the object. The to write to. The value. The calling serializer. Reads the JSON representation of the object. The to read from. Type of the object. The existing value of object being read. The calling serializer. The object value. Determines whether this instance can convert the specified object type. Type of the object. true if this instance can convert the specified object type; otherwise, false. Create a custom object The object type to convert. Writes the JSON representation of the object. The to write to. The value. The calling serializer. Reads the JSON representation of the object. The to read from. Type of the object. The existing value of object being read. The calling serializer. The object value. Creates an object which will then be populated by the serializer. Type of the object. The created object. Determines whether this instance can convert the specified object type. Type of the object. true if this instance can convert the specified object type; otherwise, false. Gets a value indicating whether this can write JSON. true if this can write JSON; otherwise, false. Converts a to and from JSON. Writes the JSON representation of the object. The to write to. The value. The calling serializer. Reads the JSON representation of the object. The to read from. Type of the object. The existing value of object being read. The calling serializer. The object value. Determines whether this instance can convert the specified value type. Type of the value. true if this instance can convert the specified value type; otherwise, false. Converts a to and from JSON. Writes the JSON representation of the object. The to write to. The value. The calling serializer. Reads the JSON representation of the object. The to read from. Type of the object. The existing value of object being read. The calling serializer. The object value. Determines whether this instance can convert the specified value type. Type of the value. true if this instance can convert the specified value type; otherwise, false. Provides a base class for converting a to and from JSON. Determines whether this instance can convert the specified object type. Type of the object. true if this instance can convert the specified object type; otherwise, false. Converts a F# discriminated union type to and from JSON. Writes the JSON representation of the object. The to write to. The value. The calling serializer. Reads the JSON representation of the object. The to read from. Type of the object. The existing value of object being read. The calling serializer. The object value. Determines whether this instance can convert the specified object type. Type of the object. true if this instance can convert the specified object type; otherwise, false. Converts a to and from JSON. Writes the JSON representation of the object. The to write to. The value. The calling serializer. Reads the JSON representation of the object. The to read from. Type of the object. The existing value of object being read. The calling serializer. The object value. Determines whether this instance can convert the specified object type. Type of the object. true if this instance can convert the specified object type; otherwise, false. Converts a to and from JSON and BSON. Writes the JSON representation of the object. The to write to. The value. The calling serializer. Reads the JSON representation of the object. The to read from. Type of the object. The existing value of object being read. The calling serializer. The object value. Determines whether this instance can convert the specified object type. Type of the object. true if this instance can convert the specified object type; otherwise, false. Converts an to and from its name string value. Initializes a new instance of the class. Writes the JSON representation of the object. The to write to. The value. The calling serializer. Reads the JSON representation of the object. The to read from. Type of the object. The existing value of object being read. The calling serializer. The object value. Determines whether this instance can convert the specified object type. Type of the object. true if this instance can convert the specified object type; otherwise, false. Gets or sets a value indicating whether the written enum text should be camel case. true if the written enum text will be camel case; otherwise, false. Gets or sets a value indicating whether integer values are allowed. true if integers are allowed; otherwise, false. Converts a to and from a string (e.g. "1.2.3.4"). Writes the JSON representation of the object. The to write to. The value. The calling serializer. Reads the JSON representation of the object. The to read from. Type of the object. The existing property value of the JSON that is being converted. The calling serializer. The object value. Determines whether this instance can convert the specified object type. Type of the object. true if this instance can convert the specified object type; otherwise, false. Specifies how dates are formatted when writing JSON text. Dates are written in the ISO 8601 format, e.g. "2012-03-21T05:40Z". Dates are written in the Microsoft JSON format, e.g. "\/Date(1198908717056)\/". Specifies how date formatted strings, e.g. "\/Date(1198908717056)\/" and "2012-03-21T05:40Z", are parsed when reading JSON text. Date formatted strings are not parsed to a date type and are read as strings. Date formatted strings, e.g. "\/Date(1198908717056)\/" and "2012-03-21T05:40Z", are parsed to . Specifies how to treat the time value when converting between string and . Treat as local time. If the object represents a Coordinated Universal Time (UTC), it is converted to the local time. Treat as a UTC. If the object represents a local time, it is converted to a UTC. Treat as a local time if a is being converted to a string. If a string is being converted to , convert to a local time if a time zone is specified. Time zone information should be preserved when converting. Specifies float format handling options when writing special floating point numbers, e.g. , and with . Write special floating point values as strings in JSON, e.g. "NaN", "Infinity", "-Infinity". Write special floating point values as symbols in JSON, e.g. NaN, Infinity, -Infinity. Note that this will produce non-valid JSON. Write special floating point values as the property's default value in JSON, e.g. 0.0 for a property, null for a property. Specifies how floating point numbers, e.g. 1.0 and 9.9, are parsed when reading JSON text. Floating point numbers are parsed to . Floating point numbers are parsed to . Specifies formatting options for the . No special formatting is applied. This is the default. Causes child objects to be indented according to the and settings. Instructs the to use the specified constructor when deserializing that object. Instructs the how to serialize the collection. Instructs the how to serialize the object. Initializes a new instance of the class. Initializes a new instance of the class with the specified container Id. The container Id. Gets or sets the id. The id. Gets or sets the title. The title. Gets or sets the description. The description. Gets the collection's items converter. The collection's items converter. Gets or sets a value that indicates whether to preserve object references. true to keep object reference; otherwise, false. The default is false. Gets or sets a value that indicates whether to preserve collection's items references. true to keep collection's items object references; otherwise, false. The default is false. Gets or sets the reference loop handling used when serializing the collection's items. The reference loop handling. Gets or sets the type name handling used when serializing the collection's items. The type name handling. Initializes a new instance of the class. Initializes a new instance of the class with the specified container Id. The container Id. The exception thrown when an error occurs during Json serialization or deserialization. Initializes a new instance of the class. Initializes a new instance of the class with a specified error message. The error message that explains the reason for the exception. Initializes a new instance of the class with a specified error message and a reference to the inner exception that is the cause of this exception. The error message that explains the reason for the exception. The exception that is the cause of the current exception, or a null reference (Nothing in Visual Basic) if no inner exception is specified. Initializes a new instance of the class. The that holds the serialized object data about the exception being thrown. The that contains contextual information about the source or destination. The parameter is null. The class name is null or is zero (0). Instructs the to deserialize properties with no matching class member into the specified collection and write values during serialization. Initializes a new instance of the class. Gets or sets a value that indicates whether to write extension data when serializing the object. true to write extension data when serializing the object; otherwise, false. The default is true. Gets or sets a value that indicates whether to read extension data when deserializing the object. true to read extension data when deserializing the object; otherwise, false. The default is true. Represents a trace writer that writes to the application's instances. Represents a trace writer. Writes the specified trace level, message and optional exception. The at which to write this trace. The trace message. The trace exception. This parameter is optional. Gets the that will be used to filter the trace messages passed to the writer. For example a filter level of Info will exclude Verbose messages and include Info, Warning and Error messages. The that will be used to filter the trace messages passed to the writer. Writes the specified trace level, message and optional exception. The at which to write this trace. The trace message. The trace exception. This parameter is optional. Gets the that will be used to filter the trace messages passed to the writer. For example a filter level of Info will exclude Verbose messages and include Info, Warning and Error messages. The that will be used to filter the trace messages passed to the writer. Contract details for a used by the . Contract details for a used by the . Gets the underlying type for the contract. The underlying type for the contract. Gets or sets the type created during deserialization. The type created during deserialization. Gets or sets whether this type contract is serialized as a reference. Whether this type contract is serialized as a reference. Gets or sets the default for this contract. The converter. Gets or sets all methods called immediately after deserialization of the object. The methods called immediately after deserialization of the object. Gets or sets all methods called during deserialization of the object. The methods called during deserialization of the object. Gets or sets all methods called after serialization of the object graph. The methods called after serialization of the object graph. Gets or sets all methods called before serialization of the object. The methods called before serialization of the object. Gets or sets all method called when an error is thrown during the serialization of the object. The methods called when an error is thrown during the serialization of the object. Gets or sets the method called immediately after deserialization of the object. The method called immediately after deserialization of the object. Gets or sets the method called during deserialization of the object. The method called during deserialization of the object. Gets or sets the method called after serialization of the object graph. The method called after serialization of the object graph. Gets or sets the method called before serialization of the object. The method called before serialization of the object. Gets or sets the method called when an error is thrown during the serialization of the object. The method called when an error is thrown during the serialization of the object. Gets or sets the default creator method used to create the object. The default creator method used to create the object. Gets or sets a value indicating whether the default creator is non public. true if the default object creator is non-public; otherwise, false. Initializes a new instance of the class. The underlying type for the contract. Gets or sets the default collection items . The converter. Gets or sets a value indicating whether the collection items preserve object references. true if collection items preserve object references; otherwise, false. Gets or sets the collection item reference loop handling. The reference loop handling. Gets or sets the collection item type name handling. The type name handling. Represents a trace writer that writes to memory. When the trace message limit is reached then old trace messages will be removed as new messages are added. Initializes a new instance of the class. Writes the specified trace level, message and optional exception. The at which to write this trace. The trace message. The trace exception. This parameter is optional. Returns an enumeration of the most recent trace messages. An enumeration of the most recent trace messages. Returns a of the most recent trace messages. A of the most recent trace messages. Gets the that will be used to filter the trace messages passed to the writer. For example a filter level of Info will exclude Verbose messages and include Info, Warning and Error messages. The that will be used to filter the trace messages passed to the writer. Provides an interface to enable a class to return line and position information. Gets a value indicating whether the class can return line information. true if LineNumber and LinePosition can be provided; otherwise, false. Gets the current line number. The current line number or 0 if no line information is available (for example, HasLineInfo returns false). Gets the current line position. The current line position or 0 if no line information is available (for example, HasLineInfo returns false). Specifies how strings are escaped when writing JSON text. Only control characters (e.g. newline) are escaped. All non-ASCII and control characters (e.g. newline) are escaped. HTML (<, >, &, ', ") and control characters (e.g. newline) are escaped. Provides a set of static (Shared in Visual Basic) methods for querying objects that implement . Returns the input typed as . Returns an empty that has the specified type argument. Converts the elements of an to the specified type. Filters the elements of an based on a specified type. Generates a sequence of integral numbers within a specified range. The value of the first integer in the sequence. The number of sequential integers to generate. Generates a sequence that contains one repeated value. Filters a sequence of values based on a predicate. Filters a sequence of values based on a predicate. Each element's index is used in the logic of the predicate function. Projects each element of a sequence into a new form. Projects each element of a sequence into a new form by incorporating the element's index. Projects each element of a sequence to an and flattens the resulting sequences into one sequence. Projects each element of a sequence to an , and flattens the resulting sequences into one sequence. The index of each source element is used in the projected form of that element. Projects each element of a sequence to an , flattens the resulting sequences into one sequence, and invokes a result selector function on each element therein. Projects each element of a sequence to an , flattens the resulting sequences into one sequence, and invokes a result selector function on each element therein. The index of each source element is used in the intermediate projected form of that element. Returns elements from a sequence as long as a specified condition is true. Returns elements from a sequence as long as a specified condition is true. The element's index is used in the logic of the predicate function. Base implementation of First operator. Returns the first element of a sequence. Returns the first element in a sequence that satisfies a specified condition. Returns the first element of a sequence, or a default value if the sequence contains no elements. Returns the first element of the sequence that satisfies a condition or a default value if no such element is found. Base implementation of Last operator. Returns the last element of a sequence. Returns the last element of a sequence that satisfies a specified condition. Returns the last element of a sequence, or a default value if the sequence contains no elements. Returns the last element of a sequence that satisfies a condition or a default value if no such element is found. Base implementation of Single operator. Returns the only element of a sequence, and throws an exception if there is not exactly one element in the sequence. Returns the only element of a sequence that satisfies a specified condition, and throws an exception if more than one such element exists. Returns the only element of a sequence, or a default value if the sequence is empty; this method throws an exception if there is more than one element in the sequence. Returns the only element of a sequence that satisfies a specified condition or a default value if no such element exists; this method throws an exception if more than one element satisfies the condition. Returns the element at a specified index in a sequence. Returns the element at a specified index in a sequence or a default value if the index is out of range. Inverts the order of the elements in a sequence. Returns a specified number of contiguous elements from the start of a sequence. Bypasses a specified number of elements in a sequence and then returns the remaining elements. Bypasses elements in a sequence as long as a specified condition is true and then returns the remaining elements. Bypasses elements in a sequence as long as a specified condition is true and then returns the remaining elements. The element's index is used in the logic of the predicate function. Returns the number of elements in a sequence. Returns a number that represents how many elements in the specified sequence satisfy a condition. Returns an that represents the total number of elements in a sequence. Returns an that represents how many elements in a sequence satisfy a condition. Concatenates two sequences. Creates a from an . Creates an array from an . Returns distinct elements from a sequence by using the default equality comparer to compare values. Returns distinct elements from a sequence by using a specified to compare values. Creates a from an according to a specified key selector function. Creates a from an according to a specified key selector function and a key comparer. Creates a from an according to specified key and element selector functions. Creates a from an according to a specified key selector function, a comparer and an element selector function. Groups the elements of a sequence according to a specified key selector function. Groups the elements of a sequence according to a specified key selector function and compares the keys by using a specified comparer. Groups the elements of a sequence according to a specified key selector function and projects the elements for each group by using a specified function. Groups the elements of a sequence according to a specified key selector function and creates a result value from each group and its key. Groups the elements of a sequence according to a key selector function. The keys are compared by using a comparer and each group's elements are projected by using a specified function. Groups the elements of a sequence according to a specified key selector function and creates a result value from each group and its key. The elements of each group are projected by using a specified function. Groups the elements of a sequence according to a specified key selector function and creates a result value from each group and its key. The keys are compared by using a specified comparer. Groups the elements of a sequence according to a specified key selector function and creates a result value from each group and its key. Key values are compared by using a specified comparer, and the elements of each group are projected by using a specified function. Applies an accumulator function over a sequence. Applies an accumulator function over a sequence. The specified seed value is used as the initial accumulator value. Applies an accumulator function over a sequence. The specified seed value is used as the initial accumulator value, and the specified function is used to select the result value. Produces the set union of two sequences by using the default equality comparer. Produces the set union of two sequences by using a specified . Returns the elements of the specified sequence or the type parameter's default value in a singleton collection if the sequence is empty. Returns the elements of the specified sequence or the specified value in a singleton collection if the sequence is empty. Determines whether all elements of a sequence satisfy a condition. Determines whether a sequence contains any elements. Determines whether any element of a sequence satisfies a condition. Determines whether a sequence contains a specified element by using the default equality comparer. Determines whether a sequence contains a specified element by using a specified . Determines whether two sequences are equal by comparing the elements by using the default equality comparer for their type. Determines whether two sequences are equal by comparing their elements by using a specified . Base implementation for Min/Max operator. Base implementation for Min/Max operator for nullable types. Returns the minimum value in a generic sequence. Invokes a transform function on each element of a generic sequence and returns the minimum resulting value. Returns the maximum value in a generic sequence. Invokes a transform function on each element of a generic sequence and returns the maximum resulting value. Makes an enumerator seen as enumerable once more. The supplied enumerator must have been started. The first element returned is the element the enumerator was on when passed in. DO NOT use this method if the caller must be a generator. It is mostly safe among aggregate operations. Sorts the elements of a sequence in ascending order according to a key. Sorts the elements of a sequence in ascending order by using a specified comparer. Sorts the elements of a sequence in descending order according to a key. Sorts the elements of a sequence in descending order by using a specified comparer. Performs a subsequent ordering of the elements in a sequence in ascending order according to a key. Performs a subsequent ordering of the elements in a sequence in ascending order by using a specified comparer. Performs a subsequent ordering of the elements in a sequence in descending order, according to a key. Performs a subsequent ordering of the elements in a sequence in descending order by using a specified comparer. Base implementation for Intersect and Except operators. Produces the set intersection of two sequences by using the default equality comparer to compare values. Produces the set intersection of two sequences by using the specified to compare values. Produces the set difference of two sequences by using the default equality comparer to compare values. Produces the set difference of two sequences by using the specified to compare values. Creates a from an according to a specified key selector function. Creates a from an according to a specified key selector function and key comparer. Creates a from an according to specified key selector and element selector functions. Creates a from an according to a specified key selector function, a comparer, and an element selector function. Correlates the elements of two sequences based on matching keys. The default equality comparer is used to compare keys. Correlates the elements of two sequences based on matching keys. The default equality comparer is used to compare keys. A specified is used to compare keys. Correlates the elements of two sequences based on equality of keys and groups the results. The default equality comparer is used to compare keys. Correlates the elements of two sequences based on equality of keys and groups the results. The default equality comparer is used to compare keys. A specified is used to compare keys. Computes the sum of a sequence of nullable values. Computes the sum of a sequence of nullable values that are obtained by invoking a transform function on each element of the input sequence. Computes the average of a sequence of nullable values. Computes the average of a sequence of nullable values that are obtained by invoking a transform function on each element of the input sequence. Computes the sum of a sequence of values. Computes the sum of a sequence of values that are obtained by invoking a transform function on each element of the input sequence. Computes the average of a sequence of values. Computes the average of a sequence of values that are obtained by invoking a transform function on each element of the input sequence. Returns the minimum value in a sequence of nullable values. Invokes a transform function on each element of a sequence and returns the minimum nullable value. Returns the maximum value in a sequence of nullable values. Invokes a transform function on each element of a sequence and returns the maximum nullable value. Computes the sum of a sequence of nullable values. Computes the sum of a sequence of nullable values that are obtained by invoking a transform function on each element of the input sequence. Computes the average of a sequence of nullable values. Computes the average of a sequence of nullable values that are obtained by invoking a transform function on each element of the input sequence. Computes the sum of a sequence of values. Computes the sum of a sequence of values that are obtained by invoking a transform function on each element of the input sequence. Computes the average of a sequence of values. Computes the average of a sequence of values that are obtained by invoking a transform function on each element of the input sequence. Returns the minimum value in a sequence of nullable values. Invokes a transform function on each element of a sequence and returns the minimum nullable value. Returns the maximum value in a sequence of nullable values. Invokes a transform function on each element of a sequence and returns the maximum nullable value. Computes the sum of a sequence of nullable values. Computes the sum of a sequence of nullable values that are obtained by invoking a transform function on each element of the input sequence. Computes the average of a sequence of nullable values. Computes the average of a sequence of nullable values that are obtained by invoking a transform function on each element of the input sequence. Computes the sum of a sequence of values. Computes the sum of a sequence of values that are obtained by invoking a transform function on each element of the input sequence. Computes the average of a sequence of values. Computes the average of a sequence of values that are obtained by invoking a transform function on each element of the input sequence. Returns the minimum value in a sequence of nullable values. Invokes a transform function on each element of a sequence and returns the minimum nullable value. Returns the maximum value in a sequence of nullable values. Invokes a transform function on each element of a sequence and returns the maximum nullable value. Computes the sum of a sequence of nullable values. Computes the sum of a sequence of nullable values that are obtained by invoking a transform function on each element of the input sequence. Computes the average of a sequence of nullable values. Computes the average of a sequence of nullable values that are obtained by invoking a transform function on each element of the input sequence. Computes the sum of a sequence of values. Computes the sum of a sequence of values that are obtained by invoking a transform function on each element of the input sequence. Computes the average of a sequence of values. Computes the average of a sequence of values that are obtained by invoking a transform function on each element of the input sequence. Returns the minimum value in a sequence of nullable values. Invokes a transform function on each element of a sequence and returns the minimum nullable value. Returns the maximum value in a sequence of nullable values. Invokes a transform function on each element of a sequence and returns the maximum nullable value. Computes the sum of a sequence of nullable values. Computes the sum of a sequence of nullable values that are obtained by invoking a transform function on each element of the input sequence. Computes the average of a sequence of nullable values. Computes the average of a sequence of nullable values that are obtained by invoking a transform function on each element of the input sequence. Computes the sum of a sequence of values. Computes the sum of a sequence of values that are obtained by invoking a transform function on each element of the input sequence. Computes the average of a sequence of values. Computes the average of a sequence of values that are obtained by invoking a transform function on each element of the input sequence. Returns the minimum value in a sequence of nullable values. Invokes a transform function on each element of a sequence and returns the minimum nullable value. Returns the maximum value in a sequence of nullable values. Invokes a transform function on each element of a sequence and returns the maximum nullable value. Represents a collection of objects that have a common key. Gets the key of the . Defines an indexer, size property, and Boolean search method for data structures that map keys to sequences of values. Represents a sorted sequence. Performs a subsequent ordering on the elements of an according to a key. Represents a collection of keys each mapped to one or more values. Determines whether a specified key is in the . Applies a transform function to each key and its associated values and returns the results. Returns a generic enumerator that iterates through the . Gets the number of key/value collection pairs in the . Gets the collection of values indexed by the specified key. See issue #11 for why this method is needed and cannot be expressed as a lambda at the call site. See issue #11 for why this method is needed and cannot be expressed as a lambda at the call site. This attribute allows us to define extension methods without requiring .NET Framework 3.5. For more information, see the section, Extension Methods in .NET Framework 2.0 Apps, of Basic Instincts: Extension Methods column in MSDN Magazine, issue Nov 2007. Represents a view of a . Initializes a new instance of the class. The name. When overridden in a derived class, returns whether resetting an object changes its value. true if resetting the component changes its value; otherwise, false. The component to test for reset capability. When overridden in a derived class, gets the current value of the property on a component. The value of a property for a given component. The component with the property for which to retrieve the value. When overridden in a derived class, resets the value for this property of the component to the default value. The component with the property value that is to be reset to the default value. When overridden in a derived class, sets the value of the component to a different value. The component with the property value that is to be set. The new value. When overridden in a derived class, determines a value indicating whether the value of this property needs to be persisted. true if the property should be persisted; otherwise, false. The component with the property to be examined for persistence. When overridden in a derived class, gets the type of the component this property is bound to. A that represents the type of component this property is bound to. When the or methods are invoked, the object specified might be an instance of this type. When overridden in a derived class, gets a value indicating whether this property is read-only. true if the property is read-only; otherwise, false. When overridden in a derived class, gets the type of the property. A that represents the type of the property. Gets the hash code for the name of the member. The hash code for the name of the member. Represents a raw JSON string. Represents a value in JSON (string, integer, date, etc). Represents an abstract JSON token. Represents a collection of objects. The type of token Gets the with the specified key. Compares the values of two tokens, including the values of all descendant tokens. The first to compare. The second to compare. true if the tokens are equal; otherwise false. Adds the specified content immediately after this token. A content object that contains simple content or a collection of content objects to be added after this token. Adds the specified content immediately before this token. A content object that contains simple content or a collection of content objects to be added before this token. Returns a collection of the ancestor tokens of this token. A collection of the ancestor tokens of this token. Returns a collection of the sibling tokens after this token, in document order. A collection of the sibling tokens after this tokens, in document order. Returns a collection of the sibling tokens before this token, in document order. A collection of the sibling tokens before this token, in document order. Gets the with the specified key converted to the specified type. The type to convert the token to. The token key. The converted token value. Returns a collection of the child tokens of this token, in document order. An of containing the child tokens of this , in document order. Returns a collection of the child tokens of this token, in document order, filtered by the specified type. The type to filter the child tokens on. A containing the child tokens of this , in document order. Returns a collection of the child values of this token, in document order. The type to convert the values to. A containing the child values of this , in document order. Removes this token from its parent. Replaces this token with the specified token. The value. Writes this token to a . A into which this method will write. A collection of which will be used when writing the token. Returns the indented JSON for this token. The indented JSON for this token. Returns the JSON for this token using the given formatting and converters. Indicates how the output is formatted. A collection of which will be used when writing the token. The JSON for this token using the given formatting and converters. Performs an explicit conversion from to . The value. The result of the conversion. Performs an explicit conversion from to . The value. The result of the conversion. Performs an explicit conversion from to . The value. The result of the conversion. Performs an explicit conversion from to . The value. The result of the conversion. Performs an explicit conversion from to . The value. The result of the conversion. Performs an explicit conversion from to . The value. The result of the conversion. Performs an explicit conversion from to . The value. The result of the conversion. Performs an explicit conversion from to . The value. The result of the conversion. Performs an explicit conversion from to . The value. The result of the conversion. Performs an explicit conversion from to . The value. The result of the conversion. Performs an explicit conversion from to . The value. The result of the conversion. Performs an explicit conversion from to . The value. The result of the conversion. Performs an explicit conversion from to . The value. The result of the conversion. Performs an explicit conversion from to . The value. The result of the conversion. Performs an explicit conversion from to . The value. The result of the conversion. Performs an explicit conversion from to . The value. The result of the conversion. Performs an explicit conversion from to . The value. The result of the conversion. Performs an explicit conversion from to . The value. The result of the conversion. Performs an explicit conversion from to . The value. The result of the conversion. Performs an explicit conversion from to . The value. The result of the conversion. Performs an explicit conversion from to . The value. The result of the conversion. Performs an explicit conversion from to . The value. The result of the conversion. Performs an explicit conversion from to . The value. The result of the conversion. Performs an explicit conversion from to . The value. The result of the conversion. Performs an explicit conversion from to . The value. The result of the conversion. Performs an explicit conversion from to . The value. The result of the conversion. Performs an explicit conversion from to . The value. The result of the conversion. Performs an explicit conversion from to . The value. The result of the conversion. Performs an explicit conversion from to . The value. The result of the conversion. Performs an explicit conversion from to . The value. The result of the conversion. Performs an explicit conversion from to . The value. The result of the conversion. Performs an explicit conversion from to . The value. The result of the conversion. Performs an explicit conversion from to . The value. The result of the conversion. Performs an explicit conversion from to . The value. The result of the conversion. Performs an explicit conversion from to . The value. The result of the conversion. Performs an implicit conversion from to . The value to create a from. The initialized with the specified value. Performs an implicit conversion from to . The value to create a from. The initialized with the specified value. Performs an implicit conversion from to . The value to create a from. The initialized with the specified value. Performs an implicit conversion from to . The value to create a from. The initialized with the specified value. Performs an implicit conversion from to . The value to create a from. The initialized with the specified value. Performs an implicit conversion from to . The value to create a from. The initialized with the specified value. Performs an implicit conversion from to . The value to create a from. The initialized with the specified value. Performs an implicit conversion from to . The value to create a from. The initialized with the specified value. Performs an implicit conversion from to . The value to create a from. The initialized with the specified value. Performs an implicit conversion from to . The value to create a from. The initialized with the specified value. Performs an implicit conversion from to . The value to create a from. The initialized with the specified value. Performs an implicit conversion from to . The value to create a from. The initialized with the specified value. Performs an implicit conversion from to . The value to create a from. The initialized with the specified value. Performs an implicit conversion from to . The value to create a from. The initialized with the specified value. Performs an implicit conversion from to . The value to create a from. The initialized with the specified value. Performs an implicit conversion from to . The value to create a from. The initialized with the specified value. Performs an implicit conversion from to . The value to create a from. The initialized with the specified value. Performs an implicit conversion from to . The value to create a from. The initialized with the specified value. Performs an implicit conversion from to . The value to create a from. The initialized with the specified value. Performs an implicit conversion from to . The value to create a from. The initialized with the specified value. Performs an implicit conversion from to . The value to create a from. The initialized with the specified value. Performs an implicit conversion from to . The value to create a from. The initialized with the specified value. Performs an implicit conversion from to . The value to create a from. The initialized with the specified value. Performs an implicit conversion from to . The value to create a from. The initialized with the specified value. Performs an implicit conversion from to . The value to create a from. The initialized with the specified value. Performs an implicit conversion from to . The value to create a from. The initialized with the specified value. Performs an implicit conversion from to . The value to create a from. The initialized with the specified value. Performs an implicit conversion from to . The value to create a from. The initialized with the specified value. Performs an implicit conversion from to . The value to create a from. The initialized with the specified value. Performs an implicit conversion from to . The value to create a from. The initialized with the specified value. Performs an implicit conversion from to . The value to create a from. The initialized with the specified value. Performs an implicit conversion from to . The value to create a from. The initialized with the specified value. Performs an implicit conversion from to . The value to create a from. The initialized with the specified value. Creates an for this token. An that can be used to read this token and its descendants. Creates a from an object. The object that will be used to create . A with the value of the specified object Creates a from an object using the specified . The object that will be used to create . The that will be used when reading the object. A with the value of the specified object Creates the specified .NET type from the . The object type that the token will be deserialized to. The new object created from the JSON value. Creates the specified .NET type from the . The object type that the token will be deserialized to. The new object created from the JSON value. Creates the specified .NET type from the using the specified . The object type that the token will be deserialized to. The that will be used when creating the object. The new object created from the JSON value. Creates the specified .NET type from the using the specified . The object type that the token will be deserialized to. The that will be used when creating the object. The new object created from the JSON value. Creates a from a . An positioned at the token to read into this . An that contains the token and its descendant tokens that were read from the reader. The runtime type of the token is determined by the token type of the first token encountered in the reader. Load a from a string that contains JSON. A that contains JSON. A populated from the string that contains JSON. Creates a from a . An positioned at the token to read into this . An that contains the token and its descendant tokens that were read from the reader. The runtime type of the token is determined by the token type of the first token encountered in the reader. Selects a using a JPath expression. Selects the token that matches the object path. A that contains a JPath expression. A , or null. Selects a using a JPath expression. Selects the token that matches the object path. A that contains a JPath expression. A flag to indicate whether an error should be thrown if no tokens are found when evaluating part of the expression. A . Selects a collection of elements using a JPath expression. A that contains a JPath expression. An that contains the selected elements. Selects a collection of elements using a JPath expression. A that contains a JPath expression. A flag to indicate whether an error should be thrown if no tokens are found when evaluating part of the expression. An that contains the selected elements. Creates a new instance of the . All child tokens are recursively cloned. A new instance of the . Gets a comparer that can compare two tokens for value equality. A that can compare two nodes for value equality. Gets or sets the parent. The parent. Gets the root of this . The root of this . Gets the node type for this . The type. Gets a value indicating whether this token has child tokens. true if this token has child values; otherwise, false. Gets the next sibling token of this node. The that contains the next sibling token. Gets the previous sibling token of this node. The that contains the previous sibling token. Gets the path of the JSON token. Gets the with the specified key. The with the specified key. Get the first child token of this token. A containing the first child token of the . Get the last child token of this token. A containing the last child token of the . Initializes a new instance of the class from another object. A object to copy from. Initializes a new instance of the class with the given value. The value. Initializes a new instance of the class with the given value. The value. Initializes a new instance of the class with the given value. The value. Initializes a new instance of the class with the given value. The value. Initializes a new instance of the class with the given value. The value. Initializes a new instance of the class with the given value. The value. Initializes a new instance of the class with the given value. The value. Initializes a new instance of the class with the given value. The value. Initializes a new instance of the class with the given value. The value. Initializes a new instance of the class with the given value. The value. Initializes a new instance of the class with the given value. The value. Initializes a new instance of the class with the given value. The value. Initializes a new instance of the class with the given value. The value. Creates a comment with the given value. The value. A comment with the given value. Creates a string with the given value. The value. A string with the given value. Writes this token to a . A into which this method will write. A collection of which will be used when writing the token. Indicates whether the current object is equal to another object of the same type. true if the current object is equal to the parameter; otherwise, false. An object to compare with this object. Determines whether the specified is equal to the current . The to compare with the current . true if the specified is equal to the current ; otherwise, false. The parameter is null. Serves as a hash function for a particular type. A hash code for the current . Returns a that represents this instance. A that represents this instance. Returns a that represents this instance. The format. A that represents this instance. Returns a that represents this instance. The format provider. A that represents this instance. Returns a that represents this instance. The format. The format provider. A that represents this instance. Compares the current instance with another object of the same type and returns an integer that indicates whether the current instance precedes, follows, or occurs in the same position in the sort order as the other object. An object to compare with this instance. A 32-bit signed integer that indicates the relative order of the objects being compared. The return value has these meanings: Value Meaning Less than zero This instance is less than . Zero This instance is equal to . Greater than zero This instance is greater than . is not the same type as this instance. Gets a value indicating whether this token has child tokens. true if this token has child values; otherwise, false. Gets the node type for this . The type. Gets or sets the underlying token value. The underlying token value. Initializes a new instance of the class from another object. A object to copy from. Initializes a new instance of the class. The raw json. Creates an instance of with the content of the reader's current token. The reader. An instance of with the content of the reader's current token. Indicating whether a property is required. The property is not required. The default state. The property must be defined in JSON but can be a null value. The property must be defined in JSON and cannot be a null value. Used to resolve references when serializing and deserializing JSON by the . Resolves a reference to its object. The serialization context. The reference to resolve. The object that Gets the reference for the sepecified object. The serialization context. The object to get a reference for. The reference to the object. Determines whether the specified object is referenced. The serialization context. The object to test for a reference. true if the specified object is referenced; otherwise, false. Adds a reference to the specified object. The serialization context. The reference. The object to reference. Specifies reference handling options for the . Note that references cannot be preserved when a value is set via a non-default constructor such as types that implement ISerializable. Do not preserve references when serializing types. Preserve references when serializing into a JSON object structure. Preserve references when serializing into a JSON array structure. Preserve references when serializing. Instructs the how to serialize the collection. Initializes a new instance of the class. Initializes a new instance of the class with a flag indicating whether the array can contain null items A flag indicating whether the array can contain null items. Initializes a new instance of the class with the specified container Id. The container Id. Gets or sets a value indicating whether null items are allowed in the collection. true if null items are allowed in the collection; otherwise, false. Specifies default value handling options for the . Include members where the member value is the same as the member's default value when serializing objects. Included members are written to JSON. Has no effect when deserializing. Ignore members where the member value is the same as the member's default value when serializing objects so that is is not written to JSON. This option will ignore all default values (e.g. null for objects and nullable typesl; 0 for integers, decimals and floating point numbers; and false for booleans). The default value ignored can be changed by placing the on the property. Members with a default value but no JSON will be set to their default value when deserializing. Ignore members where the member value is the same as the member's default value when serializing objects and sets members to their default value when deserializing. Instructs the to use the specified when serializing the member or class. Initializes a new instance of the class. Type of the converter. Gets the type of the converter. The type of the converter. Instructs the how to serialize the object. Initializes a new instance of the class. Initializes a new instance of the class with the specified member serialization. The member serialization. Initializes a new instance of the class with the specified container Id. The container Id. Gets or sets the member serialization. The member serialization. Gets or sets a value that indicates whether the object's properties are required. A value indicating whether the object's properties are required. Specifies the settings on a object. Initializes a new instance of the class. Gets or sets how reference loops (e.g. a class referencing itself) is handled. Reference loop handling. Gets or sets how missing members (e.g. JSON contains a property that isn't a member on the object) are handled during deserialization. Missing member handling. Gets or sets how objects are created during deserialization. The object creation handling. Gets or sets how null values are handled during serialization and deserialization. Null value handling. Gets or sets how null default are handled during serialization and deserialization. The default value handling. Gets or sets a collection that will be used during serialization. The converters. Gets or sets how object references are preserved by the serializer. The preserve references handling. Gets or sets how type name writing and reading is handled by the serializer. The type name handling. Gets or sets how a type name assembly is written and resolved by the serializer. The type name assembly format. Gets or sets how constructors are used during deserialization. The constructor handling. Gets or sets the contract resolver used by the serializer when serializing .NET objects to JSON and vice versa. The contract resolver. Gets or sets the used by the serializer when resolving references. The reference resolver. Gets or sets the used by the serializer when writing trace messages. The trace writer. Gets or sets the used by the serializer when resolving type names. The binder. Gets or sets the error handler called during serialization and deserialization. The error handler called during serialization and deserialization. Gets or sets the used by the serializer when invoking serialization callback methods. The context. Get or set how and values are formatting when writing JSON text. Gets or sets the maximum depth allowed when reading JSON. Reading past this depth will throw a . Indicates how JSON text output is formatted. Get or set how dates are written to JSON text. Get or set how time zones are handling during serialization and deserialization. Get or set how date formatted strings, e.g. "\/Date(1198908717056)\/" and "2012-03-21T05:40Z", are parsed when reading JSON. Get or set how special floating point numbers, e.g. , and , are written as JSON. Get or set how floating point numbers, e.g. 1.0 and 9.9, are parsed when reading JSON text. Get or set how strings are escaped when writing JSON text. Gets or sets the culture used when reading JSON. Defaults to . Gets a value indicating whether there will be a check for additional content after deserializing an object. true if there will be a check for additional content after deserializing an object; otherwise, false. Represents a reader that provides validation. Initializes a new instance of the class that validates the content returned from the given . The to read from while validating. Reads the next JSON token from the stream as a . A . Reads the next JSON token from the stream as a . A or a null reference if the next JSON token is null. Reads the next JSON token from the stream as a . A . Reads the next JSON token from the stream as a . A . This method will return null at the end of an array. Reads the next JSON token from the stream as a . A . This method will return null at the end of an array. Reads the next JSON token from the stream. true if the next token was read successfully; false if there are no more tokens to read. Sets an event handler for receiving schema validation errors. Gets the text value of the current JSON token. Gets the depth of the current token in the JSON document. The depth of the current token in the JSON document. Gets the path of the current JSON token. Gets the quotation mark character used to enclose the value of a string. Gets the type of the current JSON token. Gets the Common Language Runtime (CLR) type for the current JSON token. Gets or sets the schema. The schema. Gets the used to construct this . The specified in the constructor. Compares tokens to determine whether they are equal. Determines whether the specified objects are equal. The first object of type to compare. The second object of type to compare. true if the specified objects are equal; otherwise, false. Returns a hash code for the specified object. The for which a hash code is to be returned. A hash code for the specified object. The type of is a reference type and is null. Specifies the member serialization options for the . All public members are serialized by default. Members can be excluded using or . This is the default member serialization mode. Only members must be marked with or are serialized. This member serialization mode can also be set by marking the class with . All public and private fields are serialized. Members can be excluded using or . This member serialization mode can also be set by marking the class with and setting IgnoreSerializableAttribute on to false. Specifies how object creation is handled by the . Reuse existing objects, create new objects when needed. Only reuse existing objects. Always create new objects. Converts a to and from the ISO 8601 date format (e.g. 2008-04-12T12:53Z). Writes the JSON representation of the object. The to write to. The value. The calling serializer. Reads the JSON representation of the object. The to read from. Type of the object. The existing value of object being read. The calling serializer. The object value. Gets or sets the date time styles used when converting a date to and from JSON. The date time styles used when converting a date to and from JSON. Gets or sets the date time format used when converting a date to and from JSON. The date time format used when converting a date to and from JSON. Gets or sets the culture used when converting a date to and from JSON. The culture used when converting a date to and from JSON. Converts a to and from a JavaScript date constructor (e.g. new Date(52231943)). Writes the JSON representation of the object. The to write to. The value. The calling serializer. Reads the JSON representation of the object. The to read from. Type of the object. The existing property value of the JSON that is being converted. The calling serializer. The object value. Converts XML to and from JSON. Writes the JSON representation of the object. The to write to. The calling serializer. The value. Reads the JSON representation of the object. The to read from. Type of the object. The existing value of object being read. The calling serializer. The object value. Checks if the attributeName is a namespace attribute. Attribute name to test. The attribute name prefix if it has one, otherwise an empty string. True if attribute name is for a namespace attribute, otherwise false. Determines whether this instance can convert the specified value type. Type of the value. true if this instance can convert the specified value type; otherwise, false. Gets or sets the name of the root element to insert when deserializing to XML if the JSON structure has produces multiple root elements. The name of the deserialize root element. Gets or sets a flag to indicate whether to write the Json.NET array attribute. This attribute helps preserve arrays when converting the written XML back to JSON. true if the array attibute is written to the XML; otherwise, false. Gets or sets a value indicating whether to write the root JSON object. true if the JSON root object is omitted; otherwise, false. Represents a reader that provides fast, non-cached, forward-only access to JSON text data. Initializes a new instance of the class with the specified . The TextReader containing the XML data to read. Reads the next JSON token from the stream. true if the next token was read successfully; false if there are no more tokens to read. Reads the next JSON token from the stream as a . A or a null reference if the next JSON token is null. This method will return null at the end of an array. Reads the next JSON token from the stream as a . A . This method will return null at the end of an array. Reads the next JSON token from the stream as a . A . This method will return null at the end of an array. Reads the next JSON token from the stream as a . A . This method will return null at the end of an array. Reads the next JSON token from the stream as a . A . This method will return null at the end of an array. Changes the state to closed. Gets a value indicating whether the class can return line information. true if LineNumber and LinePosition can be provided; otherwise, false. Gets the current line number. The current line number or 0 if no line information is available (for example, HasLineInfo returns false). Gets the current line position. The current line position or 0 if no line information is available (for example, HasLineInfo returns false). Instructs the to always serialize the member with the specified name. Initializes a new instance of the class. Initializes a new instance of the class with the specified name. Name of the property. Gets or sets the converter used when serializing the property's collection items. The collection's items converter. Gets or sets the null value handling used when serializing this property. The null value handling. Gets or sets the default value handling used when serializing this property. The default value handling. Gets or sets the reference loop handling used when serializing this property. The reference loop handling. Gets or sets the object creation handling used when deserializing this property. The object creation handling. Gets or sets the type name handling used when serializing this property. The type name handling. Gets or sets whether this property's value is serialized as a reference. Whether this property's value is serialized as a reference. Gets or sets the order of serialization and deserialization of a member. The numeric order of serialization or deserialization. Gets or sets a value indicating whether this property is required. A value indicating whether this property is required. Gets or sets the name of the property. The name of the property. Gets or sets the the reference loop handling used when serializing the property's collection items. The collection's items reference loop handling. Gets or sets the the type name handling used when serializing the property's collection items. The collection's items type name handling. Gets or sets whether this property's collection items are serialized as a reference. Whether this property's collection items are serialized as a reference. Instructs the not to serialize the public field or public read/write property value. Represents a writer that provides a fast, non-cached, forward-only way of generating Json data. Creates an instance of the JsonWriter class using the specified . The TextWriter to write to. Flushes whatever is in the buffer to the underlying streams and also flushes the underlying stream. Closes this stream and the underlying stream. Writes the beginning of a Json object. Writes the beginning of a Json array. Writes the start of a constructor with the given name. The name of the constructor. Writes the specified end token. The end token to write. Writes the property name of a name/value pair on a Json object. The name of the property. Writes the property name of a name/value pair on a JSON object. The name of the property. A flag to indicate whether the text should be escaped when it is written as a JSON property name. Writes indent characters. Writes the JSON value delimiter. Writes an indent space. Writes a value. An error will raised if the value cannot be written as a single JSON token. The value to write. Writes a null value. Writes an undefined value. Writes raw JSON. The raw JSON to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes out a comment /*...*/ containing the specified text. Text to place inside the comment. Writes out the given white space. The string of white space characters. Gets or sets how many IndentChars to write for each level in the hierarchy when is set to Formatting.Indented. Gets or sets which character to use to quote attribute values. Gets or sets which character to use for indenting when is set to Formatting.Indented. Gets or sets a value indicating whether object names will be surrounded with quotes. The exception thrown when an error occurs while reading Json text. Initializes a new instance of the class. Initializes a new instance of the class with a specified error message. The error message that explains the reason for the exception. Initializes a new instance of the class with a specified error message and a reference to the inner exception that is the cause of this exception. The error message that explains the reason for the exception. The exception that is the cause of the current exception, or a null reference (Nothing in Visual Basic) if no inner exception is specified. Initializes a new instance of the class. The that holds the serialized object data about the exception being thrown. The that contains contextual information about the source or destination. The parameter is null. The class name is null or is zero (0). Gets the path to the JSON where the error occurred. The path to the JSON where the error occurred. The exception thrown when an error occurs while reading Json text. Initializes a new instance of the class. Initializes a new instance of the class with a specified error message. The error message that explains the reason for the exception. Initializes a new instance of the class with a specified error message and a reference to the inner exception that is the cause of this exception. The error message that explains the reason for the exception. The exception that is the cause of the current exception, or a null reference (Nothing in Visual Basic) if no inner exception is specified. Initializes a new instance of the class. The that holds the serialized object data about the exception being thrown. The that contains contextual information about the source or destination. The parameter is null. The class name is null or is zero (0). Gets the line number indicating where the error occurred. The line number indicating where the error occurred. Gets the line position indicating where the error occurred. The line position indicating where the error occurred. Gets the path to the JSON where the error occurred. The path to the JSON where the error occurred. Represents a collection of . Provides methods for converting between common language runtime types and JSON types. Represents JavaScript's boolean value true as a string. This field is read-only. Represents JavaScript's boolean value false as a string. This field is read-only. Represents JavaScript's null as a string. This field is read-only. Represents JavaScript's undefined as a string. This field is read-only. Represents JavaScript's positive infinity as a string. This field is read-only. Represents JavaScript's negative infinity as a string. This field is read-only. Represents JavaScript's NaN as a string. This field is read-only. Converts the to its JSON string representation. The value to convert. A JSON string representation of the . Converts the to its JSON string representation using the specified. The value to convert. The format the date will be converted to. The time zone handling when the date is converted to a string. A JSON string representation of the . Converts the to its JSON string representation. The value to convert. A JSON string representation of the . Converts the to its JSON string representation. The value to convert. A JSON string representation of the . Converts the to its JSON string representation. The value to convert. A JSON string representation of the . Converts the to its JSON string representation. The value to convert. A JSON string representation of the . Converts the to its JSON string representation. The value to convert. A JSON string representation of the . Converts the to its JSON string representation. The value to convert. A JSON string representation of the . Converts the to its JSON string representation. The value to convert. A JSON string representation of the . Converts the to its JSON string representation. The value to convert. A JSON string representation of the . Converts the to its JSON string representation. The value to convert. A JSON string representation of the . Converts the to its JSON string representation. The value to convert. A JSON string representation of the . Converts the to its JSON string representation. The value to convert. A JSON string representation of the . Converts the to its JSON string representation. The value to convert. A JSON string representation of the . Converts the to its JSON string representation. The value to convert. A JSON string representation of the . Converts the to its JSON string representation. The value to convert. A JSON string representation of the . Converts the to its JSON string representation. The value to convert. A JSON string representation of the . Converts the to its JSON string representation. The value to convert. A JSON string representation of the . Converts the to its JSON string representation. The value to convert. A JSON string representation of the . Converts the to its JSON string representation. The value to convert. A JSON string representation of the . Converts the to its JSON string representation. The value to convert. The string delimiter character. A JSON string representation of the . Converts the to its JSON string representation. The value to convert. A JSON string representation of the . Serializes the specified object to a JSON string. The object to serialize. A JSON string representation of the object. Serializes the specified object to a JSON string using formatting. The object to serialize. Indicates how the output is formatted. A JSON string representation of the object. Serializes the specified object to a JSON string using a collection of . The object to serialize. A collection converters used while serializing. A JSON string representation of the object. Serializes the specified object to a JSON string using formatting and a collection of . The object to serialize. Indicates how the output is formatted. A collection converters used while serializing. A JSON string representation of the object. Serializes the specified object to a JSON string using . The object to serialize. The used to serialize the object. If this is null, default serialization settings will be is used. A JSON string representation of the object. Serializes the specified object to a JSON string using a type, formatting and . The object to serialize. The used to serialize the object. If this is null, default serialization settings will be is used. The type of the value being serialized. This parameter is used when is Auto to write out the type name if the type of the value does not match. Specifing the type is optional. A JSON string representation of the object. Serializes the specified object to a JSON string using formatting and . The object to serialize. Indicates how the output is formatted. The used to serialize the object. If this is null, default serialization settings will be is used. A JSON string representation of the object. Serializes the specified object to a JSON string using a type, formatting and . The object to serialize. Indicates how the output is formatted. The used to serialize the object. If this is null, default serialization settings will be is used. The type of the value being serialized. This parameter is used when is Auto to write out the type name if the type of the value does not match. Specifing the type is optional. A JSON string representation of the object. Deserializes the JSON to a .NET object. The JSON to deserialize. The deserialized object from the Json string. Deserializes the JSON to a .NET object using . The JSON to deserialize. The used to deserialize the object. If this is null, default serialization settings will be is used. The deserialized object from the JSON string. Deserializes the JSON to the specified .NET type. The JSON to deserialize. The of object being deserialized. The deserialized object from the Json string. Deserializes the JSON to the specified .NET type. The type of the object to deserialize to. The JSON to deserialize. The deserialized object from the Json string. Deserializes the JSON to the given anonymous type. The anonymous type to deserialize to. This can't be specified traditionally and must be infered from the anonymous type passed as a parameter. The JSON to deserialize. The anonymous type object. The deserialized anonymous type from the JSON string. Deserializes the JSON to the given anonymous type using . The anonymous type to deserialize to. This can't be specified traditionally and must be infered from the anonymous type passed as a parameter. The JSON to deserialize. The anonymous type object. The used to deserialize the object. If this is null, default serialization settings will be is used. The deserialized anonymous type from the JSON string. Deserializes the JSON to the specified .NET type using a collection of . The type of the object to deserialize to. The JSON to deserialize. Converters to use while deserializing. The deserialized object from the JSON string. Deserializes the JSON to the specified .NET type using . The type of the object to deserialize to. The object to deserialize. The used to deserialize the object. If this is null, default serialization settings will be is used. The deserialized object from the JSON string. Deserializes the JSON to the specified .NET type using a collection of . The JSON to deserialize. The type of the object to deserialize. Converters to use while deserializing. The deserialized object from the JSON string. Deserializes the JSON to the specified .NET type using . The JSON to deserialize. The type of the object to deserialize to. The used to deserialize the object. If this is null, default serialization settings will be is used. The deserialized object from the JSON string. Populates the object with values from the JSON string. The JSON to populate values from. The target object to populate values onto. Populates the object with values from the JSON string using . The JSON to populate values from. The target object to populate values onto. The used to deserialize the object. If this is null, default serialization settings will be is used. Serializes the XML node to a JSON string. The node to serialize. A JSON string of the XmlNode. Serializes the XML node to a JSON string using formatting. The node to serialize. Indicates how the output is formatted. A JSON string of the XmlNode. Serializes the XML node to a JSON string using formatting and omits the root object if is true. The node to serialize. Indicates how the output is formatted. Omits writing the root object. A JSON string of the XmlNode. Deserializes the XmlNode from a JSON string. The JSON string. The deserialized XmlNode Deserializes the XmlNode from a JSON string nested in a root elment specified by . The JSON string. The name of the root element to append when deserializing. The deserialized XmlNode Deserializes the XmlNode from a JSON string nested in a root elment specified by and writes a .NET array attribute for collections. The JSON string. The name of the root element to append when deserializing. A flag to indicate whether to write the Json.NET array attribute. This attribute helps preserve arrays when converting the written XML back to JSON. The deserialized XmlNode Gets or sets a function that creates default . Default settings are automatically used by serialization methods on , and and on . To serialize without using any default settings create a with . The exception thrown when an error occurs during Json serialization or deserialization. Initializes a new instance of the class. Initializes a new instance of the class with a specified error message. The error message that explains the reason for the exception. Initializes a new instance of the class with a specified error message and a reference to the inner exception that is the cause of this exception. The error message that explains the reason for the exception. The exception that is the cause of the current exception, or a null reference (Nothing in Visual Basic) if no inner exception is specified. Initializes a new instance of the class. The that holds the serialized object data about the exception being thrown. The that contains contextual information about the source or destination. The parameter is null. The class name is null or is zero (0). Serializes and deserializes objects into and from the JSON format. The enables you to control how objects are encoded into JSON. Initializes a new instance of the class. Creates a new instance. The will not use default settings. A new instance. The will not use default settings. Creates a new instance using the specified . The will not use default settings. The settings to be applied to the . A new instance using the specified . The will not use default settings. Creates a new instance. The will use default settings. A new instance. The will use default settings. Creates a new instance using the specified . The will use default settings. The settings to be applied to the . A new instance using the specified . The will use default settings. Populates the JSON values onto the target object. The that contains the JSON structure to reader values from. The target object to populate values onto. Populates the JSON values onto the target object. The that contains the JSON structure to reader values from. The target object to populate values onto. Deserializes the Json structure contained by the specified . The that contains the JSON structure to deserialize. The being deserialized. Deserializes the Json structure contained by the specified into an instance of the specified type. The containing the object. The of object being deserialized. The instance of being deserialized. Deserializes the Json structure contained by the specified into an instance of the specified type. The containing the object. The type of the object to deserialize. The instance of being deserialized. Deserializes the Json structure contained by the specified into an instance of the specified type. The containing the object. The of object being deserialized. The instance of being deserialized. Serializes the specified and writes the Json structure to a Stream using the specified . The used to write the Json structure. The to serialize. Serializes the specified and writes the Json structure to a Stream using the specified . The used to write the Json structure. The to serialize. The type of the value being serialized. This parameter is used when is Auto to write out the type name if the type of the value does not match. Specifing the type is optional. Serializes the specified and writes the Json structure to a Stream using the specified . The used to write the Json structure. The to serialize. The type of the value being serialized. This parameter is used when is Auto to write out the type name if the type of the value does not match. Specifing the type is optional. Serializes the specified and writes the Json structure to a Stream using the specified . The used to write the Json structure. The to serialize. Occurs when the errors during serialization and deserialization. Gets or sets the used by the serializer when resolving references. Gets or sets the used by the serializer when resolving type names. Gets or sets the used by the serializer when writing trace messages. The trace writer. Gets or sets how type name writing and reading is handled by the serializer. Gets or sets how a type name assembly is written and resolved by the serializer. The type name assembly format. Gets or sets how object references are preserved by the serializer. Get or set how reference loops (e.g. a class referencing itself) is handled. Get or set how missing members (e.g. JSON contains a property that isn't a member on the object) are handled during deserialization. Get or set how null values are handled during serialization and deserialization. Get or set how null default are handled during serialization and deserialization. Gets or sets how objects are created during deserialization. The object creation handling. Gets or sets how constructors are used during deserialization. The constructor handling. Gets a collection that will be used during serialization. Collection that will be used during serialization. Gets or sets the contract resolver used by the serializer when serializing .NET objects to JSON and vice versa. Gets or sets the used by the serializer when invoking serialization callback methods. The context. Indicates how JSON text output is formatted. Get or set how dates are written to JSON text. Get or set how time zones are handling during serialization and deserialization. Get or set how date formatted strings, e.g. "\/Date(1198908717056)\/" and "2012-03-21T05:40Z", are parsed when reading JSON. Get or set how floating point numbers, e.g. 1.0 and 9.9, are parsed when reading JSON text. Get or set how special floating point numbers, e.g. , and , are written as JSON text. Get or set how strings are escaped when writing JSON text. Get or set how and values are formatting when writing JSON text. Gets or sets the culture used when reading JSON. Defaults to . Gets or sets the maximum depth allowed when reading JSON. Reading past this depth will throw a . Gets a value indicating whether there will be a check for additional JSON content after deserializing an object. true if there will be a check for additional JSON content after deserializing an object; otherwise, false. Contains the LINQ to JSON extension methods. Returns a collection of tokens that contains the ancestors of every token in the source collection. The type of the objects in source, constrained to . An of that contains the source collection. An of that contains the ancestors of every node in the source collection. Returns a collection of tokens that contains the descendants of every token in the source collection. The type of the objects in source, constrained to . An of that contains the source collection. An of that contains the descendants of every node in the source collection. Returns a collection of child properties of every object in the source collection. An of that contains the source collection. An of that contains the properties of every object in the source collection. Returns a collection of child values of every object in the source collection with the given key. An of that contains the source collection. The token key. An of that contains the values of every node in the source collection with the given key. Returns a collection of child values of every object in the source collection. An of that contains the source collection. An of that contains the values of every node in the source collection. Returns a collection of converted child values of every object in the source collection with the given key. The type to convert the values to. An of that contains the source collection. The token key. An that contains the converted values of every node in the source collection with the given key. Returns a collection of converted child values of every object in the source collection. The type to convert the values to. An of that contains the source collection. An that contains the converted values of every node in the source collection. Converts the value. The type to convert the value to. A cast as a of . A converted value. Converts the value. The source collection type. The type to convert the value to. A cast as a of . A converted value. Returns a collection of child tokens of every array in the source collection. The source collection type. An of that contains the source collection. An of that contains the values of every node in the source collection. Returns a collection of converted child tokens of every array in the source collection. An of that contains the source collection. The type to convert the values to. The source collection type. An that contains the converted values of every node in the source collection. Returns the input typed as . An of that contains the source collection. The input typed as . Returns the input typed as . The source collection type. An of that contains the source collection. The input typed as . Represents a JSON constructor. Represents a token that can contain other tokens. Raises the event. The instance containing the event data. Raises the event. The instance containing the event data. Returns a collection of the child tokens of this token, in document order. An of containing the child tokens of this , in document order. Returns a collection of the child values of this token, in document order. The type to convert the values to. A containing the child values of this , in document order. Returns a collection of the descendant tokens for this token in document order. An containing the descendant tokens of the . Adds the specified content as children of this . The content to be added. Adds the specified content as the first children of this . The content to be added. Creates an that can be used to add tokens to the . An that is ready to have content written to it. Replaces the children nodes of this token with the specified content. The content. Removes the child nodes from this token. Occurs when the list changes or an item in the list changes. Occurs before an item is added to the collection. Gets the container's children tokens. The container's children tokens. Gets a value indicating whether this token has child tokens. true if this token has child values; otherwise, false. Get the first child token of this token. A containing the first child token of the . Get the last child token of this token. A containing the last child token of the . Gets the count of child JSON tokens. The count of child JSON tokens Initializes a new instance of the class. Initializes a new instance of the class from another object. A object to copy from. Initializes a new instance of the class with the specified name and content. The constructor name. The contents of the constructor. Initializes a new instance of the class with the specified name and content. The constructor name. The contents of the constructor. Initializes a new instance of the class with the specified name. The constructor name. Writes this token to a . A into which this method will write. A collection of which will be used when writing the token. Loads an from a . A that will be read for the content of the . A that contains the JSON that was read from the specified . Gets the container's children tokens. The container's children tokens. Gets or sets the name of this constructor. The constructor name. Gets the node type for this . The type. Gets the with the specified key. The with the specified key. Represents a collection of objects. The type of token An empty collection of objects. Initializes a new instance of the struct. The enumerable. Returns an enumerator that iterates through the collection. A that can be used to iterate through the collection. Returns an enumerator that iterates through a collection. An object that can be used to iterate through the collection. Determines whether the specified is equal to this instance. The to compare with this instance. true if the specified is equal to this instance; otherwise, false. Returns a hash code for this instance. A hash code for this instance, suitable for use in hashing algorithms and data structures like a hash table. Gets the with the specified key. Represents a JSON object. Initializes a new instance of the class. Initializes a new instance of the class from another object. A object to copy from. Initializes a new instance of the class with the specified content. The contents of the object. Initializes a new instance of the class with the specified content. The contents of the object. Gets an of this object's properties. An of this object's properties. Gets a the specified name. The property name. A with the specified name or null. Gets an of this object's property values. An of this object's property values. Loads an from a . A that will be read for the content of the . A that contains the JSON that was read from the specified . Load a from a string that contains JSON. A that contains JSON. A populated from the string that contains JSON. Creates a from an object. The object that will be used to create . A with the values of the specified object Creates a from an object. The object that will be used to create . The that will be used to read the object. A with the values of the specified object Writes this token to a . A into which this method will write. A collection of which will be used when writing the token. Gets the with the specified property name. Name of the property. The with the specified property name. Gets the with the specified property name. The exact property name will be searched for first and if no matching property is found then the will be used to match a property. Name of the property. One of the enumeration values that specifies how the strings will be compared. The with the specified property name. Tries to get the with the specified property name. The exact property name will be searched for first and if no matching property is found then the will be used to match a property. Name of the property. The value. One of the enumeration values that specifies how the strings will be compared. true if a value was successfully retrieved; otherwise, false. Adds the specified property name. Name of the property. The value. Removes the property with the specified name. Name of the property. true if item was successfully removed; otherwise, false. Tries the get value. Name of the property. The value. true if a value was successfully retrieved; otherwise, false. Returns an enumerator that iterates through the collection. A that can be used to iterate through the collection. Raises the event with the provided arguments. Name of the property. Returns the properties for this instance of a component. A that represents the properties for this component instance. Returns the properties for this instance of a component using the attribute array as a filter. An array of type that is used as a filter. A that represents the filtered properties for this component instance. Returns a collection of custom attributes for this instance of a component. An containing the attributes for this object. Returns the class name of this instance of a component. The class name of the object, or null if the class does not have a name. Returns the name of this instance of a component. The name of the object, or null if the object does not have a name. Returns a type converter for this instance of a component. A that is the converter for this object, or null if there is no for this object. Returns the default event for this instance of a component. An that represents the default event for this object, or null if this object does not have events. Returns the default property for this instance of a component. A that represents the default property for this object, or null if this object does not have properties. Returns an editor of the specified type for this instance of a component. A that represents the editor for this object. An of the specified type that is the editor for this object, or null if the editor cannot be found. Returns the events for this instance of a component using the specified attribute array as a filter. An array of type that is used as a filter. An that represents the filtered events for this component instance. Returns the events for this instance of a component. An that represents the events for this component instance. Returns an object that contains the property described by the specified property descriptor. A that represents the property whose owner is to be found. An that represents the owner of the specified property. Gets the container's children tokens. The container's children tokens. Occurs when a property value changes. Gets the node type for this . The type. Gets the with the specified key. The with the specified key. Gets or sets the with the specified property name. Represents a JSON array. Initializes a new instance of the class. Initializes a new instance of the class from another object. A object to copy from. Initializes a new instance of the class with the specified content. The contents of the array. Initializes a new instance of the class with the specified content. The contents of the array. Loads an from a . A that will be read for the content of the . A that contains the JSON that was read from the specified . Load a from a string that contains JSON. A that contains JSON. A populated from the string that contains JSON. Creates a from an object. The object that will be used to create . A with the values of the specified object Creates a from an object. The object that will be used to create . The that will be used to read the object. A with the values of the specified object Writes this token to a . A into which this method will write. A collection of which will be used when writing the token. Determines the index of a specific item in the . The object to locate in the . The index of if found in the list; otherwise, -1. Inserts an item to the at the specified index. The zero-based index at which should be inserted. The object to insert into the . is not a valid index in the . The is read-only. Removes the item at the specified index. The zero-based index of the item to remove. is not a valid index in the . The is read-only. Returns an enumerator that iterates through the collection. A that can be used to iterate through the collection. Adds an item to the . The object to add to the . The is read-only. Removes all items from the . The is read-only. Determines whether the contains a specific value. The object to locate in the . true if is found in the ; otherwise, false. Copies to. The array. Index of the array. Removes the first occurrence of a specific object from the . The object to remove from the . true if was successfully removed from the ; otherwise, false. This method also returns false if is not found in the original . The is read-only. Gets the container's children tokens. The container's children tokens. Gets the node type for this . The type. Gets the with the specified key. The with the specified key. Gets or sets the at the specified index. Gets a value indicating whether the is read-only. true if the is read-only; otherwise, false. Represents a reader that provides fast, non-cached, forward-only access to serialized Json data. Initializes a new instance of the class. The token to read from. Reads the next JSON token from the stream as a . A or a null reference if the next JSON token is null. This method will return null at the end of an array. Reads the next JSON token from the stream as a . A . This method will return null at the end of an array. Reads the next JSON token from the stream as a . A . This method will return null at the end of an array. Reads the next JSON token from the stream as a . A . This method will return null at the end of an array. Reads the next JSON token from the stream as a . A . This method will return null at the end of an array. Reads the next JSON token from the stream. true if the next token was read successfully; false if there are no more tokens to read. Represents a writer that provides a fast, non-cached, forward-only way of generating Json data. Initializes a new instance of the class writing to the given . The container being written to. Initializes a new instance of the class. Flushes whatever is in the buffer to the underlying streams and also flushes the underlying stream. Closes this stream and the underlying stream. Writes the beginning of a Json object. Writes the beginning of a Json array. Writes the start of a constructor with the given name. The name of the constructor. Writes the end. The token. Writes the property name of a name/value pair on a Json object. The name of the property. Writes a value. An error will raised if the value cannot be written as a single JSON token. The value to write. Writes a null value. Writes an undefined value. Writes raw JSON. The raw JSON to write. Writes out a comment /*...*/ containing the specified text. Text to place inside the comment. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Gets the token being writen. The token being writen. Represents a JSON property. Initializes a new instance of the class from another object. A object to copy from. Initializes a new instance of the class. The property name. The property content. Initializes a new instance of the class. The property name. The property content. Writes this token to a . A into which this method will write. A collection of which will be used when writing the token. Loads an from a . A that will be read for the content of the . A that contains the JSON that was read from the specified . Gets the container's children tokens. The container's children tokens. Gets the property name. The property name. Gets or sets the property value. The property value. Gets the node type for this . The type. Specifies the type of token. No token type has been set. A JSON object. A JSON array. A JSON constructor. A JSON object property. A comment. An integer value. A float value. A string value. A boolean value. A null value. An undefined value. A date value. A raw JSON value. A collection of bytes value. A Guid value. A Uri value. A TimeSpan value. Contains the JSON schema extension methods. Determines whether the is valid. The source to test. The schema to test with. true if the specified is valid; otherwise, false. Determines whether the is valid. The source to test. The schema to test with. When this method returns, contains any error messages generated while validating. true if the specified is valid; otherwise, false. Validates the specified . The source to test. The schema to test with. Validates the specified . The source to test. The schema to test with. The validation event handler. Returns detailed information about the schema exception. Initializes a new instance of the class. Initializes a new instance of the class with a specified error message. The error message that explains the reason for the exception. Initializes a new instance of the class with a specified error message and a reference to the inner exception that is the cause of this exception. The error message that explains the reason for the exception. The exception that is the cause of the current exception, or a null reference (Nothing in Visual Basic) if no inner exception is specified. Initializes a new instance of the class. The that holds the serialized object data about the exception being thrown. The that contains contextual information about the source or destination. The parameter is null. The class name is null or is zero (0). Gets the line number indicating where the error occurred. The line number indicating where the error occurred. Gets the line position indicating where the error occurred. The line position indicating where the error occurred. Gets the path to the JSON where the error occurred. The path to the JSON where the error occurred. Resolves from an id. Initializes a new instance of the class. Gets a for the specified reference. The id. A for the specified reference. Gets or sets the loaded schemas. The loaded schemas. Specifies undefined schema Id handling options for the . Do not infer a schema Id. Use the .NET type name as the schema Id. Use the assembly qualified .NET type name as the schema Id. Returns detailed information related to the . Gets the associated with the validation error. The JsonSchemaException associated with the validation error. Gets the path of the JSON location where the validation error occurred. The path of the JSON location where the validation error occurred. Gets the text description corresponding to the validation error. The text description. Represents the callback method that will handle JSON schema validation events and the . Resolves member mappings for a type, camel casing property names. Used by to resolves a for a given . Used by to resolves a for a given . Resolves the contract for a given type. The type to resolve a contract for. The contract for a given type. Initializes a new instance of the class. Initializes a new instance of the class. If set to true the will use a cached shared with other resolvers of the same type. Sharing the cache will significantly performance because expensive reflection will only happen once but could cause unexpected behavior if different instances of the resolver are suppose to produce different results. When set to false it is highly recommended to reuse instances with the . Resolves the contract for a given type. The type to resolve a contract for. The contract for a given type. Gets the serializable members for the type. The type to get serializable members for. The serializable members for the type. Creates a for the given type. Type of the object. A for the given type. Creates the constructor parameters. The constructor to create properties for. The type's member properties. Properties for the given . Creates a for the given . The matching member property. The constructor parameter. A created for the given . Resolves the default for the contract. Type of the object. The contract's default . Creates a for the given type. Type of the object. A for the given type. Creates a for the given type. Type of the object. A for the given type. Creates a for the given type. Type of the object. A for the given type. Creates a for the given type. Type of the object. A for the given type. Creates a for the given type. Type of the object. A for the given type. Creates a for the given type. Type of the object. A for the given type. Determines which contract type is created for the given type. Type of the object. A for the given type. Creates properties for the given . The type to create properties for. /// The member serialization mode for the type. Properties for the given . Creates the used by the serializer to get and set values from a member. The member. The used by the serializer to get and set values from a member. Creates a for the given . The member's parent . The member to create a for. A created for the given . Resolves the name of the property. Name of the property. Name of the property. Gets the resolved name of the property. Name of the property. Name of the property. Gets a value indicating whether members are being get and set using dynamic code generation. This value is determined by the runtime permissions available. true if using dynamic code generation; otherwise, false. Gets or sets the default members search flags. The default members search flags. Gets or sets a value indicating whether compiler generated members should be serialized. true if serialized compiler generated members; otherwise, false. Gets or sets a value indicating whether to ignore the interface when serializing and deserializing types. true if the interface will be ignored when serializing and deserializing types; otherwise, false. Gets or sets a value indicating whether to ignore the attribute when serializing and deserializing types. true if the attribute will be ignored when serializing and deserializing types; otherwise, false. Initializes a new instance of the class. Resolves the name of the property. Name of the property. The property name camel cased. The default serialization binder used when resolving and loading classes from type names. When overridden in a derived class, controls the binding of a serialized object to a type. Specifies the name of the serialized object. Specifies the name of the serialized object. The type of the object the formatter creates a new instance of. Get and set values for a using dynamic methods. Provides methods to get and set values. Sets the value. The target to set the value on. The value to set on the target. Gets the value. The target to get the value from. The value. Initializes a new instance of the class. The member info. Sets the value. The target to set the value on. The value to set on the target. Gets the value. The target to get the value from. The value. Provides information surrounding an error. Gets the error. The error. Gets the original object that caused the error. The original object that caused the error. Gets the member that caused the error. The member that caused the error. Gets the path of the JSON location where the error occurred. The path of the JSON location where the error occurred. Gets or sets a value indicating whether this is handled. true if handled; otherwise, false. Provides data for the Error event. Initializes a new instance of the class. The current object. The error context. Gets the current object the error event is being raised against. The current object the error event is being raised against. Gets the error context. The error context. Contract details for a used by the . Initializes a new instance of the class. The underlying type for the contract. Gets the of the collection items. The of the collection items. Gets a value indicating whether the collection type is a multidimensional array. true if the collection type is a multidimensional array; otherwise, false. Handles serialization callback events. The object that raised the callback event. The streaming context. Handles serialization error callback events. The object that raised the callback event. The streaming context. The error context. Sets extension data for an object during deserialization. The object to set extension data on. The extension data key. The extension data value. Gets extension data for an object during serialization. The object to set extension data on. Contract details for a used by the . Initializes a new instance of the class. The underlying type for the contract. Gets or sets the property name resolver. The property name resolver. Gets the of the dictionary keys. The of the dictionary keys. Gets the of the dictionary values. The of the dictionary values. Contract details for a used by the . Initializes a new instance of the class. The underlying type for the contract. Gets or sets the ISerializable object constructor. The ISerializable object constructor. Contract details for a used by the . Initializes a new instance of the class. The underlying type for the contract. Contract details for a used by the . Initializes a new instance of the class. The underlying type for the contract. Maps a JSON property to a .NET member or constructor parameter. Returns a that represents this instance. A that represents this instance. Gets or sets the name of the property. The name of the property. Gets or sets the type that declared this property. The type that declared this property. Gets or sets the order of serialization and deserialization of a member. The numeric order of serialization or deserialization. Gets or sets the name of the underlying member or parameter. The name of the underlying member or parameter. Gets the that will get and set the during serialization. The that will get and set the during serialization. Gets or sets the type of the property. The type of the property. Gets or sets the for the property. If set this converter takes presidence over the contract converter for the property type. The converter. Gets or sets the member converter. The member converter. Gets or sets a value indicating whether this is ignored. true if ignored; otherwise, false. Gets or sets a value indicating whether this is readable. true if readable; otherwise, false. Gets or sets a value indicating whether this is writable. true if writable; otherwise, false. Gets or sets a value indicating whether this has a member attribute. true if has a member attribute; otherwise, false. Gets the default value. The default value. Gets or sets a value indicating whether this is required. A value indicating whether this is required. Gets or sets a value indicating whether this property preserves object references. true if this instance is reference; otherwise, false. Gets or sets the property null value handling. The null value handling. Gets or sets the property default value handling. The default value handling. Gets or sets the property reference loop handling. The reference loop handling. Gets or sets the property object creation handling. The object creation handling. Gets or sets or sets the type name handling. The type name handling. Gets or sets a predicate used to determine whether the property should be serialize. A predicate used to determine whether the property should be serialize. Gets or sets a predicate used to determine whether the property should be serialized. A predicate used to determine whether the property should be serialized. Gets or sets an action used to set whether the property has been deserialized. An action used to set whether the property has been deserialized. Gets or sets the converter used when serializing the property's collection items. The collection's items converter. Gets or sets whether this property's collection items are serialized as a reference. Whether this property's collection items are serialized as a reference. Gets or sets the the type name handling used when serializing the property's collection items. The collection's items type name handling. Gets or sets the the reference loop handling used when serializing the property's collection items. The collection's items reference loop handling. A collection of objects. Initializes a new instance of the class. The type. When implemented in a derived class, extracts the key from the specified element. The element from which to extract the key. The key for the specified element. Adds a object. The property to add to the collection. Gets the closest matching object. First attempts to get an exact case match of propertyName and then a case insensitive match. Name of the property. A matching property if found. Gets a property by property name. The name of the property to get. Type property name string comparison. A matching property if found. Specifies missing member handling options for the . Ignore a missing member and do not attempt to deserialize it. Throw a when a missing member is encountered during deserialization. Specifies null value handling options for the . Include null values when serializing and deserializing objects. Ignore null values when serializing and deserializing objects. Specifies reference loop handling options for the . Throw a when a loop is encountered. Ignore loop references and do not serialize. Serialize loop references. An in-memory representation of a JSON Schema. Initializes a new instance of the class. Reads a from the specified . The containing the JSON Schema to read. The object representing the JSON Schema. Reads a from the specified . The containing the JSON Schema to read. The to use when resolving schema references. The object representing the JSON Schema. Load a from a string that contains schema JSON. A that contains JSON. A populated from the string that contains JSON. Parses the specified json. The json. The resolver. A populated from the string that contains JSON. Writes this schema to a . A into which this method will write. Writes this schema to a using the specified . A into which this method will write. The resolver used. Returns a that represents the current . A that represents the current . Gets or sets the id. Gets or sets the title. Gets or sets whether the object is required. Gets or sets whether the object is read only. Gets or sets whether the object is visible to users. Gets or sets whether the object is transient. Gets or sets the description of the object. Gets or sets the types of values allowed by the object. The type. Gets or sets the pattern. The pattern. Gets or sets the minimum length. The minimum length. Gets or sets the maximum length. The maximum length. Gets or sets a number that the value should be divisble by. A number that the value should be divisble by. Gets or sets the minimum. The minimum. Gets or sets the maximum. The maximum. Gets or sets a flag indicating whether the value can not equal the number defined by the "minimum" attribute. A flag indicating whether the value can not equal the number defined by the "minimum" attribute. Gets or sets a flag indicating whether the value can not equal the number defined by the "maximum" attribute. A flag indicating whether the value can not equal the number defined by the "maximum" attribute. Gets or sets the minimum number of items. The minimum number of items. Gets or sets the maximum number of items. The maximum number of items. Gets or sets the of items. The of items. Gets or sets a value indicating whether items in an array are validated using the instance at their array position from . true if items are validated using their array position; otherwise, false. Gets or sets the of additional items. The of additional items. Gets or sets a value indicating whether additional items are allowed. true if additional items are allowed; otherwise, false. Gets or sets whether the array items must be unique. Gets or sets the of properties. The of properties. Gets or sets the of additional properties. The of additional properties. Gets or sets the pattern properties. The pattern properties. Gets or sets a value indicating whether additional properties are allowed. true if additional properties are allowed; otherwise, false. Gets or sets the required property if this property is present. The required property if this property is present. Gets or sets the a collection of valid enum values allowed. A collection of valid enum values allowed. Gets or sets disallowed types. The disallow types. Gets or sets the default value. The default value. Gets or sets the collection of that this schema extends. The collection of that this schema extends. Gets or sets the format. The format. Generates a from a specified . Generate a from the specified type. The type to generate a from. A generated from the specified type. Generate a from the specified type. The type to generate a from. The used to resolve schema references. A generated from the specified type. Generate a from the specified type. The type to generate a from. Specify whether the generated root will be nullable. A generated from the specified type. Generate a from the specified type. The type to generate a from. The used to resolve schema references. Specify whether the generated root will be nullable. A generated from the specified type. Gets or sets how undefined schemas are handled by the serializer. Gets or sets the contract resolver. The contract resolver. The value types allowed by the . No type specified. String type. Float type. Integer type. Boolean type. Object type. Array type. Null type. Any type. Contract details for a used by the . Initializes a new instance of the class. The underlying type for the contract. Gets or sets the object member serialization. The member object serialization. Gets or sets a value that indicates whether the object's properties are required. A value indicating whether the object's properties are required. Gets the object's properties. The object's properties. Gets the constructor parameters required for any non-default constructor Gets or sets the override constructor used to create the object. This is set when a constructor is marked up using the JsonConstructor attribute. The override constructor. Gets or sets the parametrized constructor used to create the object. The parametrized constructor. Gets or sets the extension data setter. Gets or sets the extension data getter. Contract details for a used by the . Initializes a new instance of the class. The underlying type for the contract. Represents a method that constructs an object. The object type to create. When applied to a method, specifies that the method is called when an error occurs serializing an object. Get and set values for a using reflection. Initializes a new instance of the class. The member info. Sets the value. The target to set the value on. The value to set on the target. Gets the value. The target to get the value from. The value. Specifies type name handling options for the . Do not include the .NET type name when serializing types. Include the .NET type name when serializing into a JSON object structure. Include the .NET type name when serializing into a JSON array structure. Always include the .NET type name when serializing. Include the .NET type name when the type of the object being serialized is not the same as its declared type. Converts the value to the specified type. The value to convert. The culture to use when converting. The type to convert the value to. The converted type. Converts the value to the specified type. The value to convert. The culture to use when converting. The type to convert the value to. The converted value if the conversion was successful or the default value of T if it failed. true if initialValue was converted successfully; otherwise, false. Converts the value to the specified type. If the value is unable to be converted, the value is checked whether it assignable to the specified type. The value to convert. The culture to use when converting. The type to convert or cast the value to. The converted type. If conversion was unsuccessful, the initial value is returned if assignable to the target type. Gets a dictionary of the names and values of an Enum type. Gets a dictionary of the names and values of an Enum type. The enum type to get names and values for. Specifies the type of Json token. This is returned by the if a method has not been called. An object start token. An array start token. A constructor start token. An object property name. A comment. Raw JSON. An integer. A float. A string. A boolean. A null token. An undefined token. An object end token. An array end token. A constructor end token. A Date. Byte data. Builds a string. Unlike StringBuilder this class lets you reuse it's internal buffer. Determines whether the collection is null or empty. The collection. true if the collection is null or empty; otherwise, false. Adds the elements of the specified collection to the specified generic IList. The list to add to. The collection of elements to add. Returns the index of the first occurrence in a sequence by using a specified IEqualityComparer. The type of the elements of source. A sequence in which to locate a value. The object to locate in the sequence An equality comparer to compare values. The zero-based index of the first occurrence of value within the entire sequence, if found; otherwise, –1. Gets the type of the typed collection's items. The type. The type of the typed collection's items. Gets the member's underlying type. The member. The underlying type of the member. Determines whether the member is an indexed property. The member. true if the member is an indexed property; otherwise, false. Determines whether the property is an indexed property. The property. true if the property is an indexed property; otherwise, false. Gets the member's value on the object. The member. The target object. The member's value on the object. Sets the member's value on the target object. The member. The target. The value. Determines whether the specified MemberInfo can be read. The MemberInfo to determine whether can be read. /// if set to true then allow the member to be gotten non-publicly. true if the specified MemberInfo can be read; otherwise, false. Determines whether the specified MemberInfo can be set. The MemberInfo to determine whether can be set. if set to true then allow the member to be set non-publicly. if set to true then allow the member to be set if read-only. true if the specified MemberInfo can be set; otherwise, false. Determines whether the string is all white space. Empty string will return false. The string to test whether it is all white space. true if the string is all white space; otherwise, false. Nulls an empty string. The string. Null if the string was null, otherwise the string unchanged. Specifies the state of the . An exception has been thrown, which has left the in an invalid state. You may call the method to put the in the Closed state. Any other method calls results in an being thrown. The method has been called. An object is being written. A array is being written. A constructor is being written. A property is being written. A write method has not been called. ================================================ FILE: packages/Newtonsoft.Json.6.0.2/lib/net35/Newtonsoft.Json.xml ================================================ Newtonsoft.Json Represents a reader that provides fast, non-cached, forward-only access to serialized Json data. Represents a reader that provides fast, non-cached, forward-only access to serialized Json data. Initializes a new instance of the class with the specified . Reads the next JSON token from the stream. true if the next token was read successfully; false if there are no more tokens to read. Reads the next JSON token from the stream as a . A . This method will return null at the end of an array. Reads the next JSON token from the stream as a . A . This method will return null at the end of an array. Reads the next JSON token from the stream as a . A or a null reference if the next JSON token is null. This method will return null at the end of an array. Reads the next JSON token from the stream as a . A . This method will return null at the end of an array. Reads the next JSON token from the stream as a . A . This method will return null at the end of an array. Reads the next JSON token from the stream as a . A . This method will return null at the end of an array. Skips the children of the current token. Sets the current token. The new token. Sets the current token and value. The new token. The value. Sets the state based on current token type. Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources. Releases unmanaged and - optionally - managed resources true to release both managed and unmanaged resources; false to release only unmanaged resources. Changes the to Closed. Gets the current reader state. The current reader state. Gets or sets a value indicating whether the underlying stream or should be closed when the reader is closed. true to close the underlying stream or when the reader is closed; otherwise false. The default is true. Gets or sets a value indicating whether multiple pieces of JSON content can be read from a continuous stream without erroring. true to support reading multiple pieces of JSON content; otherwise false. The default is false. Gets the quotation mark character used to enclose the value of a string. Get or set how time zones are handling when reading JSON. Get or set how date formatted strings, e.g. "\/Date(1198908717056)\/" and "2012-03-21T05:40Z", are parsed when reading JSON. Get or set how floating point numbers, e.g. 1.0 and 9.9, are parsed when reading JSON text. Gets or sets the maximum depth allowed when reading JSON. Reading past this depth will throw a . Gets the type of the current JSON token. Gets the text value of the current JSON token. Gets The Common Language Runtime (CLR) type for the current JSON token. Gets the depth of the current token in the JSON document. The depth of the current token in the JSON document. Gets the path of the current JSON token. Gets or sets the culture used when reading JSON. Defaults to . Specifies the state of the reader. The Read method has not been called. The end of the file has been reached successfully. Reader is at a property. Reader is at the start of an object. Reader is in an object. Reader is at the start of an array. Reader is in an array. The Close method has been called. Reader has just read a value. Reader is at the start of a constructor. Reader in a constructor. An error occurred that prevents the read operation from continuing. The end of the file has been reached successfully. Initializes a new instance of the class. The stream. Initializes a new instance of the class. The reader. Initializes a new instance of the class. The stream. if set to true the root object will be read as a JSON array. The used when reading values from BSON. Initializes a new instance of the class. The reader. if set to true the root object will be read as a JSON array. The used when reading values from BSON. Reads the next JSON token from the stream as a . A or a null reference if the next JSON token is null. This method will return null at the end of an array. Reads the next JSON token from the stream as a . A . This method will return null at the end of an array. Reads the next JSON token from the stream as a . A . This method will return null at the end of an array. Reads the next JSON token from the stream as a . A . This method will return null at the end of an array. Reads the next JSON token from the stream as a . A . This method will return null at the end of an array. Reads the next JSON token from the stream as a . A . This method will return null at the end of an array. Reads the next JSON token from the stream. true if the next token was read successfully; false if there are no more tokens to read. Changes the to Closed. Gets or sets a value indicating whether binary data reading should compatible with incorrect Json.NET 3.5 written binary. true if binary data reading will be compatible with incorrect Json.NET 3.5 written binary; otherwise, false. Gets or sets a value indicating whether the root object will be read as a JSON array. true if the root object will be read as a JSON array; otherwise, false. Gets or sets the used when reading values from BSON. The used when reading values from BSON. Represents a writer that provides a fast, non-cached, forward-only way of generating JSON data. Represents a writer that provides a fast, non-cached, forward-only way of generating Json data. Creates an instance of the JsonWriter class. Flushes whatever is in the buffer to the underlying streams and also flushes the underlying stream. Closes this stream and the underlying stream. Writes the beginning of a Json object. Writes the end of a Json object. Writes the beginning of a Json array. Writes the end of an array. Writes the start of a constructor with the given name. The name of the constructor. Writes the end constructor. Writes the property name of a name/value pair on a JSON object. The name of the property. Writes the property name of a name/value pair on a JSON object. The name of the property. A flag to indicate whether the text should be escaped when it is written as a JSON property name. Writes the end of the current Json object or array. Writes the current token and its children. The to read the token from. Writes the current token. The to read the token from. A flag indicating whether the current token's children should be written. Writes the specified end token. The end token to write. Writes indent characters. Writes the JSON value delimiter. Writes an indent space. Writes a null value. Writes an undefined value. Writes raw JSON without changing the writer's state. The raw JSON to write. Writes raw JSON where a value is expected and updates the writer's state. The raw JSON to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. An error will raised if the value cannot be written as a single JSON token. The value to write. Writes out a comment /*...*/ containing the specified text. Text to place inside the comment. Writes out the given white space. The string of white space characters. Sets the state of the JsonWriter, The JsonToken being written. The value being written. Gets or sets a value indicating whether the underlying stream or should be closed when the writer is closed. true to close the underlying stream or when the writer is closed; otherwise false. The default is true. Gets the top. The top. Gets the state of the writer. Gets the path of the writer. Indicates how JSON text output is formatted. Get or set how dates are written to JSON text. Get or set how time zones are handling when writing JSON text. Get or set how strings are escaped when writing JSON text. Get or set how special floating point numbers, e.g. , and , are written to JSON text. Get or set how and values are formatting when writing JSON text. Gets or sets the culture used when writing JSON. Defaults to . Initializes a new instance of the class. The stream. Initializes a new instance of the class. The writer. Flushes whatever is in the buffer to the underlying streams and also flushes the underlying stream. Writes the end. The token. Writes out a comment /*...*/ containing the specified text. Text to place inside the comment. Writes the start of a constructor with the given name. The name of the constructor. Writes raw JSON. The raw JSON to write. Writes raw JSON where a value is expected and updates the writer's state. The raw JSON to write. Writes the beginning of a Json array. Writes the beginning of a Json object. Writes the property name of a name/value pair on a Json object. The name of the property. Closes this stream and the underlying stream. Writes a value. An error will raised if the value cannot be written as a single JSON token. The value to write. Writes a null value. Writes an undefined value. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value that represents a BSON object id. The Object ID value to write. Writes a BSON regex. The regex pattern. The regex options. Gets or sets the used when writing values to BSON. When set to no conversion will occur. The used when writing values to BSON. Represents a BSON Oid (object id). Initializes a new instance of the class. The Oid value. Gets or sets the value of the Oid. The value of the Oid. Converts a binary value to and from a base 64 string value. Converts an object to and from JSON. Writes the JSON representation of the object. The to write to. The value. The calling serializer. Reads the JSON representation of the object. The to read from. Type of the object. The existing value of object being read. The calling serializer. The object value. Determines whether this instance can convert the specified object type. Type of the object. true if this instance can convert the specified object type; otherwise, false. Gets the of the JSON produced by the JsonConverter. The of the JSON produced by the JsonConverter. Gets a value indicating whether this can read JSON. true if this can read JSON; otherwise, false. Gets a value indicating whether this can write JSON. true if this can write JSON; otherwise, false. Writes the JSON representation of the object. The to write to. The value. The calling serializer. Reads the JSON representation of the object. The to read from. Type of the object. The existing value of object being read. The calling serializer. The object value. Determines whether this instance can convert the specified object type. Type of the object. true if this instance can convert the specified object type; otherwise, false. Converts a to and from JSON. Writes the JSON representation of the object. The to write to. The value. The calling serializer. Reads the JSON representation of the object. The to read from. Type of the object. The existing value of object being read. The calling serializer. The object value. Determines whether this instance can convert the specified value type. Type of the value. true if this instance can convert the specified value type; otherwise, false. Converts a to and from JSON. Writes the JSON representation of the object. The to write to. The value. The calling serializer. Reads the JSON representation of the object. The to read from. Type of the object. The existing value of object being read. The calling serializer. The object value. Determines whether this instance can convert the specified value type. Type of the value. true if this instance can convert the specified value type; otherwise, false. Create a custom object The object type to convert. Writes the JSON representation of the object. The to write to. The value. The calling serializer. Reads the JSON representation of the object. The to read from. Type of the object. The existing value of object being read. The calling serializer. The object value. Creates an object which will then be populated by the serializer. Type of the object. The created object. Determines whether this instance can convert the specified object type. Type of the object. true if this instance can convert the specified object type; otherwise, false. Gets a value indicating whether this can write JSON. true if this can write JSON; otherwise, false. Provides a base class for converting a to and from JSON. Determines whether this instance can convert the specified object type. Type of the object. true if this instance can convert the specified object type; otherwise, false. Converts a F# discriminated union type to and from JSON. Writes the JSON representation of the object. The to write to. The value. The calling serializer. Reads the JSON representation of the object. The to read from. Type of the object. The existing value of object being read. The calling serializer. The object value. Determines whether this instance can convert the specified object type. Type of the object. true if this instance can convert the specified object type; otherwise, false. Converts an Entity Framework EntityKey to and from JSON. Writes the JSON representation of the object. The to write to. The value. The calling serializer. Reads the JSON representation of the object. The to read from. Type of the object. The existing value of object being read. The calling serializer. The object value. Determines whether this instance can convert the specified object type. Type of the object. true if this instance can convert the specified object type; otherwise, false. Converts a to and from JSON. Writes the JSON representation of the object. The to write to. The value. The calling serializer. Reads the JSON representation of the object. The to read from. Type of the object. The existing value of object being read. The calling serializer. The object value. Determines whether this instance can convert the specified object type. Type of the object. true if this instance can convert the specified object type; otherwise, false. Converts a to and from JSON and BSON. Writes the JSON representation of the object. The to write to. The value. The calling serializer. Reads the JSON representation of the object. The to read from. Type of the object. The existing value of object being read. The calling serializer. The object value. Determines whether this instance can convert the specified object type. Type of the object. true if this instance can convert the specified object type; otherwise, false. Converts a to and from JSON and BSON. Writes the JSON representation of the object. The to write to. The value. The calling serializer. Reads the JSON representation of the object. The to read from. Type of the object. The existing value of object being read. The calling serializer. The object value. Determines whether this instance can convert the specified object type. Type of the object. true if this instance can convert the specified object type; otherwise, false. Converts an to and from its name string value. Initializes a new instance of the class. Writes the JSON representation of the object. The to write to. The value. The calling serializer. Reads the JSON representation of the object. The to read from. Type of the object. The existing value of object being read. The calling serializer. The object value. Determines whether this instance can convert the specified object type. Type of the object. true if this instance can convert the specified object type; otherwise, false. Gets or sets a value indicating whether the written enum text should be camel case. true if the written enum text will be camel case; otherwise, false. Gets or sets a value indicating whether integer values are allowed. true if integers are allowed; otherwise, false. Specifies how constructors are used when initializing objects during deserialization by the . First attempt to use the public default constructor, then fall back to single paramatized constructor, then the non-public default constructor. Json.NET will use a non-public default constructor before falling back to a paramatized constructor. Converts a to and from a string (e.g. "1.2.3.4"). Writes the JSON representation of the object. The to write to. The value. The calling serializer. Reads the JSON representation of the object. The to read from. Type of the object. The existing property value of the JSON that is being converted. The calling serializer. The object value. Determines whether this instance can convert the specified object type. Type of the object. true if this instance can convert the specified object type; otherwise, false. Specifies how dates are formatted when writing JSON text. Dates are written in the ISO 8601 format, e.g. "2012-03-21T05:40Z". Dates are written in the Microsoft JSON format, e.g. "\/Date(1198908717056)\/". Specifies how date formatted strings, e.g. "\/Date(1198908717056)\/" and "2012-03-21T05:40Z", are parsed when reading JSON text. Date formatted strings are not parsed to a date type and are read as strings. Date formatted strings, e.g. "\/Date(1198908717056)\/" and "2012-03-21T05:40Z", are parsed to . Date formatted strings, e.g. "\/Date(1198908717056)\/" and "2012-03-21T05:40Z", are parsed to . Specifies how to treat the time value when converting between string and . Treat as local time. If the object represents a Coordinated Universal Time (UTC), it is converted to the local time. Treat as a UTC. If the object represents a local time, it is converted to a UTC. Treat as a local time if a is being converted to a string. If a string is being converted to , convert to a local time if a time zone is specified. Time zone information should be preserved when converting. Specifies float format handling options when writing special floating point numbers, e.g. , and with . Write special floating point values as strings in JSON, e.g. "NaN", "Infinity", "-Infinity". Write special floating point values as symbols in JSON, e.g. NaN, Infinity, -Infinity. Note that this will produce non-valid JSON. Write special floating point values as the property's default value in JSON, e.g. 0.0 for a property, null for a property. Specifies how floating point numbers, e.g. 1.0 and 9.9, are parsed when reading JSON text. Floating point numbers are parsed to . Floating point numbers are parsed to . Specifies formatting options for the . No special formatting is applied. This is the default. Causes child objects to be indented according to the and settings. Instructs the to use the specified constructor when deserializing that object. Instructs the how to serialize the collection. Instructs the how to serialize the object. Initializes a new instance of the class. Initializes a new instance of the class with the specified container Id. The container Id. Gets or sets the id. The id. Gets or sets the title. The title. Gets or sets the description. The description. Gets the collection's items converter. The collection's items converter. Gets or sets a value that indicates whether to preserve object references. true to keep object reference; otherwise, false. The default is false. Gets or sets a value that indicates whether to preserve collection's items references. true to keep collection's items object references; otherwise, false. The default is false. Gets or sets the reference loop handling used when serializing the collection's items. The reference loop handling. Gets or sets the type name handling used when serializing the collection's items. The type name handling. Initializes a new instance of the class. Initializes a new instance of the class with the specified container Id. The container Id. The exception thrown when an error occurs during Json serialization or deserialization. Initializes a new instance of the class. Initializes a new instance of the class with a specified error message. The error message that explains the reason for the exception. Initializes a new instance of the class with a specified error message and a reference to the inner exception that is the cause of this exception. The error message that explains the reason for the exception. The exception that is the cause of the current exception, or a null reference (Nothing in Visual Basic) if no inner exception is specified. Initializes a new instance of the class. The that holds the serialized object data about the exception being thrown. The that contains contextual information about the source or destination. The parameter is null. The class name is null or is zero (0). Instructs the to deserialize properties with no matching class member into the specified collection and write values during serialization. Initializes a new instance of the class. Gets or sets a value that indicates whether to write extension data when serializing the object. true to write extension data when serializing the object; otherwise, false. The default is true. Gets or sets a value that indicates whether to read extension data when deserializing the object. true to read extension data when deserializing the object; otherwise, false. The default is true. Represents a view of a . Initializes a new instance of the class. The name. When overridden in a derived class, returns whether resetting an object changes its value. true if resetting the component changes its value; otherwise, false. The component to test for reset capability. When overridden in a derived class, gets the current value of the property on a component. The value of a property for a given component. The component with the property for which to retrieve the value. When overridden in a derived class, resets the value for this property of the component to the default value. The component with the property value that is to be reset to the default value. When overridden in a derived class, sets the value of the component to a different value. The component with the property value that is to be set. The new value. When overridden in a derived class, determines a value indicating whether the value of this property needs to be persisted. true if the property should be persisted; otherwise, false. The component with the property to be examined for persistence. When overridden in a derived class, gets the type of the component this property is bound to. A that represents the type of component this property is bound to. When the or methods are invoked, the object specified might be an instance of this type. When overridden in a derived class, gets a value indicating whether this property is read-only. true if the property is read-only; otherwise, false. When overridden in a derived class, gets the type of the property. A that represents the type of the property. Gets the hash code for the name of the member. The hash code for the name of the member. Represents a trace writer that writes to the application's instances. Represents a trace writer. Writes the specified trace level, message and optional exception. The at which to write this trace. The trace message. The trace exception. This parameter is optional. Gets the that will be used to filter the trace messages passed to the writer. For example a filter level of Info will exclude Verbose messages and include Info, Warning and Error messages. The that will be used to filter the trace messages passed to the writer. Writes the specified trace level, message and optional exception. The at which to write this trace. The trace message. The trace exception. This parameter is optional. Gets the that will be used to filter the trace messages passed to the writer. For example a filter level of Info will exclude Verbose messages and include Info, Warning and Error messages. The that will be used to filter the trace messages passed to the writer. Contract details for a used by the . Contract details for a used by the . Gets the underlying type for the contract. The underlying type for the contract. Gets or sets the type created during deserialization. The type created during deserialization. Gets or sets whether this type contract is serialized as a reference. Whether this type contract is serialized as a reference. Gets or sets the default for this contract. The converter. Gets or sets all methods called immediately after deserialization of the object. The methods called immediately after deserialization of the object. Gets or sets all methods called during deserialization of the object. The methods called during deserialization of the object. Gets or sets all methods called after serialization of the object graph. The methods called after serialization of the object graph. Gets or sets all methods called before serialization of the object. The methods called before serialization of the object. Gets or sets all method called when an error is thrown during the serialization of the object. The methods called when an error is thrown during the serialization of the object. Gets or sets the method called immediately after deserialization of the object. The method called immediately after deserialization of the object. Gets or sets the method called during deserialization of the object. The method called during deserialization of the object. Gets or sets the method called after serialization of the object graph. The method called after serialization of the object graph. Gets or sets the method called before serialization of the object. The method called before serialization of the object. Gets or sets the method called when an error is thrown during the serialization of the object. The method called when an error is thrown during the serialization of the object. Gets or sets the default creator method used to create the object. The default creator method used to create the object. Gets or sets a value indicating whether the default creator is non public. true if the default object creator is non-public; otherwise, false. Initializes a new instance of the class. The underlying type for the contract. Gets or sets the default collection items . The converter. Gets or sets a value indicating whether the collection items preserve object references. true if collection items preserve object references; otherwise, false. Gets or sets the collection item reference loop handling. The reference loop handling. Gets or sets the collection item type name handling. The type name handling. Represents a trace writer that writes to memory. When the trace message limit is reached then old trace messages will be removed as new messages are added. Initializes a new instance of the class. Writes the specified trace level, message and optional exception. The at which to write this trace. The trace message. The trace exception. This parameter is optional. Returns an enumeration of the most recent trace messages. An enumeration of the most recent trace messages. Returns a of the most recent trace messages. A of the most recent trace messages. Gets the that will be used to filter the trace messages passed to the writer. For example a filter level of Info will exclude Verbose messages and include Info, Warning and Error messages. The that will be used to filter the trace messages passed to the writer. Provides an interface to enable a class to return line and position information. Gets a value indicating whether the class can return line information. true if LineNumber and LinePosition can be provided; otherwise, false. Gets the current line number. The current line number or 0 if no line information is available (for example, HasLineInfo returns false). Gets the current line position. The current line position or 0 if no line information is available (for example, HasLineInfo returns false). Specifies how strings are escaped when writing JSON text. Only control characters (e.g. newline) are escaped. All non-ASCII and control characters (e.g. newline) are escaped. HTML (<, >, &, ', ") and control characters (e.g. newline) are escaped. Represents a raw JSON string. Represents a value in JSON (string, integer, date, etc). Represents an abstract JSON token. Represents a collection of objects. The type of token Gets the with the specified key. Compares the values of two tokens, including the values of all descendant tokens. The first to compare. The second to compare. true if the tokens are equal; otherwise false. Adds the specified content immediately after this token. A content object that contains simple content or a collection of content objects to be added after this token. Adds the specified content immediately before this token. A content object that contains simple content or a collection of content objects to be added before this token. Returns a collection of the ancestor tokens of this token. A collection of the ancestor tokens of this token. Returns a collection of the sibling tokens after this token, in document order. A collection of the sibling tokens after this tokens, in document order. Returns a collection of the sibling tokens before this token, in document order. A collection of the sibling tokens before this token, in document order. Gets the with the specified key converted to the specified type. The type to convert the token to. The token key. The converted token value. Returns a collection of the child tokens of this token, in document order. An of containing the child tokens of this , in document order. Returns a collection of the child tokens of this token, in document order, filtered by the specified type. The type to filter the child tokens on. A containing the child tokens of this , in document order. Returns a collection of the child values of this token, in document order. The type to convert the values to. A containing the child values of this , in document order. Removes this token from its parent. Replaces this token with the specified token. The value. Writes this token to a . A into which this method will write. A collection of which will be used when writing the token. Returns the indented JSON for this token. The indented JSON for this token. Returns the JSON for this token using the given formatting and converters. Indicates how the output is formatted. A collection of which will be used when writing the token. The JSON for this token using the given formatting and converters. Performs an explicit conversion from to . The value. The result of the conversion. Performs an explicit conversion from to . The value. The result of the conversion. Performs an explicit conversion from to . The value. The result of the conversion. Performs an explicit conversion from to . The value. The result of the conversion. Performs an explicit conversion from to . The value. The result of the conversion. Performs an explicit conversion from to . The value. The result of the conversion. Performs an explicit conversion from to . The value. The result of the conversion. Performs an explicit conversion from to . The value. The result of the conversion. Performs an explicit conversion from to . The value. The result of the conversion. Performs an explicit conversion from to . The value. The result of the conversion. Performs an explicit conversion from to . The value. The result of the conversion. Performs an explicit conversion from to . The value. The result of the conversion. Performs an explicit conversion from to . The value. The result of the conversion. Performs an explicit conversion from to . The value. The result of the conversion. Performs an explicit conversion from to . The value. The result of the conversion. Performs an explicit conversion from to . The value. The result of the conversion. Performs an explicit conversion from to . The value. The result of the conversion. Performs an explicit conversion from to . The value. The result of the conversion. Performs an explicit conversion from to . The value. The result of the conversion. Performs an explicit conversion from to . The value. The result of the conversion. Performs an explicit conversion from to . The value. The result of the conversion. Performs an explicit conversion from to . The value. The result of the conversion. Performs an explicit conversion from to . The value. The result of the conversion. Performs an explicit conversion from to . The value. The result of the conversion. Performs an explicit conversion from to . The value. The result of the conversion. Performs an explicit conversion from to . The value. The result of the conversion. Performs an explicit conversion from to . The value. The result of the conversion. Performs an explicit conversion from to . The value. The result of the conversion. Performs an explicit conversion from to . The value. The result of the conversion. Performs an explicit conversion from to . The value. The result of the conversion. Performs an explicit conversion from to . The value. The result of the conversion. Performs an explicit conversion from to . The value. The result of the conversion. Performs an explicit conversion from to . The value. The result of the conversion. Performs an explicit conversion from to . The value. The result of the conversion. Performs an explicit conversion from to . The value. The result of the conversion. Performs an explicit conversion from to . The value. The result of the conversion. Performs an explicit conversion from to . The value. The result of the conversion. Performs an implicit conversion from to . The value to create a from. The initialized with the specified value. Performs an implicit conversion from to . The value to create a from. The initialized with the specified value. Performs an implicit conversion from to . The value to create a from. The initialized with the specified value. Performs an implicit conversion from to . The value to create a from. The initialized with the specified value. Performs an implicit conversion from to . The value to create a from. The initialized with the specified value. Performs an implicit conversion from to . The value to create a from. The initialized with the specified value. Performs an implicit conversion from to . The value to create a from. The initialized with the specified value. Performs an implicit conversion from to . The value to create a from. The initialized with the specified value. Performs an implicit conversion from to . The value to create a from. The initialized with the specified value. Performs an implicit conversion from to . The value to create a from. The initialized with the specified value. Performs an implicit conversion from to . The value to create a from. The initialized with the specified value. Performs an implicit conversion from to . The value to create a from. The initialized with the specified value. Performs an implicit conversion from to . The value to create a from. The initialized with the specified value. Performs an implicit conversion from to . The value to create a from. The initialized with the specified value. Performs an implicit conversion from to . The value to create a from. The initialized with the specified value. Performs an implicit conversion from to . The value to create a from. The initialized with the specified value. Performs an implicit conversion from to . The value to create a from. The initialized with the specified value. Performs an implicit conversion from to . The value to create a from. The initialized with the specified value. Performs an implicit conversion from to . The value to create a from. The initialized with the specified value. Performs an implicit conversion from to . The value to create a from. The initialized with the specified value. Performs an implicit conversion from to . The value to create a from. The initialized with the specified value. Performs an implicit conversion from to . The value to create a from. The initialized with the specified value. Performs an implicit conversion from to . The value to create a from. The initialized with the specified value. Performs an implicit conversion from to . The value to create a from. The initialized with the specified value. Performs an implicit conversion from to . The value to create a from. The initialized with the specified value. Performs an implicit conversion from to . The value to create a from. The initialized with the specified value. Performs an implicit conversion from to . The value to create a from. The initialized with the specified value. Performs an implicit conversion from to . The value to create a from. The initialized with the specified value. Performs an implicit conversion from to . The value to create a from. The initialized with the specified value. Performs an implicit conversion from to . The value to create a from. The initialized with the specified value. Performs an implicit conversion from to . The value to create a from. The initialized with the specified value. Performs an implicit conversion from to . The value to create a from. The initialized with the specified value. Performs an implicit conversion from to . The value to create a from. The initialized with the specified value. Performs an implicit conversion from to . The value to create a from. The initialized with the specified value. Performs an implicit conversion from to . The value to create a from. The initialized with the specified value. Creates an for this token. An that can be used to read this token and its descendants. Creates a from an object. The object that will be used to create . A with the value of the specified object Creates a from an object using the specified . The object that will be used to create . The that will be used when reading the object. A with the value of the specified object Creates the specified .NET type from the . The object type that the token will be deserialized to. The new object created from the JSON value. Creates the specified .NET type from the . The object type that the token will be deserialized to. The new object created from the JSON value. Creates the specified .NET type from the using the specified . The object type that the token will be deserialized to. The that will be used when creating the object. The new object created from the JSON value. Creates the specified .NET type from the using the specified . The object type that the token will be deserialized to. The that will be used when creating the object. The new object created from the JSON value. Creates a from a . An positioned at the token to read into this . An that contains the token and its descendant tokens that were read from the reader. The runtime type of the token is determined by the token type of the first token encountered in the reader. Load a from a string that contains JSON. A that contains JSON. A populated from the string that contains JSON. Creates a from a . An positioned at the token to read into this . An that contains the token and its descendant tokens that were read from the reader. The runtime type of the token is determined by the token type of the first token encountered in the reader. Selects a using a JPath expression. Selects the token that matches the object path. A that contains a JPath expression. A , or null. Selects a using a JPath expression. Selects the token that matches the object path. A that contains a JPath expression. A flag to indicate whether an error should be thrown if no tokens are found when evaluating part of the expression. A . Selects a collection of elements using a JPath expression. A that contains a JPath expression. An that contains the selected elements. Selects a collection of elements using a JPath expression. A that contains a JPath expression. A flag to indicate whether an error should be thrown if no tokens are found when evaluating part of the expression. An that contains the selected elements. Creates a new instance of the . All child tokens are recursively cloned. A new instance of the . Gets a comparer that can compare two tokens for value equality. A that can compare two nodes for value equality. Gets or sets the parent. The parent. Gets the root of this . The root of this . Gets the node type for this . The type. Gets a value indicating whether this token has child tokens. true if this token has child values; otherwise, false. Gets the next sibling token of this node. The that contains the next sibling token. Gets the previous sibling token of this node. The that contains the previous sibling token. Gets the path of the JSON token. Gets the with the specified key. The with the specified key. Get the first child token of this token. A containing the first child token of the . Get the last child token of this token. A containing the last child token of the . Initializes a new instance of the class from another object. A object to copy from. Initializes a new instance of the class with the given value. The value. Initializes a new instance of the class with the given value. The value. Initializes a new instance of the class with the given value. The value. Initializes a new instance of the class with the given value. The value. Initializes a new instance of the class with the given value. The value. Initializes a new instance of the class with the given value. The value. Initializes a new instance of the class with the given value. The value. Initializes a new instance of the class with the given value. The value. Initializes a new instance of the class with the given value. The value. Initializes a new instance of the class with the given value. The value. Initializes a new instance of the class with the given value. The value. Initializes a new instance of the class with the given value. The value. Initializes a new instance of the class with the given value. The value. Initializes a new instance of the class with the given value. The value. Creates a comment with the given value. The value. A comment with the given value. Creates a string with the given value. The value. A string with the given value. Writes this token to a . A into which this method will write. A collection of which will be used when writing the token. Indicates whether the current object is equal to another object of the same type. true if the current object is equal to the parameter; otherwise, false. An object to compare with this object. Determines whether the specified is equal to the current . The to compare with the current . true if the specified is equal to the current ; otherwise, false. The parameter is null. Serves as a hash function for a particular type. A hash code for the current . Returns a that represents this instance. A that represents this instance. Returns a that represents this instance. The format. A that represents this instance. Returns a that represents this instance. The format provider. A that represents this instance. Returns a that represents this instance. The format. The format provider. A that represents this instance. Compares the current instance with another object of the same type and returns an integer that indicates whether the current instance precedes, follows, or occurs in the same position in the sort order as the other object. An object to compare with this instance. A 32-bit signed integer that indicates the relative order of the objects being compared. The return value has these meanings: Value Meaning Less than zero This instance is less than . Zero This instance is equal to . Greater than zero This instance is greater than . is not the same type as this instance. Gets a value indicating whether this token has child tokens. true if this token has child values; otherwise, false. Gets the node type for this . The type. Gets or sets the underlying token value. The underlying token value. Initializes a new instance of the class from another object. A object to copy from. Initializes a new instance of the class. The raw json. Creates an instance of with the content of the reader's current token. The reader. An instance of with the content of the reader's current token. Indicating whether a property is required. The property is not required. The default state. The property must be defined in JSON but can be a null value. The property must be defined in JSON and cannot be a null value. Contract details for a used by the . Initializes a new instance of the class. The underlying type for the contract. Gets or sets the ISerializable object constructor. The ISerializable object constructor. Contract details for a used by the . Initializes a new instance of the class. The underlying type for the contract. Contract details for a used by the . Initializes a new instance of the class. The underlying type for the contract. Get and set values for a using dynamic methods. Provides methods to get and set values. Sets the value. The target to set the value on. The value to set on the target. Gets the value. The target to get the value from. The value. Initializes a new instance of the class. The member info. Sets the value. The target to set the value on. The value to set on the target. Gets the value. The target to get the value from. The value. Provides data for the Error event. Initializes a new instance of the class. The current object. The error context. Gets the current object the error event is being raised against. The current object the error event is being raised against. Gets the error context. The error context. Used to resolve references when serializing and deserializing JSON by the . Resolves a reference to its object. The serialization context. The reference to resolve. The object that Gets the reference for the sepecified object. The serialization context. The object to get a reference for. The reference to the object. Determines whether the specified object is referenced. The serialization context. The object to test for a reference. true if the specified object is referenced; otherwise, false. Adds a reference to the specified object. The serialization context. The reference. The object to reference. Specifies reference handling options for the . Note that references cannot be preserved when a value is set via a non-default constructor such as types that implement ISerializable. Do not preserve references when serializing types. Preserve references when serializing into a JSON object structure. Preserve references when serializing into a JSON array structure. Preserve references when serializing. Instructs the how to serialize the collection. Initializes a new instance of the class. Initializes a new instance of the class with a flag indicating whether the array can contain null items A flag indicating whether the array can contain null items. Initializes a new instance of the class with the specified container Id. The container Id. Gets or sets a value indicating whether null items are allowed in the collection. true if null items are allowed in the collection; otherwise, false. Specifies default value handling options for the . Include members where the member value is the same as the member's default value when serializing objects. Included members are written to JSON. Has no effect when deserializing. Ignore members where the member value is the same as the member's default value when serializing objects so that is is not written to JSON. This option will ignore all default values (e.g. null for objects and nullable typesl; 0 for integers, decimals and floating point numbers; and false for booleans). The default value ignored can be changed by placing the on the property. Members with a default value but no JSON will be set to their default value when deserializing. Ignore members where the member value is the same as the member's default value when serializing objects and sets members to their default value when deserializing. Instructs the to use the specified when serializing the member or class. Initializes a new instance of the class. Type of the converter. Gets the type of the converter. The type of the converter. Instructs the how to serialize the object. Initializes a new instance of the class. Initializes a new instance of the class with the specified member serialization. The member serialization. Initializes a new instance of the class with the specified container Id. The container Id. Gets or sets the member serialization. The member serialization. Gets or sets a value that indicates whether the object's properties are required. A value indicating whether the object's properties are required. Specifies the settings on a object. Initializes a new instance of the class. Gets or sets how reference loops (e.g. a class referencing itself) is handled. Reference loop handling. Gets or sets how missing members (e.g. JSON contains a property that isn't a member on the object) are handled during deserialization. Missing member handling. Gets or sets how objects are created during deserialization. The object creation handling. Gets or sets how null values are handled during serialization and deserialization. Null value handling. Gets or sets how null default are handled during serialization and deserialization. The default value handling. Gets or sets a collection that will be used during serialization. The converters. Gets or sets how object references are preserved by the serializer. The preserve references handling. Gets or sets how type name writing and reading is handled by the serializer. The type name handling. Gets or sets how a type name assembly is written and resolved by the serializer. The type name assembly format. Gets or sets how constructors are used during deserialization. The constructor handling. Gets or sets the contract resolver used by the serializer when serializing .NET objects to JSON and vice versa. The contract resolver. Gets or sets the used by the serializer when resolving references. The reference resolver. Gets or sets the used by the serializer when writing trace messages. The trace writer. Gets or sets the used by the serializer when resolving type names. The binder. Gets or sets the error handler called during serialization and deserialization. The error handler called during serialization and deserialization. Gets or sets the used by the serializer when invoking serialization callback methods. The context. Get or set how and values are formatting when writing JSON text. Gets or sets the maximum depth allowed when reading JSON. Reading past this depth will throw a . Indicates how JSON text output is formatted. Get or set how dates are written to JSON text. Get or set how time zones are handling during serialization and deserialization. Get or set how date formatted strings, e.g. "\/Date(1198908717056)\/" and "2012-03-21T05:40Z", are parsed when reading JSON. Get or set how special floating point numbers, e.g. , and , are written as JSON. Get or set how floating point numbers, e.g. 1.0 and 9.9, are parsed when reading JSON text. Get or set how strings are escaped when writing JSON text. Gets or sets the culture used when reading JSON. Defaults to . Gets a value indicating whether there will be a check for additional content after deserializing an object. true if there will be a check for additional content after deserializing an object; otherwise, false. Represents a reader that provides validation. Initializes a new instance of the class that validates the content returned from the given . The to read from while validating. Reads the next JSON token from the stream as a . A . Reads the next JSON token from the stream as a . A or a null reference if the next JSON token is null. Reads the next JSON token from the stream as a . A . Reads the next JSON token from the stream as a . A . This method will return null at the end of an array. Reads the next JSON token from the stream as a . A . This method will return null at the end of an array. Reads the next JSON token from the stream as a . A . Reads the next JSON token from the stream. true if the next token was read successfully; false if there are no more tokens to read. Sets an event handler for receiving schema validation errors. Gets the text value of the current JSON token. Gets the depth of the current token in the JSON document. The depth of the current token in the JSON document. Gets the path of the current JSON token. Gets the quotation mark character used to enclose the value of a string. Gets the type of the current JSON token. Gets the Common Language Runtime (CLR) type for the current JSON token. Gets or sets the schema. The schema. Gets the used to construct this . The specified in the constructor. Compares tokens to determine whether they are equal. Determines whether the specified objects are equal. The first object of type to compare. The second object of type to compare. true if the specified objects are equal; otherwise, false. Returns a hash code for the specified object. The for which a hash code is to be returned. A hash code for the specified object. The type of is a reference type and is null. Specifies the member serialization options for the . All public members are serialized by default. Members can be excluded using or . This is the default member serialization mode. Only members must be marked with or are serialized. This member serialization mode can also be set by marking the class with . All public and private fields are serialized. Members can be excluded using or . This member serialization mode can also be set by marking the class with and setting IgnoreSerializableAttribute on to false. Specifies how object creation is handled by the . Reuse existing objects, create new objects when needed. Only reuse existing objects. Always create new objects. Converts a to and from the ISO 8601 date format (e.g. 2008-04-12T12:53Z). Writes the JSON representation of the object. The to write to. The value. The calling serializer. Reads the JSON representation of the object. The to read from. Type of the object. The existing value of object being read. The calling serializer. The object value. Gets or sets the date time styles used when converting a date to and from JSON. The date time styles used when converting a date to and from JSON. Gets or sets the date time format used when converting a date to and from JSON. The date time format used when converting a date to and from JSON. Gets or sets the culture used when converting a date to and from JSON. The culture used when converting a date to and from JSON. Converts a to and from a JavaScript date constructor (e.g. new Date(52231943)). Writes the JSON representation of the object. The to write to. The value. The calling serializer. Reads the JSON representation of the object. The to read from. Type of the object. The existing property value of the JSON that is being converted. The calling serializer. The object value. Converts XML to and from JSON. Writes the JSON representation of the object. The to write to. The calling serializer. The value. Reads the JSON representation of the object. The to read from. Type of the object. The existing value of object being read. The calling serializer. The object value. Checks if the attributeName is a namespace attribute. Attribute name to test. The attribute name prefix if it has one, otherwise an empty string. True if attribute name is for a namespace attribute, otherwise false. Determines whether this instance can convert the specified value type. Type of the value. true if this instance can convert the specified value type; otherwise, false. Gets or sets the name of the root element to insert when deserializing to XML if the JSON structure has produces multiple root elements. The name of the deserialize root element. Gets or sets a flag to indicate whether to write the Json.NET array attribute. This attribute helps preserve arrays when converting the written XML back to JSON. true if the array attibute is written to the XML; otherwise, false. Gets or sets a value indicating whether to write the root JSON object. true if the JSON root object is omitted; otherwise, false. Represents a reader that provides fast, non-cached, forward-only access to JSON text data. Initializes a new instance of the class with the specified . The TextReader containing the XML data to read. Reads the next JSON token from the stream. true if the next token was read successfully; false if there are no more tokens to read. Reads the next JSON token from the stream as a . A or a null reference if the next JSON token is null. This method will return null at the end of an array. Reads the next JSON token from the stream as a . A . This method will return null at the end of an array. Reads the next JSON token from the stream as a . A . This method will return null at the end of an array. Reads the next JSON token from the stream as a . A . This method will return null at the end of an array. Reads the next JSON token from the stream as a . A . This method will return null at the end of an array. Reads the next JSON token from the stream as a . A . This method will return null at the end of an array. Changes the state to closed. Gets a value indicating whether the class can return line information. true if LineNumber and LinePosition can be provided; otherwise, false. Gets the current line number. The current line number or 0 if no line information is available (for example, HasLineInfo returns false). Gets the current line position. The current line position or 0 if no line information is available (for example, HasLineInfo returns false). Instructs the to always serialize the member with the specified name. Initializes a new instance of the class. Initializes a new instance of the class with the specified name. Name of the property. Gets or sets the converter used when serializing the property's collection items. The collection's items converter. Gets or sets the null value handling used when serializing this property. The null value handling. Gets or sets the default value handling used when serializing this property. The default value handling. Gets or sets the reference loop handling used when serializing this property. The reference loop handling. Gets or sets the object creation handling used when deserializing this property. The object creation handling. Gets or sets the type name handling used when serializing this property. The type name handling. Gets or sets whether this property's value is serialized as a reference. Whether this property's value is serialized as a reference. Gets or sets the order of serialization and deserialization of a member. The numeric order of serialization or deserialization. Gets or sets a value indicating whether this property is required. A value indicating whether this property is required. Gets or sets the name of the property. The name of the property. Gets or sets the the reference loop handling used when serializing the property's collection items. The collection's items reference loop handling. Gets or sets the the type name handling used when serializing the property's collection items. The collection's items type name handling. Gets or sets whether this property's collection items are serialized as a reference. Whether this property's collection items are serialized as a reference. Instructs the not to serialize the public field or public read/write property value. Represents a writer that provides a fast, non-cached, forward-only way of generating Json data. Creates an instance of the JsonWriter class using the specified . The TextWriter to write to. Flushes whatever is in the buffer to the underlying streams and also flushes the underlying stream. Closes this stream and the underlying stream. Writes the beginning of a Json object. Writes the beginning of a Json array. Writes the start of a constructor with the given name. The name of the constructor. Writes the specified end token. The end token to write. Writes the property name of a name/value pair on a Json object. The name of the property. Writes the property name of a name/value pair on a JSON object. The name of the property. A flag to indicate whether the text should be escaped when it is written as a JSON property name. Writes indent characters. Writes the JSON value delimiter. Writes an indent space. Writes a value. An error will raised if the value cannot be written as a single JSON token. The value to write. Writes a null value. Writes an undefined value. Writes raw JSON. The raw JSON to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes out a comment /*...*/ containing the specified text. Text to place inside the comment. Writes out the given white space. The string of white space characters. Gets or sets how many IndentChars to write for each level in the hierarchy when is set to Formatting.Indented. Gets or sets which character to use to quote attribute values. Gets or sets which character to use for indenting when is set to Formatting.Indented. Gets or sets a value indicating whether object names will be surrounded with quotes. The exception thrown when an error occurs while reading Json text. Initializes a new instance of the class. Initializes a new instance of the class with a specified error message. The error message that explains the reason for the exception. Initializes a new instance of the class with a specified error message and a reference to the inner exception that is the cause of this exception. The error message that explains the reason for the exception. The exception that is the cause of the current exception, or a null reference (Nothing in Visual Basic) if no inner exception is specified. Initializes a new instance of the class. The that holds the serialized object data about the exception being thrown. The that contains contextual information about the source or destination. The parameter is null. The class name is null or is zero (0). Gets the path to the JSON where the error occurred. The path to the JSON where the error occurred. The exception thrown when an error occurs while reading Json text. Initializes a new instance of the class. Initializes a new instance of the class with a specified error message. The error message that explains the reason for the exception. Initializes a new instance of the class with a specified error message and a reference to the inner exception that is the cause of this exception. The error message that explains the reason for the exception. The exception that is the cause of the current exception, or a null reference (Nothing in Visual Basic) if no inner exception is specified. Initializes a new instance of the class. The that holds the serialized object data about the exception being thrown. The that contains contextual information about the source or destination. The parameter is null. The class name is null or is zero (0). Gets the line number indicating where the error occurred. The line number indicating where the error occurred. Gets the line position indicating where the error occurred. The line position indicating where the error occurred. Gets the path to the JSON where the error occurred. The path to the JSON where the error occurred. Represents a collection of . Provides methods for converting between common language runtime types and JSON types. Represents JavaScript's boolean value true as a string. This field is read-only. Represents JavaScript's boolean value false as a string. This field is read-only. Represents JavaScript's null as a string. This field is read-only. Represents JavaScript's undefined as a string. This field is read-only. Represents JavaScript's positive infinity as a string. This field is read-only. Represents JavaScript's negative infinity as a string. This field is read-only. Represents JavaScript's NaN as a string. This field is read-only. Converts the to its JSON string representation. The value to convert. A JSON string representation of the . Converts the to its JSON string representation using the specified. The value to convert. The format the date will be converted to. The time zone handling when the date is converted to a string. A JSON string representation of the . Converts the to its JSON string representation. The value to convert. A JSON string representation of the . Converts the to its JSON string representation using the specified. The value to convert. The format the date will be converted to. A JSON string representation of the . Converts the to its JSON string representation. The value to convert. A JSON string representation of the . Converts the to its JSON string representation. The value to convert. A JSON string representation of the . Converts the to its JSON string representation. The value to convert. A JSON string representation of the . Converts the to its JSON string representation. The value to convert. A JSON string representation of the . Converts the to its JSON string representation. The value to convert. A JSON string representation of the . Converts the to its JSON string representation. The value to convert. A JSON string representation of the . Converts the to its JSON string representation. The value to convert. A JSON string representation of the . Converts the to its JSON string representation. The value to convert. A JSON string representation of the . Converts the to its JSON string representation. The value to convert. A JSON string representation of the . Converts the to its JSON string representation. The value to convert. A JSON string representation of the . Converts the to its JSON string representation. The value to convert. A JSON string representation of the . Converts the to its JSON string representation. The value to convert. A JSON string representation of the . Converts the to its JSON string representation. The value to convert. A JSON string representation of the . Converts the to its JSON string representation. The value to convert. A JSON string representation of the . Converts the to its JSON string representation. The value to convert. A JSON string representation of the . Converts the to its JSON string representation. The value to convert. A JSON string representation of the . Converts the to its JSON string representation. The value to convert. A JSON string representation of the . Converts the to its JSON string representation. The value to convert. A JSON string representation of the . Converts the to its JSON string representation. The value to convert. The string delimiter character. A JSON string representation of the . Converts the to its JSON string representation. The value to convert. A JSON string representation of the . Serializes the specified object to a JSON string. The object to serialize. A JSON string representation of the object. Serializes the specified object to a JSON string using formatting. The object to serialize. Indicates how the output is formatted. A JSON string representation of the object. Serializes the specified object to a JSON string using a collection of . The object to serialize. A collection converters used while serializing. A JSON string representation of the object. Serializes the specified object to a JSON string using formatting and a collection of . The object to serialize. Indicates how the output is formatted. A collection converters used while serializing. A JSON string representation of the object. Serializes the specified object to a JSON string using . The object to serialize. The used to serialize the object. If this is null, default serialization settings will be is used. A JSON string representation of the object. Serializes the specified object to a JSON string using a type, formatting and . The object to serialize. The used to serialize the object. If this is null, default serialization settings will be is used. The type of the value being serialized. This parameter is used when is Auto to write out the type name if the type of the value does not match. Specifing the type is optional. A JSON string representation of the object. Serializes the specified object to a JSON string using formatting and . The object to serialize. Indicates how the output is formatted. The used to serialize the object. If this is null, default serialization settings will be is used. A JSON string representation of the object. Serializes the specified object to a JSON string using a type, formatting and . The object to serialize. Indicates how the output is formatted. The used to serialize the object. If this is null, default serialization settings will be is used. The type of the value being serialized. This parameter is used when is Auto to write out the type name if the type of the value does not match. Specifing the type is optional. A JSON string representation of the object. Deserializes the JSON to a .NET object. The JSON to deserialize. The deserialized object from the Json string. Deserializes the JSON to a .NET object using . The JSON to deserialize. The used to deserialize the object. If this is null, default serialization settings will be is used. The deserialized object from the JSON string. Deserializes the JSON to the specified .NET type. The JSON to deserialize. The of object being deserialized. The deserialized object from the Json string. Deserializes the JSON to the specified .NET type. The type of the object to deserialize to. The JSON to deserialize. The deserialized object from the Json string. Deserializes the JSON to the given anonymous type. The anonymous type to deserialize to. This can't be specified traditionally and must be infered from the anonymous type passed as a parameter. The JSON to deserialize. The anonymous type object. The deserialized anonymous type from the JSON string. Deserializes the JSON to the given anonymous type using . The anonymous type to deserialize to. This can't be specified traditionally and must be infered from the anonymous type passed as a parameter. The JSON to deserialize. The anonymous type object. The used to deserialize the object. If this is null, default serialization settings will be is used. The deserialized anonymous type from the JSON string. Deserializes the JSON to the specified .NET type using a collection of . The type of the object to deserialize to. The JSON to deserialize. Converters to use while deserializing. The deserialized object from the JSON string. Deserializes the JSON to the specified .NET type using . The type of the object to deserialize to. The object to deserialize. The used to deserialize the object. If this is null, default serialization settings will be is used. The deserialized object from the JSON string. Deserializes the JSON to the specified .NET type using a collection of . The JSON to deserialize. The type of the object to deserialize. Converters to use while deserializing. The deserialized object from the JSON string. Deserializes the JSON to the specified .NET type using . The JSON to deserialize. The type of the object to deserialize to. The used to deserialize the object. If this is null, default serialization settings will be is used. The deserialized object from the JSON string. Populates the object with values from the JSON string. The JSON to populate values from. The target object to populate values onto. Populates the object with values from the JSON string using . The JSON to populate values from. The target object to populate values onto. The used to deserialize the object. If this is null, default serialization settings will be is used. Serializes the XML node to a JSON string. The node to serialize. A JSON string of the XmlNode. Serializes the XML node to a JSON string using formatting. The node to serialize. Indicates how the output is formatted. A JSON string of the XmlNode. Serializes the XML node to a JSON string using formatting and omits the root object if is true. The node to serialize. Indicates how the output is formatted. Omits writing the root object. A JSON string of the XmlNode. Deserializes the XmlNode from a JSON string. The JSON string. The deserialized XmlNode Deserializes the XmlNode from a JSON string nested in a root elment specified by . The JSON string. The name of the root element to append when deserializing. The deserialized XmlNode Deserializes the XmlNode from a JSON string nested in a root elment specified by and writes a .NET array attribute for collections. The JSON string. The name of the root element to append when deserializing. A flag to indicate whether to write the Json.NET array attribute. This attribute helps preserve arrays when converting the written XML back to JSON. The deserialized XmlNode Serializes the to a JSON string. The node to convert to JSON. A JSON string of the XNode. Serializes the to a JSON string using formatting. The node to convert to JSON. Indicates how the output is formatted. A JSON string of the XNode. Serializes the to a JSON string using formatting and omits the root object if is true. The node to serialize. Indicates how the output is formatted. Omits writing the root object. A JSON string of the XNode. Deserializes the from a JSON string. The JSON string. The deserialized XNode Deserializes the from a JSON string nested in a root elment specified by . The JSON string. The name of the root element to append when deserializing. The deserialized XNode Deserializes the from a JSON string nested in a root elment specified by and writes a .NET array attribute for collections. The JSON string. The name of the root element to append when deserializing. A flag to indicate whether to write the Json.NET array attribute. This attribute helps preserve arrays when converting the written XML back to JSON. The deserialized XNode Gets or sets a function that creates default . Default settings are automatically used by serialization methods on , and and on . To serialize without using any default settings create a with . The exception thrown when an error occurs during Json serialization or deserialization. Initializes a new instance of the class. Initializes a new instance of the class with a specified error message. The error message that explains the reason for the exception. Initializes a new instance of the class with a specified error message and a reference to the inner exception that is the cause of this exception. The error message that explains the reason for the exception. The exception that is the cause of the current exception, or a null reference (Nothing in Visual Basic) if no inner exception is specified. Initializes a new instance of the class. The that holds the serialized object data about the exception being thrown. The that contains contextual information about the source or destination. The parameter is null. The class name is null or is zero (0). Serializes and deserializes objects into and from the JSON format. The enables you to control how objects are encoded into JSON. Initializes a new instance of the class. Creates a new instance. The will not use default settings. A new instance. The will not use default settings. Creates a new instance using the specified . The will not use default settings. The settings to be applied to the . A new instance using the specified . The will not use default settings. Creates a new instance. The will use default settings. A new instance. The will use default settings. Creates a new instance using the specified . The will use default settings. The settings to be applied to the . A new instance using the specified . The will use default settings. Populates the JSON values onto the target object. The that contains the JSON structure to reader values from. The target object to populate values onto. Populates the JSON values onto the target object. The that contains the JSON structure to reader values from. The target object to populate values onto. Deserializes the Json structure contained by the specified . The that contains the JSON structure to deserialize. The being deserialized. Deserializes the Json structure contained by the specified into an instance of the specified type. The containing the object. The of object being deserialized. The instance of being deserialized. Deserializes the Json structure contained by the specified into an instance of the specified type. The containing the object. The type of the object to deserialize. The instance of being deserialized. Deserializes the Json structure contained by the specified into an instance of the specified type. The containing the object. The of object being deserialized. The instance of being deserialized. Serializes the specified and writes the Json structure to a Stream using the specified . The used to write the Json structure. The to serialize. Serializes the specified and writes the Json structure to a Stream using the specified . The used to write the Json structure. The to serialize. The type of the value being serialized. This parameter is used when is Auto to write out the type name if the type of the value does not match. Specifing the type is optional. Serializes the specified and writes the Json structure to a Stream using the specified . The used to write the Json structure. The to serialize. The type of the value being serialized. This parameter is used when is Auto to write out the type name if the type of the value does not match. Specifing the type is optional. Serializes the specified and writes the Json structure to a Stream using the specified . The used to write the Json structure. The to serialize. Occurs when the errors during serialization and deserialization. Gets or sets the used by the serializer when resolving references. Gets or sets the used by the serializer when resolving type names. Gets or sets the used by the serializer when writing trace messages. The trace writer. Gets or sets how type name writing and reading is handled by the serializer. Gets or sets how a type name assembly is written and resolved by the serializer. The type name assembly format. Gets or sets how object references are preserved by the serializer. Get or set how reference loops (e.g. a class referencing itself) is handled. Get or set how missing members (e.g. JSON contains a property that isn't a member on the object) are handled during deserialization. Get or set how null values are handled during serialization and deserialization. Get or set how null default are handled during serialization and deserialization. Gets or sets how objects are created during deserialization. The object creation handling. Gets or sets how constructors are used during deserialization. The constructor handling. Gets a collection that will be used during serialization. Collection that will be used during serialization. Gets or sets the contract resolver used by the serializer when serializing .NET objects to JSON and vice versa. Gets or sets the used by the serializer when invoking serialization callback methods. The context. Indicates how JSON text output is formatted. Get or set how dates are written to JSON text. Get or set how time zones are handling during serialization and deserialization. Get or set how date formatted strings, e.g. "\/Date(1198908717056)\/" and "2012-03-21T05:40Z", are parsed when reading JSON. Get or set how floating point numbers, e.g. 1.0 and 9.9, are parsed when reading JSON text. Get or set how special floating point numbers, e.g. , and , are written as JSON text. Get or set how strings are escaped when writing JSON text. Get or set how and values are formatting when writing JSON text. Gets or sets the culture used when reading JSON. Defaults to . Gets or sets the maximum depth allowed when reading JSON. Reading past this depth will throw a . Gets a value indicating whether there will be a check for additional JSON content after deserializing an object. true if there will be a check for additional JSON content after deserializing an object; otherwise, false. Contains the LINQ to JSON extension methods. Returns a collection of tokens that contains the ancestors of every token in the source collection. The type of the objects in source, constrained to . An of that contains the source collection. An of that contains the ancestors of every node in the source collection. Returns a collection of tokens that contains the descendants of every token in the source collection. The type of the objects in source, constrained to . An of that contains the source collection. An of that contains the descendants of every node in the source collection. Returns a collection of child properties of every object in the source collection. An of that contains the source collection. An of that contains the properties of every object in the source collection. Returns a collection of child values of every object in the source collection with the given key. An of that contains the source collection. The token key. An of that contains the values of every node in the source collection with the given key. Returns a collection of child values of every object in the source collection. An of that contains the source collection. An of that contains the values of every node in the source collection. Returns a collection of converted child values of every object in the source collection with the given key. The type to convert the values to. An of that contains the source collection. The token key. An that contains the converted values of every node in the source collection with the given key. Returns a collection of converted child values of every object in the source collection. The type to convert the values to. An of that contains the source collection. An that contains the converted values of every node in the source collection. Converts the value. The type to convert the value to. A cast as a of . A converted value. Converts the value. The source collection type. The type to convert the value to. A cast as a of . A converted value. Returns a collection of child tokens of every array in the source collection. The source collection type. An of that contains the source collection. An of that contains the values of every node in the source collection. Returns a collection of converted child tokens of every array in the source collection. An of that contains the source collection. The type to convert the values to. The source collection type. An that contains the converted values of every node in the source collection. Returns the input typed as . An of that contains the source collection. The input typed as . Returns the input typed as . The source collection type. An of that contains the source collection. The input typed as . Represents a JSON constructor. Represents a token that can contain other tokens. Raises the event. The instance containing the event data. Raises the event. The instance containing the event data. Returns a collection of the child tokens of this token, in document order. An of containing the child tokens of this , in document order. Returns a collection of the child values of this token, in document order. The type to convert the values to. A containing the child values of this , in document order. Returns a collection of the descendant tokens for this token in document order. An containing the descendant tokens of the . Adds the specified content as children of this . The content to be added. Adds the specified content as the first children of this . The content to be added. Creates an that can be used to add tokens to the . An that is ready to have content written to it. Replaces the children nodes of this token with the specified content. The content. Removes the child nodes from this token. Occurs when the list changes or an item in the list changes. Occurs before an item is added to the collection. Gets the container's children tokens. The container's children tokens. Gets a value indicating whether this token has child tokens. true if this token has child values; otherwise, false. Get the first child token of this token. A containing the first child token of the . Get the last child token of this token. A containing the last child token of the . Gets the count of child JSON tokens. The count of child JSON tokens Initializes a new instance of the class. Initializes a new instance of the class from another object. A object to copy from. Initializes a new instance of the class with the specified name and content. The constructor name. The contents of the constructor. Initializes a new instance of the class with the specified name and content. The constructor name. The contents of the constructor. Initializes a new instance of the class with the specified name. The constructor name. Writes this token to a . A into which this method will write. A collection of which will be used when writing the token. Loads an from a . A that will be read for the content of the . A that contains the JSON that was read from the specified . Gets the container's children tokens. The container's children tokens. Gets or sets the name of this constructor. The constructor name. Gets the node type for this . The type. Gets the with the specified key. The with the specified key. Represents a collection of objects. The type of token An empty collection of objects. Initializes a new instance of the struct. The enumerable. Returns an enumerator that iterates through the collection. A that can be used to iterate through the collection. Returns an enumerator that iterates through a collection. An object that can be used to iterate through the collection. Determines whether the specified is equal to this instance. The to compare with this instance. true if the specified is equal to this instance; otherwise, false. Returns a hash code for this instance. A hash code for this instance, suitable for use in hashing algorithms and data structures like a hash table. Gets the with the specified key. Represents a JSON object. Initializes a new instance of the class. Initializes a new instance of the class from another object. A object to copy from. Initializes a new instance of the class with the specified content. The contents of the object. Initializes a new instance of the class with the specified content. The contents of the object. Gets an of this object's properties. An of this object's properties. Gets a the specified name. The property name. A with the specified name or null. Gets an of this object's property values. An of this object's property values. Loads an from a . A that will be read for the content of the . A that contains the JSON that was read from the specified . Load a from a string that contains JSON. A that contains JSON. A populated from the string that contains JSON. Creates a from an object. The object that will be used to create . A with the values of the specified object Creates a from an object. The object that will be used to create . The that will be used to read the object. A with the values of the specified object Writes this token to a . A into which this method will write. A collection of which will be used when writing the token. Gets the with the specified property name. Name of the property. The with the specified property name. Gets the with the specified property name. The exact property name will be searched for first and if no matching property is found then the will be used to match a property. Name of the property. One of the enumeration values that specifies how the strings will be compared. The with the specified property name. Tries to get the with the specified property name. The exact property name will be searched for first and if no matching property is found then the will be used to match a property. Name of the property. The value. One of the enumeration values that specifies how the strings will be compared. true if a value was successfully retrieved; otherwise, false. Adds the specified property name. Name of the property. The value. Removes the property with the specified name. Name of the property. true if item was successfully removed; otherwise, false. Tries the get value. Name of the property. The value. true if a value was successfully retrieved; otherwise, false. Returns an enumerator that iterates through the collection. A that can be used to iterate through the collection. Raises the event with the provided arguments. Name of the property. Raises the event with the provided arguments. Name of the property. Returns the properties for this instance of a component. A that represents the properties for this component instance. Returns the properties for this instance of a component using the attribute array as a filter. An array of type that is used as a filter. A that represents the filtered properties for this component instance. Returns a collection of custom attributes for this instance of a component. An containing the attributes for this object. Returns the class name of this instance of a component. The class name of the object, or null if the class does not have a name. Returns the name of this instance of a component. The name of the object, or null if the object does not have a name. Returns a type converter for this instance of a component. A that is the converter for this object, or null if there is no for this object. Returns the default event for this instance of a component. An that represents the default event for this object, or null if this object does not have events. Returns the default property for this instance of a component. A that represents the default property for this object, or null if this object does not have properties. Returns an editor of the specified type for this instance of a component. A that represents the editor for this object. An of the specified type that is the editor for this object, or null if the editor cannot be found. Returns the events for this instance of a component using the specified attribute array as a filter. An array of type that is used as a filter. An that represents the filtered events for this component instance. Returns the events for this instance of a component. An that represents the events for this component instance. Returns an object that contains the property described by the specified property descriptor. A that represents the property whose owner is to be found. An that represents the owner of the specified property. Gets the container's children tokens. The container's children tokens. Occurs when a property value changes. Occurs when a property value is changing. Gets the node type for this . The type. Gets the with the specified key. The with the specified key. Gets or sets the with the specified property name. Represents a JSON array. Initializes a new instance of the class. Initializes a new instance of the class from another object. A object to copy from. Initializes a new instance of the class with the specified content. The contents of the array. Initializes a new instance of the class with the specified content. The contents of the array. Loads an from a . A that will be read for the content of the . A that contains the JSON that was read from the specified . Load a from a string that contains JSON. A that contains JSON. A populated from the string that contains JSON. Creates a from an object. The object that will be used to create . A with the values of the specified object Creates a from an object. The object that will be used to create . The that will be used to read the object. A with the values of the specified object Writes this token to a . A into which this method will write. A collection of which will be used when writing the token. Determines the index of a specific item in the . The object to locate in the . The index of if found in the list; otherwise, -1. Inserts an item to the at the specified index. The zero-based index at which should be inserted. The object to insert into the . is not a valid index in the . The is read-only. Removes the item at the specified index. The zero-based index of the item to remove. is not a valid index in the . The is read-only. Returns an enumerator that iterates through the collection. A that can be used to iterate through the collection. Adds an item to the . The object to add to the . The is read-only. Removes all items from the . The is read-only. Determines whether the contains a specific value. The object to locate in the . true if is found in the ; otherwise, false. Copies to. The array. Index of the array. Removes the first occurrence of a specific object from the . The object to remove from the . true if was successfully removed from the ; otherwise, false. This method also returns false if is not found in the original . The is read-only. Gets the container's children tokens. The container's children tokens. Gets the node type for this . The type. Gets the with the specified key. The with the specified key. Gets or sets the at the specified index. Gets a value indicating whether the is read-only. true if the is read-only; otherwise, false. Represents a reader that provides fast, non-cached, forward-only access to serialized Json data. Initializes a new instance of the class. The token to read from. Reads the next JSON token from the stream as a . A or a null reference if the next JSON token is null. This method will return null at the end of an array. Reads the next JSON token from the stream as a . A . This method will return null at the end of an array. Reads the next JSON token from the stream as a . A . This method will return null at the end of an array. Reads the next JSON token from the stream as a . A . This method will return null at the end of an array. Reads the next JSON token from the stream as a . A . This method will return null at the end of an array. Reads the next JSON token from the stream as a . A . This method will return null at the end of an array. Reads the next JSON token from the stream. true if the next token was read successfully; false if there are no more tokens to read. Represents a writer that provides a fast, non-cached, forward-only way of generating Json data. Initializes a new instance of the class writing to the given . The container being written to. Initializes a new instance of the class. Flushes whatever is in the buffer to the underlying streams and also flushes the underlying stream. Closes this stream and the underlying stream. Writes the beginning of a Json object. Writes the beginning of a Json array. Writes the start of a constructor with the given name. The name of the constructor. Writes the end. The token. Writes the property name of a name/value pair on a Json object. The name of the property. Writes a value. An error will raised if the value cannot be written as a single JSON token. The value to write. Writes a null value. Writes an undefined value. Writes raw JSON. The raw JSON to write. Writes out a comment /*...*/ containing the specified text. Text to place inside the comment. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Gets the token being writen. The token being writen. Represents a JSON property. Initializes a new instance of the class from another object. A object to copy from. Initializes a new instance of the class. The property name. The property content. Initializes a new instance of the class. The property name. The property content. Writes this token to a . A into which this method will write. A collection of which will be used when writing the token. Loads an from a . A that will be read for the content of the . A that contains the JSON that was read from the specified . Gets the container's children tokens. The container's children tokens. Gets the property name. The property name. Gets or sets the property value. The property value. Gets the node type for this . The type. Specifies the type of token. No token type has been set. A JSON object. A JSON array. A JSON constructor. A JSON object property. A comment. An integer value. A float value. A string value. A boolean value. A null value. An undefined value. A date value. A raw JSON value. A collection of bytes value. A Guid value. A Uri value. A TimeSpan value. Contains the JSON schema extension methods. Determines whether the is valid. The source to test. The schema to test with. true if the specified is valid; otherwise, false. Determines whether the is valid. The source to test. The schema to test with. When this method returns, contains any error messages generated while validating. true if the specified is valid; otherwise, false. Validates the specified . The source to test. The schema to test with. Validates the specified . The source to test. The schema to test with. The validation event handler. Returns detailed information about the schema exception. Initializes a new instance of the class. Initializes a new instance of the class with a specified error message. The error message that explains the reason for the exception. Initializes a new instance of the class with a specified error message and a reference to the inner exception that is the cause of this exception. The error message that explains the reason for the exception. The exception that is the cause of the current exception, or a null reference (Nothing in Visual Basic) if no inner exception is specified. Initializes a new instance of the class. The that holds the serialized object data about the exception being thrown. The that contains contextual information about the source or destination. The parameter is null. The class name is null or is zero (0). Gets the line number indicating where the error occurred. The line number indicating where the error occurred. Gets the line position indicating where the error occurred. The line position indicating where the error occurred. Gets the path to the JSON where the error occurred. The path to the JSON where the error occurred. Resolves from an id. Initializes a new instance of the class. Gets a for the specified reference. The id. A for the specified reference. Gets or sets the loaded schemas. The loaded schemas. Specifies undefined schema Id handling options for the . Do not infer a schema Id. Use the .NET type name as the schema Id. Use the assembly qualified .NET type name as the schema Id. Returns detailed information related to the . Gets the associated with the validation error. The JsonSchemaException associated with the validation error. Gets the path of the JSON location where the validation error occurred. The path of the JSON location where the validation error occurred. Gets the text description corresponding to the validation error. The text description. Represents the callback method that will handle JSON schema validation events and the . Resolves member mappings for a type, camel casing property names. Used by to resolves a for a given . Used by to resolves a for a given . Resolves the contract for a given type. The type to resolve a contract for. The contract for a given type. Initializes a new instance of the class. Initializes a new instance of the class. If set to true the will use a cached shared with other resolvers of the same type. Sharing the cache will significantly performance because expensive reflection will only happen once but could cause unexpected behavior if different instances of the resolver are suppose to produce different results. When set to false it is highly recommended to reuse instances with the . Resolves the contract for a given type. The type to resolve a contract for. The contract for a given type. Gets the serializable members for the type. The type to get serializable members for. The serializable members for the type. Creates a for the given type. Type of the object. A for the given type. Creates the constructor parameters. The constructor to create properties for. The type's member properties. Properties for the given . Creates a for the given . The matching member property. The constructor parameter. A created for the given . Resolves the default for the contract. Type of the object. The contract's default . Creates a for the given type. Type of the object. A for the given type. Creates a for the given type. Type of the object. A for the given type. Creates a for the given type. Type of the object. A for the given type. Creates a for the given type. Type of the object. A for the given type. Creates a for the given type. Type of the object. A for the given type. Creates a for the given type. Type of the object. A for the given type. Determines which contract type is created for the given type. Type of the object. A for the given type. Creates properties for the given . The type to create properties for. /// The member serialization mode for the type. Properties for the given . Creates the used by the serializer to get and set values from a member. The member. The used by the serializer to get and set values from a member. Creates a for the given . The member's parent . The member to create a for. A created for the given . Resolves the name of the property. Name of the property. Name of the property. Gets the resolved name of the property. Name of the property. Name of the property. Gets a value indicating whether members are being get and set using dynamic code generation. This value is determined by the runtime permissions available. true if using dynamic code generation; otherwise, false. Gets or sets the default members search flags. The default members search flags. Gets or sets a value indicating whether compiler generated members should be serialized. true if serialized compiler generated members; otherwise, false. Gets or sets a value indicating whether to ignore the interface when serializing and deserializing types. true if the interface will be ignored when serializing and deserializing types; otherwise, false. Gets or sets a value indicating whether to ignore the attribute when serializing and deserializing types. true if the attribute will be ignored when serializing and deserializing types; otherwise, false. Initializes a new instance of the class. Resolves the name of the property. Name of the property. The property name camel cased. The default serialization binder used when resolving and loading classes from type names. When overridden in a derived class, controls the binding of a serialized object to a type. Specifies the name of the serialized object. Specifies the name of the serialized object. The type of the object the formatter creates a new instance of. Provides information surrounding an error. Gets the error. The error. Gets the original object that caused the error. The original object that caused the error. Gets the member that caused the error. The member that caused the error. Gets the path of the JSON location where the error occurred. The path of the JSON location where the error occurred. Gets or sets a value indicating whether this is handled. true if handled; otherwise, false. Contract details for a used by the . Initializes a new instance of the class. The underlying type for the contract. Gets the of the collection items. The of the collection items. Gets a value indicating whether the collection type is a multidimensional array. true if the collection type is a multidimensional array; otherwise, false. Handles serialization callback events. The object that raised the callback event. The streaming context. Handles serialization error callback events. The object that raised the callback event. The streaming context. The error context. Sets extension data for an object during deserialization. The object to set extension data on. The extension data key. The extension data value. Gets extension data for an object during serialization. The object to set extension data on. Contract details for a used by the . Initializes a new instance of the class. The underlying type for the contract. Gets or sets the property name resolver. The property name resolver. Gets the of the dictionary keys. The of the dictionary keys. Gets the of the dictionary values. The of the dictionary values. Maps a JSON property to a .NET member or constructor parameter. Returns a that represents this instance. A that represents this instance. Gets or sets the name of the property. The name of the property. Gets or sets the type that declared this property. The type that declared this property. Gets or sets the order of serialization and deserialization of a member. The numeric order of serialization or deserialization. Gets or sets the name of the underlying member or parameter. The name of the underlying member or parameter. Gets the that will get and set the during serialization. The that will get and set the during serialization. Gets or sets the type of the property. The type of the property. Gets or sets the for the property. If set this converter takes presidence over the contract converter for the property type. The converter. Gets or sets the member converter. The member converter. Gets or sets a value indicating whether this is ignored. true if ignored; otherwise, false. Gets or sets a value indicating whether this is readable. true if readable; otherwise, false. Gets or sets a value indicating whether this is writable. true if writable; otherwise, false. Gets or sets a value indicating whether this has a member attribute. true if has a member attribute; otherwise, false. Gets the default value. The default value. Gets or sets a value indicating whether this is required. A value indicating whether this is required. Gets or sets a value indicating whether this property preserves object references. true if this instance is reference; otherwise, false. Gets or sets the property null value handling. The null value handling. Gets or sets the property default value handling. The default value handling. Gets or sets the property reference loop handling. The reference loop handling. Gets or sets the property object creation handling. The object creation handling. Gets or sets or sets the type name handling. The type name handling. Gets or sets a predicate used to determine whether the property should be serialize. A predicate used to determine whether the property should be serialize. Gets or sets a predicate used to determine whether the property should be serialized. A predicate used to determine whether the property should be serialized. Gets or sets an action used to set whether the property has been deserialized. An action used to set whether the property has been deserialized. Gets or sets the converter used when serializing the property's collection items. The collection's items converter. Gets or sets whether this property's collection items are serialized as a reference. Whether this property's collection items are serialized as a reference. Gets or sets the the type name handling used when serializing the property's collection items. The collection's items type name handling. Gets or sets the the reference loop handling used when serializing the property's collection items. The collection's items reference loop handling. A collection of objects. Initializes a new instance of the class. The type. When implemented in a derived class, extracts the key from the specified element. The element from which to extract the key. The key for the specified element. Adds a object. The property to add to the collection. Gets the closest matching object. First attempts to get an exact case match of propertyName and then a case insensitive match. Name of the property. A matching property if found. Gets a property by property name. The name of the property to get. Type property name string comparison. A matching property if found. Specifies missing member handling options for the . Ignore a missing member and do not attempt to deserialize it. Throw a when a missing member is encountered during deserialization. Specifies null value handling options for the . Include null values when serializing and deserializing objects. Ignore null values when serializing and deserializing objects. Specifies reference loop handling options for the . Throw a when a loop is encountered. Ignore loop references and do not serialize. Serialize loop references. An in-memory representation of a JSON Schema. Initializes a new instance of the class. Reads a from the specified . The containing the JSON Schema to read. The object representing the JSON Schema. Reads a from the specified . The containing the JSON Schema to read. The to use when resolving schema references. The object representing the JSON Schema. Load a from a string that contains schema JSON. A that contains JSON. A populated from the string that contains JSON. Parses the specified json. The json. The resolver. A populated from the string that contains JSON. Writes this schema to a . A into which this method will write. Writes this schema to a using the specified . A into which this method will write. The resolver used. Returns a that represents the current . A that represents the current . Gets or sets the id. Gets or sets the title. Gets or sets whether the object is required. Gets or sets whether the object is read only. Gets or sets whether the object is visible to users. Gets or sets whether the object is transient. Gets or sets the description of the object. Gets or sets the types of values allowed by the object. The type. Gets or sets the pattern. The pattern. Gets or sets the minimum length. The minimum length. Gets or sets the maximum length. The maximum length. Gets or sets a number that the value should be divisble by. A number that the value should be divisble by. Gets or sets the minimum. The minimum. Gets or sets the maximum. The maximum. Gets or sets a flag indicating whether the value can not equal the number defined by the "minimum" attribute. A flag indicating whether the value can not equal the number defined by the "minimum" attribute. Gets or sets a flag indicating whether the value can not equal the number defined by the "maximum" attribute. A flag indicating whether the value can not equal the number defined by the "maximum" attribute. Gets or sets the minimum number of items. The minimum number of items. Gets or sets the maximum number of items. The maximum number of items. Gets or sets the of items. The of items. Gets or sets a value indicating whether items in an array are validated using the instance at their array position from . true if items are validated using their array position; otherwise, false. Gets or sets the of additional items. The of additional items. Gets or sets a value indicating whether additional items are allowed. true if additional items are allowed; otherwise, false. Gets or sets whether the array items must be unique. Gets or sets the of properties. The of properties. Gets or sets the of additional properties. The of additional properties. Gets or sets the pattern properties. The pattern properties. Gets or sets a value indicating whether additional properties are allowed. true if additional properties are allowed; otherwise, false. Gets or sets the required property if this property is present. The required property if this property is present. Gets or sets the a collection of valid enum values allowed. A collection of valid enum values allowed. Gets or sets disallowed types. The disallow types. Gets or sets the default value. The default value. Gets or sets the collection of that this schema extends. The collection of that this schema extends. Gets or sets the format. The format. Generates a from a specified . Generate a from the specified type. The type to generate a from. A generated from the specified type. Generate a from the specified type. The type to generate a from. The used to resolve schema references. A generated from the specified type. Generate a from the specified type. The type to generate a from. Specify whether the generated root will be nullable. A generated from the specified type. Generate a from the specified type. The type to generate a from. The used to resolve schema references. Specify whether the generated root will be nullable. A generated from the specified type. Gets or sets how undefined schemas are handled by the serializer. Gets or sets the contract resolver. The contract resolver. The value types allowed by the . No type specified. String type. Float type. Integer type. Boolean type. Object type. Array type. Null type. Any type. Contract details for a used by the . Initializes a new instance of the class. The underlying type for the contract. Gets or sets the object member serialization. The member object serialization. Gets or sets a value that indicates whether the object's properties are required. A value indicating whether the object's properties are required. Gets the object's properties. The object's properties. Gets the constructor parameters required for any non-default constructor Gets or sets the override constructor used to create the object. This is set when a constructor is marked up using the JsonConstructor attribute. The override constructor. Gets or sets the parametrized constructor used to create the object. The parametrized constructor. Gets or sets the extension data setter. Gets or sets the extension data getter. Contract details for a used by the . Initializes a new instance of the class. The underlying type for the contract. Get and set values for a using reflection. Initializes a new instance of the class. The member info. Sets the value. The target to set the value on. The value to set on the target. Gets the value. The target to get the value from. The value. When applied to a method, specifies that the method is called when an error occurs serializing an object. Represents a method that constructs an object. The object type to create. Specifies type name handling options for the . Do not include the .NET type name when serializing types. Include the .NET type name when serializing into a JSON object structure. Include the .NET type name when serializing into a JSON array structure. Always include the .NET type name when serializing. Include the .NET type name when the type of the object being serialized is not the same as its declared type. Converts the value to the specified type. The value to convert. The culture to use when converting. The type to convert the value to. The converted type. Converts the value to the specified type. The value to convert. The culture to use when converting. The type to convert the value to. The converted value if the conversion was successful or the default value of T if it failed. true if initialValue was converted successfully; otherwise, false. Converts the value to the specified type. If the value is unable to be converted, the value is checked whether it assignable to the specified type. The value to convert. The culture to use when converting. The type to convert or cast the value to. The converted type. If conversion was unsuccessful, the initial value is returned if assignable to the target type. Gets a dictionary of the names and values of an Enum type. Gets a dictionary of the names and values of an Enum type. The enum type to get names and values for. Specifies the type of Json token. This is returned by the if a method has not been called. An object start token. An array start token. A constructor start token. An object property name. A comment. Raw JSON. An integer. A float. A string. A boolean. A null token. An undefined token. An object end token. An array end token. A constructor end token. A Date. Byte data. Builds a string. Unlike StringBuilder this class lets you reuse it's internal buffer. Determines whether the collection is null or empty. The collection. true if the collection is null or empty; otherwise, false. Adds the elements of the specified collection to the specified generic IList. The list to add to. The collection of elements to add. Returns the index of the first occurrence in a sequence by using a specified IEqualityComparer. The type of the elements of source. A sequence in which to locate a value. The object to locate in the sequence An equality comparer to compare values. The zero-based index of the first occurrence of value within the entire sequence, if found; otherwise, –1. Gets the type of the typed collection's items. The type. The type of the typed collection's items. Gets the member's underlying type. The member. The underlying type of the member. Determines whether the member is an indexed property. The member. true if the member is an indexed property; otherwise, false. Determines whether the property is an indexed property. The property. true if the property is an indexed property; otherwise, false. Gets the member's value on the object. The member. The target object. The member's value on the object. Sets the member's value on the target object. The member. The target. The value. Determines whether the specified MemberInfo can be read. The MemberInfo to determine whether can be read. /// if set to true then allow the member to be gotten non-publicly. true if the specified MemberInfo can be read; otherwise, false. Determines whether the specified MemberInfo can be set. The MemberInfo to determine whether can be set. if set to true then allow the member to be set non-publicly. if set to true then allow the member to be set if read-only. true if the specified MemberInfo can be set; otherwise, false. Determines whether the string is all white space. Empty string will return false. The string to test whether it is all white space. true if the string is all white space; otherwise, false. Nulls an empty string. The string. Null if the string was null, otherwise the string unchanged. Specifies the state of the . An exception has been thrown, which has left the in an invalid state. You may call the method to put the in the Closed state. Any other method calls results in an being thrown. The method has been called. An object is being written. A array is being written. A constructor is being written. A property is being written. A write method has not been called. ================================================ FILE: packages/Newtonsoft.Json.6.0.2/lib/net40/Newtonsoft.Json.xml ================================================ Newtonsoft.Json Represents a reader that provides fast, non-cached, forward-only access to serialized Json data. Represents a reader that provides fast, non-cached, forward-only access to serialized Json data. Initializes a new instance of the class with the specified . Reads the next JSON token from the stream. true if the next token was read successfully; false if there are no more tokens to read. Reads the next JSON token from the stream as a . A . This method will return null at the end of an array. Reads the next JSON token from the stream as a . A . This method will return null at the end of an array. Reads the next JSON token from the stream as a . A or a null reference if the next JSON token is null. This method will return null at the end of an array. Reads the next JSON token from the stream as a . A . This method will return null at the end of an array. Reads the next JSON token from the stream as a . A . This method will return null at the end of an array. Reads the next JSON token from the stream as a . A . This method will return null at the end of an array. Skips the children of the current token. Sets the current token. The new token. Sets the current token and value. The new token. The value. Sets the state based on current token type. Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources. Releases unmanaged and - optionally - managed resources true to release both managed and unmanaged resources; false to release only unmanaged resources. Changes the to Closed. Gets the current reader state. The current reader state. Gets or sets a value indicating whether the underlying stream or should be closed when the reader is closed. true to close the underlying stream or when the reader is closed; otherwise false. The default is true. Gets or sets a value indicating whether multiple pieces of JSON content can be read from a continuous stream without erroring. true to support reading multiple pieces of JSON content; otherwise false. The default is false. Gets the quotation mark character used to enclose the value of a string. Get or set how time zones are handling when reading JSON. Get or set how date formatted strings, e.g. "\/Date(1198908717056)\/" and "2012-03-21T05:40Z", are parsed when reading JSON. Get or set how floating point numbers, e.g. 1.0 and 9.9, are parsed when reading JSON text. Gets or sets the maximum depth allowed when reading JSON. Reading past this depth will throw a . Gets the type of the current JSON token. Gets the text value of the current JSON token. Gets The Common Language Runtime (CLR) type for the current JSON token. Gets the depth of the current token in the JSON document. The depth of the current token in the JSON document. Gets the path of the current JSON token. Gets or sets the culture used when reading JSON. Defaults to . Specifies the state of the reader. The Read method has not been called. The end of the file has been reached successfully. Reader is at a property. Reader is at the start of an object. Reader is in an object. Reader is at the start of an array. Reader is in an array. The Close method has been called. Reader has just read a value. Reader is at the start of a constructor. Reader in a constructor. An error occurred that prevents the read operation from continuing. The end of the file has been reached successfully. Initializes a new instance of the class. The stream. Initializes a new instance of the class. The reader. Initializes a new instance of the class. The stream. if set to true the root object will be read as a JSON array. The used when reading values from BSON. Initializes a new instance of the class. The reader. if set to true the root object will be read as a JSON array. The used when reading values from BSON. Reads the next JSON token from the stream as a . A or a null reference if the next JSON token is null. This method will return null at the end of an array. Reads the next JSON token from the stream as a . A . This method will return null at the end of an array. Reads the next JSON token from the stream as a . A . This method will return null at the end of an array. Reads the next JSON token from the stream as a . A . This method will return null at the end of an array. Reads the next JSON token from the stream as a . A . This method will return null at the end of an array. Reads the next JSON token from the stream as a . A . This method will return null at the end of an array. Reads the next JSON token from the stream. true if the next token was read successfully; false if there are no more tokens to read. Changes the to Closed. Gets or sets a value indicating whether binary data reading should compatible with incorrect Json.NET 3.5 written binary. true if binary data reading will be compatible with incorrect Json.NET 3.5 written binary; otherwise, false. Gets or sets a value indicating whether the root object will be read as a JSON array. true if the root object will be read as a JSON array; otherwise, false. Gets or sets the used when reading values from BSON. The used when reading values from BSON. Represents a writer that provides a fast, non-cached, forward-only way of generating JSON data. Represents a writer that provides a fast, non-cached, forward-only way of generating Json data. Creates an instance of the JsonWriter class. Flushes whatever is in the buffer to the underlying streams and also flushes the underlying stream. Closes this stream and the underlying stream. Writes the beginning of a Json object. Writes the end of a Json object. Writes the beginning of a Json array. Writes the end of an array. Writes the start of a constructor with the given name. The name of the constructor. Writes the end constructor. Writes the property name of a name/value pair on a JSON object. The name of the property. Writes the property name of a name/value pair on a JSON object. The name of the property. A flag to indicate whether the text should be escaped when it is written as a JSON property name. Writes the end of the current Json object or array. Writes the current token and its children. The to read the token from. Writes the current token. The to read the token from. A flag indicating whether the current token's children should be written. Writes the specified end token. The end token to write. Writes indent characters. Writes the JSON value delimiter. Writes an indent space. Writes a null value. Writes an undefined value. Writes raw JSON without changing the writer's state. The raw JSON to write. Writes raw JSON where a value is expected and updates the writer's state. The raw JSON to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. An error will raised if the value cannot be written as a single JSON token. The value to write. Writes out a comment /*...*/ containing the specified text. Text to place inside the comment. Writes out the given white space. The string of white space characters. Sets the state of the JsonWriter, The JsonToken being written. The value being written. Gets or sets a value indicating whether the underlying stream or should be closed when the writer is closed. true to close the underlying stream or when the writer is closed; otherwise false. The default is true. Gets the top. The top. Gets the state of the writer. Gets the path of the writer. Indicates how JSON text output is formatted. Get or set how dates are written to JSON text. Get or set how time zones are handling when writing JSON text. Get or set how strings are escaped when writing JSON text. Get or set how special floating point numbers, e.g. , and , are written to JSON text. Get or set how and values are formatting when writing JSON text. Gets or sets the culture used when writing JSON. Defaults to . Initializes a new instance of the class. The stream. Initializes a new instance of the class. The writer. Flushes whatever is in the buffer to the underlying streams and also flushes the underlying stream. Writes the end. The token. Writes out a comment /*...*/ containing the specified text. Text to place inside the comment. Writes the start of a constructor with the given name. The name of the constructor. Writes raw JSON. The raw JSON to write. Writes raw JSON where a value is expected and updates the writer's state. The raw JSON to write. Writes the beginning of a Json array. Writes the beginning of a Json object. Writes the property name of a name/value pair on a Json object. The name of the property. Closes this stream and the underlying stream. Writes a value. An error will raised if the value cannot be written as a single JSON token. The value to write. Writes a null value. Writes an undefined value. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value that represents a BSON object id. The Object ID value to write. Writes a BSON regex. The regex pattern. The regex options. Gets or sets the used when writing values to BSON. When set to no conversion will occur. The used when writing values to BSON. Represents a BSON Oid (object id). Initializes a new instance of the class. The Oid value. Gets or sets the value of the Oid. The value of the Oid. Converts a binary value to and from a base 64 string value. Converts an object to and from JSON. Writes the JSON representation of the object. The to write to. The value. The calling serializer. Reads the JSON representation of the object. The to read from. Type of the object. The existing value of object being read. The calling serializer. The object value. Determines whether this instance can convert the specified object type. Type of the object. true if this instance can convert the specified object type; otherwise, false. Gets the of the JSON produced by the JsonConverter. The of the JSON produced by the JsonConverter. Gets a value indicating whether this can read JSON. true if this can read JSON; otherwise, false. Gets a value indicating whether this can write JSON. true if this can write JSON; otherwise, false. Writes the JSON representation of the object. The to write to. The value. The calling serializer. Reads the JSON representation of the object. The to read from. Type of the object. The existing value of object being read. The calling serializer. The object value. Determines whether this instance can convert the specified object type. Type of the object. true if this instance can convert the specified object type; otherwise, false. Converts a to and from JSON. Writes the JSON representation of the object. The to write to. The value. The calling serializer. Reads the JSON representation of the object. The to read from. Type of the object. The existing value of object being read. The calling serializer. The object value. Determines whether this instance can convert the specified value type. Type of the value. true if this instance can convert the specified value type; otherwise, false. Converts a to and from JSON. Writes the JSON representation of the object. The to write to. The value. The calling serializer. Reads the JSON representation of the object. The to read from. Type of the object. The existing value of object being read. The calling serializer. The object value. Determines whether this instance can convert the specified value type. Type of the value. true if this instance can convert the specified value type; otherwise, false. Create a custom object The object type to convert. Writes the JSON representation of the object. The to write to. The value. The calling serializer. Reads the JSON representation of the object. The to read from. Type of the object. The existing value of object being read. The calling serializer. The object value. Creates an object which will then be populated by the serializer. Type of the object. The created object. Determines whether this instance can convert the specified object type. Type of the object. true if this instance can convert the specified object type; otherwise, false. Gets a value indicating whether this can write JSON. true if this can write JSON; otherwise, false. Provides a base class for converting a to and from JSON. Determines whether this instance can convert the specified object type. Type of the object. true if this instance can convert the specified object type; otherwise, false. Converts a F# discriminated union type to and from JSON. Writes the JSON representation of the object. The to write to. The value. The calling serializer. Reads the JSON representation of the object. The to read from. Type of the object. The existing value of object being read. The calling serializer. The object value. Determines whether this instance can convert the specified object type. Type of the object. true if this instance can convert the specified object type; otherwise, false. Converts an Entity Framework EntityKey to and from JSON. Writes the JSON representation of the object. The to write to. The value. The calling serializer. Reads the JSON representation of the object. The to read from. Type of the object. The existing value of object being read. The calling serializer. The object value. Determines whether this instance can convert the specified object type. Type of the object. true if this instance can convert the specified object type; otherwise, false. Converts an ExpandoObject to and from JSON. Writes the JSON representation of the object. The to write to. The value. The calling serializer. Reads the JSON representation of the object. The to read from. Type of the object. The existing value of object being read. The calling serializer. The object value. Determines whether this instance can convert the specified object type. Type of the object. true if this instance can convert the specified object type; otherwise, false. Gets a value indicating whether this can write JSON. true if this can write JSON; otherwise, false. Converts a to and from JSON. Writes the JSON representation of the object. The to write to. The value. The calling serializer. Reads the JSON representation of the object. The to read from. Type of the object. The existing value of object being read. The calling serializer. The object value. Determines whether this instance can convert the specified object type. Type of the object. true if this instance can convert the specified object type; otherwise, false. Converts a to and from JSON and BSON. Writes the JSON representation of the object. The to write to. The value. The calling serializer. Reads the JSON representation of the object. The to read from. Type of the object. The existing value of object being read. The calling serializer. The object value. Determines whether this instance can convert the specified object type. Type of the object. true if this instance can convert the specified object type; otherwise, false. Converts a to and from JSON and BSON. Writes the JSON representation of the object. The to write to. The value. The calling serializer. Reads the JSON representation of the object. The to read from. Type of the object. The existing value of object being read. The calling serializer. The object value. Determines whether this instance can convert the specified object type. Type of the object. true if this instance can convert the specified object type; otherwise, false. Converts an to and from its name string value. Initializes a new instance of the class. Writes the JSON representation of the object. The to write to. The value. The calling serializer. Reads the JSON representation of the object. The to read from. Type of the object. The existing value of object being read. The calling serializer. The object value. Determines whether this instance can convert the specified object type. Type of the object. true if this instance can convert the specified object type; otherwise, false. Gets or sets a value indicating whether the written enum text should be camel case. true if the written enum text will be camel case; otherwise, false. Gets or sets a value indicating whether integer values are allowed. true if integers are allowed; otherwise, false. Specifies how constructors are used when initializing objects during deserialization by the . First attempt to use the public default constructor, then fall back to single paramatized constructor, then the non-public default constructor. Json.NET will use a non-public default constructor before falling back to a paramatized constructor. Converts a to and from a string (e.g. "1.2.3.4"). Writes the JSON representation of the object. The to write to. The value. The calling serializer. Reads the JSON representation of the object. The to read from. Type of the object. The existing property value of the JSON that is being converted. The calling serializer. The object value. Determines whether this instance can convert the specified object type. Type of the object. true if this instance can convert the specified object type; otherwise, false. Specifies float format handling options when writing special floating point numbers, e.g. , and with . Write special floating point values as strings in JSON, e.g. "NaN", "Infinity", "-Infinity". Write special floating point values as symbols in JSON, e.g. NaN, Infinity, -Infinity. Note that this will produce non-valid JSON. Write special floating point values as the property's default value in JSON, e.g. 0.0 for a property, null for a property. Specifies how floating point numbers, e.g. 1.0 and 9.9, are parsed when reading JSON text. Floating point numbers are parsed to . Floating point numbers are parsed to . Instructs the how to serialize the collection. Instructs the how to serialize the object. Initializes a new instance of the class. Initializes a new instance of the class with the specified container Id. The container Id. Gets or sets the id. The id. Gets or sets the title. The title. Gets or sets the description. The description. Gets the collection's items converter. The collection's items converter. Gets or sets a value that indicates whether to preserve object references. true to keep object reference; otherwise, false. The default is false. Gets or sets a value that indicates whether to preserve collection's items references. true to keep collection's items object references; otherwise, false. The default is false. Gets or sets the reference loop handling used when serializing the collection's items. The reference loop handling. Gets or sets the type name handling used when serializing the collection's items. The type name handling. Initializes a new instance of the class. Initializes a new instance of the class with the specified container Id. The container Id. The exception thrown when an error occurs during Json serialization or deserialization. Initializes a new instance of the class. Initializes a new instance of the class with a specified error message. The error message that explains the reason for the exception. Initializes a new instance of the class with a specified error message and a reference to the inner exception that is the cause of this exception. The error message that explains the reason for the exception. The exception that is the cause of the current exception, or a null reference (Nothing in Visual Basic) if no inner exception is specified. Initializes a new instance of the class. The that holds the serialized object data about the exception being thrown. The that contains contextual information about the source or destination. The parameter is null. The class name is null or is zero (0). Specifies how dates are formatted when writing JSON text. Dates are written in the ISO 8601 format, e.g. "2012-03-21T05:40Z". Dates are written in the Microsoft JSON format, e.g. "\/Date(1198908717056)\/". Specifies how date formatted strings, e.g. "\/Date(1198908717056)\/" and "2012-03-21T05:40Z", are parsed when reading JSON text. Date formatted strings are not parsed to a date type and are read as strings. Date formatted strings, e.g. "\/Date(1198908717056)\/" and "2012-03-21T05:40Z", are parsed to . Date formatted strings, e.g. "\/Date(1198908717056)\/" and "2012-03-21T05:40Z", are parsed to . Specifies how to treat the time value when converting between string and . Treat as local time. If the object represents a Coordinated Universal Time (UTC), it is converted to the local time. Treat as a UTC. If the object represents a local time, it is converted to a UTC. Treat as a local time if a is being converted to a string. If a string is being converted to , convert to a local time if a time zone is specified. Time zone information should be preserved when converting. Specifies formatting options for the . No special formatting is applied. This is the default. Causes child objects to be indented according to the and settings. Instructs the to use the specified constructor when deserializing that object. Instructs the to deserialize properties with no matching class member into the specified collection and write values during serialization. Initializes a new instance of the class. Gets or sets a value that indicates whether to write extension data when serializing the object. true to write extension data when serializing the object; otherwise, false. The default is true. Gets or sets a value that indicates whether to read extension data when deserializing the object. true to read extension data when deserializing the object; otherwise, false. The default is true. Represents a trace writer that writes to the application's instances. Represents a trace writer. Writes the specified trace level, message and optional exception. The at which to write this trace. The trace message. The trace exception. This parameter is optional. Gets the that will be used to filter the trace messages passed to the writer. For example a filter level of Info will exclude Verbose messages and include Info, Warning and Error messages. The that will be used to filter the trace messages passed to the writer. Writes the specified trace level, message and optional exception. The at which to write this trace. The trace message. The trace exception. This parameter is optional. Gets the that will be used to filter the trace messages passed to the writer. For example a filter level of Info will exclude Verbose messages and include Info, Warning and Error messages. The that will be used to filter the trace messages passed to the writer. Get and set values for a using dynamic methods. Provides methods to get and set values. Sets the value. The target to set the value on. The value to set on the target. Gets the value. The target to get the value from. The value. Initializes a new instance of the class. The member info. Sets the value. The target to set the value on. The value to set on the target. Gets the value. The target to get the value from. The value. Contract details for a used by the . Contract details for a used by the . Gets the underlying type for the contract. The underlying type for the contract. Gets or sets the type created during deserialization. The type created during deserialization. Gets or sets whether this type contract is serialized as a reference. Whether this type contract is serialized as a reference. Gets or sets the default for this contract. The converter. Gets or sets all methods called immediately after deserialization of the object. The methods called immediately after deserialization of the object. Gets or sets all methods called during deserialization of the object. The methods called during deserialization of the object. Gets or sets all methods called after serialization of the object graph. The methods called after serialization of the object graph. Gets or sets all methods called before serialization of the object. The methods called before serialization of the object. Gets or sets all method called when an error is thrown during the serialization of the object. The methods called when an error is thrown during the serialization of the object. Gets or sets the method called immediately after deserialization of the object. The method called immediately after deserialization of the object. Gets or sets the method called during deserialization of the object. The method called during deserialization of the object. Gets or sets the method called after serialization of the object graph. The method called after serialization of the object graph. Gets or sets the method called before serialization of the object. The method called before serialization of the object. Gets or sets the method called when an error is thrown during the serialization of the object. The method called when an error is thrown during the serialization of the object. Gets or sets the default creator method used to create the object. The default creator method used to create the object. Gets or sets a value indicating whether the default creator is non public. true if the default object creator is non-public; otherwise, false. Initializes a new instance of the class. The underlying type for the contract. Gets or sets the default collection items . The converter. Gets or sets a value indicating whether the collection items preserve object references. true if collection items preserve object references; otherwise, false. Gets or sets the collection item reference loop handling. The reference loop handling. Gets or sets the collection item type name handling. The type name handling. Represents a trace writer that writes to memory. When the trace message limit is reached then old trace messages will be removed as new messages are added. Initializes a new instance of the class. Writes the specified trace level, message and optional exception. The at which to write this trace. The trace message. The trace exception. This parameter is optional. Returns an enumeration of the most recent trace messages. An enumeration of the most recent trace messages. Returns a of the most recent trace messages. A of the most recent trace messages. Gets the that will be used to filter the trace messages passed to the writer. For example a filter level of Info will exclude Verbose messages and include Info, Warning and Error messages. The that will be used to filter the trace messages passed to the writer. Provides an interface to enable a class to return line and position information. Gets a value indicating whether the class can return line information. true if LineNumber and LinePosition can be provided; otherwise, false. Gets the current line number. The current line number or 0 if no line information is available (for example, HasLineInfo returns false). Gets the current line position. The current line position or 0 if no line information is available (for example, HasLineInfo returns false). Specifies how strings are escaped when writing JSON text. Only control characters (e.g. newline) are escaped. All non-ASCII and control characters (e.g. newline) are escaped. HTML (<, >, &, ', ") and control characters (e.g. newline) are escaped. Represents a raw JSON string. Represents a value in JSON (string, integer, date, etc). Represents an abstract JSON token. Represents a collection of objects. The type of token Gets the with the specified key. Compares the values of two tokens, including the values of all descendant tokens. The first to compare. The second to compare. true if the tokens are equal; otherwise false. Adds the specified content immediately after this token. A content object that contains simple content or a collection of content objects to be added after this token. Adds the specified content immediately before this token. A content object that contains simple content or a collection of content objects to be added before this token. Returns a collection of the ancestor tokens of this token. A collection of the ancestor tokens of this token. Returns a collection of the sibling tokens after this token, in document order. A collection of the sibling tokens after this tokens, in document order. Returns a collection of the sibling tokens before this token, in document order. A collection of the sibling tokens before this token, in document order. Gets the with the specified key converted to the specified type. The type to convert the token to. The token key. The converted token value. Returns a collection of the child tokens of this token, in document order. An of containing the child tokens of this , in document order. Returns a collection of the child tokens of this token, in document order, filtered by the specified type. The type to filter the child tokens on. A containing the child tokens of this , in document order. Returns a collection of the child values of this token, in document order. The type to convert the values to. A containing the child values of this , in document order. Removes this token from its parent. Replaces this token with the specified token. The value. Writes this token to a . A into which this method will write. A collection of which will be used when writing the token. Returns the indented JSON for this token. The indented JSON for this token. Returns the JSON for this token using the given formatting and converters. Indicates how the output is formatted. A collection of which will be used when writing the token. The JSON for this token using the given formatting and converters. Performs an explicit conversion from to . The value. The result of the conversion. Performs an explicit conversion from to . The value. The result of the conversion. Performs an explicit conversion from to . The value. The result of the conversion. Performs an explicit conversion from to . The value. The result of the conversion. Performs an explicit conversion from to . The value. The result of the conversion. Performs an explicit conversion from to . The value. The result of the conversion. Performs an explicit conversion from to . The value. The result of the conversion. Performs an explicit conversion from to . The value. The result of the conversion. Performs an explicit conversion from to . The value. The result of the conversion. Performs an explicit conversion from to . The value. The result of the conversion. Performs an explicit conversion from to . The value. The result of the conversion. Performs an explicit conversion from to . The value. The result of the conversion. Performs an explicit conversion from to . The value. The result of the conversion. Performs an explicit conversion from to . The value. The result of the conversion. Performs an explicit conversion from to . The value. The result of the conversion. Performs an explicit conversion from to . The value. The result of the conversion. Performs an explicit conversion from to . The value. The result of the conversion. Performs an explicit conversion from to . The value. The result of the conversion. Performs an explicit conversion from to . The value. The result of the conversion. Performs an explicit conversion from to . The value. The result of the conversion. Performs an explicit conversion from to . The value. The result of the conversion. Performs an explicit conversion from to . The value. The result of the conversion. Performs an explicit conversion from to . The value. The result of the conversion. Performs an explicit conversion from to . The value. The result of the conversion. Performs an explicit conversion from to . The value. The result of the conversion. Performs an explicit conversion from to . The value. The result of the conversion. Performs an explicit conversion from to . The value. The result of the conversion. Performs an explicit conversion from to . The value. The result of the conversion. Performs an explicit conversion from to . The value. The result of the conversion. Performs an explicit conversion from to . The value. The result of the conversion. Performs an explicit conversion from to . The value. The result of the conversion. Performs an explicit conversion from to . The value. The result of the conversion. Performs an explicit conversion from to . The value. The result of the conversion. Performs an explicit conversion from to . The value. The result of the conversion. Performs an explicit conversion from to . The value. The result of the conversion. Performs an explicit conversion from to . The value. The result of the conversion. Performs an explicit conversion from to . The value. The result of the conversion. Performs an implicit conversion from to . The value to create a from. The initialized with the specified value. Performs an implicit conversion from to . The value to create a from. The initialized with the specified value. Performs an implicit conversion from to . The value to create a from. The initialized with the specified value. Performs an implicit conversion from to . The value to create a from. The initialized with the specified value. Performs an implicit conversion from to . The value to create a from. The initialized with the specified value. Performs an implicit conversion from to . The value to create a from. The initialized with the specified value. Performs an implicit conversion from to . The value to create a from. The initialized with the specified value. Performs an implicit conversion from to . The value to create a from. The initialized with the specified value. Performs an implicit conversion from to . The value to create a from. The initialized with the specified value. Performs an implicit conversion from to . The value to create a from. The initialized with the specified value. Performs an implicit conversion from to . The value to create a from. The initialized with the specified value. Performs an implicit conversion from to . The value to create a from. The initialized with the specified value. Performs an implicit conversion from to . The value to create a from. The initialized with the specified value. Performs an implicit conversion from to . The value to create a from. The initialized with the specified value. Performs an implicit conversion from to . The value to create a from. The initialized with the specified value. Performs an implicit conversion from to . The value to create a from. The initialized with the specified value. Performs an implicit conversion from to . The value to create a from. The initialized with the specified value. Performs an implicit conversion from to . The value to create a from. The initialized with the specified value. Performs an implicit conversion from to . The value to create a from. The initialized with the specified value. Performs an implicit conversion from to . The value to create a from. The initialized with the specified value. Performs an implicit conversion from to . The value to create a from. The initialized with the specified value. Performs an implicit conversion from to . The value to create a from. The initialized with the specified value. Performs an implicit conversion from to . The value to create a from. The initialized with the specified value. Performs an implicit conversion from to . The value to create a from. The initialized with the specified value. Performs an implicit conversion from to . The value to create a from. The initialized with the specified value. Performs an implicit conversion from to . The value to create a from. The initialized with the specified value. Performs an implicit conversion from to . The value to create a from. The initialized with the specified value. Performs an implicit conversion from to . The value to create a from. The initialized with the specified value. Performs an implicit conversion from to . The value to create a from. The initialized with the specified value. Performs an implicit conversion from to . The value to create a from. The initialized with the specified value. Performs an implicit conversion from to . The value to create a from. The initialized with the specified value. Performs an implicit conversion from to . The value to create a from. The initialized with the specified value. Performs an implicit conversion from to . The value to create a from. The initialized with the specified value. Performs an implicit conversion from to . The value to create a from. The initialized with the specified value. Performs an implicit conversion from to . The value to create a from. The initialized with the specified value. Creates an for this token. An that can be used to read this token and its descendants. Creates a from an object. The object that will be used to create . A with the value of the specified object Creates a from an object using the specified . The object that will be used to create . The that will be used when reading the object. A with the value of the specified object Creates the specified .NET type from the . The object type that the token will be deserialized to. The new object created from the JSON value. Creates the specified .NET type from the . The object type that the token will be deserialized to. The new object created from the JSON value. Creates the specified .NET type from the using the specified . The object type that the token will be deserialized to. The that will be used when creating the object. The new object created from the JSON value. Creates the specified .NET type from the using the specified . The object type that the token will be deserialized to. The that will be used when creating the object. The new object created from the JSON value. Creates a from a . An positioned at the token to read into this . An that contains the token and its descendant tokens that were read from the reader. The runtime type of the token is determined by the token type of the first token encountered in the reader. Load a from a string that contains JSON. A that contains JSON. A populated from the string that contains JSON. Creates a from a . An positioned at the token to read into this . An that contains the token and its descendant tokens that were read from the reader. The runtime type of the token is determined by the token type of the first token encountered in the reader. Selects a using a JPath expression. Selects the token that matches the object path. A that contains a JPath expression. A , or null. Selects a using a JPath expression. Selects the token that matches the object path. A that contains a JPath expression. A flag to indicate whether an error should be thrown if no tokens are found when evaluating part of the expression. A . Selects a collection of elements using a JPath expression. A that contains a JPath expression. An that contains the selected elements. Selects a collection of elements using a JPath expression. A that contains a JPath expression. A flag to indicate whether an error should be thrown if no tokens are found when evaluating part of the expression. An that contains the selected elements. Returns the responsible for binding operations performed on this object. The expression tree representation of the runtime value. The to bind this object. Returns the responsible for binding operations performed on this object. The expression tree representation of the runtime value. The to bind this object. Creates a new instance of the . All child tokens are recursively cloned. A new instance of the . Gets a comparer that can compare two tokens for value equality. A that can compare two nodes for value equality. Gets or sets the parent. The parent. Gets the root of this . The root of this . Gets the node type for this . The type. Gets a value indicating whether this token has child tokens. true if this token has child values; otherwise, false. Gets the next sibling token of this node. The that contains the next sibling token. Gets the previous sibling token of this node. The that contains the previous sibling token. Gets the path of the JSON token. Gets the with the specified key. The with the specified key. Get the first child token of this token. A containing the first child token of the . Get the last child token of this token. A containing the last child token of the . Initializes a new instance of the class from another object. A object to copy from. Initializes a new instance of the class with the given value. The value. Initializes a new instance of the class with the given value. The value. Initializes a new instance of the class with the given value. The value. Initializes a new instance of the class with the given value. The value. Initializes a new instance of the class with the given value. The value. Initializes a new instance of the class with the given value. The value. Initializes a new instance of the class with the given value. The value. Initializes a new instance of the class with the given value. The value. Initializes a new instance of the class with the given value. The value. Initializes a new instance of the class with the given value. The value. Initializes a new instance of the class with the given value. The value. Initializes a new instance of the class with the given value. The value. Initializes a new instance of the class with the given value. The value. Initializes a new instance of the class with the given value. The value. Creates a comment with the given value. The value. A comment with the given value. Creates a string with the given value. The value. A string with the given value. Writes this token to a . A into which this method will write. A collection of which will be used when writing the token. Indicates whether the current object is equal to another object of the same type. true if the current object is equal to the parameter; otherwise, false. An object to compare with this object. Determines whether the specified is equal to the current . The to compare with the current . true if the specified is equal to the current ; otherwise, false. The parameter is null. Serves as a hash function for a particular type. A hash code for the current . Returns a that represents this instance. A that represents this instance. Returns a that represents this instance. The format. A that represents this instance. Returns a that represents this instance. The format provider. A that represents this instance. Returns a that represents this instance. The format. The format provider. A that represents this instance. Returns the responsible for binding operations performed on this object. The expression tree representation of the runtime value. The to bind this object. Compares the current instance with another object of the same type and returns an integer that indicates whether the current instance precedes, follows, or occurs in the same position in the sort order as the other object. An object to compare with this instance. A 32-bit signed integer that indicates the relative order of the objects being compared. The return value has these meanings: Value Meaning Less than zero This instance is less than . Zero This instance is equal to . Greater than zero This instance is greater than . is not the same type as this instance. Gets a value indicating whether this token has child tokens. true if this token has child values; otherwise, false. Gets the node type for this . The type. Gets or sets the underlying token value. The underlying token value. Initializes a new instance of the class from another object. A object to copy from. Initializes a new instance of the class. The raw json. Creates an instance of with the content of the reader's current token. The reader. An instance of with the content of the reader's current token. Indicating whether a property is required. The property is not required. The default state. The property must be defined in JSON but can be a null value. The property must be defined in JSON and cannot be a null value. Contract details for a used by the . Initializes a new instance of the class. The underlying type for the contract. Gets the object's properties. The object's properties. Gets or sets the property name resolver. The property name resolver. Contract details for a used by the . Initializes a new instance of the class. The underlying type for the contract. Gets or sets the ISerializable object constructor. The ISerializable object constructor. Contract details for a used by the . Initializes a new instance of the class. The underlying type for the contract. Contract details for a used by the . Initializes a new instance of the class. The underlying type for the contract. Get and set values for a using dynamic methods. Initializes a new instance of the class. The member info. Sets the value. The target to set the value on. The value to set on the target. Gets the value. The target to get the value from. The value. Provides data for the Error event. Initializes a new instance of the class. The current object. The error context. Gets the current object the error event is being raised against. The current object the error event is being raised against. Gets the error context. The error context. Represents a view of a . Initializes a new instance of the class. The name. When overridden in a derived class, returns whether resetting an object changes its value. true if resetting the component changes its value; otherwise, false. The component to test for reset capability. When overridden in a derived class, gets the current value of the property on a component. The value of a property for a given component. The component with the property for which to retrieve the value. When overridden in a derived class, resets the value for this property of the component to the default value. The component with the property value that is to be reset to the default value. When overridden in a derived class, sets the value of the component to a different value. The component with the property value that is to be set. The new value. When overridden in a derived class, determines a value indicating whether the value of this property needs to be persisted. true if the property should be persisted; otherwise, false. The component with the property to be examined for persistence. When overridden in a derived class, gets the type of the component this property is bound to. A that represents the type of component this property is bound to. When the or methods are invoked, the object specified might be an instance of this type. When overridden in a derived class, gets a value indicating whether this property is read-only. true if the property is read-only; otherwise, false. When overridden in a derived class, gets the type of the property. A that represents the type of the property. Gets the hash code for the name of the member. The hash code for the name of the member. Used to resolve references when serializing and deserializing JSON by the . Resolves a reference to its object. The serialization context. The reference to resolve. The object that Gets the reference for the sepecified object. The serialization context. The object to get a reference for. The reference to the object. Determines whether the specified object is referenced. The serialization context. The object to test for a reference. true if the specified object is referenced; otherwise, false. Adds a reference to the specified object. The serialization context. The reference. The object to reference. Specifies reference handling options for the . Note that references cannot be preserved when a value is set via a non-default constructor such as types that implement ISerializable. Do not preserve references when serializing types. Preserve references when serializing into a JSON object structure. Preserve references when serializing into a JSON array structure. Preserve references when serializing. Instructs the how to serialize the collection. Initializes a new instance of the class. Initializes a new instance of the class with a flag indicating whether the array can contain null items A flag indicating whether the array can contain null items. Initializes a new instance of the class with the specified container Id. The container Id. Gets or sets a value indicating whether null items are allowed in the collection. true if null items are allowed in the collection; otherwise, false. Specifies default value handling options for the . Include members where the member value is the same as the member's default value when serializing objects. Included members are written to JSON. Has no effect when deserializing. Ignore members where the member value is the same as the member's default value when serializing objects so that is is not written to JSON. This option will ignore all default values (e.g. null for objects and nullable typesl; 0 for integers, decimals and floating point numbers; and false for booleans). The default value ignored can be changed by placing the on the property. Members with a default value but no JSON will be set to their default value when deserializing. Ignore members where the member value is the same as the member's default value when serializing objects and sets members to their default value when deserializing. Instructs the to use the specified when serializing the member or class. Initializes a new instance of the class. Type of the converter. Gets the type of the converter. The type of the converter. Instructs the how to serialize the object. Initializes a new instance of the class. Initializes a new instance of the class with the specified member serialization. The member serialization. Initializes a new instance of the class with the specified container Id. The container Id. Gets or sets the member serialization. The member serialization. Gets or sets a value that indicates whether the object's properties are required. A value indicating whether the object's properties are required. Specifies the settings on a object. Initializes a new instance of the class. Gets or sets how reference loops (e.g. a class referencing itself) is handled. Reference loop handling. Gets or sets how missing members (e.g. JSON contains a property that isn't a member on the object) are handled during deserialization. Missing member handling. Gets or sets how objects are created during deserialization. The object creation handling. Gets or sets how null values are handled during serialization and deserialization. Null value handling. Gets or sets how null default are handled during serialization and deserialization. The default value handling. Gets or sets a collection that will be used during serialization. The converters. Gets or sets how object references are preserved by the serializer. The preserve references handling. Gets or sets how type name writing and reading is handled by the serializer. The type name handling. Gets or sets how a type name assembly is written and resolved by the serializer. The type name assembly format. Gets or sets how constructors are used during deserialization. The constructor handling. Gets or sets the contract resolver used by the serializer when serializing .NET objects to JSON and vice versa. The contract resolver. Gets or sets the used by the serializer when resolving references. The reference resolver. Gets or sets the used by the serializer when writing trace messages. The trace writer. Gets or sets the used by the serializer when resolving type names. The binder. Gets or sets the error handler called during serialization and deserialization. The error handler called during serialization and deserialization. Gets or sets the used by the serializer when invoking serialization callback methods. The context. Get or set how and values are formatting when writing JSON text. Gets or sets the maximum depth allowed when reading JSON. Reading past this depth will throw a . Indicates how JSON text output is formatted. Get or set how dates are written to JSON text. Get or set how time zones are handling during serialization and deserialization. Get or set how date formatted strings, e.g. "\/Date(1198908717056)\/" and "2012-03-21T05:40Z", are parsed when reading JSON. Get or set how special floating point numbers, e.g. , and , are written as JSON. Get or set how floating point numbers, e.g. 1.0 and 9.9, are parsed when reading JSON text. Get or set how strings are escaped when writing JSON text. Gets or sets the culture used when reading JSON. Defaults to . Gets a value indicating whether there will be a check for additional content after deserializing an object. true if there will be a check for additional content after deserializing an object; otherwise, false. Represents a reader that provides validation. Initializes a new instance of the class that validates the content returned from the given . The to read from while validating. Reads the next JSON token from the stream as a . A . Reads the next JSON token from the stream as a . A or a null reference if the next JSON token is null. Reads the next JSON token from the stream as a . A . Reads the next JSON token from the stream as a . A . This method will return null at the end of an array. Reads the next JSON token from the stream as a . A . This method will return null at the end of an array. Reads the next JSON token from the stream as a . A . Reads the next JSON token from the stream. true if the next token was read successfully; false if there are no more tokens to read. Sets an event handler for receiving schema validation errors. Gets the text value of the current JSON token. Gets the depth of the current token in the JSON document. The depth of the current token in the JSON document. Gets the path of the current JSON token. Gets the quotation mark character used to enclose the value of a string. Gets the type of the current JSON token. Gets the Common Language Runtime (CLR) type for the current JSON token. Gets or sets the schema. The schema. Gets the used to construct this . The specified in the constructor. Compares tokens to determine whether they are equal. Determines whether the specified objects are equal. The first object of type to compare. The second object of type to compare. true if the specified objects are equal; otherwise, false. Returns a hash code for the specified object. The for which a hash code is to be returned. A hash code for the specified object. The type of is a reference type and is null. Specifies the member serialization options for the . All public members are serialized by default. Members can be excluded using or . This is the default member serialization mode. Only members must be marked with or are serialized. This member serialization mode can also be set by marking the class with . All public and private fields are serialized. Members can be excluded using or . This member serialization mode can also be set by marking the class with and setting IgnoreSerializableAttribute on to false. Specifies how object creation is handled by the . Reuse existing objects, create new objects when needed. Only reuse existing objects. Always create new objects. Converts a to and from the ISO 8601 date format (e.g. 2008-04-12T12:53Z). Writes the JSON representation of the object. The to write to. The value. The calling serializer. Reads the JSON representation of the object. The to read from. Type of the object. The existing value of object being read. The calling serializer. The object value. Gets or sets the date time styles used when converting a date to and from JSON. The date time styles used when converting a date to and from JSON. Gets or sets the date time format used when converting a date to and from JSON. The date time format used when converting a date to and from JSON. Gets or sets the culture used when converting a date to and from JSON. The culture used when converting a date to and from JSON. Converts a to and from a JavaScript date constructor (e.g. new Date(52231943)). Writes the JSON representation of the object. The to write to. The value. The calling serializer. Reads the JSON representation of the object. The to read from. Type of the object. The existing property value of the JSON that is being converted. The calling serializer. The object value. Converts XML to and from JSON. Writes the JSON representation of the object. The to write to. The calling serializer. The value. Reads the JSON representation of the object. The to read from. Type of the object. The existing value of object being read. The calling serializer. The object value. Checks if the attributeName is a namespace attribute. Attribute name to test. The attribute name prefix if it has one, otherwise an empty string. True if attribute name is for a namespace attribute, otherwise false. Determines whether this instance can convert the specified value type. Type of the value. true if this instance can convert the specified value type; otherwise, false. Gets or sets the name of the root element to insert when deserializing to XML if the JSON structure has produces multiple root elements. The name of the deserialize root element. Gets or sets a flag to indicate whether to write the Json.NET array attribute. This attribute helps preserve arrays when converting the written XML back to JSON. true if the array attibute is written to the XML; otherwise, false. Gets or sets a value indicating whether to write the root JSON object. true if the JSON root object is omitted; otherwise, false. Represents a reader that provides fast, non-cached, forward-only access to JSON text data. Initializes a new instance of the class with the specified . The TextReader containing the XML data to read. Reads the next JSON token from the stream. true if the next token was read successfully; false if there are no more tokens to read. Reads the next JSON token from the stream as a . A or a null reference if the next JSON token is null. This method will return null at the end of an array. Reads the next JSON token from the stream as a . A . This method will return null at the end of an array. Reads the next JSON token from the stream as a . A . This method will return null at the end of an array. Reads the next JSON token from the stream as a . A . This method will return null at the end of an array. Reads the next JSON token from the stream as a . A . This method will return null at the end of an array. Reads the next JSON token from the stream as a . A . This method will return null at the end of an array. Changes the state to closed. Gets a value indicating whether the class can return line information. true if LineNumber and LinePosition can be provided; otherwise, false. Gets the current line number. The current line number or 0 if no line information is available (for example, HasLineInfo returns false). Gets the current line position. The current line position or 0 if no line information is available (for example, HasLineInfo returns false). Instructs the to always serialize the member with the specified name. Initializes a new instance of the class. Initializes a new instance of the class with the specified name. Name of the property. Gets or sets the converter used when serializing the property's collection items. The collection's items converter. Gets or sets the null value handling used when serializing this property. The null value handling. Gets or sets the default value handling used when serializing this property. The default value handling. Gets or sets the reference loop handling used when serializing this property. The reference loop handling. Gets or sets the object creation handling used when deserializing this property. The object creation handling. Gets or sets the type name handling used when serializing this property. The type name handling. Gets or sets whether this property's value is serialized as a reference. Whether this property's value is serialized as a reference. Gets or sets the order of serialization and deserialization of a member. The numeric order of serialization or deserialization. Gets or sets a value indicating whether this property is required. A value indicating whether this property is required. Gets or sets the name of the property. The name of the property. Gets or sets the the reference loop handling used when serializing the property's collection items. The collection's items reference loop handling. Gets or sets the the type name handling used when serializing the property's collection items. The collection's items type name handling. Gets or sets whether this property's collection items are serialized as a reference. Whether this property's collection items are serialized as a reference. Instructs the not to serialize the public field or public read/write property value. Represents a writer that provides a fast, non-cached, forward-only way of generating Json data. Creates an instance of the JsonWriter class using the specified . The TextWriter to write to. Flushes whatever is in the buffer to the underlying streams and also flushes the underlying stream. Closes this stream and the underlying stream. Writes the beginning of a Json object. Writes the beginning of a Json array. Writes the start of a constructor with the given name. The name of the constructor. Writes the specified end token. The end token to write. Writes the property name of a name/value pair on a Json object. The name of the property. Writes the property name of a name/value pair on a JSON object. The name of the property. A flag to indicate whether the text should be escaped when it is written as a JSON property name. Writes indent characters. Writes the JSON value delimiter. Writes an indent space. Writes a value. An error will raised if the value cannot be written as a single JSON token. The value to write. Writes a null value. Writes an undefined value. Writes raw JSON. The raw JSON to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes out a comment /*...*/ containing the specified text. Text to place inside the comment. Writes out the given white space. The string of white space characters. Gets or sets how many IndentChars to write for each level in the hierarchy when is set to Formatting.Indented. Gets or sets which character to use to quote attribute values. Gets or sets which character to use for indenting when is set to Formatting.Indented. Gets or sets a value indicating whether object names will be surrounded with quotes. The exception thrown when an error occurs while reading Json text. Initializes a new instance of the class. Initializes a new instance of the class with a specified error message. The error message that explains the reason for the exception. Initializes a new instance of the class with a specified error message and a reference to the inner exception that is the cause of this exception. The error message that explains the reason for the exception. The exception that is the cause of the current exception, or a null reference (Nothing in Visual Basic) if no inner exception is specified. Initializes a new instance of the class. The that holds the serialized object data about the exception being thrown. The that contains contextual information about the source or destination. The parameter is null. The class name is null or is zero (0). Gets the path to the JSON where the error occurred. The path to the JSON where the error occurred. The exception thrown when an error occurs while reading Json text. Initializes a new instance of the class. Initializes a new instance of the class with a specified error message. The error message that explains the reason for the exception. Initializes a new instance of the class with a specified error message and a reference to the inner exception that is the cause of this exception. The error message that explains the reason for the exception. The exception that is the cause of the current exception, or a null reference (Nothing in Visual Basic) if no inner exception is specified. Initializes a new instance of the class. The that holds the serialized object data about the exception being thrown. The that contains contextual information about the source or destination. The parameter is null. The class name is null or is zero (0). Gets the line number indicating where the error occurred. The line number indicating where the error occurred. Gets the line position indicating where the error occurred. The line position indicating where the error occurred. Gets the path to the JSON where the error occurred. The path to the JSON where the error occurred. Represents a collection of . Provides methods for converting between common language runtime types and JSON types. Represents JavaScript's boolean value true as a string. This field is read-only. Represents JavaScript's boolean value false as a string. This field is read-only. Represents JavaScript's null as a string. This field is read-only. Represents JavaScript's undefined as a string. This field is read-only. Represents JavaScript's positive infinity as a string. This field is read-only. Represents JavaScript's negative infinity as a string. This field is read-only. Represents JavaScript's NaN as a string. This field is read-only. Converts the to its JSON string representation. The value to convert. A JSON string representation of the . Converts the to its JSON string representation using the specified. The value to convert. The format the date will be converted to. The time zone handling when the date is converted to a string. A JSON string representation of the . Converts the to its JSON string representation. The value to convert. A JSON string representation of the . Converts the to its JSON string representation using the specified. The value to convert. The format the date will be converted to. A JSON string representation of the . Converts the to its JSON string representation. The value to convert. A JSON string representation of the . Converts the to its JSON string representation. The value to convert. A JSON string representation of the . Converts the to its JSON string representation. The value to convert. A JSON string representation of the . Converts the to its JSON string representation. The value to convert. A JSON string representation of the . Converts the to its JSON string representation. The value to convert. A JSON string representation of the . Converts the to its JSON string representation. The value to convert. A JSON string representation of the . Converts the to its JSON string representation. The value to convert. A JSON string representation of the . Converts the to its JSON string representation. The value to convert. A JSON string representation of the . Converts the to its JSON string representation. The value to convert. A JSON string representation of the . Converts the to its JSON string representation. The value to convert. A JSON string representation of the . Converts the to its JSON string representation. The value to convert. A JSON string representation of the . Converts the to its JSON string representation. The value to convert. A JSON string representation of the . Converts the to its JSON string representation. The value to convert. A JSON string representation of the . Converts the to its JSON string representation. The value to convert. A JSON string representation of the . Converts the to its JSON string representation. The value to convert. A JSON string representation of the . Converts the to its JSON string representation. The value to convert. A JSON string representation of the . Converts the to its JSON string representation. The value to convert. A JSON string representation of the . Converts the to its JSON string representation. The value to convert. A JSON string representation of the . Converts the to its JSON string representation. The value to convert. The string delimiter character. A JSON string representation of the . Converts the to its JSON string representation. The value to convert. A JSON string representation of the . Serializes the specified object to a JSON string. The object to serialize. A JSON string representation of the object. Serializes the specified object to a JSON string using formatting. The object to serialize. Indicates how the output is formatted. A JSON string representation of the object. Serializes the specified object to a JSON string using a collection of . The object to serialize. A collection converters used while serializing. A JSON string representation of the object. Serializes the specified object to a JSON string using formatting and a collection of . The object to serialize. Indicates how the output is formatted. A collection converters used while serializing. A JSON string representation of the object. Serializes the specified object to a JSON string using . The object to serialize. The used to serialize the object. If this is null, default serialization settings will be is used. A JSON string representation of the object. Serializes the specified object to a JSON string using a type, formatting and . The object to serialize. The used to serialize the object. If this is null, default serialization settings will be is used. The type of the value being serialized. This parameter is used when is Auto to write out the type name if the type of the value does not match. Specifing the type is optional. A JSON string representation of the object. Serializes the specified object to a JSON string using formatting and . The object to serialize. Indicates how the output is formatted. The used to serialize the object. If this is null, default serialization settings will be is used. A JSON string representation of the object. Serializes the specified object to a JSON string using a type, formatting and . The object to serialize. Indicates how the output is formatted. The used to serialize the object. If this is null, default serialization settings will be is used. The type of the value being serialized. This parameter is used when is Auto to write out the type name if the type of the value does not match. Specifing the type is optional. A JSON string representation of the object. Asynchronously serializes the specified object to a JSON string. Serialization will happen on a new thread. The object to serialize. A task that represents the asynchronous serialize operation. The value of the TResult parameter contains a JSON string representation of the object. Asynchronously serializes the specified object to a JSON string using formatting. Serialization will happen on a new thread. The object to serialize. Indicates how the output is formatted. A task that represents the asynchronous serialize operation. The value of the TResult parameter contains a JSON string representation of the object. Asynchronously serializes the specified object to a JSON string using formatting and a collection of . Serialization will happen on a new thread. The object to serialize. Indicates how the output is formatted. The used to serialize the object. If this is null, default serialization settings will be is used. A task that represents the asynchronous serialize operation. The value of the TResult parameter contains a JSON string representation of the object. Deserializes the JSON to a .NET object. The JSON to deserialize. The deserialized object from the Json string. Deserializes the JSON to a .NET object using . The JSON to deserialize. The used to deserialize the object. If this is null, default serialization settings will be is used. The deserialized object from the JSON string. Deserializes the JSON to the specified .NET type. The JSON to deserialize. The of object being deserialized. The deserialized object from the Json string. Deserializes the JSON to the specified .NET type. The type of the object to deserialize to. The JSON to deserialize. The deserialized object from the Json string. Deserializes the JSON to the given anonymous type. The anonymous type to deserialize to. This can't be specified traditionally and must be infered from the anonymous type passed as a parameter. The JSON to deserialize. The anonymous type object. The deserialized anonymous type from the JSON string. Deserializes the JSON to the given anonymous type using . The anonymous type to deserialize to. This can't be specified traditionally and must be infered from the anonymous type passed as a parameter. The JSON to deserialize. The anonymous type object. The used to deserialize the object. If this is null, default serialization settings will be is used. The deserialized anonymous type from the JSON string. Deserializes the JSON to the specified .NET type using a collection of . The type of the object to deserialize to. The JSON to deserialize. Converters to use while deserializing. The deserialized object from the JSON string. Deserializes the JSON to the specified .NET type using . The type of the object to deserialize to. The object to deserialize. The used to deserialize the object. If this is null, default serialization settings will be is used. The deserialized object from the JSON string. Deserializes the JSON to the specified .NET type using a collection of . The JSON to deserialize. The type of the object to deserialize. Converters to use while deserializing. The deserialized object from the JSON string. Deserializes the JSON to the specified .NET type using . The JSON to deserialize. The type of the object to deserialize to. The used to deserialize the object. If this is null, default serialization settings will be is used. The deserialized object from the JSON string. Asynchronously deserializes the JSON to the specified .NET type. Deserialization will happen on a new thread. The type of the object to deserialize to. The JSON to deserialize. A task that represents the asynchronous deserialize operation. The value of the TResult parameter contains the deserialized object from the JSON string. Asynchronously deserializes the JSON to the specified .NET type using . Deserialization will happen on a new thread. The type of the object to deserialize to. The JSON to deserialize. The used to deserialize the object. If this is null, default serialization settings will be is used. A task that represents the asynchronous deserialize operation. The value of the TResult parameter contains the deserialized object from the JSON string. Asynchronously deserializes the JSON to the specified .NET type. Deserialization will happen on a new thread. The JSON to deserialize. A task that represents the asynchronous deserialize operation. The value of the TResult parameter contains the deserialized object from the JSON string. Asynchronously deserializes the JSON to the specified .NET type using . Deserialization will happen on a new thread. The JSON to deserialize. The type of the object to deserialize to. The used to deserialize the object. If this is null, default serialization settings will be is used. A task that represents the asynchronous deserialize operation. The value of the TResult parameter contains the deserialized object from the JSON string. Populates the object with values from the JSON string. The JSON to populate values from. The target object to populate values onto. Populates the object with values from the JSON string using . The JSON to populate values from. The target object to populate values onto. The used to deserialize the object. If this is null, default serialization settings will be is used. Asynchronously populates the object with values from the JSON string using . The JSON to populate values from. The target object to populate values onto. The used to deserialize the object. If this is null, default serialization settings will be is used. A task that represents the asynchronous populate operation. Serializes the XML node to a JSON string. The node to serialize. A JSON string of the XmlNode. Serializes the XML node to a JSON string using formatting. The node to serialize. Indicates how the output is formatted. A JSON string of the XmlNode. Serializes the XML node to a JSON string using formatting and omits the root object if is true. The node to serialize. Indicates how the output is formatted. Omits writing the root object. A JSON string of the XmlNode. Deserializes the XmlNode from a JSON string. The JSON string. The deserialized XmlNode Deserializes the XmlNode from a JSON string nested in a root elment specified by . The JSON string. The name of the root element to append when deserializing. The deserialized XmlNode Deserializes the XmlNode from a JSON string nested in a root elment specified by and writes a .NET array attribute for collections. The JSON string. The name of the root element to append when deserializing. A flag to indicate whether to write the Json.NET array attribute. This attribute helps preserve arrays when converting the written XML back to JSON. The deserialized XmlNode Serializes the to a JSON string. The node to convert to JSON. A JSON string of the XNode. Serializes the to a JSON string using formatting. The node to convert to JSON. Indicates how the output is formatted. A JSON string of the XNode. Serializes the to a JSON string using formatting and omits the root object if is true. The node to serialize. Indicates how the output is formatted. Omits writing the root object. A JSON string of the XNode. Deserializes the from a JSON string. The JSON string. The deserialized XNode Deserializes the from a JSON string nested in a root elment specified by . The JSON string. The name of the root element to append when deserializing. The deserialized XNode Deserializes the from a JSON string nested in a root elment specified by and writes a .NET array attribute for collections. The JSON string. The name of the root element to append when deserializing. A flag to indicate whether to write the Json.NET array attribute. This attribute helps preserve arrays when converting the written XML back to JSON. The deserialized XNode Gets or sets a function that creates default . Default settings are automatically used by serialization methods on , and and on . To serialize without using any default settings create a with . The exception thrown when an error occurs during Json serialization or deserialization. Initializes a new instance of the class. Initializes a new instance of the class with a specified error message. The error message that explains the reason for the exception. Initializes a new instance of the class with a specified error message and a reference to the inner exception that is the cause of this exception. The error message that explains the reason for the exception. The exception that is the cause of the current exception, or a null reference (Nothing in Visual Basic) if no inner exception is specified. Initializes a new instance of the class. The that holds the serialized object data about the exception being thrown. The that contains contextual information about the source or destination. The parameter is null. The class name is null or is zero (0). Serializes and deserializes objects into and from the JSON format. The enables you to control how objects are encoded into JSON. Initializes a new instance of the class. Creates a new instance. The will not use default settings. A new instance. The will not use default settings. Creates a new instance using the specified . The will not use default settings. The settings to be applied to the . A new instance using the specified . The will not use default settings. Creates a new instance. The will use default settings. A new instance. The will use default settings. Creates a new instance using the specified . The will use default settings. The settings to be applied to the . A new instance using the specified . The will use default settings. Populates the JSON values onto the target object. The that contains the JSON structure to reader values from. The target object to populate values onto. Populates the JSON values onto the target object. The that contains the JSON structure to reader values from. The target object to populate values onto. Deserializes the Json structure contained by the specified . The that contains the JSON structure to deserialize. The being deserialized. Deserializes the Json structure contained by the specified into an instance of the specified type. The containing the object. The of object being deserialized. The instance of being deserialized. Deserializes the Json structure contained by the specified into an instance of the specified type. The containing the object. The type of the object to deserialize. The instance of being deserialized. Deserializes the Json structure contained by the specified into an instance of the specified type. The containing the object. The of object being deserialized. The instance of being deserialized. Serializes the specified and writes the Json structure to a Stream using the specified . The used to write the Json structure. The to serialize. Serializes the specified and writes the Json structure to a Stream using the specified . The used to write the Json structure. The to serialize. The type of the value being serialized. This parameter is used when is Auto to write out the type name if the type of the value does not match. Specifing the type is optional. Serializes the specified and writes the Json structure to a Stream using the specified . The used to write the Json structure. The to serialize. The type of the value being serialized. This parameter is used when is Auto to write out the type name if the type of the value does not match. Specifing the type is optional. Serializes the specified and writes the Json structure to a Stream using the specified . The used to write the Json structure. The to serialize. Occurs when the errors during serialization and deserialization. Gets or sets the used by the serializer when resolving references. Gets or sets the used by the serializer when resolving type names. Gets or sets the used by the serializer when writing trace messages. The trace writer. Gets or sets how type name writing and reading is handled by the serializer. Gets or sets how a type name assembly is written and resolved by the serializer. The type name assembly format. Gets or sets how object references are preserved by the serializer. Get or set how reference loops (e.g. a class referencing itself) is handled. Get or set how missing members (e.g. JSON contains a property that isn't a member on the object) are handled during deserialization. Get or set how null values are handled during serialization and deserialization. Get or set how null default are handled during serialization and deserialization. Gets or sets how objects are created during deserialization. The object creation handling. Gets or sets how constructors are used during deserialization. The constructor handling. Gets a collection that will be used during serialization. Collection that will be used during serialization. Gets or sets the contract resolver used by the serializer when serializing .NET objects to JSON and vice versa. Gets or sets the used by the serializer when invoking serialization callback methods. The context. Indicates how JSON text output is formatted. Get or set how dates are written to JSON text. Get or set how time zones are handling during serialization and deserialization. Get or set how date formatted strings, e.g. "\/Date(1198908717056)\/" and "2012-03-21T05:40Z", are parsed when reading JSON. Get or set how floating point numbers, e.g. 1.0 and 9.9, are parsed when reading JSON text. Get or set how special floating point numbers, e.g. , and , are written as JSON text. Get or set how strings are escaped when writing JSON text. Get or set how and values are formatting when writing JSON text. Gets or sets the culture used when reading JSON. Defaults to . Gets or sets the maximum depth allowed when reading JSON. Reading past this depth will throw a . Gets a value indicating whether there will be a check for additional JSON content after deserializing an object. true if there will be a check for additional JSON content after deserializing an object; otherwise, false. Contains the LINQ to JSON extension methods. Returns a collection of tokens that contains the ancestors of every token in the source collection. The type of the objects in source, constrained to . An of that contains the source collection. An of that contains the ancestors of every node in the source collection. Returns a collection of tokens that contains the descendants of every token in the source collection. The type of the objects in source, constrained to . An of that contains the source collection. An of that contains the descendants of every node in the source collection. Returns a collection of child properties of every object in the source collection. An of that contains the source collection. An of that contains the properties of every object in the source collection. Returns a collection of child values of every object in the source collection with the given key. An of that contains the source collection. The token key. An of that contains the values of every node in the source collection with the given key. Returns a collection of child values of every object in the source collection. An of that contains the source collection. An of that contains the values of every node in the source collection. Returns a collection of converted child values of every object in the source collection with the given key. The type to convert the values to. An of that contains the source collection. The token key. An that contains the converted values of every node in the source collection with the given key. Returns a collection of converted child values of every object in the source collection. The type to convert the values to. An of that contains the source collection. An that contains the converted values of every node in the source collection. Converts the value. The type to convert the value to. A cast as a of . A converted value. Converts the value. The source collection type. The type to convert the value to. A cast as a of . A converted value. Returns a collection of child tokens of every array in the source collection. The source collection type. An of that contains the source collection. An of that contains the values of every node in the source collection. Returns a collection of converted child tokens of every array in the source collection. An of that contains the source collection. The type to convert the values to. The source collection type. An that contains the converted values of every node in the source collection. Returns the input typed as . An of that contains the source collection. The input typed as . Returns the input typed as . The source collection type. An of that contains the source collection. The input typed as . Represents a JSON constructor. Represents a token that can contain other tokens. Raises the event. The instance containing the event data. Raises the event. The instance containing the event data. Raises the event. The instance containing the event data. Returns a collection of the child tokens of this token, in document order. An of containing the child tokens of this , in document order. Returns a collection of the child values of this token, in document order. The type to convert the values to. A containing the child values of this , in document order. Returns a collection of the descendant tokens for this token in document order. An containing the descendant tokens of the . Adds the specified content as children of this . The content to be added. Adds the specified content as the first children of this . The content to be added. Creates an that can be used to add tokens to the . An that is ready to have content written to it. Replaces the children nodes of this token with the specified content. The content. Removes the child nodes from this token. Occurs when the list changes or an item in the list changes. Occurs before an item is added to the collection. Occurs when the items list of the collection has changed, or the collection is reset. Gets the container's children tokens. The container's children tokens. Gets a value indicating whether this token has child tokens. true if this token has child values; otherwise, false. Get the first child token of this token. A containing the first child token of the . Get the last child token of this token. A containing the last child token of the . Gets the count of child JSON tokens. The count of child JSON tokens Initializes a new instance of the class. Initializes a new instance of the class from another object. A object to copy from. Initializes a new instance of the class with the specified name and content. The constructor name. The contents of the constructor. Initializes a new instance of the class with the specified name and content. The constructor name. The contents of the constructor. Initializes a new instance of the class with the specified name. The constructor name. Writes this token to a . A into which this method will write. A collection of which will be used when writing the token. Loads an from a . A that will be read for the content of the . A that contains the JSON that was read from the specified . Gets the container's children tokens. The container's children tokens. Gets or sets the name of this constructor. The constructor name. Gets the node type for this . The type. Gets the with the specified key. The with the specified key. Represents a collection of objects. The type of token An empty collection of objects. Initializes a new instance of the struct. The enumerable. Returns an enumerator that iterates through the collection. A that can be used to iterate through the collection. Returns an enumerator that iterates through a collection. An object that can be used to iterate through the collection. Determines whether the specified is equal to this instance. The to compare with this instance. true if the specified is equal to this instance; otherwise, false. Returns a hash code for this instance. A hash code for this instance, suitable for use in hashing algorithms and data structures like a hash table. Gets the with the specified key. Represents a JSON object. Initializes a new instance of the class. Initializes a new instance of the class from another object. A object to copy from. Initializes a new instance of the class with the specified content. The contents of the object. Initializes a new instance of the class with the specified content. The contents of the object. Gets an of this object's properties. An of this object's properties. Gets a the specified name. The property name. A with the specified name or null. Gets an of this object's property values. An of this object's property values. Loads an from a . A that will be read for the content of the . A that contains the JSON that was read from the specified . Load a from a string that contains JSON. A that contains JSON. A populated from the string that contains JSON. Creates a from an object. The object that will be used to create . A with the values of the specified object Creates a from an object. The object that will be used to create . The that will be used to read the object. A with the values of the specified object Writes this token to a . A into which this method will write. A collection of which will be used when writing the token. Gets the with the specified property name. Name of the property. The with the specified property name. Gets the with the specified property name. The exact property name will be searched for first and if no matching property is found then the will be used to match a property. Name of the property. One of the enumeration values that specifies how the strings will be compared. The with the specified property name. Tries to get the with the specified property name. The exact property name will be searched for first and if no matching property is found then the will be used to match a property. Name of the property. The value. One of the enumeration values that specifies how the strings will be compared. true if a value was successfully retrieved; otherwise, false. Adds the specified property name. Name of the property. The value. Removes the property with the specified name. Name of the property. true if item was successfully removed; otherwise, false. Tries the get value. Name of the property. The value. true if a value was successfully retrieved; otherwise, false. Returns an enumerator that iterates through the collection. A that can be used to iterate through the collection. Raises the event with the provided arguments. Name of the property. Raises the event with the provided arguments. Name of the property. Returns the properties for this instance of a component. A that represents the properties for this component instance. Returns the properties for this instance of a component using the attribute array as a filter. An array of type that is used as a filter. A that represents the filtered properties for this component instance. Returns a collection of custom attributes for this instance of a component. An containing the attributes for this object. Returns the class name of this instance of a component. The class name of the object, or null if the class does not have a name. Returns the name of this instance of a component. The name of the object, or null if the object does not have a name. Returns a type converter for this instance of a component. A that is the converter for this object, or null if there is no for this object. Returns the default event for this instance of a component. An that represents the default event for this object, or null if this object does not have events. Returns the default property for this instance of a component. A that represents the default property for this object, or null if this object does not have properties. Returns an editor of the specified type for this instance of a component. A that represents the editor for this object. An of the specified type that is the editor for this object, or null if the editor cannot be found. Returns the events for this instance of a component using the specified attribute array as a filter. An array of type that is used as a filter. An that represents the filtered events for this component instance. Returns the events for this instance of a component. An that represents the events for this component instance. Returns an object that contains the property described by the specified property descriptor. A that represents the property whose owner is to be found. An that represents the owner of the specified property. Returns the responsible for binding operations performed on this object. The expression tree representation of the runtime value. The to bind this object. Gets the container's children tokens. The container's children tokens. Occurs when a property value changes. Occurs when a property value is changing. Gets the node type for this . The type. Gets the with the specified key. The with the specified key. Gets or sets the with the specified property name. Represents a JSON array. Initializes a new instance of the class. Initializes a new instance of the class from another object. A object to copy from. Initializes a new instance of the class with the specified content. The contents of the array. Initializes a new instance of the class with the specified content. The contents of the array. Loads an from a . A that will be read for the content of the . A that contains the JSON that was read from the specified . Load a from a string that contains JSON. A that contains JSON. A populated from the string that contains JSON. Creates a from an object. The object that will be used to create . A with the values of the specified object Creates a from an object. The object that will be used to create . The that will be used to read the object. A with the values of the specified object Writes this token to a . A into which this method will write. A collection of which will be used when writing the token. Determines the index of a specific item in the . The object to locate in the . The index of if found in the list; otherwise, -1. Inserts an item to the at the specified index. The zero-based index at which should be inserted. The object to insert into the . is not a valid index in the . The is read-only. Removes the item at the specified index. The zero-based index of the item to remove. is not a valid index in the . The is read-only. Returns an enumerator that iterates through the collection. A that can be used to iterate through the collection. Adds an item to the . The object to add to the . The is read-only. Removes all items from the . The is read-only. Determines whether the contains a specific value. The object to locate in the . true if is found in the ; otherwise, false. Copies to. The array. Index of the array. Removes the first occurrence of a specific object from the . The object to remove from the . true if was successfully removed from the ; otherwise, false. This method also returns false if is not found in the original . The is read-only. Gets the container's children tokens. The container's children tokens. Gets the node type for this . The type. Gets the with the specified key. The with the specified key. Gets or sets the at the specified index. Gets a value indicating whether the is read-only. true if the is read-only; otherwise, false. Represents a reader that provides fast, non-cached, forward-only access to serialized Json data. Initializes a new instance of the class. The token to read from. Reads the next JSON token from the stream as a . A or a null reference if the next JSON token is null. This method will return null at the end of an array. Reads the next JSON token from the stream as a . A . This method will return null at the end of an array. Reads the next JSON token from the stream as a . A . This method will return null at the end of an array. Reads the next JSON token from the stream as a . A . This method will return null at the end of an array. Reads the next JSON token from the stream as a . A . This method will return null at the end of an array. Reads the next JSON token from the stream as a . A . This method will return null at the end of an array. Reads the next JSON token from the stream. true if the next token was read successfully; false if there are no more tokens to read. Represents a writer that provides a fast, non-cached, forward-only way of generating Json data. Initializes a new instance of the class writing to the given . The container being written to. Initializes a new instance of the class. Flushes whatever is in the buffer to the underlying streams and also flushes the underlying stream. Closes this stream and the underlying stream. Writes the beginning of a Json object. Writes the beginning of a Json array. Writes the start of a constructor with the given name. The name of the constructor. Writes the end. The token. Writes the property name of a name/value pair on a Json object. The name of the property. Writes a value. An error will raised if the value cannot be written as a single JSON token. The value to write. Writes a null value. Writes an undefined value. Writes raw JSON. The raw JSON to write. Writes out a comment /*...*/ containing the specified text. Text to place inside the comment. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Gets the token being writen. The token being writen. Represents a JSON property. Initializes a new instance of the class from another object. A object to copy from. Initializes a new instance of the class. The property name. The property content. Initializes a new instance of the class. The property name. The property content. Writes this token to a . A into which this method will write. A collection of which will be used when writing the token. Loads an from a . A that will be read for the content of the . A that contains the JSON that was read from the specified . Gets the container's children tokens. The container's children tokens. Gets the property name. The property name. Gets or sets the property value. The property value. Gets the node type for this . The type. Specifies the type of token. No token type has been set. A JSON object. A JSON array. A JSON constructor. A JSON object property. A comment. An integer value. A float value. A string value. A boolean value. A null value. An undefined value. A date value. A raw JSON value. A collection of bytes value. A Guid value. A Uri value. A TimeSpan value. Contains the JSON schema extension methods. Determines whether the is valid. The source to test. The schema to test with. true if the specified is valid; otherwise, false. Determines whether the is valid. The source to test. The schema to test with. When this method returns, contains any error messages generated while validating. true if the specified is valid; otherwise, false. Validates the specified . The source to test. The schema to test with. Validates the specified . The source to test. The schema to test with. The validation event handler. Returns detailed information about the schema exception. Initializes a new instance of the class. Initializes a new instance of the class with a specified error message. The error message that explains the reason for the exception. Initializes a new instance of the class with a specified error message and a reference to the inner exception that is the cause of this exception. The error message that explains the reason for the exception. The exception that is the cause of the current exception, or a null reference (Nothing in Visual Basic) if no inner exception is specified. Initializes a new instance of the class. The that holds the serialized object data about the exception being thrown. The that contains contextual information about the source or destination. The parameter is null. The class name is null or is zero (0). Gets the line number indicating where the error occurred. The line number indicating where the error occurred. Gets the line position indicating where the error occurred. The line position indicating where the error occurred. Gets the path to the JSON where the error occurred. The path to the JSON where the error occurred. Resolves from an id. Initializes a new instance of the class. Gets a for the specified reference. The id. A for the specified reference. Gets or sets the loaded schemas. The loaded schemas. Specifies undefined schema Id handling options for the . Do not infer a schema Id. Use the .NET type name as the schema Id. Use the assembly qualified .NET type name as the schema Id. Returns detailed information related to the . Gets the associated with the validation error. The JsonSchemaException associated with the validation error. Gets the path of the JSON location where the validation error occurred. The path of the JSON location where the validation error occurred. Gets the text description corresponding to the validation error. The text description. Represents the callback method that will handle JSON schema validation events and the . Resolves member mappings for a type, camel casing property names. Used by to resolves a for a given . Used by to resolves a for a given . Resolves the contract for a given type. The type to resolve a contract for. The contract for a given type. Initializes a new instance of the class. Initializes a new instance of the class. If set to true the will use a cached shared with other resolvers of the same type. Sharing the cache will significantly performance because expensive reflection will only happen once but could cause unexpected behavior if different instances of the resolver are suppose to produce different results. When set to false it is highly recommended to reuse instances with the . Resolves the contract for a given type. The type to resolve a contract for. The contract for a given type. Gets the serializable members for the type. The type to get serializable members for. The serializable members for the type. Creates a for the given type. Type of the object. A for the given type. Creates the constructor parameters. The constructor to create properties for. The type's member properties. Properties for the given . Creates a for the given . The matching member property. The constructor parameter. A created for the given . Resolves the default for the contract. Type of the object. The contract's default . Creates a for the given type. Type of the object. A for the given type. Creates a for the given type. Type of the object. A for the given type. Creates a for the given type. Type of the object. A for the given type. Creates a for the given type. Type of the object. A for the given type. Creates a for the given type. Type of the object. A for the given type. Creates a for the given type. Type of the object. A for the given type. Creates a for the given type. Type of the object. A for the given type. Determines which contract type is created for the given type. Type of the object. A for the given type. Creates properties for the given . The type to create properties for. /// The member serialization mode for the type. Properties for the given . Creates the used by the serializer to get and set values from a member. The member. The used by the serializer to get and set values from a member. Creates a for the given . The member's parent . The member to create a for. A created for the given . Resolves the name of the property. Name of the property. Name of the property. Gets the resolved name of the property. Name of the property. Name of the property. Gets a value indicating whether members are being get and set using dynamic code generation. This value is determined by the runtime permissions available. true if using dynamic code generation; otherwise, false. Gets or sets the default members search flags. The default members search flags. Gets or sets a value indicating whether compiler generated members should be serialized. true if serialized compiler generated members; otherwise, false. Gets or sets a value indicating whether to ignore the interface when serializing and deserializing types. true if the interface will be ignored when serializing and deserializing types; otherwise, false. Gets or sets a value indicating whether to ignore the attribute when serializing and deserializing types. true if the attribute will be ignored when serializing and deserializing types; otherwise, false. Initializes a new instance of the class. Resolves the name of the property. Name of the property. The property name camel cased. The default serialization binder used when resolving and loading classes from type names. When overridden in a derived class, controls the binding of a serialized object to a type. Specifies the name of the serialized object. Specifies the name of the serialized object. The type of the object the formatter creates a new instance of. When overridden in a derived class, controls the binding of a serialized object to a type. The type of the object the formatter creates a new instance of. Specifies the name of the serialized object. Specifies the name of the serialized object. Provides information surrounding an error. Gets the error. The error. Gets the original object that caused the error. The original object that caused the error. Gets the member that caused the error. The member that caused the error. Gets the path of the JSON location where the error occurred. The path of the JSON location where the error occurred. Gets or sets a value indicating whether this is handled. true if handled; otherwise, false. Contract details for a used by the . Initializes a new instance of the class. The underlying type for the contract. Gets the of the collection items. The of the collection items. Gets a value indicating whether the collection type is a multidimensional array. true if the collection type is a multidimensional array; otherwise, false. Handles serialization callback events. The object that raised the callback event. The streaming context. Handles serialization error callback events. The object that raised the callback event. The streaming context. The error context. Sets extension data for an object during deserialization. The object to set extension data on. The extension data key. The extension data value. Gets extension data for an object during serialization. The object to set extension data on. Contract details for a used by the . Initializes a new instance of the class. The underlying type for the contract. Gets or sets the property name resolver. The property name resolver. Gets the of the dictionary keys. The of the dictionary keys. Gets the of the dictionary values. The of the dictionary values. Maps a JSON property to a .NET member or constructor parameter. Returns a that represents this instance. A that represents this instance. Gets or sets the name of the property. The name of the property. Gets or sets the type that declared this property. The type that declared this property. Gets or sets the order of serialization and deserialization of a member. The numeric order of serialization or deserialization. Gets or sets the name of the underlying member or parameter. The name of the underlying member or parameter. Gets the that will get and set the during serialization. The that will get and set the during serialization. Gets or sets the type of the property. The type of the property. Gets or sets the for the property. If set this converter takes presidence over the contract converter for the property type. The converter. Gets or sets the member converter. The member converter. Gets or sets a value indicating whether this is ignored. true if ignored; otherwise, false. Gets or sets a value indicating whether this is readable. true if readable; otherwise, false. Gets or sets a value indicating whether this is writable. true if writable; otherwise, false. Gets or sets a value indicating whether this has a member attribute. true if has a member attribute; otherwise, false. Gets the default value. The default value. Gets or sets a value indicating whether this is required. A value indicating whether this is required. Gets or sets a value indicating whether this property preserves object references. true if this instance is reference; otherwise, false. Gets or sets the property null value handling. The null value handling. Gets or sets the property default value handling. The default value handling. Gets or sets the property reference loop handling. The reference loop handling. Gets or sets the property object creation handling. The object creation handling. Gets or sets or sets the type name handling. The type name handling. Gets or sets a predicate used to determine whether the property should be serialize. A predicate used to determine whether the property should be serialize. Gets or sets a predicate used to determine whether the property should be serialized. A predicate used to determine whether the property should be serialized. Gets or sets an action used to set whether the property has been deserialized. An action used to set whether the property has been deserialized. Gets or sets the converter used when serializing the property's collection items. The collection's items converter. Gets or sets whether this property's collection items are serialized as a reference. Whether this property's collection items are serialized as a reference. Gets or sets the the type name handling used when serializing the property's collection items. The collection's items type name handling. Gets or sets the the reference loop handling used when serializing the property's collection items. The collection's items reference loop handling. A collection of objects. Initializes a new instance of the class. The type. When implemented in a derived class, extracts the key from the specified element. The element from which to extract the key. The key for the specified element. Adds a object. The property to add to the collection. Gets the closest matching object. First attempts to get an exact case match of propertyName and then a case insensitive match. Name of the property. A matching property if found. Gets a property by property name. The name of the property to get. Type property name string comparison. A matching property if found. Specifies missing member handling options for the . Ignore a missing member and do not attempt to deserialize it. Throw a when a missing member is encountered during deserialization. Specifies null value handling options for the . Include null values when serializing and deserializing objects. Ignore null values when serializing and deserializing objects. Specifies reference loop handling options for the . Throw a when a loop is encountered. Ignore loop references and do not serialize. Serialize loop references. An in-memory representation of a JSON Schema. Initializes a new instance of the class. Reads a from the specified . The containing the JSON Schema to read. The object representing the JSON Schema. Reads a from the specified . The containing the JSON Schema to read. The to use when resolving schema references. The object representing the JSON Schema. Load a from a string that contains schema JSON. A that contains JSON. A populated from the string that contains JSON. Parses the specified json. The json. The resolver. A populated from the string that contains JSON. Writes this schema to a . A into which this method will write. Writes this schema to a using the specified . A into which this method will write. The resolver used. Returns a that represents the current . A that represents the current . Gets or sets the id. Gets or sets the title. Gets or sets whether the object is required. Gets or sets whether the object is read only. Gets or sets whether the object is visible to users. Gets or sets whether the object is transient. Gets or sets the description of the object. Gets or sets the types of values allowed by the object. The type. Gets or sets the pattern. The pattern. Gets or sets the minimum length. The minimum length. Gets or sets the maximum length. The maximum length. Gets or sets a number that the value should be divisble by. A number that the value should be divisble by. Gets or sets the minimum. The minimum. Gets or sets the maximum. The maximum. Gets or sets a flag indicating whether the value can not equal the number defined by the "minimum" attribute. A flag indicating whether the value can not equal the number defined by the "minimum" attribute. Gets or sets a flag indicating whether the value can not equal the number defined by the "maximum" attribute. A flag indicating whether the value can not equal the number defined by the "maximum" attribute. Gets or sets the minimum number of items. The minimum number of items. Gets or sets the maximum number of items. The maximum number of items. Gets or sets the of items. The of items. Gets or sets a value indicating whether items in an array are validated using the instance at their array position from . true if items are validated using their array position; otherwise, false. Gets or sets the of additional items. The of additional items. Gets or sets a value indicating whether additional items are allowed. true if additional items are allowed; otherwise, false. Gets or sets whether the array items must be unique. Gets or sets the of properties. The of properties. Gets or sets the of additional properties. The of additional properties. Gets or sets the pattern properties. The pattern properties. Gets or sets a value indicating whether additional properties are allowed. true if additional properties are allowed; otherwise, false. Gets or sets the required property if this property is present. The required property if this property is present. Gets or sets the a collection of valid enum values allowed. A collection of valid enum values allowed. Gets or sets disallowed types. The disallow types. Gets or sets the default value. The default value. Gets or sets the collection of that this schema extends. The collection of that this schema extends. Gets or sets the format. The format. Generates a from a specified . Generate a from the specified type. The type to generate a from. A generated from the specified type. Generate a from the specified type. The type to generate a from. The used to resolve schema references. A generated from the specified type. Generate a from the specified type. The type to generate a from. Specify whether the generated root will be nullable. A generated from the specified type. Generate a from the specified type. The type to generate a from. The used to resolve schema references. Specify whether the generated root will be nullable. A generated from the specified type. Gets or sets how undefined schemas are handled by the serializer. Gets or sets the contract resolver. The contract resolver. The value types allowed by the . No type specified. String type. Float type. Integer type. Boolean type. Object type. Array type. Null type. Any type. Contract details for a used by the . Initializes a new instance of the class. The underlying type for the contract. Gets or sets the object member serialization. The member object serialization. Gets or sets a value that indicates whether the object's properties are required. A value indicating whether the object's properties are required. Gets the object's properties. The object's properties. Gets the constructor parameters required for any non-default constructor Gets or sets the override constructor used to create the object. This is set when a constructor is marked up using the JsonConstructor attribute. The override constructor. Gets or sets the parametrized constructor used to create the object. The parametrized constructor. Gets or sets the extension data setter. Gets or sets the extension data getter. Contract details for a used by the . Initializes a new instance of the class. The underlying type for the contract. Get and set values for a using reflection. Initializes a new instance of the class. The member info. Sets the value. The target to set the value on. The value to set on the target. Gets the value. The target to get the value from. The value. When applied to a method, specifies that the method is called when an error occurs serializing an object. Helper method for generating a MetaObject which calls a specific method on Dynamic that returns a result Helper method for generating a MetaObject which calls a specific method on Dynamic, but uses one of the arguments for the result. Helper method for generating a MetaObject which calls a specific method on Dynamic, but uses one of the arguments for the result. Returns a Restrictions object which includes our current restrictions merged with a restriction limiting our type Represents a method that constructs an object. The object type to create. Specifies type name handling options for the . Do not include the .NET type name when serializing types. Include the .NET type name when serializing into a JSON object structure. Include the .NET type name when serializing into a JSON array structure. Always include the .NET type name when serializing. Include the .NET type name when the type of the object being serialized is not the same as its declared type. Converts the value to the specified type. The value to convert. The culture to use when converting. The type to convert the value to. The converted type. Converts the value to the specified type. The value to convert. The culture to use when converting. The type to convert the value to. The converted value if the conversion was successful or the default value of T if it failed. true if initialValue was converted successfully; otherwise, false. Converts the value to the specified type. If the value is unable to be converted, the value is checked whether it assignable to the specified type. The value to convert. The culture to use when converting. The type to convert or cast the value to. The converted type. If conversion was unsuccessful, the initial value is returned if assignable to the target type. Gets a dictionary of the names and values of an Enum type. Gets a dictionary of the names and values of an Enum type. The enum type to get names and values for. Specifies the type of Json token. This is returned by the if a method has not been called. An object start token. An array start token. A constructor start token. An object property name. A comment. Raw JSON. An integer. A float. A string. A boolean. A null token. An undefined token. An object end token. An array end token. A constructor end token. A Date. Byte data. Builds a string. Unlike StringBuilder this class lets you reuse it's internal buffer. Determines whether the collection is null or empty. The collection. true if the collection is null or empty; otherwise, false. Adds the elements of the specified collection to the specified generic IList. The list to add to. The collection of elements to add. Returns the index of the first occurrence in a sequence by using a specified IEqualityComparer. The type of the elements of source. A sequence in which to locate a value. The object to locate in the sequence An equality comparer to compare values. The zero-based index of the first occurrence of value within the entire sequence, if found; otherwise, –1. Gets the type of the typed collection's items. The type. The type of the typed collection's items. Gets the member's underlying type. The member. The underlying type of the member. Determines whether the member is an indexed property. The member. true if the member is an indexed property; otherwise, false. Determines whether the property is an indexed property. The property. true if the property is an indexed property; otherwise, false. Gets the member's value on the object. The member. The target object. The member's value on the object. Sets the member's value on the target object. The member. The target. The value. Determines whether the specified MemberInfo can be read. The MemberInfo to determine whether can be read. /// if set to true then allow the member to be gotten non-publicly. true if the specified MemberInfo can be read; otherwise, false. Determines whether the specified MemberInfo can be set. The MemberInfo to determine whether can be set. if set to true then allow the member to be set non-publicly. if set to true then allow the member to be set if read-only. true if the specified MemberInfo can be set; otherwise, false. Determines whether the string is all white space. Empty string will return false. The string to test whether it is all white space. true if the string is all white space; otherwise, false. Nulls an empty string. The string. Null if the string was null, otherwise the string unchanged. Specifies the state of the . An exception has been thrown, which has left the in an invalid state. You may call the method to put the in the Closed state. Any other method calls results in an being thrown. The method has been called. An object is being written. A array is being written. A constructor is being written. A property is being written. A write method has not been called. ================================================ FILE: packages/Newtonsoft.Json.6.0.2/lib/net45/Newtonsoft.Json.xml ================================================ Newtonsoft.Json Represents a BSON Oid (object id). Initializes a new instance of the class. The Oid value. Gets or sets the value of the Oid. The value of the Oid. Represents a reader that provides fast, non-cached, forward-only access to serialized Json data. Represents a reader that provides fast, non-cached, forward-only access to serialized Json data. Initializes a new instance of the class with the specified . Reads the next JSON token from the stream. true if the next token was read successfully; false if there are no more tokens to read. Reads the next JSON token from the stream as a . A . This method will return null at the end of an array. Reads the next JSON token from the stream as a . A . This method will return null at the end of an array. Reads the next JSON token from the stream as a . A or a null reference if the next JSON token is null. This method will return null at the end of an array. Reads the next JSON token from the stream as a . A . This method will return null at the end of an array. Reads the next JSON token from the stream as a . A . This method will return null at the end of an array. Reads the next JSON token from the stream as a . A . This method will return null at the end of an array. Skips the children of the current token. Sets the current token. The new token. Sets the current token and value. The new token. The value. Sets the state based on current token type. Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources. Releases unmanaged and - optionally - managed resources true to release both managed and unmanaged resources; false to release only unmanaged resources. Changes the to Closed. Gets the current reader state. The current reader state. Gets or sets a value indicating whether the underlying stream or should be closed when the reader is closed. true to close the underlying stream or when the reader is closed; otherwise false. The default is true. Gets or sets a value indicating whether multiple pieces of JSON content can be read from a continuous stream without erroring. true to support reading multiple pieces of JSON content; otherwise false. The default is false. Gets the quotation mark character used to enclose the value of a string. Get or set how time zones are handling when reading JSON. Get or set how date formatted strings, e.g. "\/Date(1198908717056)\/" and "2012-03-21T05:40Z", are parsed when reading JSON. Get or set how floating point numbers, e.g. 1.0 and 9.9, are parsed when reading JSON text. Gets or sets the maximum depth allowed when reading JSON. Reading past this depth will throw a . Gets the type of the current JSON token. Gets the text value of the current JSON token. Gets The Common Language Runtime (CLR) type for the current JSON token. Gets the depth of the current token in the JSON document. The depth of the current token in the JSON document. Gets the path of the current JSON token. Gets or sets the culture used when reading JSON. Defaults to . Specifies the state of the reader. The Read method has not been called. The end of the file has been reached successfully. Reader is at a property. Reader is at the start of an object. Reader is in an object. Reader is at the start of an array. Reader is in an array. The Close method has been called. Reader has just read a value. Reader is at the start of a constructor. Reader in a constructor. An error occurred that prevents the read operation from continuing. The end of the file has been reached successfully. Initializes a new instance of the class. The stream. Initializes a new instance of the class. The reader. Initializes a new instance of the class. The stream. if set to true the root object will be read as a JSON array. The used when reading values from BSON. Initializes a new instance of the class. The reader. if set to true the root object will be read as a JSON array. The used when reading values from BSON. Reads the next JSON token from the stream as a . A or a null reference if the next JSON token is null. This method will return null at the end of an array. Reads the next JSON token from the stream as a . A . This method will return null at the end of an array. Reads the next JSON token from the stream as a . A . This method will return null at the end of an array. Reads the next JSON token from the stream as a . A . This method will return null at the end of an array. Reads the next JSON token from the stream as a . A . This method will return null at the end of an array. Reads the next JSON token from the stream as a . A . This method will return null at the end of an array. Reads the next JSON token from the stream. true if the next token was read successfully; false if there are no more tokens to read. Changes the to Closed. Gets or sets a value indicating whether binary data reading should compatible with incorrect Json.NET 3.5 written binary. true if binary data reading will be compatible with incorrect Json.NET 3.5 written binary; otherwise, false. Gets or sets a value indicating whether the root object will be read as a JSON array. true if the root object will be read as a JSON array; otherwise, false. Gets or sets the used when reading values from BSON. The used when reading values from BSON. Represents a writer that provides a fast, non-cached, forward-only way of generating JSON data. Represents a writer that provides a fast, non-cached, forward-only way of generating Json data. Creates an instance of the JsonWriter class. Flushes whatever is in the buffer to the underlying streams and also flushes the underlying stream. Closes this stream and the underlying stream. Writes the beginning of a Json object. Writes the end of a Json object. Writes the beginning of a Json array. Writes the end of an array. Writes the start of a constructor with the given name. The name of the constructor. Writes the end constructor. Writes the property name of a name/value pair on a JSON object. The name of the property. Writes the property name of a name/value pair on a JSON object. The name of the property. A flag to indicate whether the text should be escaped when it is written as a JSON property name. Writes the end of the current Json object or array. Writes the current token and its children. The to read the token from. Writes the current token. The to read the token from. A flag indicating whether the current token's children should be written. Writes the specified end token. The end token to write. Writes indent characters. Writes the JSON value delimiter. Writes an indent space. Writes a null value. Writes an undefined value. Writes raw JSON without changing the writer's state. The raw JSON to write. Writes raw JSON where a value is expected and updates the writer's state. The raw JSON to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. An error will raised if the value cannot be written as a single JSON token. The value to write. Writes out a comment /*...*/ containing the specified text. Text to place inside the comment. Writes out the given white space. The string of white space characters. Sets the state of the JsonWriter, The JsonToken being written. The value being written. Gets or sets a value indicating whether the underlying stream or should be closed when the writer is closed. true to close the underlying stream or when the writer is closed; otherwise false. The default is true. Gets the top. The top. Gets the state of the writer. Gets the path of the writer. Indicates how JSON text output is formatted. Get or set how dates are written to JSON text. Get or set how time zones are handling when writing JSON text. Get or set how strings are escaped when writing JSON text. Get or set how special floating point numbers, e.g. , and , are written to JSON text. Get or set how and values are formatting when writing JSON text. Gets or sets the culture used when writing JSON. Defaults to . Initializes a new instance of the class. The stream. Initializes a new instance of the class. The writer. Flushes whatever is in the buffer to the underlying streams and also flushes the underlying stream. Writes the end. The token. Writes out a comment /*...*/ containing the specified text. Text to place inside the comment. Writes the start of a constructor with the given name. The name of the constructor. Writes raw JSON. The raw JSON to write. Writes raw JSON where a value is expected and updates the writer's state. The raw JSON to write. Writes the beginning of a Json array. Writes the beginning of a Json object. Writes the property name of a name/value pair on a Json object. The name of the property. Closes this stream and the underlying stream. Writes a value. An error will raised if the value cannot be written as a single JSON token. The value to write. Writes a null value. Writes an undefined value. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value that represents a BSON object id. The Object ID value to write. Writes a BSON regex. The regex pattern. The regex options. Gets or sets the used when writing values to BSON. When set to no conversion will occur. The used when writing values to BSON. Specifies how constructors are used when initializing objects during deserialization by the . First attempt to use the public default constructor, then fall back to single paramatized constructor, then the non-public default constructor. Json.NET will use a non-public default constructor before falling back to a paramatized constructor. Converts a binary value to and from a base 64 string value. Converts an object to and from JSON. Writes the JSON representation of the object. The to write to. The value. The calling serializer. Reads the JSON representation of the object. The to read from. Type of the object. The existing value of object being read. The calling serializer. The object value. Determines whether this instance can convert the specified object type. Type of the object. true if this instance can convert the specified object type; otherwise, false. Gets the of the JSON produced by the JsonConverter. The of the JSON produced by the JsonConverter. Gets a value indicating whether this can read JSON. true if this can read JSON; otherwise, false. Gets a value indicating whether this can write JSON. true if this can write JSON; otherwise, false. Writes the JSON representation of the object. The to write to. The value. The calling serializer. Reads the JSON representation of the object. The to read from. Type of the object. The existing value of object being read. The calling serializer. The object value. Determines whether this instance can convert the specified object type. Type of the object. true if this instance can convert the specified object type; otherwise, false. Converts a to and from JSON and BSON. Writes the JSON representation of the object. The to write to. The value. The calling serializer. Reads the JSON representation of the object. The to read from. Type of the object. The existing value of object being read. The calling serializer. The object value. Determines whether this instance can convert the specified object type. Type of the object. true if this instance can convert the specified object type; otherwise, false. Create a custom object The object type to convert. Writes the JSON representation of the object. The to write to. The value. The calling serializer. Reads the JSON representation of the object. The to read from. Type of the object. The existing value of object being read. The calling serializer. The object value. Creates an object which will then be populated by the serializer. Type of the object. The created object. Determines whether this instance can convert the specified object type. Type of the object. true if this instance can convert the specified object type; otherwise, false. Gets a value indicating whether this can write JSON. true if this can write JSON; otherwise, false. Converts a to and from JSON. Writes the JSON representation of the object. The to write to. The value. The calling serializer. Reads the JSON representation of the object. The to read from. Type of the object. The existing value of object being read. The calling serializer. The object value. Determines whether this instance can convert the specified value type. Type of the value. true if this instance can convert the specified value type; otherwise, false. Converts a to and from JSON. Writes the JSON representation of the object. The to write to. The value. The calling serializer. Reads the JSON representation of the object. The to read from. Type of the object. The existing value of object being read. The calling serializer. The object value. Determines whether this instance can convert the specified value type. Type of the value. true if this instance can convert the specified value type; otherwise, false. Provides a base class for converting a to and from JSON. Determines whether this instance can convert the specified object type. Type of the object. true if this instance can convert the specified object type; otherwise, false. Converts a F# discriminated union type to and from JSON. Writes the JSON representation of the object. The to write to. The value. The calling serializer. Reads the JSON representation of the object. The to read from. Type of the object. The existing value of object being read. The calling serializer. The object value. Determines whether this instance can convert the specified object type. Type of the object. true if this instance can convert the specified object type; otherwise, false. Converts an Entity Framework EntityKey to and from JSON. Writes the JSON representation of the object. The to write to. The value. The calling serializer. Reads the JSON representation of the object. The to read from. Type of the object. The existing value of object being read. The calling serializer. The object value. Determines whether this instance can convert the specified object type. Type of the object. true if this instance can convert the specified object type; otherwise, false. Converts an ExpandoObject to and from JSON. Writes the JSON representation of the object. The to write to. The value. The calling serializer. Reads the JSON representation of the object. The to read from. Type of the object. The existing value of object being read. The calling serializer. The object value. Determines whether this instance can convert the specified object type. Type of the object. true if this instance can convert the specified object type; otherwise, false. Gets a value indicating whether this can write JSON. true if this can write JSON; otherwise, false. Converts a to and from the ISO 8601 date format (e.g. 2008-04-12T12:53Z). Writes the JSON representation of the object. The to write to. The value. The calling serializer. Reads the JSON representation of the object. The to read from. Type of the object. The existing value of object being read. The calling serializer. The object value. Gets or sets the date time styles used when converting a date to and from JSON. The date time styles used when converting a date to and from JSON. Gets or sets the date time format used when converting a date to and from JSON. The date time format used when converting a date to and from JSON. Gets or sets the culture used when converting a date to and from JSON. The culture used when converting a date to and from JSON. Converts a to and from a JavaScript date constructor (e.g. new Date(52231943)). Writes the JSON representation of the object. The to write to. The value. The calling serializer. Reads the JSON representation of the object. The to read from. Type of the object. The existing property value of the JSON that is being converted. The calling serializer. The object value. Converts a to and from JSON. Writes the JSON representation of the object. The to write to. The value. The calling serializer. Reads the JSON representation of the object. The to read from. Type of the object. The existing value of object being read. The calling serializer. The object value. Determines whether this instance can convert the specified object type. Type of the object. true if this instance can convert the specified object type; otherwise, false. Converts a to and from JSON and BSON. Writes the JSON representation of the object. The to write to. The value. The calling serializer. Reads the JSON representation of the object. The to read from. Type of the object. The existing value of object being read. The calling serializer. The object value. Determines whether this instance can convert the specified object type. Type of the object. true if this instance can convert the specified object type; otherwise, false. Converts an to and from its name string value. Initializes a new instance of the class. Writes the JSON representation of the object. The to write to. The value. The calling serializer. Reads the JSON representation of the object. The to read from. Type of the object. The existing value of object being read. The calling serializer. The object value. Determines whether this instance can convert the specified object type. Type of the object. true if this instance can convert the specified object type; otherwise, false. Gets or sets a value indicating whether the written enum text should be camel case. true if the written enum text will be camel case; otherwise, false. Gets or sets a value indicating whether integer values are allowed. true if integers are allowed; otherwise, false. Converts a to and from a string (e.g. "1.2.3.4"). Writes the JSON representation of the object. The to write to. The value. The calling serializer. Reads the JSON representation of the object. The to read from. Type of the object. The existing property value of the JSON that is being converted. The calling serializer. The object value. Determines whether this instance can convert the specified object type. Type of the object. true if this instance can convert the specified object type; otherwise, false. Converts XML to and from JSON. Writes the JSON representation of the object. The to write to. The calling serializer. The value. Reads the JSON representation of the object. The to read from. Type of the object. The existing value of object being read. The calling serializer. The object value. Checks if the attributeName is a namespace attribute. Attribute name to test. The attribute name prefix if it has one, otherwise an empty string. True if attribute name is for a namespace attribute, otherwise false. Determines whether this instance can convert the specified value type. Type of the value. true if this instance can convert the specified value type; otherwise, false. Gets or sets the name of the root element to insert when deserializing to XML if the JSON structure has produces multiple root elements. The name of the deserialize root element. Gets or sets a flag to indicate whether to write the Json.NET array attribute. This attribute helps preserve arrays when converting the written XML back to JSON. true if the array attibute is written to the XML; otherwise, false. Gets or sets a value indicating whether to write the root JSON object. true if the JSON root object is omitted; otherwise, false. Specifies how floating point numbers, e.g. 1.0 and 9.9, are parsed when reading JSON text. Floating point numbers are parsed to . Floating point numbers are parsed to . Specifies how dates are formatted when writing JSON text. Dates are written in the ISO 8601 format, e.g. "2012-03-21T05:40Z". Dates are written in the Microsoft JSON format, e.g. "\/Date(1198908717056)\/". Specifies how date formatted strings, e.g. "\/Date(1198908717056)\/" and "2012-03-21T05:40Z", are parsed when reading JSON text. Date formatted strings are not parsed to a date type and are read as strings. Date formatted strings, e.g. "\/Date(1198908717056)\/" and "2012-03-21T05:40Z", are parsed to . Date formatted strings, e.g. "\/Date(1198908717056)\/" and "2012-03-21T05:40Z", are parsed to . Specifies how to treat the time value when converting between string and . Treat as local time. If the object represents a Coordinated Universal Time (UTC), it is converted to the local time. Treat as a UTC. If the object represents a local time, it is converted to a UTC. Treat as a local time if a is being converted to a string. If a string is being converted to , convert to a local time if a time zone is specified. Time zone information should be preserved when converting. Specifies default value handling options for the . Include members where the member value is the same as the member's default value when serializing objects. Included members are written to JSON. Has no effect when deserializing. Ignore members where the member value is the same as the member's default value when serializing objects so that is is not written to JSON. This option will ignore all default values (e.g. null for objects and nullable typesl; 0 for integers, decimals and floating point numbers; and false for booleans). The default value ignored can be changed by placing the on the property. Members with a default value but no JSON will be set to their default value when deserializing. Ignore members where the member value is the same as the member's default value when serializing objects and sets members to their default value when deserializing. Specifies float format handling options when writing special floating point numbers, e.g. , and with . Write special floating point values as strings in JSON, e.g. "NaN", "Infinity", "-Infinity". Write special floating point values as symbols in JSON, e.g. NaN, Infinity, -Infinity. Note that this will produce non-valid JSON. Write special floating point values as the property's default value in JSON, e.g. 0.0 for a property, null for a property. Specifies formatting options for the . No special formatting is applied. This is the default. Causes child objects to be indented according to the and settings. Provides an interface to enable a class to return line and position information. Gets a value indicating whether the class can return line information. true if LineNumber and LinePosition can be provided; otherwise, false. Gets the current line number. The current line number or 0 if no line information is available (for example, HasLineInfo returns false). Gets the current line position. The current line position or 0 if no line information is available (for example, HasLineInfo returns false). Instructs the how to serialize the collection. Instructs the how to serialize the object. Initializes a new instance of the class. Initializes a new instance of the class with the specified container Id. The container Id. Gets or sets the id. The id. Gets or sets the title. The title. Gets or sets the description. The description. Gets the collection's items converter. The collection's items converter. Gets or sets a value that indicates whether to preserve object references. true to keep object reference; otherwise, false. The default is false. Gets or sets a value that indicates whether to preserve collection's items references. true to keep collection's items object references; otherwise, false. The default is false. Gets or sets the reference loop handling used when serializing the collection's items. The reference loop handling. Gets or sets the type name handling used when serializing the collection's items. The type name handling. Initializes a new instance of the class. Initializes a new instance of the class with a flag indicating whether the array can contain null items A flag indicating whether the array can contain null items. Initializes a new instance of the class with the specified container Id. The container Id. Gets or sets a value indicating whether null items are allowed in the collection. true if null items are allowed in the collection; otherwise, false. Instructs the to use the specified constructor when deserializing that object. Provides methods for converting between common language runtime types and JSON types. Represents JavaScript's boolean value true as a string. This field is read-only. Represents JavaScript's boolean value false as a string. This field is read-only. Represents JavaScript's null as a string. This field is read-only. Represents JavaScript's undefined as a string. This field is read-only. Represents JavaScript's positive infinity as a string. This field is read-only. Represents JavaScript's negative infinity as a string. This field is read-only. Represents JavaScript's NaN as a string. This field is read-only. Converts the to its JSON string representation. The value to convert. A JSON string representation of the . Converts the to its JSON string representation using the specified. The value to convert. The format the date will be converted to. The time zone handling when the date is converted to a string. A JSON string representation of the . Converts the to its JSON string representation. The value to convert. A JSON string representation of the . Converts the to its JSON string representation using the specified. The value to convert. The format the date will be converted to. A JSON string representation of the . Converts the to its JSON string representation. The value to convert. A JSON string representation of the . Converts the to its JSON string representation. The value to convert. A JSON string representation of the . Converts the to its JSON string representation. The value to convert. A JSON string representation of the . Converts the to its JSON string representation. The value to convert. A JSON string representation of the . Converts the to its JSON string representation. The value to convert. A JSON string representation of the . Converts the to its JSON string representation. The value to convert. A JSON string representation of the . Converts the to its JSON string representation. The value to convert. A JSON string representation of the . Converts the to its JSON string representation. The value to convert. A JSON string representation of the . Converts the to its JSON string representation. The value to convert. A JSON string representation of the . Converts the to its JSON string representation. The value to convert. A JSON string representation of the . Converts the to its JSON string representation. The value to convert. A JSON string representation of the . Converts the to its JSON string representation. The value to convert. A JSON string representation of the . Converts the to its JSON string representation. The value to convert. A JSON string representation of the . Converts the to its JSON string representation. The value to convert. A JSON string representation of the . Converts the to its JSON string representation. The value to convert. A JSON string representation of the . Converts the to its JSON string representation. The value to convert. A JSON string representation of the . Converts the to its JSON string representation. The value to convert. A JSON string representation of the . Converts the to its JSON string representation. The value to convert. A JSON string representation of the . Converts the to its JSON string representation. The value to convert. The string delimiter character. A JSON string representation of the . Converts the to its JSON string representation. The value to convert. A JSON string representation of the . Serializes the specified object to a JSON string. The object to serialize. A JSON string representation of the object. Serializes the specified object to a JSON string using formatting. The object to serialize. Indicates how the output is formatted. A JSON string representation of the object. Serializes the specified object to a JSON string using a collection of . The object to serialize. A collection converters used while serializing. A JSON string representation of the object. Serializes the specified object to a JSON string using formatting and a collection of . The object to serialize. Indicates how the output is formatted. A collection converters used while serializing. A JSON string representation of the object. Serializes the specified object to a JSON string using . The object to serialize. The used to serialize the object. If this is null, default serialization settings will be is used. A JSON string representation of the object. Serializes the specified object to a JSON string using a type, formatting and . The object to serialize. The used to serialize the object. If this is null, default serialization settings will be is used. The type of the value being serialized. This parameter is used when is Auto to write out the type name if the type of the value does not match. Specifing the type is optional. A JSON string representation of the object. Serializes the specified object to a JSON string using formatting and . The object to serialize. Indicates how the output is formatted. The used to serialize the object. If this is null, default serialization settings will be is used. A JSON string representation of the object. Serializes the specified object to a JSON string using a type, formatting and . The object to serialize. Indicates how the output is formatted. The used to serialize the object. If this is null, default serialization settings will be is used. The type of the value being serialized. This parameter is used when is Auto to write out the type name if the type of the value does not match. Specifing the type is optional. A JSON string representation of the object. Asynchronously serializes the specified object to a JSON string. Serialization will happen on a new thread. The object to serialize. A task that represents the asynchronous serialize operation. The value of the TResult parameter contains a JSON string representation of the object. Asynchronously serializes the specified object to a JSON string using formatting. Serialization will happen on a new thread. The object to serialize. Indicates how the output is formatted. A task that represents the asynchronous serialize operation. The value of the TResult parameter contains a JSON string representation of the object. Asynchronously serializes the specified object to a JSON string using formatting and a collection of . Serialization will happen on a new thread. The object to serialize. Indicates how the output is formatted. The used to serialize the object. If this is null, default serialization settings will be is used. A task that represents the asynchronous serialize operation. The value of the TResult parameter contains a JSON string representation of the object. Deserializes the JSON to a .NET object. The JSON to deserialize. The deserialized object from the Json string. Deserializes the JSON to a .NET object using . The JSON to deserialize. The used to deserialize the object. If this is null, default serialization settings will be is used. The deserialized object from the JSON string. Deserializes the JSON to the specified .NET type. The JSON to deserialize. The of object being deserialized. The deserialized object from the Json string. Deserializes the JSON to the specified .NET type. The type of the object to deserialize to. The JSON to deserialize. The deserialized object from the Json string. Deserializes the JSON to the given anonymous type. The anonymous type to deserialize to. This can't be specified traditionally and must be infered from the anonymous type passed as a parameter. The JSON to deserialize. The anonymous type object. The deserialized anonymous type from the JSON string. Deserializes the JSON to the given anonymous type using . The anonymous type to deserialize to. This can't be specified traditionally and must be infered from the anonymous type passed as a parameter. The JSON to deserialize. The anonymous type object. The used to deserialize the object. If this is null, default serialization settings will be is used. The deserialized anonymous type from the JSON string. Deserializes the JSON to the specified .NET type using a collection of . The type of the object to deserialize to. The JSON to deserialize. Converters to use while deserializing. The deserialized object from the JSON string. Deserializes the JSON to the specified .NET type using . The type of the object to deserialize to. The object to deserialize. The used to deserialize the object. If this is null, default serialization settings will be is used. The deserialized object from the JSON string. Deserializes the JSON to the specified .NET type using a collection of . The JSON to deserialize. The type of the object to deserialize. Converters to use while deserializing. The deserialized object from the JSON string. Deserializes the JSON to the specified .NET type using . The JSON to deserialize. The type of the object to deserialize to. The used to deserialize the object. If this is null, default serialization settings will be is used. The deserialized object from the JSON string. Asynchronously deserializes the JSON to the specified .NET type. Deserialization will happen on a new thread. The type of the object to deserialize to. The JSON to deserialize. A task that represents the asynchronous deserialize operation. The value of the TResult parameter contains the deserialized object from the JSON string. Asynchronously deserializes the JSON to the specified .NET type using . Deserialization will happen on a new thread. The type of the object to deserialize to. The JSON to deserialize. The used to deserialize the object. If this is null, default serialization settings will be is used. A task that represents the asynchronous deserialize operation. The value of the TResult parameter contains the deserialized object from the JSON string. Asynchronously deserializes the JSON to the specified .NET type. Deserialization will happen on a new thread. The JSON to deserialize. A task that represents the asynchronous deserialize operation. The value of the TResult parameter contains the deserialized object from the JSON string. Asynchronously deserializes the JSON to the specified .NET type using . Deserialization will happen on a new thread. The JSON to deserialize. The type of the object to deserialize to. The used to deserialize the object. If this is null, default serialization settings will be is used. A task that represents the asynchronous deserialize operation. The value of the TResult parameter contains the deserialized object from the JSON string. Populates the object with values from the JSON string. The JSON to populate values from. The target object to populate values onto. Populates the object with values from the JSON string using . The JSON to populate values from. The target object to populate values onto. The used to deserialize the object. If this is null, default serialization settings will be is used. Asynchronously populates the object with values from the JSON string using . The JSON to populate values from. The target object to populate values onto. The used to deserialize the object. If this is null, default serialization settings will be is used. A task that represents the asynchronous populate operation. Serializes the XML node to a JSON string. The node to serialize. A JSON string of the XmlNode. Serializes the XML node to a JSON string using formatting. The node to serialize. Indicates how the output is formatted. A JSON string of the XmlNode. Serializes the XML node to a JSON string using formatting and omits the root object if is true. The node to serialize. Indicates how the output is formatted. Omits writing the root object. A JSON string of the XmlNode. Deserializes the XmlNode from a JSON string. The JSON string. The deserialized XmlNode Deserializes the XmlNode from a JSON string nested in a root elment specified by . The JSON string. The name of the root element to append when deserializing. The deserialized XmlNode Deserializes the XmlNode from a JSON string nested in a root elment specified by and writes a .NET array attribute for collections. The JSON string. The name of the root element to append when deserializing. A flag to indicate whether to write the Json.NET array attribute. This attribute helps preserve arrays when converting the written XML back to JSON. The deserialized XmlNode Serializes the to a JSON string. The node to convert to JSON. A JSON string of the XNode. Serializes the to a JSON string using formatting. The node to convert to JSON. Indicates how the output is formatted. A JSON string of the XNode. Serializes the to a JSON string using formatting and omits the root object if is true. The node to serialize. Indicates how the output is formatted. Omits writing the root object. A JSON string of the XNode. Deserializes the from a JSON string. The JSON string. The deserialized XNode Deserializes the from a JSON string nested in a root elment specified by . The JSON string. The name of the root element to append when deserializing. The deserialized XNode Deserializes the from a JSON string nested in a root elment specified by and writes a .NET array attribute for collections. The JSON string. The name of the root element to append when deserializing. A flag to indicate whether to write the Json.NET array attribute. This attribute helps preserve arrays when converting the written XML back to JSON. The deserialized XNode Gets or sets a function that creates default . Default settings are automatically used by serialization methods on , and and on . To serialize without using any default settings create a with . Instructs the to use the specified when serializing the member or class. Initializes a new instance of the class. Type of the converter. Gets the type of the converter. The type of the converter. Represents a collection of . Instructs the how to serialize the collection. Initializes a new instance of the class. Initializes a new instance of the class with the specified container Id. The container Id. The exception thrown when an error occurs during Json serialization or deserialization. Initializes a new instance of the class. Initializes a new instance of the class with a specified error message. The error message that explains the reason for the exception. Initializes a new instance of the class with a specified error message and a reference to the inner exception that is the cause of this exception. The error message that explains the reason for the exception. The exception that is the cause of the current exception, or a null reference (Nothing in Visual Basic) if no inner exception is specified. Initializes a new instance of the class. The that holds the serialized object data about the exception being thrown. The that contains contextual information about the source or destination. The parameter is null. The class name is null or is zero (0). Instructs the to deserialize properties with no matching class member into the specified collection and write values during serialization. Initializes a new instance of the class. Gets or sets a value that indicates whether to write extension data when serializing the object. true to write extension data when serializing the object; otherwise, false. The default is true. Gets or sets a value that indicates whether to read extension data when deserializing the object. true to read extension data when deserializing the object; otherwise, false. The default is true. Instructs the not to serialize the public field or public read/write property value. Instructs the how to serialize the object. Initializes a new instance of the class. Initializes a new instance of the class with the specified member serialization. The member serialization. Initializes a new instance of the class with the specified container Id. The container Id. Gets or sets the member serialization. The member serialization. Gets or sets a value that indicates whether the object's properties are required. A value indicating whether the object's properties are required. Instructs the to always serialize the member with the specified name. Initializes a new instance of the class. Initializes a new instance of the class with the specified name. Name of the property. Gets or sets the converter used when serializing the property's collection items. The collection's items converter. Gets or sets the null value handling used when serializing this property. The null value handling. Gets or sets the default value handling used when serializing this property. The default value handling. Gets or sets the reference loop handling used when serializing this property. The reference loop handling. Gets or sets the object creation handling used when deserializing this property. The object creation handling. Gets or sets the type name handling used when serializing this property. The type name handling. Gets or sets whether this property's value is serialized as a reference. Whether this property's value is serialized as a reference. Gets or sets the order of serialization and deserialization of a member. The numeric order of serialization or deserialization. Gets or sets a value indicating whether this property is required. A value indicating whether this property is required. Gets or sets the name of the property. The name of the property. Gets or sets the the reference loop handling used when serializing the property's collection items. The collection's items reference loop handling. Gets or sets the the type name handling used when serializing the property's collection items. The collection's items type name handling. Gets or sets whether this property's collection items are serialized as a reference. Whether this property's collection items are serialized as a reference. The exception thrown when an error occurs while reading Json text. Initializes a new instance of the class. Initializes a new instance of the class with a specified error message. The error message that explains the reason for the exception. Initializes a new instance of the class with a specified error message and a reference to the inner exception that is the cause of this exception. The error message that explains the reason for the exception. The exception that is the cause of the current exception, or a null reference (Nothing in Visual Basic) if no inner exception is specified. Initializes a new instance of the class. The that holds the serialized object data about the exception being thrown. The that contains contextual information about the source or destination. The parameter is null. The class name is null or is zero (0). Gets the line number indicating where the error occurred. The line number indicating where the error occurred. Gets the line position indicating where the error occurred. The line position indicating where the error occurred. Gets the path to the JSON where the error occurred. The path to the JSON where the error occurred. The exception thrown when an error occurs during Json serialization or deserialization. Initializes a new instance of the class. Initializes a new instance of the class with a specified error message. The error message that explains the reason for the exception. Initializes a new instance of the class with a specified error message and a reference to the inner exception that is the cause of this exception. The error message that explains the reason for the exception. The exception that is the cause of the current exception, or a null reference (Nothing in Visual Basic) if no inner exception is specified. Initializes a new instance of the class. The that holds the serialized object data about the exception being thrown. The that contains contextual information about the source or destination. The parameter is null. The class name is null or is zero (0). Serializes and deserializes objects into and from the JSON format. The enables you to control how objects are encoded into JSON. Initializes a new instance of the class. Creates a new instance. The will not use default settings. A new instance. The will not use default settings. Creates a new instance using the specified . The will not use default settings. The settings to be applied to the . A new instance using the specified . The will not use default settings. Creates a new instance. The will use default settings. A new instance. The will use default settings. Creates a new instance using the specified . The will use default settings. The settings to be applied to the . A new instance using the specified . The will use default settings. Populates the JSON values onto the target object. The that contains the JSON structure to reader values from. The target object to populate values onto. Populates the JSON values onto the target object. The that contains the JSON structure to reader values from. The target object to populate values onto. Deserializes the Json structure contained by the specified . The that contains the JSON structure to deserialize. The being deserialized. Deserializes the Json structure contained by the specified into an instance of the specified type. The containing the object. The of object being deserialized. The instance of being deserialized. Deserializes the Json structure contained by the specified into an instance of the specified type. The containing the object. The type of the object to deserialize. The instance of being deserialized. Deserializes the Json structure contained by the specified into an instance of the specified type. The containing the object. The of object being deserialized. The instance of being deserialized. Serializes the specified and writes the Json structure to a Stream using the specified . The used to write the Json structure. The to serialize. Serializes the specified and writes the Json structure to a Stream using the specified . The used to write the Json structure. The to serialize. The type of the value being serialized. This parameter is used when is Auto to write out the type name if the type of the value does not match. Specifing the type is optional. Serializes the specified and writes the Json structure to a Stream using the specified . The used to write the Json structure. The to serialize. The type of the value being serialized. This parameter is used when is Auto to write out the type name if the type of the value does not match. Specifing the type is optional. Serializes the specified and writes the Json structure to a Stream using the specified . The used to write the Json structure. The to serialize. Occurs when the errors during serialization and deserialization. Gets or sets the used by the serializer when resolving references. Gets or sets the used by the serializer when resolving type names. Gets or sets the used by the serializer when writing trace messages. The trace writer. Gets or sets how type name writing and reading is handled by the serializer. Gets or sets how a type name assembly is written and resolved by the serializer. The type name assembly format. Gets or sets how object references are preserved by the serializer. Get or set how reference loops (e.g. a class referencing itself) is handled. Get or set how missing members (e.g. JSON contains a property that isn't a member on the object) are handled during deserialization. Get or set how null values are handled during serialization and deserialization. Get or set how null default are handled during serialization and deserialization. Gets or sets how objects are created during deserialization. The object creation handling. Gets or sets how constructors are used during deserialization. The constructor handling. Gets a collection that will be used during serialization. Collection that will be used during serialization. Gets or sets the contract resolver used by the serializer when serializing .NET objects to JSON and vice versa. Gets or sets the used by the serializer when invoking serialization callback methods. The context. Indicates how JSON text output is formatted. Get or set how dates are written to JSON text. Get or set how time zones are handling during serialization and deserialization. Get or set how date formatted strings, e.g. "\/Date(1198908717056)\/" and "2012-03-21T05:40Z", are parsed when reading JSON. Get or set how floating point numbers, e.g. 1.0 and 9.9, are parsed when reading JSON text. Get or set how special floating point numbers, e.g. , and , are written as JSON text. Get or set how strings are escaped when writing JSON text. Get or set how and values are formatting when writing JSON text. Gets or sets the culture used when reading JSON. Defaults to . Gets or sets the maximum depth allowed when reading JSON. Reading past this depth will throw a . Gets a value indicating whether there will be a check for additional JSON content after deserializing an object. true if there will be a check for additional JSON content after deserializing an object; otherwise, false. Specifies the settings on a object. Initializes a new instance of the class. Gets or sets how reference loops (e.g. a class referencing itself) is handled. Reference loop handling. Gets or sets how missing members (e.g. JSON contains a property that isn't a member on the object) are handled during deserialization. Missing member handling. Gets or sets how objects are created during deserialization. The object creation handling. Gets or sets how null values are handled during serialization and deserialization. Null value handling. Gets or sets how null default are handled during serialization and deserialization. The default value handling. Gets or sets a collection that will be used during serialization. The converters. Gets or sets how object references are preserved by the serializer. The preserve references handling. Gets or sets how type name writing and reading is handled by the serializer. The type name handling. Gets or sets how a type name assembly is written and resolved by the serializer. The type name assembly format. Gets or sets how constructors are used during deserialization. The constructor handling. Gets or sets the contract resolver used by the serializer when serializing .NET objects to JSON and vice versa. The contract resolver. Gets or sets the used by the serializer when resolving references. The reference resolver. Gets or sets the used by the serializer when writing trace messages. The trace writer. Gets or sets the used by the serializer when resolving type names. The binder. Gets or sets the error handler called during serialization and deserialization. The error handler called during serialization and deserialization. Gets or sets the used by the serializer when invoking serialization callback methods. The context. Get or set how and values are formatting when writing JSON text. Gets or sets the maximum depth allowed when reading JSON. Reading past this depth will throw a . Indicates how JSON text output is formatted. Get or set how dates are written to JSON text. Get or set how time zones are handling during serialization and deserialization. Get or set how date formatted strings, e.g. "\/Date(1198908717056)\/" and "2012-03-21T05:40Z", are parsed when reading JSON. Get or set how special floating point numbers, e.g. , and , are written as JSON. Get or set how floating point numbers, e.g. 1.0 and 9.9, are parsed when reading JSON text. Get or set how strings are escaped when writing JSON text. Gets or sets the culture used when reading JSON. Defaults to . Gets a value indicating whether there will be a check for additional content after deserializing an object. true if there will be a check for additional content after deserializing an object; otherwise, false. Represents a reader that provides fast, non-cached, forward-only access to JSON text data. Initializes a new instance of the class with the specified . The TextReader containing the XML data to read. Reads the next JSON token from the stream. true if the next token was read successfully; false if there are no more tokens to read. Reads the next JSON token from the stream as a . A or a null reference if the next JSON token is null. This method will return null at the end of an array. Reads the next JSON token from the stream as a . A . This method will return null at the end of an array. Reads the next JSON token from the stream as a . A . This method will return null at the end of an array. Reads the next JSON token from the stream as a . A . This method will return null at the end of an array. Reads the next JSON token from the stream as a . A . This method will return null at the end of an array. Reads the next JSON token from the stream as a . A . This method will return null at the end of an array. Changes the state to closed. Gets a value indicating whether the class can return line information. true if LineNumber and LinePosition can be provided; otherwise, false. Gets the current line number. The current line number or 0 if no line information is available (for example, HasLineInfo returns false). Gets the current line position. The current line position or 0 if no line information is available (for example, HasLineInfo returns false). Represents a writer that provides a fast, non-cached, forward-only way of generating Json data. Creates an instance of the JsonWriter class using the specified . The TextWriter to write to. Flushes whatever is in the buffer to the underlying streams and also flushes the underlying stream. Closes this stream and the underlying stream. Writes the beginning of a Json object. Writes the beginning of a Json array. Writes the start of a constructor with the given name. The name of the constructor. Writes the specified end token. The end token to write. Writes the property name of a name/value pair on a Json object. The name of the property. Writes the property name of a name/value pair on a JSON object. The name of the property. A flag to indicate whether the text should be escaped when it is written as a JSON property name. Writes indent characters. Writes the JSON value delimiter. Writes an indent space. Writes a value. An error will raised if the value cannot be written as a single JSON token. The value to write. Writes a null value. Writes an undefined value. Writes raw JSON. The raw JSON to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes out a comment /*...*/ containing the specified text. Text to place inside the comment. Writes out the given white space. The string of white space characters. Gets or sets how many IndentChars to write for each level in the hierarchy when is set to Formatting.Indented. Gets or sets which character to use to quote attribute values. Gets or sets which character to use for indenting when is set to Formatting.Indented. Gets or sets a value indicating whether object names will be surrounded with quotes. Specifies the type of Json token. This is returned by the if a method has not been called. An object start token. An array start token. A constructor start token. An object property name. A comment. Raw JSON. An integer. A float. A string. A boolean. A null token. An undefined token. An object end token. An array end token. A constructor end token. A Date. Byte data. Represents a reader that provides validation. Initializes a new instance of the class that validates the content returned from the given . The to read from while validating. Reads the next JSON token from the stream as a . A . Reads the next JSON token from the stream as a . A or a null reference if the next JSON token is null. Reads the next JSON token from the stream as a . A . Reads the next JSON token from the stream as a . A . This method will return null at the end of an array. Reads the next JSON token from the stream as a . A . This method will return null at the end of an array. Reads the next JSON token from the stream as a . A . Reads the next JSON token from the stream. true if the next token was read successfully; false if there are no more tokens to read. Sets an event handler for receiving schema validation errors. Gets the text value of the current JSON token. Gets the depth of the current token in the JSON document. The depth of the current token in the JSON document. Gets the path of the current JSON token. Gets the quotation mark character used to enclose the value of a string. Gets the type of the current JSON token. Gets the Common Language Runtime (CLR) type for the current JSON token. Gets or sets the schema. The schema. Gets the used to construct this . The specified in the constructor. The exception thrown when an error occurs while reading Json text. Initializes a new instance of the class. Initializes a new instance of the class with a specified error message. The error message that explains the reason for the exception. Initializes a new instance of the class with a specified error message and a reference to the inner exception that is the cause of this exception. The error message that explains the reason for the exception. The exception that is the cause of the current exception, or a null reference (Nothing in Visual Basic) if no inner exception is specified. Initializes a new instance of the class. The that holds the serialized object data about the exception being thrown. The that contains contextual information about the source or destination. The parameter is null. The class name is null or is zero (0). Gets the path to the JSON where the error occurred. The path to the JSON where the error occurred. Contains the LINQ to JSON extension methods. Returns a collection of tokens that contains the ancestors of every token in the source collection. The type of the objects in source, constrained to . An of that contains the source collection. An of that contains the ancestors of every node in the source collection. Returns a collection of tokens that contains the descendants of every token in the source collection. The type of the objects in source, constrained to . An of that contains the source collection. An of that contains the descendants of every node in the source collection. Returns a collection of child properties of every object in the source collection. An of that contains the source collection. An of that contains the properties of every object in the source collection. Returns a collection of child values of every object in the source collection with the given key. An of that contains the source collection. The token key. An of that contains the values of every node in the source collection with the given key. Returns a collection of child values of every object in the source collection. An of that contains the source collection. An of that contains the values of every node in the source collection. Returns a collection of converted child values of every object in the source collection with the given key. The type to convert the values to. An of that contains the source collection. The token key. An that contains the converted values of every node in the source collection with the given key. Returns a collection of converted child values of every object in the source collection. The type to convert the values to. An of that contains the source collection. An that contains the converted values of every node in the source collection. Converts the value. The type to convert the value to. A cast as a of . A converted value. Converts the value. The source collection type. The type to convert the value to. A cast as a of . A converted value. Returns a collection of child tokens of every array in the source collection. The source collection type. An of that contains the source collection. An of that contains the values of every node in the source collection. Returns a collection of converted child tokens of every array in the source collection. An of that contains the source collection. The type to convert the values to. The source collection type. An that contains the converted values of every node in the source collection. Returns the input typed as . An of that contains the source collection. The input typed as . Returns the input typed as . The source collection type. An of that contains the source collection. The input typed as . Represents a collection of objects. The type of token Gets the with the specified key. Represents a JSON array. Represents a token that can contain other tokens. Represents an abstract JSON token. Compares the values of two tokens, including the values of all descendant tokens. The first to compare. The second to compare. true if the tokens are equal; otherwise false. Adds the specified content immediately after this token. A content object that contains simple content or a collection of content objects to be added after this token. Adds the specified content immediately before this token. A content object that contains simple content or a collection of content objects to be added before this token. Returns a collection of the ancestor tokens of this token. A collection of the ancestor tokens of this token. Returns a collection of the sibling tokens after this token, in document order. A collection of the sibling tokens after this tokens, in document order. Returns a collection of the sibling tokens before this token, in document order. A collection of the sibling tokens before this token, in document order. Gets the with the specified key converted to the specified type. The type to convert the token to. The token key. The converted token value. Returns a collection of the child tokens of this token, in document order. An of containing the child tokens of this , in document order. Returns a collection of the child tokens of this token, in document order, filtered by the specified type. The type to filter the child tokens on. A containing the child tokens of this , in document order. Returns a collection of the child values of this token, in document order. The type to convert the values to. A containing the child values of this , in document order. Removes this token from its parent. Replaces this token with the specified token. The value. Writes this token to a . A into which this method will write. A collection of which will be used when writing the token. Returns the indented JSON for this token. The indented JSON for this token. Returns the JSON for this token using the given formatting and converters. Indicates how the output is formatted. A collection of which will be used when writing the token. The JSON for this token using the given formatting and converters. Performs an explicit conversion from to . The value. The result of the conversion. Performs an explicit conversion from to . The value. The result of the conversion. Performs an explicit conversion from to . The value. The result of the conversion. Performs an explicit conversion from to . The value. The result of the conversion. Performs an explicit conversion from to . The value. The result of the conversion. Performs an explicit conversion from to . The value. The result of the conversion. Performs an explicit conversion from to . The value. The result of the conversion. Performs an explicit conversion from to . The value. The result of the conversion. Performs an explicit conversion from to . The value. The result of the conversion. Performs an explicit conversion from to . The value. The result of the conversion. Performs an explicit conversion from to . The value. The result of the conversion. Performs an explicit conversion from to . The value. The result of the conversion. Performs an explicit conversion from to . The value. The result of the conversion. Performs an explicit conversion from to . The value. The result of the conversion. Performs an explicit conversion from to . The value. The result of the conversion. Performs an explicit conversion from to . The value. The result of the conversion. Performs an explicit conversion from to . The value. The result of the conversion. Performs an explicit conversion from to . The value. The result of the conversion. Performs an explicit conversion from to . The value. The result of the conversion. Performs an explicit conversion from to . The value. The result of the conversion. Performs an explicit conversion from to . The value. The result of the conversion. Performs an explicit conversion from to . The value. The result of the conversion. Performs an explicit conversion from to . The value. The result of the conversion. Performs an explicit conversion from to . The value. The result of the conversion. Performs an explicit conversion from to . The value. The result of the conversion. Performs an explicit conversion from to . The value. The result of the conversion. Performs an explicit conversion from to . The value. The result of the conversion. Performs an explicit conversion from to . The value. The result of the conversion. Performs an explicit conversion from to . The value. The result of the conversion. Performs an explicit conversion from to . The value. The result of the conversion. Performs an explicit conversion from to . The value. The result of the conversion. Performs an explicit conversion from to . The value. The result of the conversion. Performs an explicit conversion from to . The value. The result of the conversion. Performs an explicit conversion from to . The value. The result of the conversion. Performs an explicit conversion from to . The value. The result of the conversion. Performs an explicit conversion from to . The value. The result of the conversion. Performs an explicit conversion from to . The value. The result of the conversion. Performs an implicit conversion from to . The value to create a from. The initialized with the specified value. Performs an implicit conversion from to . The value to create a from. The initialized with the specified value. Performs an implicit conversion from to . The value to create a from. The initialized with the specified value. Performs an implicit conversion from to . The value to create a from. The initialized with the specified value. Performs an implicit conversion from to . The value to create a from. The initialized with the specified value. Performs an implicit conversion from to . The value to create a from. The initialized with the specified value. Performs an implicit conversion from to . The value to create a from. The initialized with the specified value. Performs an implicit conversion from to . The value to create a from. The initialized with the specified value. Performs an implicit conversion from to . The value to create a from. The initialized with the specified value. Performs an implicit conversion from to . The value to create a from. The initialized with the specified value. Performs an implicit conversion from to . The value to create a from. The initialized with the specified value. Performs an implicit conversion from to . The value to create a from. The initialized with the specified value. Performs an implicit conversion from to . The value to create a from. The initialized with the specified value. Performs an implicit conversion from to . The value to create a from. The initialized with the specified value. Performs an implicit conversion from to . The value to create a from. The initialized with the specified value. Performs an implicit conversion from to . The value to create a from. The initialized with the specified value. Performs an implicit conversion from to . The value to create a from. The initialized with the specified value. Performs an implicit conversion from to . The value to create a from. The initialized with the specified value. Performs an implicit conversion from to . The value to create a from. The initialized with the specified value. Performs an implicit conversion from to . The value to create a from. The initialized with the specified value. Performs an implicit conversion from to . The value to create a from. The initialized with the specified value. Performs an implicit conversion from to . The value to create a from. The initialized with the specified value. Performs an implicit conversion from to . The value to create a from. The initialized with the specified value. Performs an implicit conversion from to . The value to create a from. The initialized with the specified value. Performs an implicit conversion from to . The value to create a from. The initialized with the specified value. Performs an implicit conversion from to . The value to create a from. The initialized with the specified value. Performs an implicit conversion from to . The value to create a from. The initialized with the specified value. Performs an implicit conversion from to . The value to create a from. The initialized with the specified value. Performs an implicit conversion from to . The value to create a from. The initialized with the specified value. Performs an implicit conversion from to . The value to create a from. The initialized with the specified value. Performs an implicit conversion from to . The value to create a from. The initialized with the specified value. Performs an implicit conversion from to . The value to create a from. The initialized with the specified value. Performs an implicit conversion from to . The value to create a from. The initialized with the specified value. Performs an implicit conversion from to . The value to create a from. The initialized with the specified value. Performs an implicit conversion from to . The value to create a from. The initialized with the specified value. Creates an for this token. An that can be used to read this token and its descendants. Creates a from an object. The object that will be used to create . A with the value of the specified object Creates a from an object using the specified . The object that will be used to create . The that will be used when reading the object. A with the value of the specified object Creates the specified .NET type from the . The object type that the token will be deserialized to. The new object created from the JSON value. Creates the specified .NET type from the . The object type that the token will be deserialized to. The new object created from the JSON value. Creates the specified .NET type from the using the specified . The object type that the token will be deserialized to. The that will be used when creating the object. The new object created from the JSON value. Creates the specified .NET type from the using the specified . The object type that the token will be deserialized to. The that will be used when creating the object. The new object created from the JSON value. Creates a from a . An positioned at the token to read into this . An that contains the token and its descendant tokens that were read from the reader. The runtime type of the token is determined by the token type of the first token encountered in the reader. Load a from a string that contains JSON. A that contains JSON. A populated from the string that contains JSON. Creates a from a . An positioned at the token to read into this . An that contains the token and its descendant tokens that were read from the reader. The runtime type of the token is determined by the token type of the first token encountered in the reader. Selects a using a JPath expression. Selects the token that matches the object path. A that contains a JPath expression. A , or null. Selects a using a JPath expression. Selects the token that matches the object path. A that contains a JPath expression. A flag to indicate whether an error should be thrown if no tokens are found when evaluating part of the expression. A . Selects a collection of elements using a JPath expression. A that contains a JPath expression. An that contains the selected elements. Selects a collection of elements using a JPath expression. A that contains a JPath expression. A flag to indicate whether an error should be thrown if no tokens are found when evaluating part of the expression. An that contains the selected elements. Returns the responsible for binding operations performed on this object. The expression tree representation of the runtime value. The to bind this object. Returns the responsible for binding operations performed on this object. The expression tree representation of the runtime value. The to bind this object. Creates a new instance of the . All child tokens are recursively cloned. A new instance of the . Gets a comparer that can compare two tokens for value equality. A that can compare two nodes for value equality. Gets or sets the parent. The parent. Gets the root of this . The root of this . Gets the node type for this . The type. Gets a value indicating whether this token has child tokens. true if this token has child values; otherwise, false. Gets the next sibling token of this node. The that contains the next sibling token. Gets the previous sibling token of this node. The that contains the previous sibling token. Gets the path of the JSON token. Gets the with the specified key. The with the specified key. Get the first child token of this token. A containing the first child token of the . Get the last child token of this token. A containing the last child token of the . Raises the event. The instance containing the event data. Raises the event. The instance containing the event data. Raises the event. The instance containing the event data. Returns a collection of the child tokens of this token, in document order. An of containing the child tokens of this , in document order. Returns a collection of the child values of this token, in document order. The type to convert the values to. A containing the child values of this , in document order. Returns a collection of the descendant tokens for this token in document order. An containing the descendant tokens of the . Adds the specified content as children of this . The content to be added. Adds the specified content as the first children of this . The content to be added. Creates an that can be used to add tokens to the . An that is ready to have content written to it. Replaces the children nodes of this token with the specified content. The content. Removes the child nodes from this token. Occurs when the list changes or an item in the list changes. Occurs before an item is added to the collection. Occurs when the items list of the collection has changed, or the collection is reset. Gets the container's children tokens. The container's children tokens. Gets a value indicating whether this token has child tokens. true if this token has child values; otherwise, false. Get the first child token of this token. A containing the first child token of the . Get the last child token of this token. A containing the last child token of the . Gets the count of child JSON tokens. The count of child JSON tokens Initializes a new instance of the class. Initializes a new instance of the class from another object. A object to copy from. Initializes a new instance of the class with the specified content. The contents of the array. Initializes a new instance of the class with the specified content. The contents of the array. Loads an from a . A that will be read for the content of the . A that contains the JSON that was read from the specified . Load a from a string that contains JSON. A that contains JSON. A populated from the string that contains JSON. Creates a from an object. The object that will be used to create . A with the values of the specified object Creates a from an object. The object that will be used to create . The that will be used to read the object. A with the values of the specified object Writes this token to a . A into which this method will write. A collection of which will be used when writing the token. Determines the index of a specific item in the . The object to locate in the . The index of if found in the list; otherwise, -1. Inserts an item to the at the specified index. The zero-based index at which should be inserted. The object to insert into the . is not a valid index in the . The is read-only. Removes the item at the specified index. The zero-based index of the item to remove. is not a valid index in the . The is read-only. Returns an enumerator that iterates through the collection. A that can be used to iterate through the collection. Adds an item to the . The object to add to the . The is read-only. Removes all items from the . The is read-only. Determines whether the contains a specific value. The object to locate in the . true if is found in the ; otherwise, false. Copies to. The array. Index of the array. Removes the first occurrence of a specific object from the . The object to remove from the . true if was successfully removed from the ; otherwise, false. This method also returns false if is not found in the original . The is read-only. Gets the container's children tokens. The container's children tokens. Gets the node type for this . The type. Gets the with the specified key. The with the specified key. Gets or sets the at the specified index. Gets a value indicating whether the is read-only. true if the is read-only; otherwise, false. Represents a JSON constructor. Initializes a new instance of the class. Initializes a new instance of the class from another object. A object to copy from. Initializes a new instance of the class with the specified name and content. The constructor name. The contents of the constructor. Initializes a new instance of the class with the specified name and content. The constructor name. The contents of the constructor. Initializes a new instance of the class with the specified name. The constructor name. Writes this token to a . A into which this method will write. A collection of which will be used when writing the token. Loads an from a . A that will be read for the content of the . A that contains the JSON that was read from the specified . Gets the container's children tokens. The container's children tokens. Gets or sets the name of this constructor. The constructor name. Gets the node type for this . The type. Gets the with the specified key. The with the specified key. Represents a collection of objects. The type of token An empty collection of objects. Initializes a new instance of the struct. The enumerable. Returns an enumerator that iterates through the collection. A that can be used to iterate through the collection. Returns an enumerator that iterates through a collection. An object that can be used to iterate through the collection. Determines whether the specified is equal to this instance. The to compare with this instance. true if the specified is equal to this instance; otherwise, false. Returns a hash code for this instance. A hash code for this instance, suitable for use in hashing algorithms and data structures like a hash table. Gets the with the specified key. Represents a JSON object. Initializes a new instance of the class. Initializes a new instance of the class from another object. A object to copy from. Initializes a new instance of the class with the specified content. The contents of the object. Initializes a new instance of the class with the specified content. The contents of the object. Gets an of this object's properties. An of this object's properties. Gets a the specified name. The property name. A with the specified name or null. Gets an of this object's property values. An of this object's property values. Loads an from a . A that will be read for the content of the . A that contains the JSON that was read from the specified . Load a from a string that contains JSON. A that contains JSON. A populated from the string that contains JSON. Creates a from an object. The object that will be used to create . A with the values of the specified object Creates a from an object. The object that will be used to create . The that will be used to read the object. A with the values of the specified object Writes this token to a . A into which this method will write. A collection of which will be used when writing the token. Gets the with the specified property name. Name of the property. The with the specified property name. Gets the with the specified property name. The exact property name will be searched for first and if no matching property is found then the will be used to match a property. Name of the property. One of the enumeration values that specifies how the strings will be compared. The with the specified property name. Tries to get the with the specified property name. The exact property name will be searched for first and if no matching property is found then the will be used to match a property. Name of the property. The value. One of the enumeration values that specifies how the strings will be compared. true if a value was successfully retrieved; otherwise, false. Adds the specified property name. Name of the property. The value. Removes the property with the specified name. Name of the property. true if item was successfully removed; otherwise, false. Tries the get value. Name of the property. The value. true if a value was successfully retrieved; otherwise, false. Returns an enumerator that iterates through the collection. A that can be used to iterate through the collection. Raises the event with the provided arguments. Name of the property. Raises the event with the provided arguments. Name of the property. Returns the properties for this instance of a component. A that represents the properties for this component instance. Returns the properties for this instance of a component using the attribute array as a filter. An array of type that is used as a filter. A that represents the filtered properties for this component instance. Returns a collection of custom attributes for this instance of a component. An containing the attributes for this object. Returns the class name of this instance of a component. The class name of the object, or null if the class does not have a name. Returns the name of this instance of a component. The name of the object, or null if the object does not have a name. Returns a type converter for this instance of a component. A that is the converter for this object, or null if there is no for this object. Returns the default event for this instance of a component. An that represents the default event for this object, or null if this object does not have events. Returns the default property for this instance of a component. A that represents the default property for this object, or null if this object does not have properties. Returns an editor of the specified type for this instance of a component. A that represents the editor for this object. An of the specified type that is the editor for this object, or null if the editor cannot be found. Returns the events for this instance of a component using the specified attribute array as a filter. An array of type that is used as a filter. An that represents the filtered events for this component instance. Returns the events for this instance of a component. An that represents the events for this component instance. Returns an object that contains the property described by the specified property descriptor. A that represents the property whose owner is to be found. An that represents the owner of the specified property. Returns the responsible for binding operations performed on this object. The expression tree representation of the runtime value. The to bind this object. Gets the container's children tokens. The container's children tokens. Occurs when a property value changes. Occurs when a property value is changing. Gets the node type for this . The type. Gets the with the specified key. The with the specified key. Gets or sets the with the specified property name. Represents a JSON property. Initializes a new instance of the class from another object. A object to copy from. Initializes a new instance of the class. The property name. The property content. Initializes a new instance of the class. The property name. The property content. Writes this token to a . A into which this method will write. A collection of which will be used when writing the token. Loads an from a . A that will be read for the content of the . A that contains the JSON that was read from the specified . Gets the container's children tokens. The container's children tokens. Gets the property name. The property name. Gets or sets the property value. The property value. Gets the node type for this . The type. Represents a view of a . Initializes a new instance of the class. The name. When overridden in a derived class, returns whether resetting an object changes its value. true if resetting the component changes its value; otherwise, false. The component to test for reset capability. When overridden in a derived class, gets the current value of the property on a component. The value of a property for a given component. The component with the property for which to retrieve the value. When overridden in a derived class, resets the value for this property of the component to the default value. The component with the property value that is to be reset to the default value. When overridden in a derived class, sets the value of the component to a different value. The component with the property value that is to be set. The new value. When overridden in a derived class, determines a value indicating whether the value of this property needs to be persisted. true if the property should be persisted; otherwise, false. The component with the property to be examined for persistence. When overridden in a derived class, gets the type of the component this property is bound to. A that represents the type of component this property is bound to. When the or methods are invoked, the object specified might be an instance of this type. When overridden in a derived class, gets a value indicating whether this property is read-only. true if the property is read-only; otherwise, false. When overridden in a derived class, gets the type of the property. A that represents the type of the property. Gets the hash code for the name of the member. The hash code for the name of the member. Represents a raw JSON string. Represents a value in JSON (string, integer, date, etc). Initializes a new instance of the class from another object. A object to copy from. Initializes a new instance of the class with the given value. The value. Initializes a new instance of the class with the given value. The value. Initializes a new instance of the class with the given value. The value. Initializes a new instance of the class with the given value. The value. Initializes a new instance of the class with the given value. The value. Initializes a new instance of the class with the given value. The value. Initializes a new instance of the class with the given value. The value. Initializes a new instance of the class with the given value. The value. Initializes a new instance of the class with the given value. The value. Initializes a new instance of the class with the given value. The value. Initializes a new instance of the class with the given value. The value. Initializes a new instance of the class with the given value. The value. Initializes a new instance of the class with the given value. The value. Initializes a new instance of the class with the given value. The value. Creates a comment with the given value. The value. A comment with the given value. Creates a string with the given value. The value. A string with the given value. Writes this token to a . A into which this method will write. A collection of which will be used when writing the token. Indicates whether the current object is equal to another object of the same type. true if the current object is equal to the parameter; otherwise, false. An object to compare with this object. Determines whether the specified is equal to the current . The to compare with the current . true if the specified is equal to the current ; otherwise, false. The parameter is null. Serves as a hash function for a particular type. A hash code for the current . Returns a that represents this instance. A that represents this instance. Returns a that represents this instance. The format. A that represents this instance. Returns a that represents this instance. The format provider. A that represents this instance. Returns a that represents this instance. The format. The format provider. A that represents this instance. Returns the responsible for binding operations performed on this object. The expression tree representation of the runtime value. The to bind this object. Compares the current instance with another object of the same type and returns an integer that indicates whether the current instance precedes, follows, or occurs in the same position in the sort order as the other object. An object to compare with this instance. A 32-bit signed integer that indicates the relative order of the objects being compared. The return value has these meanings: Value Meaning Less than zero This instance is less than . Zero This instance is equal to . Greater than zero This instance is greater than . is not the same type as this instance. Gets a value indicating whether this token has child tokens. true if this token has child values; otherwise, false. Gets the node type for this . The type. Gets or sets the underlying token value. The underlying token value. Initializes a new instance of the class from another object. A object to copy from. Initializes a new instance of the class. The raw json. Creates an instance of with the content of the reader's current token. The reader. An instance of with the content of the reader's current token. Compares tokens to determine whether they are equal. Determines whether the specified objects are equal. The first object of type to compare. The second object of type to compare. true if the specified objects are equal; otherwise, false. Returns a hash code for the specified object. The for which a hash code is to be returned. A hash code for the specified object. The type of is a reference type and is null. Represents a reader that provides fast, non-cached, forward-only access to serialized Json data. Initializes a new instance of the class. The token to read from. Reads the next JSON token from the stream as a . A or a null reference if the next JSON token is null. This method will return null at the end of an array. Reads the next JSON token from the stream as a . A . This method will return null at the end of an array. Reads the next JSON token from the stream as a . A . This method will return null at the end of an array. Reads the next JSON token from the stream as a . A . This method will return null at the end of an array. Reads the next JSON token from the stream as a . A . This method will return null at the end of an array. Reads the next JSON token from the stream as a . A . This method will return null at the end of an array. Reads the next JSON token from the stream. true if the next token was read successfully; false if there are no more tokens to read. Specifies the type of token. No token type has been set. A JSON object. A JSON array. A JSON constructor. A JSON object property. A comment. An integer value. A float value. A string value. A boolean value. A null value. An undefined value. A date value. A raw JSON value. A collection of bytes value. A Guid value. A Uri value. A TimeSpan value. Represents a writer that provides a fast, non-cached, forward-only way of generating Json data. Initializes a new instance of the class writing to the given . The container being written to. Initializes a new instance of the class. Flushes whatever is in the buffer to the underlying streams and also flushes the underlying stream. Closes this stream and the underlying stream. Writes the beginning of a Json object. Writes the beginning of a Json array. Writes the start of a constructor with the given name. The name of the constructor. Writes the end. The token. Writes the property name of a name/value pair on a Json object. The name of the property. Writes a value. An error will raised if the value cannot be written as a single JSON token. The value to write. Writes a null value. Writes an undefined value. Writes raw JSON. The raw JSON to write. Writes out a comment /*...*/ containing the specified text. Text to place inside the comment. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Gets the token being writen. The token being writen. Specifies the member serialization options for the . All public members are serialized by default. Members can be excluded using or . This is the default member serialization mode. Only members must be marked with or are serialized. This member serialization mode can also be set by marking the class with . All public and private fields are serialized. Members can be excluded using or . This member serialization mode can also be set by marking the class with and setting IgnoreSerializableAttribute on to false. Specifies missing member handling options for the . Ignore a missing member and do not attempt to deserialize it. Throw a when a missing member is encountered during deserialization. Specifies null value handling options for the . Include null values when serializing and deserializing objects. Ignore null values when serializing and deserializing objects. Specifies how object creation is handled by the . Reuse existing objects, create new objects when needed. Only reuse existing objects. Always create new objects. Specifies reference handling options for the . Note that references cannot be preserved when a value is set via a non-default constructor such as types that implement ISerializable. Do not preserve references when serializing types. Preserve references when serializing into a JSON object structure. Preserve references when serializing into a JSON array structure. Preserve references when serializing. Specifies reference loop handling options for the . Throw a when a loop is encountered. Ignore loop references and do not serialize. Serialize loop references. Indicating whether a property is required. The property is not required. The default state. The property must be defined in JSON but can be a null value. The property must be defined in JSON and cannot be a null value. Contains the JSON schema extension methods. Determines whether the is valid. The source to test. The schema to test with. true if the specified is valid; otherwise, false. Determines whether the is valid. The source to test. The schema to test with. When this method returns, contains any error messages generated while validating. true if the specified is valid; otherwise, false. Validates the specified . The source to test. The schema to test with. Validates the specified . The source to test. The schema to test with. The validation event handler. An in-memory representation of a JSON Schema. Initializes a new instance of the class. Reads a from the specified . The containing the JSON Schema to read. The object representing the JSON Schema. Reads a from the specified . The containing the JSON Schema to read. The to use when resolving schema references. The object representing the JSON Schema. Load a from a string that contains schema JSON. A that contains JSON. A populated from the string that contains JSON. Parses the specified json. The json. The resolver. A populated from the string that contains JSON. Writes this schema to a . A into which this method will write. Writes this schema to a using the specified . A into which this method will write. The resolver used. Returns a that represents the current . A that represents the current . Gets or sets the id. Gets or sets the title. Gets or sets whether the object is required. Gets or sets whether the object is read only. Gets or sets whether the object is visible to users. Gets or sets whether the object is transient. Gets or sets the description of the object. Gets or sets the types of values allowed by the object. The type. Gets or sets the pattern. The pattern. Gets or sets the minimum length. The minimum length. Gets or sets the maximum length. The maximum length. Gets or sets a number that the value should be divisble by. A number that the value should be divisble by. Gets or sets the minimum. The minimum. Gets or sets the maximum. The maximum. Gets or sets a flag indicating whether the value can not equal the number defined by the "minimum" attribute. A flag indicating whether the value can not equal the number defined by the "minimum" attribute. Gets or sets a flag indicating whether the value can not equal the number defined by the "maximum" attribute. A flag indicating whether the value can not equal the number defined by the "maximum" attribute. Gets or sets the minimum number of items. The minimum number of items. Gets or sets the maximum number of items. The maximum number of items. Gets or sets the of items. The of items. Gets or sets a value indicating whether items in an array are validated using the instance at their array position from . true if items are validated using their array position; otherwise, false. Gets or sets the of additional items. The of additional items. Gets or sets a value indicating whether additional items are allowed. true if additional items are allowed; otherwise, false. Gets or sets whether the array items must be unique. Gets or sets the of properties. The of properties. Gets or sets the of additional properties. The of additional properties. Gets or sets the pattern properties. The pattern properties. Gets or sets a value indicating whether additional properties are allowed. true if additional properties are allowed; otherwise, false. Gets or sets the required property if this property is present. The required property if this property is present. Gets or sets the a collection of valid enum values allowed. A collection of valid enum values allowed. Gets or sets disallowed types. The disallow types. Gets or sets the default value. The default value. Gets or sets the collection of that this schema extends. The collection of that this schema extends. Gets or sets the format. The format. Returns detailed information about the schema exception. Initializes a new instance of the class. Initializes a new instance of the class with a specified error message. The error message that explains the reason for the exception. Initializes a new instance of the class with a specified error message and a reference to the inner exception that is the cause of this exception. The error message that explains the reason for the exception. The exception that is the cause of the current exception, or a null reference (Nothing in Visual Basic) if no inner exception is specified. Initializes a new instance of the class. The that holds the serialized object data about the exception being thrown. The that contains contextual information about the source or destination. The parameter is null. The class name is null or is zero (0). Gets the line number indicating where the error occurred. The line number indicating where the error occurred. Gets the line position indicating where the error occurred. The line position indicating where the error occurred. Gets the path to the JSON where the error occurred. The path to the JSON where the error occurred. Generates a from a specified . Generate a from the specified type. The type to generate a from. A generated from the specified type. Generate a from the specified type. The type to generate a from. The used to resolve schema references. A generated from the specified type. Generate a from the specified type. The type to generate a from. Specify whether the generated root will be nullable. A generated from the specified type. Generate a from the specified type. The type to generate a from. The used to resolve schema references. Specify whether the generated root will be nullable. A generated from the specified type. Gets or sets how undefined schemas are handled by the serializer. Gets or sets the contract resolver. The contract resolver. Resolves from an id. Initializes a new instance of the class. Gets a for the specified reference. The id. A for the specified reference. Gets or sets the loaded schemas. The loaded schemas. The value types allowed by the . No type specified. String type. Float type. Integer type. Boolean type. Object type. Array type. Null type. Any type. Specifies undefined schema Id handling options for the . Do not infer a schema Id. Use the .NET type name as the schema Id. Use the assembly qualified .NET type name as the schema Id. Returns detailed information related to the . Gets the associated with the validation error. The JsonSchemaException associated with the validation error. Gets the path of the JSON location where the validation error occurred. The path of the JSON location where the validation error occurred. Gets the text description corresponding to the validation error. The text description. Represents the callback method that will handle JSON schema validation events and the . Resolves member mappings for a type, camel casing property names. Used by to resolves a for a given . Used by to resolves a for a given . Resolves the contract for a given type. The type to resolve a contract for. The contract for a given type. Initializes a new instance of the class. Initializes a new instance of the class. If set to true the will use a cached shared with other resolvers of the same type. Sharing the cache will significantly performance because expensive reflection will only happen once but could cause unexpected behavior if different instances of the resolver are suppose to produce different results. When set to false it is highly recommended to reuse instances with the . Resolves the contract for a given type. The type to resolve a contract for. The contract for a given type. Gets the serializable members for the type. The type to get serializable members for. The serializable members for the type. Creates a for the given type. Type of the object. A for the given type. Creates the constructor parameters. The constructor to create properties for. The type's member properties. Properties for the given . Creates a for the given . The matching member property. The constructor parameter. A created for the given . Resolves the default for the contract. Type of the object. The contract's default . Creates a for the given type. Type of the object. A for the given type. Creates a for the given type. Type of the object. A for the given type. Creates a for the given type. Type of the object. A for the given type. Creates a for the given type. Type of the object. A for the given type. Creates a for the given type. Type of the object. A for the given type. Creates a for the given type. Type of the object. A for the given type. Creates a for the given type. Type of the object. A for the given type. Determines which contract type is created for the given type. Type of the object. A for the given type. Creates properties for the given . The type to create properties for. /// The member serialization mode for the type. Properties for the given . Creates the used by the serializer to get and set values from a member. The member. The used by the serializer to get and set values from a member. Creates a for the given . The member's parent . The member to create a for. A created for the given . Resolves the name of the property. Name of the property. Name of the property. Gets the resolved name of the property. Name of the property. Name of the property. Gets a value indicating whether members are being get and set using dynamic code generation. This value is determined by the runtime permissions available. true if using dynamic code generation; otherwise, false. Gets or sets the default members search flags. The default members search flags. Gets or sets a value indicating whether compiler generated members should be serialized. true if serialized compiler generated members; otherwise, false. Gets or sets a value indicating whether to ignore the interface when serializing and deserializing types. true if the interface will be ignored when serializing and deserializing types; otherwise, false. Gets or sets a value indicating whether to ignore the attribute when serializing and deserializing types. true if the attribute will be ignored when serializing and deserializing types; otherwise, false. Initializes a new instance of the class. Resolves the name of the property. Name of the property. The property name camel cased. Used to resolve references when serializing and deserializing JSON by the . Resolves a reference to its object. The serialization context. The reference to resolve. The object that Gets the reference for the sepecified object. The serialization context. The object to get a reference for. The reference to the object. Determines whether the specified object is referenced. The serialization context. The object to test for a reference. true if the specified object is referenced; otherwise, false. Adds a reference to the specified object. The serialization context. The reference. The object to reference. The default serialization binder used when resolving and loading classes from type names. When overridden in a derived class, controls the binding of a serialized object to a type. Specifies the name of the serialized object. Specifies the name of the serialized object. The type of the object the formatter creates a new instance of. When overridden in a derived class, controls the binding of a serialized object to a type. The type of the object the formatter creates a new instance of. Specifies the name of the serialized object. Specifies the name of the serialized object. Represents a trace writer that writes to the application's instances. Represents a trace writer. Writes the specified trace level, message and optional exception. The at which to write this trace. The trace message. The trace exception. This parameter is optional. Gets the that will be used to filter the trace messages passed to the writer. For example a filter level of Info will exclude Verbose messages and include Info, Warning and Error messages. The that will be used to filter the trace messages passed to the writer. Writes the specified trace level, message and optional exception. The at which to write this trace. The trace message. The trace exception. This parameter is optional. Gets the that will be used to filter the trace messages passed to the writer. For example a filter level of Info will exclude Verbose messages and include Info, Warning and Error messages. The that will be used to filter the trace messages passed to the writer. Get and set values for a using dynamic methods. Provides methods to get and set values. Sets the value. The target to set the value on. The value to set on the target. Gets the value. The target to get the value from. The value. Initializes a new instance of the class. The member info. Sets the value. The target to set the value on. The value to set on the target. Gets the value. The target to get the value from. The value. Provides information surrounding an error. Gets the error. The error. Gets the original object that caused the error. The original object that caused the error. Gets the member that caused the error. The member that caused the error. Gets the path of the JSON location where the error occurred. The path of the JSON location where the error occurred. Gets or sets a value indicating whether this is handled. true if handled; otherwise, false. Provides data for the Error event. Initializes a new instance of the class. The current object. The error context. Gets the current object the error event is being raised against. The current object the error event is being raised against. Gets the error context. The error context. Get and set values for a using dynamic methods. Initializes a new instance of the class. The member info. Sets the value. The target to set the value on. The value to set on the target. Gets the value. The target to get the value from. The value. Contract details for a used by the . Contract details for a used by the . Contract details for a used by the . Gets the underlying type for the contract. The underlying type for the contract. Gets or sets the type created during deserialization. The type created during deserialization. Gets or sets whether this type contract is serialized as a reference. Whether this type contract is serialized as a reference. Gets or sets the default for this contract. The converter. Gets or sets all methods called immediately after deserialization of the object. The methods called immediately after deserialization of the object. Gets or sets all methods called during deserialization of the object. The methods called during deserialization of the object. Gets or sets all methods called after serialization of the object graph. The methods called after serialization of the object graph. Gets or sets all methods called before serialization of the object. The methods called before serialization of the object. Gets or sets all method called when an error is thrown during the serialization of the object. The methods called when an error is thrown during the serialization of the object. Gets or sets the method called immediately after deserialization of the object. The method called immediately after deserialization of the object. Gets or sets the method called during deserialization of the object. The method called during deserialization of the object. Gets or sets the method called after serialization of the object graph. The method called after serialization of the object graph. Gets or sets the method called before serialization of the object. The method called before serialization of the object. Gets or sets the method called when an error is thrown during the serialization of the object. The method called when an error is thrown during the serialization of the object. Gets or sets the default creator method used to create the object. The default creator method used to create the object. Gets or sets a value indicating whether the default creator is non public. true if the default object creator is non-public; otherwise, false. Initializes a new instance of the class. The underlying type for the contract. Gets or sets the default collection items . The converter. Gets or sets a value indicating whether the collection items preserve object references. true if collection items preserve object references; otherwise, false. Gets or sets the collection item reference loop handling. The reference loop handling. Gets or sets the collection item type name handling. The type name handling. Initializes a new instance of the class. The underlying type for the contract. Gets the of the collection items. The of the collection items. Gets a value indicating whether the collection type is a multidimensional array. true if the collection type is a multidimensional array; otherwise, false. Handles serialization callback events. The object that raised the callback event. The streaming context. Handles serialization error callback events. The object that raised the callback event. The streaming context. The error context. Sets extension data for an object during deserialization. The object to set extension data on. The extension data key. The extension data value. Gets extension data for an object during serialization. The object to set extension data on. Contract details for a used by the . Initializes a new instance of the class. The underlying type for the contract. Gets or sets the property name resolver. The property name resolver. Gets the of the dictionary keys. The of the dictionary keys. Gets the of the dictionary values. The of the dictionary values. Contract details for a used by the . Initializes a new instance of the class. The underlying type for the contract. Gets the object's properties. The object's properties. Gets or sets the property name resolver. The property name resolver. Contract details for a used by the . Initializes a new instance of the class. The underlying type for the contract. Gets or sets the ISerializable object constructor. The ISerializable object constructor. Contract details for a used by the . Initializes a new instance of the class. The underlying type for the contract. Contract details for a used by the . Initializes a new instance of the class. The underlying type for the contract. Gets or sets the object member serialization. The member object serialization. Gets or sets a value that indicates whether the object's properties are required. A value indicating whether the object's properties are required. Gets the object's properties. The object's properties. Gets the constructor parameters required for any non-default constructor Gets or sets the override constructor used to create the object. This is set when a constructor is marked up using the JsonConstructor attribute. The override constructor. Gets or sets the parametrized constructor used to create the object. The parametrized constructor. Gets or sets the extension data setter. Gets or sets the extension data getter. Contract details for a used by the . Initializes a new instance of the class. The underlying type for the contract. Maps a JSON property to a .NET member or constructor parameter. Returns a that represents this instance. A that represents this instance. Gets or sets the name of the property. The name of the property. Gets or sets the type that declared this property. The type that declared this property. Gets or sets the order of serialization and deserialization of a member. The numeric order of serialization or deserialization. Gets or sets the name of the underlying member or parameter. The name of the underlying member or parameter. Gets the that will get and set the during serialization. The that will get and set the during serialization. Gets or sets the type of the property. The type of the property. Gets or sets the for the property. If set this converter takes presidence over the contract converter for the property type. The converter. Gets or sets the member converter. The member converter. Gets or sets a value indicating whether this is ignored. true if ignored; otherwise, false. Gets or sets a value indicating whether this is readable. true if readable; otherwise, false. Gets or sets a value indicating whether this is writable. true if writable; otherwise, false. Gets or sets a value indicating whether this has a member attribute. true if has a member attribute; otherwise, false. Gets the default value. The default value. Gets or sets a value indicating whether this is required. A value indicating whether this is required. Gets or sets a value indicating whether this property preserves object references. true if this instance is reference; otherwise, false. Gets or sets the property null value handling. The null value handling. Gets or sets the property default value handling. The default value handling. Gets or sets the property reference loop handling. The reference loop handling. Gets or sets the property object creation handling. The object creation handling. Gets or sets or sets the type name handling. The type name handling. Gets or sets a predicate used to determine whether the property should be serialize. A predicate used to determine whether the property should be serialize. Gets or sets a predicate used to determine whether the property should be serialized. A predicate used to determine whether the property should be serialized. Gets or sets an action used to set whether the property has been deserialized. An action used to set whether the property has been deserialized. Gets or sets the converter used when serializing the property's collection items. The collection's items converter. Gets or sets whether this property's collection items are serialized as a reference. Whether this property's collection items are serialized as a reference. Gets or sets the the type name handling used when serializing the property's collection items. The collection's items type name handling. Gets or sets the the reference loop handling used when serializing the property's collection items. The collection's items reference loop handling. A collection of objects. Initializes a new instance of the class. The type. When implemented in a derived class, extracts the key from the specified element. The element from which to extract the key. The key for the specified element. Adds a object. The property to add to the collection. Gets the closest matching object. First attempts to get an exact case match of propertyName and then a case insensitive match. Name of the property. A matching property if found. Gets a property by property name. The name of the property to get. Type property name string comparison. A matching property if found. Contract details for a used by the . Initializes a new instance of the class. The underlying type for the contract. Represents a trace writer that writes to memory. When the trace message limit is reached then old trace messages will be removed as new messages are added. Initializes a new instance of the class. Writes the specified trace level, message and optional exception. The at which to write this trace. The trace message. The trace exception. This parameter is optional. Returns an enumeration of the most recent trace messages. An enumeration of the most recent trace messages. Returns a of the most recent trace messages. A of the most recent trace messages. Gets the that will be used to filter the trace messages passed to the writer. For example a filter level of Info will exclude Verbose messages and include Info, Warning and Error messages. The that will be used to filter the trace messages passed to the writer. Represents a method that constructs an object. The object type to create. When applied to a method, specifies that the method is called when an error occurs serializing an object. Get and set values for a using reflection. Initializes a new instance of the class. The member info. Sets the value. The target to set the value on. The value to set on the target. Gets the value. The target to get the value from. The value. Specifies how strings are escaped when writing JSON text. Only control characters (e.g. newline) are escaped. All non-ASCII and control characters (e.g. newline) are escaped. HTML (<, >, &, ', ") and control characters (e.g. newline) are escaped. Specifies type name handling options for the . Do not include the .NET type name when serializing types. Include the .NET type name when serializing into a JSON object structure. Include the .NET type name when serializing into a JSON array structure. Always include the .NET type name when serializing. Include the .NET type name when the type of the object being serialized is not the same as its declared type. Determines whether the collection is null or empty. The collection. true if the collection is null or empty; otherwise, false. Adds the elements of the specified collection to the specified generic IList. The list to add to. The collection of elements to add. Returns the index of the first occurrence in a sequence by using a specified IEqualityComparer. The type of the elements of source. A sequence in which to locate a value. The object to locate in the sequence An equality comparer to compare values. The zero-based index of the first occurrence of value within the entire sequence, if found; otherwise, –1. Converts the value to the specified type. The value to convert. The culture to use when converting. The type to convert the value to. The converted type. Converts the value to the specified type. The value to convert. The culture to use when converting. The type to convert the value to. The converted value if the conversion was successful or the default value of T if it failed. true if initialValue was converted successfully; otherwise, false. Converts the value to the specified type. If the value is unable to be converted, the value is checked whether it assignable to the specified type. The value to convert. The culture to use when converting. The type to convert or cast the value to. The converted type. If conversion was unsuccessful, the initial value is returned if assignable to the target type. Helper method for generating a MetaObject which calls a specific method on Dynamic that returns a result Helper method for generating a MetaObject which calls a specific method on Dynamic, but uses one of the arguments for the result. Helper method for generating a MetaObject which calls a specific method on Dynamic, but uses one of the arguments for the result. Returns a Restrictions object which includes our current restrictions merged with a restriction limiting our type Gets a dictionary of the names and values of an Enum type. Gets a dictionary of the names and values of an Enum type. The enum type to get names and values for. Gets the type of the typed collection's items. The type. The type of the typed collection's items. Gets the member's underlying type. The member. The underlying type of the member. Determines whether the member is an indexed property. The member. true if the member is an indexed property; otherwise, false. Determines whether the property is an indexed property. The property. true if the property is an indexed property; otherwise, false. Gets the member's value on the object. The member. The target object. The member's value on the object. Sets the member's value on the target object. The member. The target. The value. Determines whether the specified MemberInfo can be read. The MemberInfo to determine whether can be read. /// if set to true then allow the member to be gotten non-publicly. true if the specified MemberInfo can be read; otherwise, false. Determines whether the specified MemberInfo can be set. The MemberInfo to determine whether can be set. if set to true then allow the member to be set non-publicly. if set to true then allow the member to be set if read-only. true if the specified MemberInfo can be set; otherwise, false. Builds a string. Unlike StringBuilder this class lets you reuse it's internal buffer. Determines whether the string is all white space. Empty string will return false. The string to test whether it is all white space. true if the string is all white space; otherwise, false. Nulls an empty string. The string. Null if the string was null, otherwise the string unchanged. Specifies the state of the . An exception has been thrown, which has left the in an invalid state. You may call the method to put the in the Closed state. Any other method calls results in an being thrown. The method has been called. An object is being written. A array is being written. A constructor is being written. A property is being written. A write method has not been called. ================================================ FILE: packages/Newtonsoft.Json.6.0.2/lib/netcore45/Newtonsoft.Json.xml ================================================ Newtonsoft.Json Represents a BSON Oid (object id). Initializes a new instance of the class. The Oid value. Gets or sets the value of the Oid. The value of the Oid. Represents a reader that provides fast, non-cached, forward-only access to serialized Json data. Represents a reader that provides fast, non-cached, forward-only access to serialized Json data. Initializes a new instance of the class with the specified . Reads the next JSON token from the stream. true if the next token was read successfully; false if there are no more tokens to read. Reads the next JSON token from the stream as a . A . This method will return null at the end of an array. Reads the next JSON token from the stream as a . A . This method will return null at the end of an array. Reads the next JSON token from the stream as a . A or a null reference if the next JSON token is null. This method will return null at the end of an array. Reads the next JSON token from the stream as a . A . This method will return null at the end of an array. Reads the next JSON token from the stream as a . A . This method will return null at the end of an array. Reads the next JSON token from the stream as a . A . This method will return null at the end of an array. Skips the children of the current token. Sets the current token. The new token. Sets the current token and value. The new token. The value. Sets the state based on current token type. Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources. Releases unmanaged and - optionally - managed resources true to release both managed and unmanaged resources; false to release only unmanaged resources. Changes the to Closed. Gets the current reader state. The current reader state. Gets or sets a value indicating whether the underlying stream or should be closed when the reader is closed. true to close the underlying stream or when the reader is closed; otherwise false. The default is true. Gets or sets a value indicating whether multiple pieces of JSON content can be read from a continuous stream without erroring. true to support reading multiple pieces of JSON content; otherwise false. The default is false. Gets the quotation mark character used to enclose the value of a string. Get or set how time zones are handling when reading JSON. Get or set how date formatted strings, e.g. "\/Date(1198908717056)\/" and "2012-03-21T05:40Z", are parsed when reading JSON. Get or set how floating point numbers, e.g. 1.0 and 9.9, are parsed when reading JSON text. Gets or sets the maximum depth allowed when reading JSON. Reading past this depth will throw a . Gets the type of the current JSON token. Gets the text value of the current JSON token. Gets The Common Language Runtime (CLR) type for the current JSON token. Gets the depth of the current token in the JSON document. The depth of the current token in the JSON document. Gets the path of the current JSON token. Gets or sets the culture used when reading JSON. Defaults to . Specifies the state of the reader. The Read method has not been called. The end of the file has been reached successfully. Reader is at a property. Reader is at the start of an object. Reader is in an object. Reader is at the start of an array. Reader is in an array. The Close method has been called. Reader has just read a value. Reader is at the start of a constructor. Reader in a constructor. An error occurred that prevents the read operation from continuing. The end of the file has been reached successfully. Initializes a new instance of the class. The stream. Initializes a new instance of the class. The reader. Initializes a new instance of the class. The stream. if set to true the root object will be read as a JSON array. The used when reading values from BSON. Initializes a new instance of the class. The reader. if set to true the root object will be read as a JSON array. The used when reading values from BSON. Reads the next JSON token from the stream as a . A or a null reference if the next JSON token is null. This method will return null at the end of an array. Reads the next JSON token from the stream as a . A . This method will return null at the end of an array. Reads the next JSON token from the stream as a . A . This method will return null at the end of an array. Reads the next JSON token from the stream as a . A . This method will return null at the end of an array. Reads the next JSON token from the stream as a . A . This method will return null at the end of an array. Reads the next JSON token from the stream as a . A . This method will return null at the end of an array. Reads the next JSON token from the stream. true if the next token was read successfully; false if there are no more tokens to read. Changes the to Closed. Gets or sets a value indicating whether binary data reading should compatible with incorrect Json.NET 3.5 written binary. true if binary data reading will be compatible with incorrect Json.NET 3.5 written binary; otherwise, false. Gets or sets a value indicating whether the root object will be read as a JSON array. true if the root object will be read as a JSON array; otherwise, false. Gets or sets the used when reading values from BSON. The used when reading values from BSON. Represents a writer that provides a fast, non-cached, forward-only way of generating JSON data. Represents a writer that provides a fast, non-cached, forward-only way of generating Json data. Creates an instance of the JsonWriter class. Flushes whatever is in the buffer to the underlying streams and also flushes the underlying stream. Closes this stream and the underlying stream. Writes the beginning of a Json object. Writes the end of a Json object. Writes the beginning of a Json array. Writes the end of an array. Writes the start of a constructor with the given name. The name of the constructor. Writes the end constructor. Writes the property name of a name/value pair on a JSON object. The name of the property. Writes the property name of a name/value pair on a JSON object. The name of the property. A flag to indicate whether the text should be escaped when it is written as a JSON property name. Writes the end of the current Json object or array. Writes the current token and its children. The to read the token from. Writes the current token. The to read the token from. A flag indicating whether the current token's children should be written. Writes the specified end token. The end token to write. Writes indent characters. Writes the JSON value delimiter. Writes an indent space. Writes a null value. Writes an undefined value. Writes raw JSON without changing the writer's state. The raw JSON to write. Writes raw JSON where a value is expected and updates the writer's state. The raw JSON to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. An error will raised if the value cannot be written as a single JSON token. The value to write. Writes out a comment /*...*/ containing the specified text. Text to place inside the comment. Writes out the given white space. The string of white space characters. Sets the state of the JsonWriter, The JsonToken being written. The value being written. Gets or sets a value indicating whether the underlying stream or should be closed when the writer is closed. true to close the underlying stream or when the writer is closed; otherwise false. The default is true. Gets the top. The top. Gets the state of the writer. Gets the path of the writer. Indicates how JSON text output is formatted. Get or set how dates are written to JSON text. Get or set how time zones are handling when writing JSON text. Get or set how strings are escaped when writing JSON text. Get or set how special floating point numbers, e.g. , and , are written to JSON text. Get or set how and values are formatting when writing JSON text. Gets or sets the culture used when writing JSON. Defaults to . Initializes a new instance of the class. The stream. Initializes a new instance of the class. The writer. Flushes whatever is in the buffer to the underlying streams and also flushes the underlying stream. Writes the end. The token. Writes out a comment /*...*/ containing the specified text. Text to place inside the comment. Writes the start of a constructor with the given name. The name of the constructor. Writes raw JSON. The raw JSON to write. Writes raw JSON where a value is expected and updates the writer's state. The raw JSON to write. Writes the beginning of a Json array. Writes the beginning of a Json object. Writes the property name of a name/value pair on a Json object. The name of the property. Closes this stream and the underlying stream. Writes a value. An error will raised if the value cannot be written as a single JSON token. The value to write. Writes a null value. Writes an undefined value. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value that represents a BSON object id. The Object ID value to write. Writes a BSON regex. The regex pattern. The regex options. Gets or sets the used when writing values to BSON. When set to no conversion will occur. The used when writing values to BSON. Specifies how constructors are used when initializing objects during deserialization by the . First attempt to use the public default constructor, then fall back to single paramatized constructor, then the non-public default constructor. Json.NET will use a non-public default constructor before falling back to a paramatized constructor. Converts a to and from JSON and BSON. Converts an object to and from JSON. Writes the JSON representation of the object. The to write to. The value. The calling serializer. Reads the JSON representation of the object. The to read from. Type of the object. The existing value of object being read. The calling serializer. The object value. Determines whether this instance can convert the specified object type. Type of the object. true if this instance can convert the specified object type; otherwise, false. Gets the of the JSON produced by the JsonConverter. The of the JSON produced by the JsonConverter. Gets a value indicating whether this can read JSON. true if this can read JSON; otherwise, false. Gets a value indicating whether this can write JSON. true if this can write JSON; otherwise, false. Writes the JSON representation of the object. The to write to. The value. The calling serializer. Reads the JSON representation of the object. The to read from. Type of the object. The existing value of object being read. The calling serializer. The object value. Determines whether this instance can convert the specified object type. Type of the object. true if this instance can convert the specified object type; otherwise, false. Create a custom object The object type to convert. Writes the JSON representation of the object. The to write to. The value. The calling serializer. Reads the JSON representation of the object. The to read from. Type of the object. The existing value of object being read. The calling serializer. The object value. Creates an object which will then be populated by the serializer. Type of the object. The created object. Determines whether this instance can convert the specified object type. Type of the object. true if this instance can convert the specified object type; otherwise, false. Gets a value indicating whether this can write JSON. true if this can write JSON; otherwise, false. Provides a base class for converting a to and from JSON. Determines whether this instance can convert the specified object type. Type of the object. true if this instance can convert the specified object type; otherwise, false. Converts a F# discriminated union type to and from JSON. Writes the JSON representation of the object. The to write to. The value. The calling serializer. Reads the JSON representation of the object. The to read from. Type of the object. The existing value of object being read. The calling serializer. The object value. Determines whether this instance can convert the specified object type. Type of the object. true if this instance can convert the specified object type; otherwise, false. Converts an ExpandoObject to and from JSON. Writes the JSON representation of the object. The to write to. The value. The calling serializer. Reads the JSON representation of the object. The to read from. Type of the object. The existing value of object being read. The calling serializer. The object value. Determines whether this instance can convert the specified object type. Type of the object. true if this instance can convert the specified object type; otherwise, false. Gets a value indicating whether this can write JSON. true if this can write JSON; otherwise, false. Converts a to and from the ISO 8601 date format (e.g. 2008-04-12T12:53Z). Writes the JSON representation of the object. The to write to. The value. The calling serializer. Reads the JSON representation of the object. The to read from. Type of the object. The existing value of object being read. The calling serializer. The object value. Gets or sets the date time styles used when converting a date to and from JSON. The date time styles used when converting a date to and from JSON. Gets or sets the date time format used when converting a date to and from JSON. The date time format used when converting a date to and from JSON. Gets or sets the culture used when converting a date to and from JSON. The culture used when converting a date to and from JSON. Converts a to and from a JavaScript date constructor (e.g. new Date(52231943)). Writes the JSON representation of the object. The to write to. The value. The calling serializer. Reads the JSON representation of the object. The to read from. Type of the object. The existing property value of the JSON that is being converted. The calling serializer. The object value. Converts a to and from JSON. Writes the JSON representation of the object. The to write to. The value. The calling serializer. Reads the JSON representation of the object. The to read from. Type of the object. The existing value of object being read. The calling serializer. The object value. Determines whether this instance can convert the specified object type. Type of the object. true if this instance can convert the specified object type; otherwise, false. Converts a to and from JSON. Writes the JSON representation of the object. The to write to. The value. The calling serializer. Reads the JSON representation of the object. The to read from. Type of the object. The existing value of object being read. The calling serializer. The object value. Determines whether this instance can convert the specified object type. Type of the object. true if this instance can convert the specified object type; otherwise, false. Converts a to and from JSON and BSON. Writes the JSON representation of the object. The to write to. The value. The calling serializer. Reads the JSON representation of the object. The to read from. Type of the object. The existing value of object being read. The calling serializer. The object value. Determines whether this instance can convert the specified object type. Type of the object. true if this instance can convert the specified object type; otherwise, false. Converts an to and from its name string value. Initializes a new instance of the class. Writes the JSON representation of the object. The to write to. The value. The calling serializer. Reads the JSON representation of the object. The to read from. Type of the object. The existing value of object being read. The calling serializer. The object value. Determines whether this instance can convert the specified object type. Type of the object. true if this instance can convert the specified object type; otherwise, false. Gets or sets a value indicating whether the written enum text should be camel case. true if the written enum text will be camel case; otherwise, false. Gets or sets a value indicating whether integer values are allowed. true if integers are allowed; otherwise, false. Converts a to and from a string (e.g. "1.2.3.4"). Writes the JSON representation of the object. The to write to. The value. The calling serializer. Reads the JSON representation of the object. The to read from. Type of the object. The existing property value of the JSON that is being converted. The calling serializer. The object value. Determines whether this instance can convert the specified object type. Type of the object. true if this instance can convert the specified object type; otherwise, false. Converts XML to and from JSON. Writes the JSON representation of the object. The to write to. The calling serializer. The value. Reads the JSON representation of the object. The to read from. Type of the object. The existing value of object being read. The calling serializer. The object value. Checks if the attributeName is a namespace attribute. Attribute name to test. The attribute name prefix if it has one, otherwise an empty string. True if attribute name is for a namespace attribute, otherwise false. Determines whether this instance can convert the specified value type. Type of the value. true if this instance can convert the specified value type; otherwise, false. Gets or sets the name of the root element to insert when deserializing to XML if the JSON structure has produces multiple root elements. The name of the deserialize root element. Gets or sets a flag to indicate whether to write the Json.NET array attribute. This attribute helps preserve arrays when converting the written XML back to JSON. true if the array attibute is written to the XML; otherwise, false. Gets or sets a value indicating whether to write the root JSON object. true if the JSON root object is omitted; otherwise, false. Specifies how dates are formatted when writing JSON text. Dates are written in the ISO 8601 format, e.g. "2012-03-21T05:40Z". Dates are written in the Microsoft JSON format, e.g. "\/Date(1198908717056)\/". Specifies how date formatted strings, e.g. "\/Date(1198908717056)\/" and "2012-03-21T05:40Z", are parsed when reading JSON text. Date formatted strings are not parsed to a date type and are read as strings. Date formatted strings, e.g. "\/Date(1198908717056)\/" and "2012-03-21T05:40Z", are parsed to . Date formatted strings, e.g. "\/Date(1198908717056)\/" and "2012-03-21T05:40Z", are parsed to . Specifies how to treat the time value when converting between string and . Treat as local time. If the object represents a Coordinated Universal Time (UTC), it is converted to the local time. Treat as a UTC. If the object represents a local time, it is converted to a UTC. Treat as a local time if a is being converted to a string. If a string is being converted to , convert to a local time if a time zone is specified. Time zone information should be preserved when converting. Specifies float format handling options when writing special floating point numbers, e.g. , and with . Write special floating point values as strings in JSON, e.g. "NaN", "Infinity", "-Infinity". Write special floating point values as symbols in JSON, e.g. NaN, Infinity, -Infinity. Note that this will produce non-valid JSON. Write special floating point values as the property's default value in JSON, e.g. 0.0 for a property, null for a property. Specifies default value handling options for the . Include members where the member value is the same as the member's default value when serializing objects. Included members are written to JSON. Has no effect when deserializing. Ignore members where the member value is the same as the member's default value when serializing objects so that is is not written to JSON. This option will ignore all default values (e.g. null for objects and nullable typesl; 0 for integers, decimals and floating point numbers; and false for booleans). The default value ignored can be changed by placing the on the property. Members with a default value but no JSON will be set to their default value when deserializing. Ignore members where the member value is the same as the member's default value when serializing objects and sets members to their default value when deserializing. Specifies how floating point numbers, e.g. 1.0 and 9.9, are parsed when reading JSON text. Floating point numbers are parsed to . Floating point numbers are parsed to . Indicates the method that will be used during deserialization for locating and loading assemblies. In simple mode, the assembly used during deserialization need not match exactly the assembly used during serialization. Specifically, the version numbers need not match as the LoadWithPartialName method is used to load the assembly. In full mode, the assembly used during deserialization must match exactly the assembly used during serialization. The Load method of the Assembly class is used to load the assembly. Specifies formatting options for the . No special formatting is applied. This is the default. Causes child objects to be indented according to the and settings. Provides an interface to enable a class to return line and position information. Gets a value indicating whether the class can return line information. true if LineNumber and LinePosition can be provided; otherwise, false. Gets the current line number. The current line number or 0 if no line information is available (for example, HasLineInfo returns false). Gets the current line position. The current line position or 0 if no line information is available (for example, HasLineInfo returns false). Instructs the how to serialize the collection. Instructs the how to serialize the object. Initializes a new instance of the class. Initializes a new instance of the class with the specified container Id. The container Id. Gets or sets the id. The id. Gets or sets the title. The title. Gets or sets the description. The description. Gets the collection's items converter. The collection's items converter. Gets or sets a value that indicates whether to preserve object references. true to keep object reference; otherwise, false. The default is false. Gets or sets a value that indicates whether to preserve collection's items references. true to keep collection's items object references; otherwise, false. The default is false. Gets or sets the reference loop handling used when serializing the collection's items. The reference loop handling. Gets or sets the type name handling used when serializing the collection's items. The type name handling. Initializes a new instance of the class. Initializes a new instance of the class with a flag indicating whether the array can contain null items A flag indicating whether the array can contain null items. Initializes a new instance of the class with the specified container Id. The container Id. Gets or sets a value indicating whether null items are allowed in the collection. true if null items are allowed in the collection; otherwise, false. Instructs the to use the specified constructor when deserializing that object. Provides methods for converting between common language runtime types and JSON types. Represents JavaScript's boolean value true as a string. This field is read-only. Represents JavaScript's boolean value false as a string. This field is read-only. Represents JavaScript's null as a string. This field is read-only. Represents JavaScript's undefined as a string. This field is read-only. Represents JavaScript's positive infinity as a string. This field is read-only. Represents JavaScript's negative infinity as a string. This field is read-only. Represents JavaScript's NaN as a string. This field is read-only. Converts the to its JSON string representation. The value to convert. A JSON string representation of the . Converts the to its JSON string representation using the specified. The value to convert. The format the date will be converted to. The time zone handling when the date is converted to a string. A JSON string representation of the . Converts the to its JSON string representation. The value to convert. A JSON string representation of the . Converts the to its JSON string representation using the specified. The value to convert. The format the date will be converted to. A JSON string representation of the . Converts the to its JSON string representation. The value to convert. A JSON string representation of the . Converts the to its JSON string representation. The value to convert. A JSON string representation of the . Converts the to its JSON string representation. The value to convert. A JSON string representation of the . Converts the to its JSON string representation. The value to convert. A JSON string representation of the . Converts the to its JSON string representation. The value to convert. A JSON string representation of the . Converts the to its JSON string representation. The value to convert. A JSON string representation of the . Converts the to its JSON string representation. The value to convert. A JSON string representation of the . Converts the to its JSON string representation. The value to convert. A JSON string representation of the . Converts the to its JSON string representation. The value to convert. A JSON string representation of the . Converts the to its JSON string representation. The value to convert. A JSON string representation of the . Converts the to its JSON string representation. The value to convert. A JSON string representation of the . Converts the to its JSON string representation. The value to convert. A JSON string representation of the . Converts the to its JSON string representation. The value to convert. A JSON string representation of the . Converts the to its JSON string representation. The value to convert. A JSON string representation of the . Converts the to its JSON string representation. The value to convert. A JSON string representation of the . Converts the to its JSON string representation. The value to convert. A JSON string representation of the . Converts the to its JSON string representation. The value to convert. A JSON string representation of the . Converts the to its JSON string representation. The value to convert. A JSON string representation of the . Converts the to its JSON string representation. The value to convert. The string delimiter character. A JSON string representation of the . Converts the to its JSON string representation. The value to convert. A JSON string representation of the . Serializes the specified object to a JSON string. The object to serialize. A JSON string representation of the object. Serializes the specified object to a JSON string using formatting. The object to serialize. Indicates how the output is formatted. A JSON string representation of the object. Serializes the specified object to a JSON string using a collection of . The object to serialize. A collection converters used while serializing. A JSON string representation of the object. Serializes the specified object to a JSON string using formatting and a collection of . The object to serialize. Indicates how the output is formatted. A collection converters used while serializing. A JSON string representation of the object. Serializes the specified object to a JSON string using . The object to serialize. The used to serialize the object. If this is null, default serialization settings will be is used. A JSON string representation of the object. Serializes the specified object to a JSON string using a type, formatting and . The object to serialize. The used to serialize the object. If this is null, default serialization settings will be is used. The type of the value being serialized. This parameter is used when is Auto to write out the type name if the type of the value does not match. Specifing the type is optional. A JSON string representation of the object. Serializes the specified object to a JSON string using formatting and . The object to serialize. Indicates how the output is formatted. The used to serialize the object. If this is null, default serialization settings will be is used. A JSON string representation of the object. Serializes the specified object to a JSON string using a type, formatting and . The object to serialize. Indicates how the output is formatted. The used to serialize the object. If this is null, default serialization settings will be is used. The type of the value being serialized. This parameter is used when is Auto to write out the type name if the type of the value does not match. Specifing the type is optional. A JSON string representation of the object. Asynchronously serializes the specified object to a JSON string. Serialization will happen on a new thread. The object to serialize. A task that represents the asynchronous serialize operation. The value of the TResult parameter contains a JSON string representation of the object. Asynchronously serializes the specified object to a JSON string using formatting. Serialization will happen on a new thread. The object to serialize. Indicates how the output is formatted. A task that represents the asynchronous serialize operation. The value of the TResult parameter contains a JSON string representation of the object. Asynchronously serializes the specified object to a JSON string using formatting and a collection of . Serialization will happen on a new thread. The object to serialize. Indicates how the output is formatted. The used to serialize the object. If this is null, default serialization settings will be is used. A task that represents the asynchronous serialize operation. The value of the TResult parameter contains a JSON string representation of the object. Deserializes the JSON to a .NET object. The JSON to deserialize. The deserialized object from the Json string. Deserializes the JSON to a .NET object using . The JSON to deserialize. The used to deserialize the object. If this is null, default serialization settings will be is used. The deserialized object from the JSON string. Deserializes the JSON to the specified .NET type. The JSON to deserialize. The of object being deserialized. The deserialized object from the Json string. Deserializes the JSON to the specified .NET type. The type of the object to deserialize to. The JSON to deserialize. The deserialized object from the Json string. Deserializes the JSON to the given anonymous type. The anonymous type to deserialize to. This can't be specified traditionally and must be infered from the anonymous type passed as a parameter. The JSON to deserialize. The anonymous type object. The deserialized anonymous type from the JSON string. Deserializes the JSON to the given anonymous type using . The anonymous type to deserialize to. This can't be specified traditionally and must be infered from the anonymous type passed as a parameter. The JSON to deserialize. The anonymous type object. The used to deserialize the object. If this is null, default serialization settings will be is used. The deserialized anonymous type from the JSON string. Deserializes the JSON to the specified .NET type using a collection of . The type of the object to deserialize to. The JSON to deserialize. Converters to use while deserializing. The deserialized object from the JSON string. Deserializes the JSON to the specified .NET type using . The type of the object to deserialize to. The object to deserialize. The used to deserialize the object. If this is null, default serialization settings will be is used. The deserialized object from the JSON string. Deserializes the JSON to the specified .NET type using a collection of . The JSON to deserialize. The type of the object to deserialize. Converters to use while deserializing. The deserialized object from the JSON string. Deserializes the JSON to the specified .NET type using . The JSON to deserialize. The type of the object to deserialize to. The used to deserialize the object. If this is null, default serialization settings will be is used. The deserialized object from the JSON string. Asynchronously deserializes the JSON to the specified .NET type. Deserialization will happen on a new thread. The type of the object to deserialize to. The JSON to deserialize. A task that represents the asynchronous deserialize operation. The value of the TResult parameter contains the deserialized object from the JSON string. Asynchronously deserializes the JSON to the specified .NET type using . Deserialization will happen on a new thread. The type of the object to deserialize to. The JSON to deserialize. The used to deserialize the object. If this is null, default serialization settings will be is used. A task that represents the asynchronous deserialize operation. The value of the TResult parameter contains the deserialized object from the JSON string. Asynchronously deserializes the JSON to the specified .NET type. Deserialization will happen on a new thread. The JSON to deserialize. A task that represents the asynchronous deserialize operation. The value of the TResult parameter contains the deserialized object from the JSON string. Asynchronously deserializes the JSON to the specified .NET type using . Deserialization will happen on a new thread. The JSON to deserialize. The type of the object to deserialize to. The used to deserialize the object. If this is null, default serialization settings will be is used. A task that represents the asynchronous deserialize operation. The value of the TResult parameter contains the deserialized object from the JSON string. Populates the object with values from the JSON string. The JSON to populate values from. The target object to populate values onto. Populates the object with values from the JSON string using . The JSON to populate values from. The target object to populate values onto. The used to deserialize the object. If this is null, default serialization settings will be is used. Asynchronously populates the object with values from the JSON string using . The JSON to populate values from. The target object to populate values onto. The used to deserialize the object. If this is null, default serialization settings will be is used. A task that represents the asynchronous populate operation. Serializes the to a JSON string. The node to convert to JSON. A JSON string of the XNode. Serializes the to a JSON string using formatting. The node to convert to JSON. Indicates how the output is formatted. A JSON string of the XNode. Serializes the to a JSON string using formatting and omits the root object if is true. The node to serialize. Indicates how the output is formatted. Omits writing the root object. A JSON string of the XNode. Deserializes the from a JSON string. The JSON string. The deserialized XNode Deserializes the from a JSON string nested in a root elment specified by . The JSON string. The name of the root element to append when deserializing. The deserialized XNode Deserializes the from a JSON string nested in a root elment specified by and writes a .NET array attribute for collections. The JSON string. The name of the root element to append when deserializing. A flag to indicate whether to write the Json.NET array attribute. This attribute helps preserve arrays when converting the written XML back to JSON. The deserialized XNode Gets or sets a function that creates default . Default settings are automatically used by serialization methods on , and and on . To serialize without using any default settings create a with . Instructs the to use the specified when serializing the member or class. Initializes a new instance of the class. Type of the converter. Gets the type of the converter. The type of the converter. Represents a collection of . Instructs the how to serialize the collection. Initializes a new instance of the class. Initializes a new instance of the class with the specified container Id. The container Id. The exception thrown when an error occurs during Json serialization or deserialization. Initializes a new instance of the class. Initializes a new instance of the class with a specified error message. The error message that explains the reason for the exception. Initializes a new instance of the class with a specified error message and a reference to the inner exception that is the cause of this exception. The error message that explains the reason for the exception. The exception that is the cause of the current exception, or a null reference (Nothing in Visual Basic) if no inner exception is specified. Instructs the to deserialize properties with no matching class member into the specified collection and write values during serialization. Initializes a new instance of the class. Gets or sets a value that indicates whether to write extension data when serializing the object. true to write extension data when serializing the object; otherwise, false. The default is true. Gets or sets a value that indicates whether to read extension data when deserializing the object. true to read extension data when deserializing the object; otherwise, false. The default is true. Instructs the not to serialize the public field or public read/write property value. Instructs the how to serialize the object. Initializes a new instance of the class. Initializes a new instance of the class with the specified member serialization. The member serialization. Initializes a new instance of the class with the specified container Id. The container Id. Gets or sets the member serialization. The member serialization. Gets or sets a value that indicates whether the object's properties are required. A value indicating whether the object's properties are required. Instructs the to always serialize the member with the specified name. Initializes a new instance of the class. Initializes a new instance of the class with the specified name. Name of the property. Gets or sets the converter used when serializing the property's collection items. The collection's items converter. Gets or sets the null value handling used when serializing this property. The null value handling. Gets or sets the default value handling used when serializing this property. The default value handling. Gets or sets the reference loop handling used when serializing this property. The reference loop handling. Gets or sets the object creation handling used when deserializing this property. The object creation handling. Gets or sets the type name handling used when serializing this property. The type name handling. Gets or sets whether this property's value is serialized as a reference. Whether this property's value is serialized as a reference. Gets or sets the order of serialization and deserialization of a member. The numeric order of serialization or deserialization. Gets or sets a value indicating whether this property is required. A value indicating whether this property is required. Gets or sets the name of the property. The name of the property. Gets or sets the the reference loop handling used when serializing the property's collection items. The collection's items reference loop handling. Gets or sets the the type name handling used when serializing the property's collection items. The collection's items type name handling. Gets or sets whether this property's collection items are serialized as a reference. Whether this property's collection items are serialized as a reference. The exception thrown when an error occurs while reading Json text. Initializes a new instance of the class. Initializes a new instance of the class with a specified error message. The error message that explains the reason for the exception. Initializes a new instance of the class with a specified error message and a reference to the inner exception that is the cause of this exception. The error message that explains the reason for the exception. The exception that is the cause of the current exception, or a null reference (Nothing in Visual Basic) if no inner exception is specified. Gets the line number indicating where the error occurred. The line number indicating where the error occurred. Gets the line position indicating where the error occurred. The line position indicating where the error occurred. Gets the path to the JSON where the error occurred. The path to the JSON where the error occurred. The exception thrown when an error occurs during Json serialization or deserialization. Initializes a new instance of the class. Initializes a new instance of the class with a specified error message. The error message that explains the reason for the exception. Initializes a new instance of the class with a specified error message and a reference to the inner exception that is the cause of this exception. The error message that explains the reason for the exception. The exception that is the cause of the current exception, or a null reference (Nothing in Visual Basic) if no inner exception is specified. Serializes and deserializes objects into and from the JSON format. The enables you to control how objects are encoded into JSON. Initializes a new instance of the class. Creates a new instance. The will not use default settings. A new instance. The will not use default settings. Creates a new instance using the specified . The will not use default settings. The settings to be applied to the . A new instance using the specified . The will not use default settings. Creates a new instance. The will use default settings. A new instance. The will use default settings. Creates a new instance using the specified . The will use default settings. The settings to be applied to the . A new instance using the specified . The will use default settings. Populates the JSON values onto the target object. The that contains the JSON structure to reader values from. The target object to populate values onto. Populates the JSON values onto the target object. The that contains the JSON structure to reader values from. The target object to populate values onto. Deserializes the Json structure contained by the specified . The that contains the JSON structure to deserialize. The being deserialized. Deserializes the Json structure contained by the specified into an instance of the specified type. The containing the object. The of object being deserialized. The instance of being deserialized. Deserializes the Json structure contained by the specified into an instance of the specified type. The containing the object. The type of the object to deserialize. The instance of being deserialized. Deserializes the Json structure contained by the specified into an instance of the specified type. The containing the object. The of object being deserialized. The instance of being deserialized. Serializes the specified and writes the Json structure to a Stream using the specified . The used to write the Json structure. The to serialize. Serializes the specified and writes the Json structure to a Stream using the specified . The used to write the Json structure. The to serialize. The type of the value being serialized. This parameter is used when is Auto to write out the type name if the type of the value does not match. Specifing the type is optional. Serializes the specified and writes the Json structure to a Stream using the specified . The used to write the Json structure. The to serialize. The type of the value being serialized. This parameter is used when is Auto to write out the type name if the type of the value does not match. Specifing the type is optional. Serializes the specified and writes the Json structure to a Stream using the specified . The used to write the Json structure. The to serialize. Occurs when the errors during serialization and deserialization. Gets or sets the used by the serializer when resolving references. Gets or sets the used by the serializer when resolving type names. Gets or sets the used by the serializer when writing trace messages. The trace writer. Gets or sets how type name writing and reading is handled by the serializer. Gets or sets how a type name assembly is written and resolved by the serializer. The type name assembly format. Gets or sets how object references are preserved by the serializer. Get or set how reference loops (e.g. a class referencing itself) is handled. Get or set how missing members (e.g. JSON contains a property that isn't a member on the object) are handled during deserialization. Get or set how null values are handled during serialization and deserialization. Get or set how null default are handled during serialization and deserialization. Gets or sets how objects are created during deserialization. The object creation handling. Gets or sets how constructors are used during deserialization. The constructor handling. Gets a collection that will be used during serialization. Collection that will be used during serialization. Gets or sets the contract resolver used by the serializer when serializing .NET objects to JSON and vice versa. Gets or sets the used by the serializer when invoking serialization callback methods. The context. Indicates how JSON text output is formatted. Get or set how dates are written to JSON text. Get or set how time zones are handling during serialization and deserialization. Get or set how date formatted strings, e.g. "\/Date(1198908717056)\/" and "2012-03-21T05:40Z", are parsed when reading JSON. Get or set how floating point numbers, e.g. 1.0 and 9.9, are parsed when reading JSON text. Get or set how special floating point numbers, e.g. , and , are written as JSON text. Get or set how strings are escaped when writing JSON text. Get or set how and values are formatting when writing JSON text. Gets or sets the culture used when reading JSON. Defaults to . Gets or sets the maximum depth allowed when reading JSON. Reading past this depth will throw a . Gets a value indicating whether there will be a check for additional JSON content after deserializing an object. true if there will be a check for additional JSON content after deserializing an object; otherwise, false. Specifies the settings on a object. Initializes a new instance of the class. Gets or sets how reference loops (e.g. a class referencing itself) is handled. Reference loop handling. Gets or sets how missing members (e.g. JSON contains a property that isn't a member on the object) are handled during deserialization. Missing member handling. Gets or sets how objects are created during deserialization. The object creation handling. Gets or sets how null values are handled during serialization and deserialization. Null value handling. Gets or sets how null default are handled during serialization and deserialization. The default value handling. Gets or sets a collection that will be used during serialization. The converters. Gets or sets how object references are preserved by the serializer. The preserve references handling. Gets or sets how type name writing and reading is handled by the serializer. The type name handling. Gets or sets how a type name assembly is written and resolved by the serializer. The type name assembly format. Gets or sets how constructors are used during deserialization. The constructor handling. Gets or sets the contract resolver used by the serializer when serializing .NET objects to JSON and vice versa. The contract resolver. Gets or sets the used by the serializer when resolving references. The reference resolver. Gets or sets the used by the serializer when writing trace messages. The trace writer. Gets or sets the used by the serializer when resolving type names. The binder. Gets or sets the error handler called during serialization and deserialization. The error handler called during serialization and deserialization. Gets or sets the used by the serializer when invoking serialization callback methods. The context. Get or set how and values are formatting when writing JSON text. Gets or sets the maximum depth allowed when reading JSON. Reading past this depth will throw a . Indicates how JSON text output is formatted. Get or set how dates are written to JSON text. Get or set how time zones are handling during serialization and deserialization. Get or set how date formatted strings, e.g. "\/Date(1198908717056)\/" and "2012-03-21T05:40Z", are parsed when reading JSON. Get or set how special floating point numbers, e.g. , and , are written as JSON. Get or set how floating point numbers, e.g. 1.0 and 9.9, are parsed when reading JSON text. Get or set how strings are escaped when writing JSON text. Gets or sets the culture used when reading JSON. Defaults to . Gets a value indicating whether there will be a check for additional content after deserializing an object. true if there will be a check for additional content after deserializing an object; otherwise, false. Represents a reader that provides fast, non-cached, forward-only access to JSON text data. Initializes a new instance of the class with the specified . The TextReader containing the XML data to read. Reads the next JSON token from the stream. true if the next token was read successfully; false if there are no more tokens to read. Reads the next JSON token from the stream as a . A or a null reference if the next JSON token is null. This method will return null at the end of an array. Reads the next JSON token from the stream as a . A . This method will return null at the end of an array. Reads the next JSON token from the stream as a . A . This method will return null at the end of an array. Reads the next JSON token from the stream as a . A . This method will return null at the end of an array. Reads the next JSON token from the stream as a . A . This method will return null at the end of an array. Reads the next JSON token from the stream as a . A . This method will return null at the end of an array. Changes the state to closed. Gets a value indicating whether the class can return line information. true if LineNumber and LinePosition can be provided; otherwise, false. Gets the current line number. The current line number or 0 if no line information is available (for example, HasLineInfo returns false). Gets the current line position. The current line position or 0 if no line information is available (for example, HasLineInfo returns false). Represents a writer that provides a fast, non-cached, forward-only way of generating Json data. Creates an instance of the JsonWriter class using the specified . The TextWriter to write to. Flushes whatever is in the buffer to the underlying streams and also flushes the underlying stream. Closes this stream and the underlying stream. Writes the beginning of a Json object. Writes the beginning of a Json array. Writes the start of a constructor with the given name. The name of the constructor. Writes the specified end token. The end token to write. Writes the property name of a name/value pair on a Json object. The name of the property. Writes the property name of a name/value pair on a JSON object. The name of the property. A flag to indicate whether the text should be escaped when it is written as a JSON property name. Writes indent characters. Writes the JSON value delimiter. Writes an indent space. Writes a value. An error will raised if the value cannot be written as a single JSON token. The value to write. Writes a null value. Writes an undefined value. Writes raw JSON. The raw JSON to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes out a comment /*...*/ containing the specified text. Text to place inside the comment. Writes out the given white space. The string of white space characters. Gets or sets how many IndentChars to write for each level in the hierarchy when is set to Formatting.Indented. Gets or sets which character to use to quote attribute values. Gets or sets which character to use for indenting when is set to Formatting.Indented. Gets or sets a value indicating whether object names will be surrounded with quotes. Specifies the type of Json token. This is returned by the if a method has not been called. An object start token. An array start token. A constructor start token. An object property name. A comment. Raw JSON. An integer. A float. A string. A boolean. A null token. An undefined token. An object end token. An array end token. A constructor end token. A Date. Byte data. Represents a reader that provides validation. Initializes a new instance of the class that validates the content returned from the given . The to read from while validating. Reads the next JSON token from the stream as a . A . Reads the next JSON token from the stream as a . A or a null reference if the next JSON token is null. Reads the next JSON token from the stream as a . A . Reads the next JSON token from the stream as a . A . This method will return null at the end of an array. Reads the next JSON token from the stream as a . A . This method will return null at the end of an array. Reads the next JSON token from the stream as a . A . Reads the next JSON token from the stream. true if the next token was read successfully; false if there are no more tokens to read. Sets an event handler for receiving schema validation errors. Gets the text value of the current JSON token. Gets the depth of the current token in the JSON document. The depth of the current token in the JSON document. Gets the path of the current JSON token. Gets the quotation mark character used to enclose the value of a string. Gets the type of the current JSON token. Gets the Common Language Runtime (CLR) type for the current JSON token. Gets or sets the schema. The schema. Gets the used to construct this . The specified in the constructor. The exception thrown when an error occurs while reading Json text. Initializes a new instance of the class. Initializes a new instance of the class with a specified error message. The error message that explains the reason for the exception. Initializes a new instance of the class with a specified error message and a reference to the inner exception that is the cause of this exception. The error message that explains the reason for the exception. The exception that is the cause of the current exception, or a null reference (Nothing in Visual Basic) if no inner exception is specified. Gets the path to the JSON where the error occurred. The path to the JSON where the error occurred. Contains the LINQ to JSON extension methods. Returns a collection of tokens that contains the ancestors of every token in the source collection. The type of the objects in source, constrained to . An of that contains the source collection. An of that contains the ancestors of every node in the source collection. Returns a collection of tokens that contains the descendants of every token in the source collection. The type of the objects in source, constrained to . An of that contains the source collection. An of that contains the descendants of every node in the source collection. Returns a collection of child properties of every object in the source collection. An of that contains the source collection. An of that contains the properties of every object in the source collection. Returns a collection of child values of every object in the source collection with the given key. An of that contains the source collection. The token key. An of that contains the values of every node in the source collection with the given key. Returns a collection of child values of every object in the source collection. An of that contains the source collection. An of that contains the values of every node in the source collection. Returns a collection of converted child values of every object in the source collection with the given key. The type to convert the values to. An of that contains the source collection. The token key. An that contains the converted values of every node in the source collection with the given key. Returns a collection of converted child values of every object in the source collection. The type to convert the values to. An of that contains the source collection. An that contains the converted values of every node in the source collection. Converts the value. The type to convert the value to. A cast as a of . A converted value. Converts the value. The source collection type. The type to convert the value to. A cast as a of . A converted value. Returns a collection of child tokens of every array in the source collection. The source collection type. An of that contains the source collection. An of that contains the values of every node in the source collection. Returns a collection of converted child tokens of every array in the source collection. An of that contains the source collection. The type to convert the values to. The source collection type. An that contains the converted values of every node in the source collection. Returns the input typed as . An of that contains the source collection. The input typed as . Returns the input typed as . The source collection type. An of that contains the source collection. The input typed as . Represents a collection of objects. The type of token Gets the with the specified key. Represents a JSON array. Represents a token that can contain other tokens. Represents an abstract JSON token. Compares the values of two tokens, including the values of all descendant tokens. The first to compare. The second to compare. true if the tokens are equal; otherwise false. Adds the specified content immediately after this token. A content object that contains simple content or a collection of content objects to be added after this token. Adds the specified content immediately before this token. A content object that contains simple content or a collection of content objects to be added before this token. Returns a collection of the ancestor tokens of this token. A collection of the ancestor tokens of this token. Returns a collection of the sibling tokens after this token, in document order. A collection of the sibling tokens after this tokens, in document order. Returns a collection of the sibling tokens before this token, in document order. A collection of the sibling tokens before this token, in document order. Gets the with the specified key converted to the specified type. The type to convert the token to. The token key. The converted token value. Returns a collection of the child tokens of this token, in document order. An of containing the child tokens of this , in document order. Returns a collection of the child tokens of this token, in document order, filtered by the specified type. The type to filter the child tokens on. A containing the child tokens of this , in document order. Returns a collection of the child values of this token, in document order. The type to convert the values to. A containing the child values of this , in document order. Removes this token from its parent. Replaces this token with the specified token. The value. Writes this token to a . A into which this method will write. A collection of which will be used when writing the token. Returns the indented JSON for this token. The indented JSON for this token. Returns the JSON for this token using the given formatting and converters. Indicates how the output is formatted. A collection of which will be used when writing the token. The JSON for this token using the given formatting and converters. Performs an explicit conversion from to . The value. The result of the conversion. Performs an explicit conversion from to . The value. The result of the conversion. Performs an explicit conversion from to . The value. The result of the conversion. Performs an explicit conversion from to . The value. The result of the conversion. Performs an explicit conversion from to . The value. The result of the conversion. Performs an explicit conversion from to . The value. The result of the conversion. Performs an explicit conversion from to . The value. The result of the conversion. Performs an explicit conversion from to . The value. The result of the conversion. Performs an explicit conversion from to . The value. The result of the conversion. Performs an explicit conversion from to . The value. The result of the conversion. Performs an explicit conversion from to . The value. The result of the conversion. Performs an explicit conversion from to . The value. The result of the conversion. Performs an explicit conversion from to . The value. The result of the conversion. Performs an explicit conversion from to . The value. The result of the conversion. Performs an explicit conversion from to . The value. The result of the conversion. Performs an explicit conversion from to . The value. The result of the conversion. Performs an explicit conversion from to . The value. The result of the conversion. Performs an explicit conversion from to . The value. The result of the conversion. Performs an explicit conversion from to . The value. The result of the conversion. Performs an explicit conversion from to . The value. The result of the conversion. Performs an explicit conversion from to . The value. The result of the conversion. Performs an explicit conversion from to . The value. The result of the conversion. Performs an explicit conversion from to . The value. The result of the conversion. Performs an explicit conversion from to . The value. The result of the conversion. Performs an explicit conversion from to . The value. The result of the conversion. Performs an explicit conversion from to . The value. The result of the conversion. Performs an explicit conversion from to . The value. The result of the conversion. Performs an explicit conversion from to . The value. The result of the conversion. Performs an explicit conversion from to . The value. The result of the conversion. Performs an explicit conversion from to . The value. The result of the conversion. Performs an explicit conversion from to . The value. The result of the conversion. Performs an explicit conversion from to . The value. The result of the conversion. Performs an explicit conversion from to . The value. The result of the conversion. Performs an explicit conversion from to . The value. The result of the conversion. Performs an explicit conversion from to . The value. The result of the conversion. Performs an explicit conversion from to . The value. The result of the conversion. Performs an explicit conversion from to . The value. The result of the conversion. Performs an implicit conversion from to . The value to create a from. The initialized with the specified value. Performs an implicit conversion from to . The value to create a from. The initialized with the specified value. Performs an implicit conversion from to . The value to create a from. The initialized with the specified value. Performs an implicit conversion from to . The value to create a from. The initialized with the specified value. Performs an implicit conversion from to . The value to create a from. The initialized with the specified value. Performs an implicit conversion from to . The value to create a from. The initialized with the specified value. Performs an implicit conversion from to . The value to create a from. The initialized with the specified value. Performs an implicit conversion from to . The value to create a from. The initialized with the specified value. Performs an implicit conversion from to . The value to create a from. The initialized with the specified value. Performs an implicit conversion from to . The value to create a from. The initialized with the specified value. Performs an implicit conversion from to . The value to create a from. The initialized with the specified value. Performs an implicit conversion from to . The value to create a from. The initialized with the specified value. Performs an implicit conversion from to . The value to create a from. The initialized with the specified value. Performs an implicit conversion from to . The value to create a from. The initialized with the specified value. Performs an implicit conversion from to . The value to create a from. The initialized with the specified value. Performs an implicit conversion from to . The value to create a from. The initialized with the specified value. Performs an implicit conversion from to . The value to create a from. The initialized with the specified value. Performs an implicit conversion from to . The value to create a from. The initialized with the specified value. Performs an implicit conversion from to . The value to create a from. The initialized with the specified value. Performs an implicit conversion from to . The value to create a from. The initialized with the specified value. Performs an implicit conversion from to . The value to create a from. The initialized with the specified value. Performs an implicit conversion from to . The value to create a from. The initialized with the specified value. Performs an implicit conversion from to . The value to create a from. The initialized with the specified value. Performs an implicit conversion from to . The value to create a from. The initialized with the specified value. Performs an implicit conversion from to . The value to create a from. The initialized with the specified value. Performs an implicit conversion from to . The value to create a from. The initialized with the specified value. Performs an implicit conversion from to . The value to create a from. The initialized with the specified value. Performs an implicit conversion from to . The value to create a from. The initialized with the specified value. Performs an implicit conversion from to . The value to create a from. The initialized with the specified value. Performs an implicit conversion from to . The value to create a from. The initialized with the specified value. Performs an implicit conversion from to . The value to create a from. The initialized with the specified value. Performs an implicit conversion from to . The value to create a from. The initialized with the specified value. Performs an implicit conversion from to . The value to create a from. The initialized with the specified value. Performs an implicit conversion from to . The value to create a from. The initialized with the specified value. Performs an implicit conversion from to . The value to create a from. The initialized with the specified value. Creates an for this token. An that can be used to read this token and its descendants. Creates a from an object. The object that will be used to create . A with the value of the specified object Creates a from an object using the specified . The object that will be used to create . The that will be used when reading the object. A with the value of the specified object Creates the specified .NET type from the . The object type that the token will be deserialized to. The new object created from the JSON value. Creates the specified .NET type from the . The object type that the token will be deserialized to. The new object created from the JSON value. Creates the specified .NET type from the using the specified . The object type that the token will be deserialized to. The that will be used when creating the object. The new object created from the JSON value. Creates the specified .NET type from the using the specified . The object type that the token will be deserialized to. The that will be used when creating the object. The new object created from the JSON value. Creates a from a . An positioned at the token to read into this . An that contains the token and its descendant tokens that were read from the reader. The runtime type of the token is determined by the token type of the first token encountered in the reader. Load a from a string that contains JSON. A that contains JSON. A populated from the string that contains JSON. Creates a from a . An positioned at the token to read into this . An that contains the token and its descendant tokens that were read from the reader. The runtime type of the token is determined by the token type of the first token encountered in the reader. Selects a using a JPath expression. Selects the token that matches the object path. A that contains a JPath expression. A , or null. Selects a using a JPath expression. Selects the token that matches the object path. A that contains a JPath expression. A flag to indicate whether an error should be thrown if no tokens are found when evaluating part of the expression. A . Selects a collection of elements using a JPath expression. A that contains a JPath expression. An that contains the selected elements. Selects a collection of elements using a JPath expression. A that contains a JPath expression. A flag to indicate whether an error should be thrown if no tokens are found when evaluating part of the expression. An that contains the selected elements. Returns the responsible for binding operations performed on this object. The expression tree representation of the runtime value. The to bind this object. Returns the responsible for binding operations performed on this object. The expression tree representation of the runtime value. The to bind this object. Creates a new instance of the . All child tokens are recursively cloned. A new instance of the . Gets a comparer that can compare two tokens for value equality. A that can compare two nodes for value equality. Gets or sets the parent. The parent. Gets the root of this . The root of this . Gets the node type for this . The type. Gets a value indicating whether this token has child tokens. true if this token has child values; otherwise, false. Gets the next sibling token of this node. The that contains the next sibling token. Gets the previous sibling token of this node. The that contains the previous sibling token. Gets the path of the JSON token. Gets the with the specified key. The with the specified key. Get the first child token of this token. A containing the first child token of the . Get the last child token of this token. A containing the last child token of the . Raises the event. The instance containing the event data. Returns a collection of the child tokens of this token, in document order. An of containing the child tokens of this , in document order. Returns a collection of the child values of this token, in document order. The type to convert the values to. A containing the child values of this , in document order. Returns a collection of the descendant tokens for this token in document order. An containing the descendant tokens of the . Adds the specified content as children of this . The content to be added. Adds the specified content as the first children of this . The content to be added. Creates an that can be used to add tokens to the . An that is ready to have content written to it. Replaces the children nodes of this token with the specified content. The content. Removes the child nodes from this token. Occurs when the items list of the collection has changed, or the collection is reset. Gets the container's children tokens. The container's children tokens. Gets a value indicating whether this token has child tokens. true if this token has child values; otherwise, false. Get the first child token of this token. A containing the first child token of the . Get the last child token of this token. A containing the last child token of the . Gets the count of child JSON tokens. The count of child JSON tokens Initializes a new instance of the class. Initializes a new instance of the class from another object. A object to copy from. Initializes a new instance of the class with the specified content. The contents of the array. Initializes a new instance of the class with the specified content. The contents of the array. Loads an from a . A that will be read for the content of the . A that contains the JSON that was read from the specified . Load a from a string that contains JSON. A that contains JSON. A populated from the string that contains JSON. Creates a from an object. The object that will be used to create . A with the values of the specified object Creates a from an object. The object that will be used to create . The that will be used to read the object. A with the values of the specified object Writes this token to a . A into which this method will write. A collection of which will be used when writing the token. Determines the index of a specific item in the . The object to locate in the . The index of if found in the list; otherwise, -1. Inserts an item to the at the specified index. The zero-based index at which should be inserted. The object to insert into the . is not a valid index in the . The is read-only. Removes the item at the specified index. The zero-based index of the item to remove. is not a valid index in the . The is read-only. Returns an enumerator that iterates through the collection. A that can be used to iterate through the collection. Adds an item to the . The object to add to the . The is read-only. Removes all items from the . The is read-only. Determines whether the contains a specific value. The object to locate in the . true if is found in the ; otherwise, false. Copies to. The array. Index of the array. Removes the first occurrence of a specific object from the . The object to remove from the . true if was successfully removed from the ; otherwise, false. This method also returns false if is not found in the original . The is read-only. Gets the container's children tokens. The container's children tokens. Gets the node type for this . The type. Gets the with the specified key. The with the specified key. Gets or sets the at the specified index. Gets a value indicating whether the is read-only. true if the is read-only; otherwise, false. Represents a JSON constructor. Initializes a new instance of the class. Initializes a new instance of the class from another object. A object to copy from. Initializes a new instance of the class with the specified name and content. The constructor name. The contents of the constructor. Initializes a new instance of the class with the specified name and content. The constructor name. The contents of the constructor. Initializes a new instance of the class with the specified name. The constructor name. Writes this token to a . A into which this method will write. A collection of which will be used when writing the token. Loads an from a . A that will be read for the content of the . A that contains the JSON that was read from the specified . Gets the container's children tokens. The container's children tokens. Gets or sets the name of this constructor. The constructor name. Gets the node type for this . The type. Gets the with the specified key. The with the specified key. Represents a collection of objects. The type of token An empty collection of objects. Initializes a new instance of the struct. The enumerable. Returns an enumerator that iterates through the collection. A that can be used to iterate through the collection. Returns an enumerator that iterates through a collection. An object that can be used to iterate through the collection. Determines whether the specified is equal to this instance. The to compare with this instance. true if the specified is equal to this instance; otherwise, false. Returns a hash code for this instance. A hash code for this instance, suitable for use in hashing algorithms and data structures like a hash table. Gets the with the specified key. Represents a JSON object. Initializes a new instance of the class. Initializes a new instance of the class from another object. A object to copy from. Initializes a new instance of the class with the specified content. The contents of the object. Initializes a new instance of the class with the specified content. The contents of the object. Gets an of this object's properties. An of this object's properties. Gets a the specified name. The property name. A with the specified name or null. Gets an of this object's property values. An of this object's property values. Loads an from a . A that will be read for the content of the . A that contains the JSON that was read from the specified . Load a from a string that contains JSON. A that contains JSON. A populated from the string that contains JSON. Creates a from an object. The object that will be used to create . A with the values of the specified object Creates a from an object. The object that will be used to create . The that will be used to read the object. A with the values of the specified object Writes this token to a . A into which this method will write. A collection of which will be used when writing the token. Gets the with the specified property name. Name of the property. The with the specified property name. Gets the with the specified property name. The exact property name will be searched for first and if no matching property is found then the will be used to match a property. Name of the property. One of the enumeration values that specifies how the strings will be compared. The with the specified property name. Tries to get the with the specified property name. The exact property name will be searched for first and if no matching property is found then the will be used to match a property. Name of the property. The value. One of the enumeration values that specifies how the strings will be compared. true if a value was successfully retrieved; otherwise, false. Adds the specified property name. Name of the property. The value. Removes the property with the specified name. Name of the property. true if item was successfully removed; otherwise, false. Tries the get value. Name of the property. The value. true if a value was successfully retrieved; otherwise, false. Returns an enumerator that iterates through the collection. A that can be used to iterate through the collection. Raises the event with the provided arguments. Name of the property. Returns the responsible for binding operations performed on this object. The expression tree representation of the runtime value. The to bind this object. Gets the container's children tokens. The container's children tokens. Occurs when a property value changes. Gets the node type for this . The type. Gets the with the specified key. The with the specified key. Gets or sets the with the specified property name. Represents a JSON property. Initializes a new instance of the class from another object. A object to copy from. Initializes a new instance of the class. The property name. The property content. Initializes a new instance of the class. The property name. The property content. Writes this token to a . A into which this method will write. A collection of which will be used when writing the token. Loads an from a . A that will be read for the content of the . A that contains the JSON that was read from the specified . Gets the container's children tokens. The container's children tokens. Gets the property name. The property name. Gets or sets the property value. The property value. Gets the node type for this . The type. Represents a raw JSON string. Represents a value in JSON (string, integer, date, etc). Initializes a new instance of the class from another object. A object to copy from. Initializes a new instance of the class with the given value. The value. Initializes a new instance of the class with the given value. The value. Initializes a new instance of the class with the given value. The value. Initializes a new instance of the class with the given value. The value. Initializes a new instance of the class with the given value. The value. Initializes a new instance of the class with the given value. The value. Initializes a new instance of the class with the given value. The value. Initializes a new instance of the class with the given value. The value. Initializes a new instance of the class with the given value. The value. Initializes a new instance of the class with the given value. The value. Initializes a new instance of the class with the given value. The value. Initializes a new instance of the class with the given value. The value. Initializes a new instance of the class with the given value. The value. Initializes a new instance of the class with the given value. The value. Creates a comment with the given value. The value. A comment with the given value. Creates a string with the given value. The value. A string with the given value. Writes this token to a . A into which this method will write. A collection of which will be used when writing the token. Indicates whether the current object is equal to another object of the same type. true if the current object is equal to the parameter; otherwise, false. An object to compare with this object. Determines whether the specified is equal to the current . The to compare with the current . true if the specified is equal to the current ; otherwise, false. The parameter is null. Serves as a hash function for a particular type. A hash code for the current . Returns a that represents this instance. A that represents this instance. Returns a that represents this instance. The format. A that represents this instance. Returns a that represents this instance. The format provider. A that represents this instance. Returns a that represents this instance. The format. The format provider. A that represents this instance. Returns the responsible for binding operations performed on this object. The expression tree representation of the runtime value. The to bind this object. Compares the current instance with another object of the same type and returns an integer that indicates whether the current instance precedes, follows, or occurs in the same position in the sort order as the other object. An object to compare with this instance. A 32-bit signed integer that indicates the relative order of the objects being compared. The return value has these meanings: Value Meaning Less than zero This instance is less than . Zero This instance is equal to . Greater than zero This instance is greater than . is not the same type as this instance. Gets a value indicating whether this token has child tokens. true if this token has child values; otherwise, false. Gets the node type for this . The type. Gets or sets the underlying token value. The underlying token value. Initializes a new instance of the class from another object. A object to copy from. Initializes a new instance of the class. The raw json. Creates an instance of with the content of the reader's current token. The reader. An instance of with the content of the reader's current token. Compares tokens to determine whether they are equal. Determines whether the specified objects are equal. The first object of type to compare. The second object of type to compare. true if the specified objects are equal; otherwise, false. Returns a hash code for the specified object. The for which a hash code is to be returned. A hash code for the specified object. The type of is a reference type and is null. Represents a reader that provides fast, non-cached, forward-only access to serialized Json data. Initializes a new instance of the class. The token to read from. Reads the next JSON token from the stream as a . A or a null reference if the next JSON token is null. This method will return null at the end of an array. Reads the next JSON token from the stream as a . A . This method will return null at the end of an array. Reads the next JSON token from the stream as a . A . This method will return null at the end of an array. Reads the next JSON token from the stream as a . A . This method will return null at the end of an array. Reads the next JSON token from the stream as a . A . This method will return null at the end of an array. Reads the next JSON token from the stream as a . A . This method will return null at the end of an array. Reads the next JSON token from the stream. true if the next token was read successfully; false if there are no more tokens to read. Specifies the type of token. No token type has been set. A JSON object. A JSON array. A JSON constructor. A JSON object property. A comment. An integer value. A float value. A string value. A boolean value. A null value. An undefined value. A date value. A raw JSON value. A collection of bytes value. A Guid value. A Uri value. A TimeSpan value. Represents a writer that provides a fast, non-cached, forward-only way of generating Json data. Initializes a new instance of the class writing to the given . The container being written to. Initializes a new instance of the class. Flushes whatever is in the buffer to the underlying streams and also flushes the underlying stream. Closes this stream and the underlying stream. Writes the beginning of a Json object. Writes the beginning of a Json array. Writes the start of a constructor with the given name. The name of the constructor. Writes the end. The token. Writes the property name of a name/value pair on a Json object. The name of the property. Writes a value. An error will raised if the value cannot be written as a single JSON token. The value to write. Writes a null value. Writes an undefined value. Writes raw JSON. The raw JSON to write. Writes out a comment /*...*/ containing the specified text. Text to place inside the comment. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Gets the token being writen. The token being writen. Specifies the member serialization options for the . All public members are serialized by default. Members can be excluded using or . This is the default member serialization mode. Only members must be marked with or are serialized. This member serialization mode can also be set by marking the class with . All public and private fields are serialized. Members can be excluded using or . This member serialization mode can also be set by marking the class with and setting IgnoreSerializableAttribute on to false. Specifies missing member handling options for the . Ignore a missing member and do not attempt to deserialize it. Throw a when a missing member is encountered during deserialization. Specifies null value handling options for the . Include null values when serializing and deserializing objects. Ignore null values when serializing and deserializing objects. Specifies how object creation is handled by the . Reuse existing objects, create new objects when needed. Only reuse existing objects. Always create new objects. Specifies reference handling options for the . Note that references cannot be preserved when a value is set via a non-default constructor such as types that implement ISerializable. Do not preserve references when serializing types. Preserve references when serializing into a JSON object structure. Preserve references when serializing into a JSON array structure. Preserve references when serializing. Specifies reference loop handling options for the . Throw a when a loop is encountered. Ignore loop references and do not serialize. Serialize loop references. Indicating whether a property is required. The property is not required. The default state. The property must be defined in JSON but can be a null value. The property must be defined in JSON and cannot be a null value. Contains the JSON schema extension methods. Determines whether the is valid. The source to test. The schema to test with. true if the specified is valid; otherwise, false. Determines whether the is valid. The source to test. The schema to test with. When this method returns, contains any error messages generated while validating. true if the specified is valid; otherwise, false. Validates the specified . The source to test. The schema to test with. Validates the specified . The source to test. The schema to test with. The validation event handler. An in-memory representation of a JSON Schema. Initializes a new instance of the class. Reads a from the specified . The containing the JSON Schema to read. The object representing the JSON Schema. Reads a from the specified . The containing the JSON Schema to read. The to use when resolving schema references. The object representing the JSON Schema. Load a from a string that contains schema JSON. A that contains JSON. A populated from the string that contains JSON. Parses the specified json. The json. The resolver. A populated from the string that contains JSON. Writes this schema to a . A into which this method will write. Writes this schema to a using the specified . A into which this method will write. The resolver used. Returns a that represents the current . A that represents the current . Gets or sets the id. Gets or sets the title. Gets or sets whether the object is required. Gets or sets whether the object is read only. Gets or sets whether the object is visible to users. Gets or sets whether the object is transient. Gets or sets the description of the object. Gets or sets the types of values allowed by the object. The type. Gets or sets the pattern. The pattern. Gets or sets the minimum length. The minimum length. Gets or sets the maximum length. The maximum length. Gets or sets a number that the value should be divisble by. A number that the value should be divisble by. Gets or sets the minimum. The minimum. Gets or sets the maximum. The maximum. Gets or sets a flag indicating whether the value can not equal the number defined by the "minimum" attribute. A flag indicating whether the value can not equal the number defined by the "minimum" attribute. Gets or sets a flag indicating whether the value can not equal the number defined by the "maximum" attribute. A flag indicating whether the value can not equal the number defined by the "maximum" attribute. Gets or sets the minimum number of items. The minimum number of items. Gets or sets the maximum number of items. The maximum number of items. Gets or sets the of items. The of items. Gets or sets a value indicating whether items in an array are validated using the instance at their array position from . true if items are validated using their array position; otherwise, false. Gets or sets the of additional items. The of additional items. Gets or sets a value indicating whether additional items are allowed. true if additional items are allowed; otherwise, false. Gets or sets whether the array items must be unique. Gets or sets the of properties. The of properties. Gets or sets the of additional properties. The of additional properties. Gets or sets the pattern properties. The pattern properties. Gets or sets a value indicating whether additional properties are allowed. true if additional properties are allowed; otherwise, false. Gets or sets the required property if this property is present. The required property if this property is present. Gets or sets the a collection of valid enum values allowed. A collection of valid enum values allowed. Gets or sets disallowed types. The disallow types. Gets or sets the default value. The default value. Gets or sets the collection of that this schema extends. The collection of that this schema extends. Gets or sets the format. The format. Returns detailed information about the schema exception. Initializes a new instance of the class. Initializes a new instance of the class with a specified error message. The error message that explains the reason for the exception. Initializes a new instance of the class with a specified error message and a reference to the inner exception that is the cause of this exception. The error message that explains the reason for the exception. The exception that is the cause of the current exception, or a null reference (Nothing in Visual Basic) if no inner exception is specified. Gets the line number indicating where the error occurred. The line number indicating where the error occurred. Gets the line position indicating where the error occurred. The line position indicating where the error occurred. Gets the path to the JSON where the error occurred. The path to the JSON where the error occurred. Generates a from a specified . Generate a from the specified type. The type to generate a from. A generated from the specified type. Generate a from the specified type. The type to generate a from. The used to resolve schema references. A generated from the specified type. Generate a from the specified type. The type to generate a from. Specify whether the generated root will be nullable. A generated from the specified type. Generate a from the specified type. The type to generate a from. The used to resolve schema references. Specify whether the generated root will be nullable. A generated from the specified type. Gets or sets how undefined schemas are handled by the serializer. Gets or sets the contract resolver. The contract resolver. Resolves from an id. Initializes a new instance of the class. Gets a for the specified reference. The id. A for the specified reference. Gets or sets the loaded schemas. The loaded schemas. The value types allowed by the . No type specified. String type. Float type. Integer type. Boolean type. Object type. Array type. Null type. Any type. Specifies undefined schema Id handling options for the . Do not infer a schema Id. Use the .NET type name as the schema Id. Use the assembly qualified .NET type name as the schema Id. Returns detailed information related to the . Gets the associated with the validation error. The JsonSchemaException associated with the validation error. Gets the path of the JSON location where the validation error occurred. The path of the JSON location where the validation error occurred. Gets the text description corresponding to the validation error. The text description. Represents the callback method that will handle JSON schema validation events and the . Allows users to control class loading and mandate what class to load. When overridden in a derived class, controls the binding of a serialized object to a type. Specifies the name of the serialized object. Specifies the name of the serialized object The type of the object the formatter creates a new instance of. When overridden in a derived class, controls the binding of a serialized object to a type. The type of the object the formatter creates a new instance of. Specifies the name of the serialized object. Specifies the name of the serialized object. Resolves member mappings for a type, camel casing property names. Used by to resolves a for a given . Used by to resolves a for a given . Resolves the contract for a given type. The type to resolve a contract for. The contract for a given type. Initializes a new instance of the class. Initializes a new instance of the class. If set to true the will use a cached shared with other resolvers of the same type. Sharing the cache will significantly performance because expensive reflection will only happen once but could cause unexpected behavior if different instances of the resolver are suppose to produce different results. When set to false it is highly recommended to reuse instances with the . Resolves the contract for a given type. The type to resolve a contract for. The contract for a given type. Gets the serializable members for the type. The type to get serializable members for. The serializable members for the type. Creates a for the given type. Type of the object. A for the given type. Creates the constructor parameters. The constructor to create properties for. The type's member properties. Properties for the given . Creates a for the given . The matching member property. The constructor parameter. A created for the given . Resolves the default for the contract. Type of the object. The contract's default . Creates a for the given type. Type of the object. A for the given type. Creates a for the given type. Type of the object. A for the given type. Creates a for the given type. Type of the object. A for the given type. Creates a for the given type. Type of the object. A for the given type. Creates a for the given type. Type of the object. A for the given type. Creates a for the given type. Type of the object. A for the given type. Determines which contract type is created for the given type. Type of the object. A for the given type. Creates properties for the given . The type to create properties for. /// The member serialization mode for the type. Properties for the given . Creates the used by the serializer to get and set values from a member. The member. The used by the serializer to get and set values from a member. Creates a for the given . The member's parent . The member to create a for. A created for the given . Resolves the name of the property. Name of the property. Name of the property. Gets the resolved name of the property. Name of the property. Name of the property. Gets a value indicating whether members are being get and set using dynamic code generation. This value is determined by the runtime permissions available. true if using dynamic code generation; otherwise, false. Gets or sets a value indicating whether compiler generated members should be serialized. true if serialized compiler generated members; otherwise, false. Initializes a new instance of the class. Resolves the name of the property. Name of the property. The property name camel cased. Used to resolve references when serializing and deserializing JSON by the . Resolves a reference to its object. The serialization context. The reference to resolve. The object that Gets the reference for the sepecified object. The serialization context. The object to get a reference for. The reference to the object. Determines whether the specified object is referenced. The serialization context. The object to test for a reference. true if the specified object is referenced; otherwise, false. Adds a reference to the specified object. The serialization context. The reference. The object to reference. The default serialization binder used when resolving and loading classes from type names. When overridden in a derived class, controls the binding of a serialized object to a type. Specifies the name of the serialized object. Specifies the name of the serialized object. The type of the object the formatter creates a new instance of. When overridden in a derived class, controls the binding of a serialized object to a type. The type of the object the formatter creates a new instance of. Specifies the name of the serialized object. Specifies the name of the serialized object. Provides information surrounding an error. Gets the error. The error. Gets the original object that caused the error. The original object that caused the error. Gets the member that caused the error. The member that caused the error. Gets the path of the JSON location where the error occurred. The path of the JSON location where the error occurred. Gets or sets a value indicating whether this is handled. true if handled; otherwise, false. Provides data for the Error event. Initializes a new instance of the class. The current object. The error context. Gets the current object the error event is being raised against. The current object the error event is being raised against. Gets the error context. The error context. Get and set values for a using dynamic methods. Provides methods to get and set values. Sets the value. The target to set the value on. The value to set on the target. Gets the value. The target to get the value from. The value. Initializes a new instance of the class. The member info. Sets the value. The target to set the value on. The value to set on the target. Gets the value. The target to get the value from. The value. Represents a trace writer. Writes the specified trace level, message and optional exception. The at which to write this trace. The trace message. The trace exception. This parameter is optional. Gets the that will be used to filter the trace messages passed to the writer. For example a filter level of Info will exclude Verbose messages and include Info, Warning and Error messages. The that will be used to filter the trace messages passed to the writer. Contract details for a used by the . Contract details for a used by the . Contract details for a used by the . Gets the underlying type for the contract. The underlying type for the contract. Gets or sets the type created during deserialization. The type created during deserialization. Gets or sets whether this type contract is serialized as a reference. Whether this type contract is serialized as a reference. Gets or sets the default for this contract. The converter. Gets or sets all methods called immediately after deserialization of the object. The methods called immediately after deserialization of the object. Gets or sets all methods called during deserialization of the object. The methods called during deserialization of the object. Gets or sets all methods called after serialization of the object graph. The methods called after serialization of the object graph. Gets or sets all methods called before serialization of the object. The methods called before serialization of the object. Gets or sets all method called when an error is thrown during the serialization of the object. The methods called when an error is thrown during the serialization of the object. Gets or sets the method called immediately after deserialization of the object. The method called immediately after deserialization of the object. Gets or sets the method called during deserialization of the object. The method called during deserialization of the object. Gets or sets the method called after serialization of the object graph. The method called after serialization of the object graph. Gets or sets the method called before serialization of the object. The method called before serialization of the object. Gets or sets the method called when an error is thrown during the serialization of the object. The method called when an error is thrown during the serialization of the object. Gets or sets the default creator method used to create the object. The default creator method used to create the object. Gets or sets a value indicating whether the default creator is non public. true if the default object creator is non-public; otherwise, false. Initializes a new instance of the class. The underlying type for the contract. Gets or sets the default collection items . The converter. Gets or sets a value indicating whether the collection items preserve object references. true if collection items preserve object references; otherwise, false. Gets or sets the collection item reference loop handling. The reference loop handling. Gets or sets the collection item type name handling. The type name handling. Initializes a new instance of the class. The underlying type for the contract. Gets the of the collection items. The of the collection items. Gets a value indicating whether the collection type is a multidimensional array. true if the collection type is a multidimensional array; otherwise, false. Handles serialization callback events. The object that raised the callback event. The streaming context. Handles serialization error callback events. The object that raised the callback event. The streaming context. The error context. Sets extension data for an object during deserialization. The object to set extension data on. The extension data key. The extension data value. Gets extension data for an object during serialization. The object to set extension data on. Contract details for a used by the . Initializes a new instance of the class. The underlying type for the contract. Gets or sets the property name resolver. The property name resolver. Gets the of the dictionary keys. The of the dictionary keys. Gets the of the dictionary values. The of the dictionary values. Contract details for a used by the . Initializes a new instance of the class. The underlying type for the contract. Gets the object's properties. The object's properties. Gets or sets the property name resolver. The property name resolver. Contract details for a used by the . Initializes a new instance of the class. The underlying type for the contract. Contract details for a used by the . Initializes a new instance of the class. The underlying type for the contract. Gets or sets the object member serialization. The member object serialization. Gets or sets a value that indicates whether the object's properties are required. A value indicating whether the object's properties are required. Gets the object's properties. The object's properties. Gets the constructor parameters required for any non-default constructor Gets or sets the override constructor used to create the object. This is set when a constructor is marked up using the JsonConstructor attribute. The override constructor. Gets or sets the parametrized constructor used to create the object. The parametrized constructor. Gets or sets the extension data setter. Gets or sets the extension data getter. Contract details for a used by the . Initializes a new instance of the class. The underlying type for the contract. Maps a JSON property to a .NET member or constructor parameter. Returns a that represents this instance. A that represents this instance. Gets or sets the name of the property. The name of the property. Gets or sets the type that declared this property. The type that declared this property. Gets or sets the order of serialization and deserialization of a member. The numeric order of serialization or deserialization. Gets or sets the name of the underlying member or parameter. The name of the underlying member or parameter. Gets the that will get and set the during serialization. The that will get and set the during serialization. Gets or sets the type of the property. The type of the property. Gets or sets the for the property. If set this converter takes presidence over the contract converter for the property type. The converter. Gets or sets the member converter. The member converter. Gets or sets a value indicating whether this is ignored. true if ignored; otherwise, false. Gets or sets a value indicating whether this is readable. true if readable; otherwise, false. Gets or sets a value indicating whether this is writable. true if writable; otherwise, false. Gets or sets a value indicating whether this has a member attribute. true if has a member attribute; otherwise, false. Gets the default value. The default value. Gets or sets a value indicating whether this is required. A value indicating whether this is required. Gets or sets a value indicating whether this property preserves object references. true if this instance is reference; otherwise, false. Gets or sets the property null value handling. The null value handling. Gets or sets the property default value handling. The default value handling. Gets or sets the property reference loop handling. The reference loop handling. Gets or sets the property object creation handling. The object creation handling. Gets or sets or sets the type name handling. The type name handling. Gets or sets a predicate used to determine whether the property should be serialize. A predicate used to determine whether the property should be serialize. Gets or sets a predicate used to determine whether the property should be serialized. A predicate used to determine whether the property should be serialized. Gets or sets an action used to set whether the property has been deserialized. An action used to set whether the property has been deserialized. Gets or sets the converter used when serializing the property's collection items. The collection's items converter. Gets or sets whether this property's collection items are serialized as a reference. Whether this property's collection items are serialized as a reference. Gets or sets the the type name handling used when serializing the property's collection items. The collection's items type name handling. Gets or sets the the reference loop handling used when serializing the property's collection items. The collection's items reference loop handling. A collection of objects. Initializes a new instance of the class. The type. When implemented in a derived class, extracts the key from the specified element. The element from which to extract the key. The key for the specified element. Adds a object. The property to add to the collection. Gets the closest matching object. First attempts to get an exact case match of propertyName and then a case insensitive match. Name of the property. A matching property if found. Gets a property by property name. The name of the property to get. Type property name string comparison. A matching property if found. Contract details for a used by the . Initializes a new instance of the class. The underlying type for the contract. Represents a method that constructs an object. The object type to create. When applied to a method, specifies that the method is called when an error occurs serializing an object. Get and set values for a using reflection. Initializes a new instance of the class. The member info. Sets the value. The target to set the value on. The value to set on the target. Gets the value. The target to get the value from. The value. Represents a trace writer that writes to memory. When the trace message limit is reached then old trace messages will be removed as new messages are added. Initializes a new instance of the class. Writes the specified trace level, message and optional exception. The at which to write this trace. The trace message. The trace exception. This parameter is optional. Returns an enumeration of the most recent trace messages. An enumeration of the most recent trace messages. Returns a of the most recent trace messages. A of the most recent trace messages. Gets the that will be used to filter the trace messages passed to the writer. For example a filter level of Info will exclude Verbose messages and include Info, Warning and Error messages. The that will be used to filter the trace messages passed to the writer. Specifies how strings are escaped when writing JSON text. Only control characters (e.g. newline) are escaped. All non-ASCII and control characters (e.g. newline) are escaped. HTML (<, >, &, ', ") and control characters (e.g. newline) are escaped. Specifies what messages to output for the class. Output no tracing and debugging messages. Output error-handling messages. Output warnings and error-handling messages. Output informational messages, warnings, and error-handling messages. Output all debugging and tracing messages. Specifies type name handling options for the . Do not include the .NET type name when serializing types. Include the .NET type name when serializing into a JSON object structure. Include the .NET type name when serializing into a JSON array structure. Always include the .NET type name when serializing. Include the .NET type name when the type of the object being serialized is not the same as its declared type. Determines whether the collection is null or empty. The collection. true if the collection is null or empty; otherwise, false. Adds the elements of the specified collection to the specified generic IList. The list to add to. The collection of elements to add. Returns the index of the first occurrence in a sequence by using a specified IEqualityComparer. The type of the elements of source. A sequence in which to locate a value. The object to locate in the sequence An equality comparer to compare values. The zero-based index of the first occurrence of value within the entire sequence, if found; otherwise, –1. Converts the value to the specified type. The value to convert. The culture to use when converting. The type to convert the value to. The converted type. Converts the value to the specified type. The value to convert. The culture to use when converting. The type to convert the value to. The converted value if the conversion was successful or the default value of T if it failed. true if initialValue was converted successfully; otherwise, false. Converts the value to the specified type. If the value is unable to be converted, the value is checked whether it assignable to the specified type. The value to convert. The culture to use when converting. The type to convert or cast the value to. The converted type. If conversion was unsuccessful, the initial value is returned if assignable to the target type. Helper method for generating a MetaObject which calls a specific method on Dynamic that returns a result Helper method for generating a MetaObject which calls a specific method on Dynamic, but uses one of the arguments for the result. Helper method for generating a MetaObject which calls a specific method on Dynamic, but uses one of the arguments for the result. Returns a Restrictions object which includes our current restrictions merged with a restriction limiting our type Gets a dictionary of the names and values of an Enum type. Gets a dictionary of the names and values of an Enum type. The enum type to get names and values for. Gets the type of the typed collection's items. The type. The type of the typed collection's items. Gets the member's underlying type. The member. The underlying type of the member. Determines whether the member is an indexed property. The member. true if the member is an indexed property; otherwise, false. Determines whether the property is an indexed property. The property. true if the property is an indexed property; otherwise, false. Gets the member's value on the object. The member. The target object. The member's value on the object. Sets the member's value on the target object. The member. The target. The value. Determines whether the specified MemberInfo can be read. The MemberInfo to determine whether can be read. /// if set to true then allow the member to be gotten non-publicly. true if the specified MemberInfo can be read; otherwise, false. Determines whether the specified MemberInfo can be set. The MemberInfo to determine whether can be set. if set to true then allow the member to be set non-publicly. if set to true then allow the member to be set if read-only. true if the specified MemberInfo can be set; otherwise, false. Builds a string. Unlike StringBuilder this class lets you reuse it's internal buffer. Determines whether the string is all white space. Empty string will return false. The string to test whether it is all white space. true if the string is all white space; otherwise, false. Nulls an empty string. The string. Null if the string was null, otherwise the string unchanged. Specifies the state of the . An exception has been thrown, which has left the in an invalid state. You may call the method to put the in the Closed state. Any other method calls results in an being thrown. The method has been called. An object is being written. A array is being written. A constructor is being written. A property is being written. A write method has not been called. ================================================ FILE: packages/Newtonsoft.Json.6.0.2/lib/portable-net40+sl5+wp80+win8+monotouch+monoandroid/Newtonsoft.Json.xml ================================================ Newtonsoft.Json Represents a BSON Oid (object id). Initializes a new instance of the class. The Oid value. Gets or sets the value of the Oid. The value of the Oid. Represents a reader that provides fast, non-cached, forward-only access to serialized Json data. Represents a reader that provides fast, non-cached, forward-only access to serialized Json data. Initializes a new instance of the class with the specified . Reads the next JSON token from the stream. true if the next token was read successfully; false if there are no more tokens to read. Reads the next JSON token from the stream as a . A . This method will return null at the end of an array. Reads the next JSON token from the stream as a . A . This method will return null at the end of an array. Reads the next JSON token from the stream as a . A or a null reference if the next JSON token is null. This method will return null at the end of an array. Reads the next JSON token from the stream as a . A . This method will return null at the end of an array. Reads the next JSON token from the stream as a . A . This method will return null at the end of an array. Reads the next JSON token from the stream as a . A . This method will return null at the end of an array. Skips the children of the current token. Sets the current token. The new token. Sets the current token and value. The new token. The value. Sets the state based on current token type. Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources. Releases unmanaged and - optionally - managed resources true to release both managed and unmanaged resources; false to release only unmanaged resources. Changes the to Closed. Gets the current reader state. The current reader state. Gets or sets a value indicating whether the underlying stream or should be closed when the reader is closed. true to close the underlying stream or when the reader is closed; otherwise false. The default is true. Gets or sets a value indicating whether multiple pieces of JSON content can be read from a continuous stream without erroring. true to support reading multiple pieces of JSON content; otherwise false. The default is false. Gets the quotation mark character used to enclose the value of a string. Get or set how time zones are handling when reading JSON. Get or set how date formatted strings, e.g. "\/Date(1198908717056)\/" and "2012-03-21T05:40Z", are parsed when reading JSON. Get or set how floating point numbers, e.g. 1.0 and 9.9, are parsed when reading JSON text. Gets or sets the maximum depth allowed when reading JSON. Reading past this depth will throw a . Gets the type of the current JSON token. Gets the text value of the current JSON token. Gets The Common Language Runtime (CLR) type for the current JSON token. Gets the depth of the current token in the JSON document. The depth of the current token in the JSON document. Gets the path of the current JSON token. Gets or sets the culture used when reading JSON. Defaults to . Specifies the state of the reader. The Read method has not been called. The end of the file has been reached successfully. Reader is at a property. Reader is at the start of an object. Reader is in an object. Reader is at the start of an array. Reader is in an array. The Close method has been called. Reader has just read a value. Reader is at the start of a constructor. Reader in a constructor. An error occurred that prevents the read operation from continuing. The end of the file has been reached successfully. Initializes a new instance of the class. The stream. Initializes a new instance of the class. The reader. Initializes a new instance of the class. The stream. if set to true the root object will be read as a JSON array. The used when reading values from BSON. Initializes a new instance of the class. The reader. if set to true the root object will be read as a JSON array. The used when reading values from BSON. Reads the next JSON token from the stream as a . A or a null reference if the next JSON token is null. This method will return null at the end of an array. Reads the next JSON token from the stream as a . A . This method will return null at the end of an array. Reads the next JSON token from the stream as a . A . This method will return null at the end of an array. Reads the next JSON token from the stream as a . A . This method will return null at the end of an array. Reads the next JSON token from the stream as a . A . This method will return null at the end of an array. Reads the next JSON token from the stream as a . A . This method will return null at the end of an array. Reads the next JSON token from the stream. true if the next token was read successfully; false if there are no more tokens to read. Changes the to Closed. Gets or sets a value indicating whether binary data reading should compatible with incorrect Json.NET 3.5 written binary. true if binary data reading will be compatible with incorrect Json.NET 3.5 written binary; otherwise, false. Gets or sets a value indicating whether the root object will be read as a JSON array. true if the root object will be read as a JSON array; otherwise, false. Gets or sets the used when reading values from BSON. The used when reading values from BSON. Represents a writer that provides a fast, non-cached, forward-only way of generating JSON data. Represents a writer that provides a fast, non-cached, forward-only way of generating Json data. Creates an instance of the JsonWriter class. Flushes whatever is in the buffer to the underlying streams and also flushes the underlying stream. Closes this stream and the underlying stream. Writes the beginning of a Json object. Writes the end of a Json object. Writes the beginning of a Json array. Writes the end of an array. Writes the start of a constructor with the given name. The name of the constructor. Writes the end constructor. Writes the property name of a name/value pair on a JSON object. The name of the property. Writes the property name of a name/value pair on a JSON object. The name of the property. A flag to indicate whether the text should be escaped when it is written as a JSON property name. Writes the end of the current Json object or array. Writes the current token and its children. The to read the token from. Writes the current token. The to read the token from. A flag indicating whether the current token's children should be written. Writes the specified end token. The end token to write. Writes indent characters. Writes the JSON value delimiter. Writes an indent space. Writes a null value. Writes an undefined value. Writes raw JSON without changing the writer's state. The raw JSON to write. Writes raw JSON where a value is expected and updates the writer's state. The raw JSON to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. An error will raised if the value cannot be written as a single JSON token. The value to write. Writes out a comment /*...*/ containing the specified text. Text to place inside the comment. Writes out the given white space. The string of white space characters. Sets the state of the JsonWriter, The JsonToken being written. The value being written. Gets or sets a value indicating whether the underlying stream or should be closed when the writer is closed. true to close the underlying stream or when the writer is closed; otherwise false. The default is true. Gets the top. The top. Gets the state of the writer. Gets the path of the writer. Indicates how JSON text output is formatted. Get or set how dates are written to JSON text. Get or set how time zones are handling when writing JSON text. Get or set how strings are escaped when writing JSON text. Get or set how special floating point numbers, e.g. , and , are written to JSON text. Get or set how and values are formatting when writing JSON text. Gets or sets the culture used when writing JSON. Defaults to . Initializes a new instance of the class. The stream. Initializes a new instance of the class. The writer. Flushes whatever is in the buffer to the underlying streams and also flushes the underlying stream. Writes the end. The token. Writes out a comment /*...*/ containing the specified text. Text to place inside the comment. Writes the start of a constructor with the given name. The name of the constructor. Writes raw JSON. The raw JSON to write. Writes raw JSON where a value is expected and updates the writer's state. The raw JSON to write. Writes the beginning of a Json array. Writes the beginning of a Json object. Writes the property name of a name/value pair on a Json object. The name of the property. Closes this stream and the underlying stream. Writes a value. An error will raised if the value cannot be written as a single JSON token. The value to write. Writes a null value. Writes an undefined value. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value that represents a BSON object id. The Object ID value to write. Writes a BSON regex. The regex pattern. The regex options. Gets or sets the used when writing values to BSON. When set to no conversion will occur. The used when writing values to BSON. Specifies how constructors are used when initializing objects during deserialization by the . First attempt to use the public default constructor, then fall back to single paramatized constructor, then the non-public default constructor. Json.NET will use a non-public default constructor before falling back to a paramatized constructor. Converts a to and from JSON and BSON. Converts an object to and from JSON. Writes the JSON representation of the object. The to write to. The value. The calling serializer. Reads the JSON representation of the object. The to read from. Type of the object. The existing value of object being read. The calling serializer. The object value. Determines whether this instance can convert the specified object type. Type of the object. true if this instance can convert the specified object type; otherwise, false. Gets the of the JSON produced by the JsonConverter. The of the JSON produced by the JsonConverter. Gets a value indicating whether this can read JSON. true if this can read JSON; otherwise, false. Gets a value indicating whether this can write JSON. true if this can write JSON; otherwise, false. Writes the JSON representation of the object. The to write to. The value. The calling serializer. Reads the JSON representation of the object. The to read from. Type of the object. The existing value of object being read. The calling serializer. The object value. Determines whether this instance can convert the specified object type. Type of the object. true if this instance can convert the specified object type; otherwise, false. Create a custom object The object type to convert. Writes the JSON representation of the object. The to write to. The value. The calling serializer. Reads the JSON representation of the object. The to read from. Type of the object. The existing value of object being read. The calling serializer. The object value. Creates an object which will then be populated by the serializer. Type of the object. The created object. Determines whether this instance can convert the specified object type. Type of the object. true if this instance can convert the specified object type; otherwise, false. Gets a value indicating whether this can write JSON. true if this can write JSON; otherwise, false. Provides a base class for converting a to and from JSON. Determines whether this instance can convert the specified object type. Type of the object. true if this instance can convert the specified object type; otherwise, false. Converts a F# discriminated union type to and from JSON. Writes the JSON representation of the object. The to write to. The value. The calling serializer. Reads the JSON representation of the object. The to read from. Type of the object. The existing value of object being read. The calling serializer. The object value. Determines whether this instance can convert the specified object type. Type of the object. true if this instance can convert the specified object type; otherwise, false. Converts a to and from the ISO 8601 date format (e.g. 2008-04-12T12:53Z). Writes the JSON representation of the object. The to write to. The value. The calling serializer. Reads the JSON representation of the object. The to read from. Type of the object. The existing value of object being read. The calling serializer. The object value. Gets or sets the date time styles used when converting a date to and from JSON. The date time styles used when converting a date to and from JSON. Gets or sets the date time format used when converting a date to and from JSON. The date time format used when converting a date to and from JSON. Gets or sets the culture used when converting a date to and from JSON. The culture used when converting a date to and from JSON. Converts a to and from a JavaScript date constructor (e.g. new Date(52231943)). Writes the JSON representation of the object. The to write to. The value. The calling serializer. Reads the JSON representation of the object. The to read from. Type of the object. The existing property value of the JSON that is being converted. The calling serializer. The object value. Converts a to and from JSON. Writes the JSON representation of the object. The to write to. The value. The calling serializer. Reads the JSON representation of the object. The to read from. Type of the object. The existing value of object being read. The calling serializer. The object value. Determines whether this instance can convert the specified object type. Type of the object. true if this instance can convert the specified object type; otherwise, false. Converts a to and from JSON and BSON. Writes the JSON representation of the object. The to write to. The value. The calling serializer. Reads the JSON representation of the object. The to read from. Type of the object. The existing value of object being read. The calling serializer. The object value. Determines whether this instance can convert the specified object type. Type of the object. true if this instance can convert the specified object type; otherwise, false. Converts an to and from its name string value. Initializes a new instance of the class. Writes the JSON representation of the object. The to write to. The value. The calling serializer. Reads the JSON representation of the object. The to read from. Type of the object. The existing value of object being read. The calling serializer. The object value. Determines whether this instance can convert the specified object type. Type of the object. true if this instance can convert the specified object type; otherwise, false. Gets or sets a value indicating whether the written enum text should be camel case. true if the written enum text will be camel case; otherwise, false. Gets or sets a value indicating whether integer values are allowed. true if integers are allowed; otherwise, false. Converts a to and from a string (e.g. "1.2.3.4"). Writes the JSON representation of the object. The to write to. The value. The calling serializer. Reads the JSON representation of the object. The to read from. Type of the object. The existing property value of the JSON that is being converted. The calling serializer. The object value. Determines whether this instance can convert the specified object type. Type of the object. true if this instance can convert the specified object type; otherwise, false. Specifies how dates are formatted when writing JSON text. Dates are written in the ISO 8601 format, e.g. "2012-03-21T05:40Z". Dates are written in the Microsoft JSON format, e.g. "\/Date(1198908717056)\/". Specifies how date formatted strings, e.g. "\/Date(1198908717056)\/" and "2012-03-21T05:40Z", are parsed when reading JSON text. Date formatted strings are not parsed to a date type and are read as strings. Date formatted strings, e.g. "\/Date(1198908717056)\/" and "2012-03-21T05:40Z", are parsed to . Date formatted strings, e.g. "\/Date(1198908717056)\/" and "2012-03-21T05:40Z", are parsed to . Specifies how to treat the time value when converting between string and . Treat as local time. If the object represents a Coordinated Universal Time (UTC), it is converted to the local time. Treat as a UTC. If the object represents a local time, it is converted to a UTC. Treat as a local time if a is being converted to a string. If a string is being converted to , convert to a local time if a time zone is specified. Time zone information should be preserved when converting. Specifies default value handling options for the . Include members where the member value is the same as the member's default value when serializing objects. Included members are written to JSON. Has no effect when deserializing. Ignore members where the member value is the same as the member's default value when serializing objects so that is is not written to JSON. This option will ignore all default values (e.g. null for objects and nullable typesl; 0 for integers, decimals and floating point numbers; and false for booleans). The default value ignored can be changed by placing the on the property. Members with a default value but no JSON will be set to their default value when deserializing. Ignore members where the member value is the same as the member's default value when serializing objects and sets members to their default value when deserializing. Specifies float format handling options when writing special floating point numbers, e.g. , and with . Write special floating point values as strings in JSON, e.g. "NaN", "Infinity", "-Infinity". Write special floating point values as symbols in JSON, e.g. NaN, Infinity, -Infinity. Note that this will produce non-valid JSON. Write special floating point values as the property's default value in JSON, e.g. 0.0 for a property, null for a property. Specifies how floating point numbers, e.g. 1.0 and 9.9, are parsed when reading JSON text. Floating point numbers are parsed to . Floating point numbers are parsed to . Indicates the method that will be used during deserialization for locating and loading assemblies. In simple mode, the assembly used during deserialization need not match exactly the assembly used during serialization. Specifically, the version numbers need not match as the LoadWithPartialName method is used to load the assembly. In full mode, the assembly used during deserialization must match exactly the assembly used during serialization. The Load method of the Assembly class is used to load the assembly. Specifies formatting options for the . No special formatting is applied. This is the default. Causes child objects to be indented according to the and settings. Provides an interface to enable a class to return line and position information. Gets a value indicating whether the class can return line information. true if LineNumber and LinePosition can be provided; otherwise, false. Gets the current line number. The current line number or 0 if no line information is available (for example, HasLineInfo returns false). Gets the current line position. The current line position or 0 if no line information is available (for example, HasLineInfo returns false). Instructs the how to serialize the collection. Instructs the how to serialize the object. Initializes a new instance of the class. Initializes a new instance of the class with the specified container Id. The container Id. Gets or sets the id. The id. Gets or sets the title. The title. Gets or sets the description. The description. Gets the collection's items converter. The collection's items converter. Gets or sets a value that indicates whether to preserve object references. true to keep object reference; otherwise, false. The default is false. Gets or sets a value that indicates whether to preserve collection's items references. true to keep collection's items object references; otherwise, false. The default is false. Gets or sets the reference loop handling used when serializing the collection's items. The reference loop handling. Gets or sets the type name handling used when serializing the collection's items. The type name handling. Initializes a new instance of the class. Initializes a new instance of the class with a flag indicating whether the array can contain null items A flag indicating whether the array can contain null items. Initializes a new instance of the class with the specified container Id. The container Id. Gets or sets a value indicating whether null items are allowed in the collection. true if null items are allowed in the collection; otherwise, false. Instructs the to use the specified constructor when deserializing that object. Provides methods for converting between common language runtime types and JSON types. Represents JavaScript's boolean value true as a string. This field is read-only. Represents JavaScript's boolean value false as a string. This field is read-only. Represents JavaScript's null as a string. This field is read-only. Represents JavaScript's undefined as a string. This field is read-only. Represents JavaScript's positive infinity as a string. This field is read-only. Represents JavaScript's negative infinity as a string. This field is read-only. Represents JavaScript's NaN as a string. This field is read-only. Converts the to its JSON string representation. The value to convert. A JSON string representation of the . Converts the to its JSON string representation using the specified. The value to convert. The format the date will be converted to. The time zone handling when the date is converted to a string. A JSON string representation of the . Converts the to its JSON string representation. The value to convert. A JSON string representation of the . Converts the to its JSON string representation using the specified. The value to convert. The format the date will be converted to. A JSON string representation of the . Converts the to its JSON string representation. The value to convert. A JSON string representation of the . Converts the to its JSON string representation. The value to convert. A JSON string representation of the . Converts the to its JSON string representation. The value to convert. A JSON string representation of the . Converts the to its JSON string representation. The value to convert. A JSON string representation of the . Converts the to its JSON string representation. The value to convert. A JSON string representation of the . Converts the to its JSON string representation. The value to convert. A JSON string representation of the . Converts the to its JSON string representation. The value to convert. A JSON string representation of the . Converts the to its JSON string representation. The value to convert. A JSON string representation of the . Converts the to its JSON string representation. The value to convert. A JSON string representation of the . Converts the to its JSON string representation. The value to convert. A JSON string representation of the . Converts the to its JSON string representation. The value to convert. A JSON string representation of the . Converts the to its JSON string representation. The value to convert. A JSON string representation of the . Converts the to its JSON string representation. The value to convert. A JSON string representation of the . Converts the to its JSON string representation. The value to convert. A JSON string representation of the . Converts the to its JSON string representation. The value to convert. A JSON string representation of the . Converts the to its JSON string representation. The value to convert. A JSON string representation of the . Converts the to its JSON string representation. The value to convert. A JSON string representation of the . Converts the to its JSON string representation. The value to convert. A JSON string representation of the . Converts the to its JSON string representation. The value to convert. The string delimiter character. A JSON string representation of the . Converts the to its JSON string representation. The value to convert. A JSON string representation of the . Serializes the specified object to a JSON string. The object to serialize. A JSON string representation of the object. Serializes the specified object to a JSON string using formatting. The object to serialize. Indicates how the output is formatted. A JSON string representation of the object. Serializes the specified object to a JSON string using a collection of . The object to serialize. A collection converters used while serializing. A JSON string representation of the object. Serializes the specified object to a JSON string using formatting and a collection of . The object to serialize. Indicates how the output is formatted. A collection converters used while serializing. A JSON string representation of the object. Serializes the specified object to a JSON string using . The object to serialize. The used to serialize the object. If this is null, default serialization settings will be is used. A JSON string representation of the object. Serializes the specified object to a JSON string using a type, formatting and . The object to serialize. The used to serialize the object. If this is null, default serialization settings will be is used. The type of the value being serialized. This parameter is used when is Auto to write out the type name if the type of the value does not match. Specifing the type is optional. A JSON string representation of the object. Serializes the specified object to a JSON string using formatting and . The object to serialize. Indicates how the output is formatted. The used to serialize the object. If this is null, default serialization settings will be is used. A JSON string representation of the object. Serializes the specified object to a JSON string using a type, formatting and . The object to serialize. Indicates how the output is formatted. The used to serialize the object. If this is null, default serialization settings will be is used. The type of the value being serialized. This parameter is used when is Auto to write out the type name if the type of the value does not match. Specifing the type is optional. A JSON string representation of the object. Deserializes the JSON to a .NET object. The JSON to deserialize. The deserialized object from the Json string. Deserializes the JSON to a .NET object using . The JSON to deserialize. The used to deserialize the object. If this is null, default serialization settings will be is used. The deserialized object from the JSON string. Deserializes the JSON to the specified .NET type. The JSON to deserialize. The of object being deserialized. The deserialized object from the Json string. Deserializes the JSON to the specified .NET type. The type of the object to deserialize to. The JSON to deserialize. The deserialized object from the Json string. Deserializes the JSON to the given anonymous type. The anonymous type to deserialize to. This can't be specified traditionally and must be infered from the anonymous type passed as a parameter. The JSON to deserialize. The anonymous type object. The deserialized anonymous type from the JSON string. Deserializes the JSON to the given anonymous type using . The anonymous type to deserialize to. This can't be specified traditionally and must be infered from the anonymous type passed as a parameter. The JSON to deserialize. The anonymous type object. The used to deserialize the object. If this is null, default serialization settings will be is used. The deserialized anonymous type from the JSON string. Deserializes the JSON to the specified .NET type using a collection of . The type of the object to deserialize to. The JSON to deserialize. Converters to use while deserializing. The deserialized object from the JSON string. Deserializes the JSON to the specified .NET type using . The type of the object to deserialize to. The object to deserialize. The used to deserialize the object. If this is null, default serialization settings will be is used. The deserialized object from the JSON string. Deserializes the JSON to the specified .NET type using a collection of . The JSON to deserialize. The type of the object to deserialize. Converters to use while deserializing. The deserialized object from the JSON string. Deserializes the JSON to the specified .NET type using . The JSON to deserialize. The type of the object to deserialize to. The used to deserialize the object. If this is null, default serialization settings will be is used. The deserialized object from the JSON string. Populates the object with values from the JSON string. The JSON to populate values from. The target object to populate values onto. Populates the object with values from the JSON string using . The JSON to populate values from. The target object to populate values onto. The used to deserialize the object. If this is null, default serialization settings will be is used. Gets or sets a function that creates default . Default settings are automatically used by serialization methods on , and and on . To serialize without using any default settings create a with . Instructs the to use the specified when serializing the member or class. Initializes a new instance of the class. Type of the converter. Gets the type of the converter. The type of the converter. Represents a collection of . Instructs the how to serialize the collection. Initializes a new instance of the class. Initializes a new instance of the class with the specified container Id. The container Id. The exception thrown when an error occurs during Json serialization or deserialization. Initializes a new instance of the class. Initializes a new instance of the class with a specified error message. The error message that explains the reason for the exception. Initializes a new instance of the class with a specified error message and a reference to the inner exception that is the cause of this exception. The error message that explains the reason for the exception. The exception that is the cause of the current exception, or a null reference (Nothing in Visual Basic) if no inner exception is specified. Instructs the to deserialize properties with no matching class member into the specified collection and write values during serialization. Initializes a new instance of the class. Gets or sets a value that indicates whether to write extension data when serializing the object. true to write extension data when serializing the object; otherwise, false. The default is true. Gets or sets a value that indicates whether to read extension data when deserializing the object. true to read extension data when deserializing the object; otherwise, false. The default is true. Instructs the not to serialize the public field or public read/write property value. Instructs the how to serialize the object. Initializes a new instance of the class. Initializes a new instance of the class with the specified member serialization. The member serialization. Initializes a new instance of the class with the specified container Id. The container Id. Gets or sets the member serialization. The member serialization. Gets or sets a value that indicates whether the object's properties are required. A value indicating whether the object's properties are required. Instructs the to always serialize the member with the specified name. Initializes a new instance of the class. Initializes a new instance of the class with the specified name. Name of the property. Gets or sets the converter used when serializing the property's collection items. The collection's items converter. Gets or sets the null value handling used when serializing this property. The null value handling. Gets or sets the default value handling used when serializing this property. The default value handling. Gets or sets the reference loop handling used when serializing this property. The reference loop handling. Gets or sets the object creation handling used when deserializing this property. The object creation handling. Gets or sets the type name handling used when serializing this property. The type name handling. Gets or sets whether this property's value is serialized as a reference. Whether this property's value is serialized as a reference. Gets or sets the order of serialization and deserialization of a member. The numeric order of serialization or deserialization. Gets or sets a value indicating whether this property is required. A value indicating whether this property is required. Gets or sets the name of the property. The name of the property. Gets or sets the the reference loop handling used when serializing the property's collection items. The collection's items reference loop handling. Gets or sets the the type name handling used when serializing the property's collection items. The collection's items type name handling. Gets or sets whether this property's collection items are serialized as a reference. Whether this property's collection items are serialized as a reference. The exception thrown when an error occurs while reading Json text. Initializes a new instance of the class. Initializes a new instance of the class with a specified error message. The error message that explains the reason for the exception. Initializes a new instance of the class with a specified error message and a reference to the inner exception that is the cause of this exception. The error message that explains the reason for the exception. The exception that is the cause of the current exception, or a null reference (Nothing in Visual Basic) if no inner exception is specified. Gets the line number indicating where the error occurred. The line number indicating where the error occurred. Gets the line position indicating where the error occurred. The line position indicating where the error occurred. Gets the path to the JSON where the error occurred. The path to the JSON where the error occurred. The exception thrown when an error occurs during Json serialization or deserialization. Initializes a new instance of the class. Initializes a new instance of the class with a specified error message. The error message that explains the reason for the exception. Initializes a new instance of the class with a specified error message and a reference to the inner exception that is the cause of this exception. The error message that explains the reason for the exception. The exception that is the cause of the current exception, or a null reference (Nothing in Visual Basic) if no inner exception is specified. Serializes and deserializes objects into and from the JSON format. The enables you to control how objects are encoded into JSON. Initializes a new instance of the class. Creates a new instance. The will not use default settings. A new instance. The will not use default settings. Creates a new instance using the specified . The will not use default settings. The settings to be applied to the . A new instance using the specified . The will not use default settings. Creates a new instance. The will use default settings. A new instance. The will use default settings. Creates a new instance using the specified . The will use default settings. The settings to be applied to the . A new instance using the specified . The will use default settings. Populates the JSON values onto the target object. The that contains the JSON structure to reader values from. The target object to populate values onto. Populates the JSON values onto the target object. The that contains the JSON structure to reader values from. The target object to populate values onto. Deserializes the Json structure contained by the specified . The that contains the JSON structure to deserialize. The being deserialized. Deserializes the Json structure contained by the specified into an instance of the specified type. The containing the object. The of object being deserialized. The instance of being deserialized. Deserializes the Json structure contained by the specified into an instance of the specified type. The containing the object. The type of the object to deserialize. The instance of being deserialized. Deserializes the Json structure contained by the specified into an instance of the specified type. The containing the object. The of object being deserialized. The instance of being deserialized. Serializes the specified and writes the Json structure to a Stream using the specified . The used to write the Json structure. The to serialize. Serializes the specified and writes the Json structure to a Stream using the specified . The used to write the Json structure. The to serialize. The type of the value being serialized. This parameter is used when is Auto to write out the type name if the type of the value does not match. Specifing the type is optional. Serializes the specified and writes the Json structure to a Stream using the specified . The used to write the Json structure. The to serialize. The type of the value being serialized. This parameter is used when is Auto to write out the type name if the type of the value does not match. Specifing the type is optional. Serializes the specified and writes the Json structure to a Stream using the specified . The used to write the Json structure. The to serialize. Occurs when the errors during serialization and deserialization. Gets or sets the used by the serializer when resolving references. Gets or sets the used by the serializer when resolving type names. Gets or sets the used by the serializer when writing trace messages. The trace writer. Gets or sets how type name writing and reading is handled by the serializer. Gets or sets how a type name assembly is written and resolved by the serializer. The type name assembly format. Gets or sets how object references are preserved by the serializer. Get or set how reference loops (e.g. a class referencing itself) is handled. Get or set how missing members (e.g. JSON contains a property that isn't a member on the object) are handled during deserialization. Get or set how null values are handled during serialization and deserialization. Get or set how null default are handled during serialization and deserialization. Gets or sets how objects are created during deserialization. The object creation handling. Gets or sets how constructors are used during deserialization. The constructor handling. Gets a collection that will be used during serialization. Collection that will be used during serialization. Gets or sets the contract resolver used by the serializer when serializing .NET objects to JSON and vice versa. Gets or sets the used by the serializer when invoking serialization callback methods. The context. Indicates how JSON text output is formatted. Get or set how dates are written to JSON text. Get or set how time zones are handling during serialization and deserialization. Get or set how date formatted strings, e.g. "\/Date(1198908717056)\/" and "2012-03-21T05:40Z", are parsed when reading JSON. Get or set how floating point numbers, e.g. 1.0 and 9.9, are parsed when reading JSON text. Get or set how special floating point numbers, e.g. , and , are written as JSON text. Get or set how strings are escaped when writing JSON text. Get or set how and values are formatting when writing JSON text. Gets or sets the culture used when reading JSON. Defaults to . Gets or sets the maximum depth allowed when reading JSON. Reading past this depth will throw a . Gets a value indicating whether there will be a check for additional JSON content after deserializing an object. true if there will be a check for additional JSON content after deserializing an object; otherwise, false. Specifies the settings on a object. Initializes a new instance of the class. Gets or sets how reference loops (e.g. a class referencing itself) is handled. Reference loop handling. Gets or sets how missing members (e.g. JSON contains a property that isn't a member on the object) are handled during deserialization. Missing member handling. Gets or sets how objects are created during deserialization. The object creation handling. Gets or sets how null values are handled during serialization and deserialization. Null value handling. Gets or sets how null default are handled during serialization and deserialization. The default value handling. Gets or sets a collection that will be used during serialization. The converters. Gets or sets how object references are preserved by the serializer. The preserve references handling. Gets or sets how type name writing and reading is handled by the serializer. The type name handling. Gets or sets how a type name assembly is written and resolved by the serializer. The type name assembly format. Gets or sets how constructors are used during deserialization. The constructor handling. Gets or sets the contract resolver used by the serializer when serializing .NET objects to JSON and vice versa. The contract resolver. Gets or sets the used by the serializer when resolving references. The reference resolver. Gets or sets the used by the serializer when writing trace messages. The trace writer. Gets or sets the used by the serializer when resolving type names. The binder. Gets or sets the error handler called during serialization and deserialization. The error handler called during serialization and deserialization. Gets or sets the used by the serializer when invoking serialization callback methods. The context. Get or set how and values are formatting when writing JSON text. Gets or sets the maximum depth allowed when reading JSON. Reading past this depth will throw a . Indicates how JSON text output is formatted. Get or set how dates are written to JSON text. Get or set how time zones are handling during serialization and deserialization. Get or set how date formatted strings, e.g. "\/Date(1198908717056)\/" and "2012-03-21T05:40Z", are parsed when reading JSON. Get or set how special floating point numbers, e.g. , and , are written as JSON. Get or set how floating point numbers, e.g. 1.0 and 9.9, are parsed when reading JSON text. Get or set how strings are escaped when writing JSON text. Gets or sets the culture used when reading JSON. Defaults to . Gets a value indicating whether there will be a check for additional content after deserializing an object. true if there will be a check for additional content after deserializing an object; otherwise, false. Represents a reader that provides fast, non-cached, forward-only access to JSON text data. Initializes a new instance of the class with the specified . The TextReader containing the XML data to read. Reads the next JSON token from the stream. true if the next token was read successfully; false if there are no more tokens to read. Reads the next JSON token from the stream as a . A or a null reference if the next JSON token is null. This method will return null at the end of an array. Reads the next JSON token from the stream as a . A . This method will return null at the end of an array. Reads the next JSON token from the stream as a . A . This method will return null at the end of an array. Reads the next JSON token from the stream as a . A . This method will return null at the end of an array. Reads the next JSON token from the stream as a . A . This method will return null at the end of an array. Reads the next JSON token from the stream as a . A . This method will return null at the end of an array. Changes the state to closed. Gets a value indicating whether the class can return line information. true if LineNumber and LinePosition can be provided; otherwise, false. Gets the current line number. The current line number or 0 if no line information is available (for example, HasLineInfo returns false). Gets the current line position. The current line position or 0 if no line information is available (for example, HasLineInfo returns false). Represents a writer that provides a fast, non-cached, forward-only way of generating Json data. Creates an instance of the JsonWriter class using the specified . The TextWriter to write to. Flushes whatever is in the buffer to the underlying streams and also flushes the underlying stream. Closes this stream and the underlying stream. Writes the beginning of a Json object. Writes the beginning of a Json array. Writes the start of a constructor with the given name. The name of the constructor. Writes the specified end token. The end token to write. Writes the property name of a name/value pair on a Json object. The name of the property. Writes the property name of a name/value pair on a JSON object. The name of the property. A flag to indicate whether the text should be escaped when it is written as a JSON property name. Writes indent characters. Writes the JSON value delimiter. Writes an indent space. Writes a value. An error will raised if the value cannot be written as a single JSON token. The value to write. Writes a null value. Writes an undefined value. Writes raw JSON. The raw JSON to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes out a comment /*...*/ containing the specified text. Text to place inside the comment. Writes out the given white space. The string of white space characters. Gets or sets how many IndentChars to write for each level in the hierarchy when is set to Formatting.Indented. Gets or sets which character to use to quote attribute values. Gets or sets which character to use for indenting when is set to Formatting.Indented. Gets or sets a value indicating whether object names will be surrounded with quotes. Specifies the type of Json token. This is returned by the if a method has not been called. An object start token. An array start token. A constructor start token. An object property name. A comment. Raw JSON. An integer. A float. A string. A boolean. A null token. An undefined token. An object end token. An array end token. A constructor end token. A Date. Byte data. Represents a reader that provides validation. Initializes a new instance of the class that validates the content returned from the given . The to read from while validating. Reads the next JSON token from the stream as a . A . Reads the next JSON token from the stream as a . A or a null reference if the next JSON token is null. Reads the next JSON token from the stream as a . A . Reads the next JSON token from the stream as a . A . This method will return null at the end of an array. Reads the next JSON token from the stream as a . A . This method will return null at the end of an array. Reads the next JSON token from the stream as a . A . Reads the next JSON token from the stream. true if the next token was read successfully; false if there are no more tokens to read. Sets an event handler for receiving schema validation errors. Gets the text value of the current JSON token. Gets the depth of the current token in the JSON document. The depth of the current token in the JSON document. Gets the path of the current JSON token. Gets the quotation mark character used to enclose the value of a string. Gets the type of the current JSON token. Gets the Common Language Runtime (CLR) type for the current JSON token. Gets or sets the schema. The schema. Gets the used to construct this . The specified in the constructor. The exception thrown when an error occurs while reading Json text. Initializes a new instance of the class. Initializes a new instance of the class with a specified error message. The error message that explains the reason for the exception. Initializes a new instance of the class with a specified error message and a reference to the inner exception that is the cause of this exception. The error message that explains the reason for the exception. The exception that is the cause of the current exception, or a null reference (Nothing in Visual Basic) if no inner exception is specified. Gets the path to the JSON where the error occurred. The path to the JSON where the error occurred. Contains the LINQ to JSON extension methods. Returns a collection of tokens that contains the ancestors of every token in the source collection. The type of the objects in source, constrained to . An of that contains the source collection. An of that contains the ancestors of every node in the source collection. Returns a collection of tokens that contains the descendants of every token in the source collection. The type of the objects in source, constrained to . An of that contains the source collection. An of that contains the descendants of every node in the source collection. Returns a collection of child properties of every object in the source collection. An of that contains the source collection. An of that contains the properties of every object in the source collection. Returns a collection of child values of every object in the source collection with the given key. An of that contains the source collection. The token key. An of that contains the values of every node in the source collection with the given key. Returns a collection of child values of every object in the source collection. An of that contains the source collection. An of that contains the values of every node in the source collection. Returns a collection of converted child values of every object in the source collection with the given key. The type to convert the values to. An of that contains the source collection. The token key. An that contains the converted values of every node in the source collection with the given key. Returns a collection of converted child values of every object in the source collection. The type to convert the values to. An of that contains the source collection. An that contains the converted values of every node in the source collection. Converts the value. The type to convert the value to. A cast as a of . A converted value. Converts the value. The source collection type. The type to convert the value to. A cast as a of . A converted value. Returns a collection of child tokens of every array in the source collection. The source collection type. An of that contains the source collection. An of that contains the values of every node in the source collection. Returns a collection of converted child tokens of every array in the source collection. An of that contains the source collection. The type to convert the values to. The source collection type. An that contains the converted values of every node in the source collection. Returns the input typed as . An of that contains the source collection. The input typed as . Returns the input typed as . The source collection type. An of that contains the source collection. The input typed as . Represents a collection of objects. The type of token Gets the with the specified key. Represents a JSON array. Represents a token that can contain other tokens. Represents an abstract JSON token. Compares the values of two tokens, including the values of all descendant tokens. The first to compare. The second to compare. true if the tokens are equal; otherwise false. Adds the specified content immediately after this token. A content object that contains simple content or a collection of content objects to be added after this token. Adds the specified content immediately before this token. A content object that contains simple content or a collection of content objects to be added before this token. Returns a collection of the ancestor tokens of this token. A collection of the ancestor tokens of this token. Returns a collection of the sibling tokens after this token, in document order. A collection of the sibling tokens after this tokens, in document order. Returns a collection of the sibling tokens before this token, in document order. A collection of the sibling tokens before this token, in document order. Gets the with the specified key converted to the specified type. The type to convert the token to. The token key. The converted token value. Returns a collection of the child tokens of this token, in document order. An of containing the child tokens of this , in document order. Returns a collection of the child tokens of this token, in document order, filtered by the specified type. The type to filter the child tokens on. A containing the child tokens of this , in document order. Returns a collection of the child values of this token, in document order. The type to convert the values to. A containing the child values of this , in document order. Removes this token from its parent. Replaces this token with the specified token. The value. Writes this token to a . A into which this method will write. A collection of which will be used when writing the token. Returns the indented JSON for this token. The indented JSON for this token. Returns the JSON for this token using the given formatting and converters. Indicates how the output is formatted. A collection of which will be used when writing the token. The JSON for this token using the given formatting and converters. Performs an explicit conversion from to . The value. The result of the conversion. Performs an explicit conversion from to . The value. The result of the conversion. Performs an explicit conversion from to . The value. The result of the conversion. Performs an explicit conversion from to . The value. The result of the conversion. Performs an explicit conversion from to . The value. The result of the conversion. Performs an explicit conversion from to . The value. The result of the conversion. Performs an explicit conversion from to . The value. The result of the conversion. Performs an explicit conversion from to . The value. The result of the conversion. Performs an explicit conversion from to . The value. The result of the conversion. Performs an explicit conversion from to . The value. The result of the conversion. Performs an explicit conversion from to . The value. The result of the conversion. Performs an explicit conversion from to . The value. The result of the conversion. Performs an explicit conversion from to . The value. The result of the conversion. Performs an explicit conversion from to . The value. The result of the conversion. Performs an explicit conversion from to . The value. The result of the conversion. Performs an explicit conversion from to . The value. The result of the conversion. Performs an explicit conversion from to . The value. The result of the conversion. Performs an explicit conversion from to . The value. The result of the conversion. Performs an explicit conversion from to . The value. The result of the conversion. Performs an explicit conversion from to . The value. The result of the conversion. Performs an explicit conversion from to . The value. The result of the conversion. Performs an explicit conversion from to . The value. The result of the conversion. Performs an explicit conversion from to . The value. The result of the conversion. Performs an explicit conversion from to . The value. The result of the conversion. Performs an explicit conversion from to . The value. The result of the conversion. Performs an explicit conversion from to . The value. The result of the conversion. Performs an explicit conversion from to . The value. The result of the conversion. Performs an explicit conversion from to . The value. The result of the conversion. Performs an explicit conversion from to . The value. The result of the conversion. Performs an explicit conversion from to . The value. The result of the conversion. Performs an explicit conversion from to . The value. The result of the conversion. Performs an explicit conversion from to . The value. The result of the conversion. Performs an explicit conversion from to . The value. The result of the conversion. Performs an explicit conversion from to . The value. The result of the conversion. Performs an explicit conversion from to . The value. The result of the conversion. Performs an explicit conversion from to . The value. The result of the conversion. Performs an explicit conversion from to . The value. The result of the conversion. Performs an implicit conversion from to . The value to create a from. The initialized with the specified value. Performs an implicit conversion from to . The value to create a from. The initialized with the specified value. Performs an implicit conversion from to . The value to create a from. The initialized with the specified value. Performs an implicit conversion from to . The value to create a from. The initialized with the specified value. Performs an implicit conversion from to . The value to create a from. The initialized with the specified value. Performs an implicit conversion from to . The value to create a from. The initialized with the specified value. Performs an implicit conversion from to . The value to create a from. The initialized with the specified value. Performs an implicit conversion from to . The value to create a from. The initialized with the specified value. Performs an implicit conversion from to . The value to create a from. The initialized with the specified value. Performs an implicit conversion from to . The value to create a from. The initialized with the specified value. Performs an implicit conversion from to . The value to create a from. The initialized with the specified value. Performs an implicit conversion from to . The value to create a from. The initialized with the specified value. Performs an implicit conversion from to . The value to create a from. The initialized with the specified value. Performs an implicit conversion from to . The value to create a from. The initialized with the specified value. Performs an implicit conversion from to . The value to create a from. The initialized with the specified value. Performs an implicit conversion from to . The value to create a from. The initialized with the specified value. Performs an implicit conversion from to . The value to create a from. The initialized with the specified value. Performs an implicit conversion from to . The value to create a from. The initialized with the specified value. Performs an implicit conversion from to . The value to create a from. The initialized with the specified value. Performs an implicit conversion from to . The value to create a from. The initialized with the specified value. Performs an implicit conversion from to . The value to create a from. The initialized with the specified value. Performs an implicit conversion from to . The value to create a from. The initialized with the specified value. Performs an implicit conversion from to . The value to create a from. The initialized with the specified value. Performs an implicit conversion from to . The value to create a from. The initialized with the specified value. Performs an implicit conversion from to . The value to create a from. The initialized with the specified value. Performs an implicit conversion from to . The value to create a from. The initialized with the specified value. Performs an implicit conversion from to . The value to create a from. The initialized with the specified value. Performs an implicit conversion from to . The value to create a from. The initialized with the specified value. Performs an implicit conversion from to . The value to create a from. The initialized with the specified value. Performs an implicit conversion from to . The value to create a from. The initialized with the specified value. Performs an implicit conversion from to . The value to create a from. The initialized with the specified value. Performs an implicit conversion from to . The value to create a from. The initialized with the specified value. Performs an implicit conversion from to . The value to create a from. The initialized with the specified value. Performs an implicit conversion from to . The value to create a from. The initialized with the specified value. Performs an implicit conversion from to . The value to create a from. The initialized with the specified value. Creates an for this token. An that can be used to read this token and its descendants. Creates a from an object. The object that will be used to create . A with the value of the specified object Creates a from an object using the specified . The object that will be used to create . The that will be used when reading the object. A with the value of the specified object Creates the specified .NET type from the . The object type that the token will be deserialized to. The new object created from the JSON value. Creates the specified .NET type from the . The object type that the token will be deserialized to. The new object created from the JSON value. Creates the specified .NET type from the using the specified . The object type that the token will be deserialized to. The that will be used when creating the object. The new object created from the JSON value. Creates the specified .NET type from the using the specified . The object type that the token will be deserialized to. The that will be used when creating the object. The new object created from the JSON value. Creates a from a . An positioned at the token to read into this . An that contains the token and its descendant tokens that were read from the reader. The runtime type of the token is determined by the token type of the first token encountered in the reader. Load a from a string that contains JSON. A that contains JSON. A populated from the string that contains JSON. Creates a from a . An positioned at the token to read into this . An that contains the token and its descendant tokens that were read from the reader. The runtime type of the token is determined by the token type of the first token encountered in the reader. Selects a using a JPath expression. Selects the token that matches the object path. A that contains a JPath expression. A , or null. Selects a using a JPath expression. Selects the token that matches the object path. A that contains a JPath expression. A flag to indicate whether an error should be thrown if no tokens are found when evaluating part of the expression. A . Selects a collection of elements using a JPath expression. A that contains a JPath expression. An that contains the selected elements. Selects a collection of elements using a JPath expression. A that contains a JPath expression. A flag to indicate whether an error should be thrown if no tokens are found when evaluating part of the expression. An that contains the selected elements. Creates a new instance of the . All child tokens are recursively cloned. A new instance of the . Gets a comparer that can compare two tokens for value equality. A that can compare two nodes for value equality. Gets or sets the parent. The parent. Gets the root of this . The root of this . Gets the node type for this . The type. Gets a value indicating whether this token has child tokens. true if this token has child values; otherwise, false. Gets the next sibling token of this node. The that contains the next sibling token. Gets the previous sibling token of this node. The that contains the previous sibling token. Gets the path of the JSON token. Gets the with the specified key. The with the specified key. Get the first child token of this token. A containing the first child token of the . Get the last child token of this token. A containing the last child token of the . Returns a collection of the child tokens of this token, in document order. An of containing the child tokens of this , in document order. Returns a collection of the child values of this token, in document order. The type to convert the values to. A containing the child values of this , in document order. Returns a collection of the descendant tokens for this token in document order. An containing the descendant tokens of the . Adds the specified content as children of this . The content to be added. Adds the specified content as the first children of this . The content to be added. Creates an that can be used to add tokens to the . An that is ready to have content written to it. Replaces the children nodes of this token with the specified content. The content. Removes the child nodes from this token. Gets the container's children tokens. The container's children tokens. Gets a value indicating whether this token has child tokens. true if this token has child values; otherwise, false. Get the first child token of this token. A containing the first child token of the . Get the last child token of this token. A containing the last child token of the . Gets the count of child JSON tokens. The count of child JSON tokens Initializes a new instance of the class. Initializes a new instance of the class from another object. A object to copy from. Initializes a new instance of the class with the specified content. The contents of the array. Initializes a new instance of the class with the specified content. The contents of the array. Loads an from a . A that will be read for the content of the . A that contains the JSON that was read from the specified . Load a from a string that contains JSON. A that contains JSON. A populated from the string that contains JSON. Creates a from an object. The object that will be used to create . A with the values of the specified object Creates a from an object. The object that will be used to create . The that will be used to read the object. A with the values of the specified object Writes this token to a . A into which this method will write. A collection of which will be used when writing the token. Determines the index of a specific item in the . The object to locate in the . The index of if found in the list; otherwise, -1. Inserts an item to the at the specified index. The zero-based index at which should be inserted. The object to insert into the . is not a valid index in the . The is read-only. Removes the item at the specified index. The zero-based index of the item to remove. is not a valid index in the . The is read-only. Returns an enumerator that iterates through the collection. A that can be used to iterate through the collection. Adds an item to the . The object to add to the . The is read-only. Removes all items from the . The is read-only. Determines whether the contains a specific value. The object to locate in the . true if is found in the ; otherwise, false. Copies to. The array. Index of the array. Removes the first occurrence of a specific object from the . The object to remove from the . true if was successfully removed from the ; otherwise, false. This method also returns false if is not found in the original . The is read-only. Gets the container's children tokens. The container's children tokens. Gets the node type for this . The type. Gets the with the specified key. The with the specified key. Gets or sets the at the specified index. Gets a value indicating whether the is read-only. true if the is read-only; otherwise, false. Represents a JSON constructor. Initializes a new instance of the class. Initializes a new instance of the class from another object. A object to copy from. Initializes a new instance of the class with the specified name and content. The constructor name. The contents of the constructor. Initializes a new instance of the class with the specified name and content. The constructor name. The contents of the constructor. Initializes a new instance of the class with the specified name. The constructor name. Writes this token to a . A into which this method will write. A collection of which will be used when writing the token. Loads an from a . A that will be read for the content of the . A that contains the JSON that was read from the specified . Gets the container's children tokens. The container's children tokens. Gets or sets the name of this constructor. The constructor name. Gets the node type for this . The type. Gets the with the specified key. The with the specified key. Represents a collection of objects. The type of token An empty collection of objects. Initializes a new instance of the struct. The enumerable. Returns an enumerator that iterates through the collection. A that can be used to iterate through the collection. Returns an enumerator that iterates through a collection. An object that can be used to iterate through the collection. Determines whether the specified is equal to this instance. The to compare with this instance. true if the specified is equal to this instance; otherwise, false. Returns a hash code for this instance. A hash code for this instance, suitable for use in hashing algorithms and data structures like a hash table. Gets the with the specified key. Represents a JSON object. Initializes a new instance of the class. Initializes a new instance of the class from another object. A object to copy from. Initializes a new instance of the class with the specified content. The contents of the object. Initializes a new instance of the class with the specified content. The contents of the object. Gets an of this object's properties. An of this object's properties. Gets a the specified name. The property name. A with the specified name or null. Gets an of this object's property values. An of this object's property values. Loads an from a . A that will be read for the content of the . A that contains the JSON that was read from the specified . Load a from a string that contains JSON. A that contains JSON. A populated from the string that contains JSON. Creates a from an object. The object that will be used to create . A with the values of the specified object Creates a from an object. The object that will be used to create . The that will be used to read the object. A with the values of the specified object Writes this token to a . A into which this method will write. A collection of which will be used when writing the token. Gets the with the specified property name. Name of the property. The with the specified property name. Gets the with the specified property name. The exact property name will be searched for first and if no matching property is found then the will be used to match a property. Name of the property. One of the enumeration values that specifies how the strings will be compared. The with the specified property name. Tries to get the with the specified property name. The exact property name will be searched for first and if no matching property is found then the will be used to match a property. Name of the property. The value. One of the enumeration values that specifies how the strings will be compared. true if a value was successfully retrieved; otherwise, false. Adds the specified property name. Name of the property. The value. Removes the property with the specified name. Name of the property. true if item was successfully removed; otherwise, false. Tries the get value. Name of the property. The value. true if a value was successfully retrieved; otherwise, false. Returns an enumerator that iterates through the collection. A that can be used to iterate through the collection. Raises the event with the provided arguments. Name of the property. Gets the container's children tokens. The container's children tokens. Occurs when a property value changes. Gets the node type for this . The type. Gets the with the specified key. The with the specified key. Gets or sets the with the specified property name. Represents a JSON property. Initializes a new instance of the class from another object. A object to copy from. Initializes a new instance of the class. The property name. The property content. Initializes a new instance of the class. The property name. The property content. Writes this token to a . A into which this method will write. A collection of which will be used when writing the token. Loads an from a . A that will be read for the content of the . A that contains the JSON that was read from the specified . Gets the container's children tokens. The container's children tokens. Gets the property name. The property name. Gets or sets the property value. The property value. Gets the node type for this . The type. Represents a raw JSON string. Represents a value in JSON (string, integer, date, etc). Initializes a new instance of the class from another object. A object to copy from. Initializes a new instance of the class with the given value. The value. Initializes a new instance of the class with the given value. The value. Initializes a new instance of the class with the given value. The value. Initializes a new instance of the class with the given value. The value. Initializes a new instance of the class with the given value. The value. Initializes a new instance of the class with the given value. The value. Initializes a new instance of the class with the given value. The value. Initializes a new instance of the class with the given value. The value. Initializes a new instance of the class with the given value. The value. Initializes a new instance of the class with the given value. The value. Initializes a new instance of the class with the given value. The value. Initializes a new instance of the class with the given value. The value. Initializes a new instance of the class with the given value. The value. Initializes a new instance of the class with the given value. The value. Creates a comment with the given value. The value. A comment with the given value. Creates a string with the given value. The value. A string with the given value. Writes this token to a . A into which this method will write. A collection of which will be used when writing the token. Indicates whether the current object is equal to another object of the same type. true if the current object is equal to the parameter; otherwise, false. An object to compare with this object. Determines whether the specified is equal to the current . The to compare with the current . true if the specified is equal to the current ; otherwise, false. The parameter is null. Serves as a hash function for a particular type. A hash code for the current . Returns a that represents this instance. A that represents this instance. Returns a that represents this instance. The format. A that represents this instance. Returns a that represents this instance. The format provider. A that represents this instance. Returns a that represents this instance. The format. The format provider. A that represents this instance. Compares the current instance with another object of the same type and returns an integer that indicates whether the current instance precedes, follows, or occurs in the same position in the sort order as the other object. An object to compare with this instance. A 32-bit signed integer that indicates the relative order of the objects being compared. The return value has these meanings: Value Meaning Less than zero This instance is less than . Zero This instance is equal to . Greater than zero This instance is greater than . is not the same type as this instance. Gets a value indicating whether this token has child tokens. true if this token has child values; otherwise, false. Gets the node type for this . The type. Gets or sets the underlying token value. The underlying token value. Initializes a new instance of the class from another object. A object to copy from. Initializes a new instance of the class. The raw json. Creates an instance of with the content of the reader's current token. The reader. An instance of with the content of the reader's current token. Compares tokens to determine whether they are equal. Determines whether the specified objects are equal. The first object of type to compare. The second object of type to compare. true if the specified objects are equal; otherwise, false. Returns a hash code for the specified object. The for which a hash code is to be returned. A hash code for the specified object. The type of is a reference type and is null. Represents a reader that provides fast, non-cached, forward-only access to serialized Json data. Initializes a new instance of the class. The token to read from. Reads the next JSON token from the stream as a . A or a null reference if the next JSON token is null. This method will return null at the end of an array. Reads the next JSON token from the stream as a . A . This method will return null at the end of an array. Reads the next JSON token from the stream as a . A . This method will return null at the end of an array. Reads the next JSON token from the stream as a . A . This method will return null at the end of an array. Reads the next JSON token from the stream as a . A . This method will return null at the end of an array. Reads the next JSON token from the stream as a . A . This method will return null at the end of an array. Reads the next JSON token from the stream. true if the next token was read successfully; false if there are no more tokens to read. Specifies the type of token. No token type has been set. A JSON object. A JSON array. A JSON constructor. A JSON object property. A comment. An integer value. A float value. A string value. A boolean value. A null value. An undefined value. A date value. A raw JSON value. A collection of bytes value. A Guid value. A Uri value. A TimeSpan value. Represents a writer that provides a fast, non-cached, forward-only way of generating Json data. Initializes a new instance of the class writing to the given . The container being written to. Initializes a new instance of the class. Flushes whatever is in the buffer to the underlying streams and also flushes the underlying stream. Closes this stream and the underlying stream. Writes the beginning of a Json object. Writes the beginning of a Json array. Writes the start of a constructor with the given name. The name of the constructor. Writes the end. The token. Writes the property name of a name/value pair on a Json object. The name of the property. Writes a value. An error will raised if the value cannot be written as a single JSON token. The value to write. Writes a null value. Writes an undefined value. Writes raw JSON. The raw JSON to write. Writes out a comment /*...*/ containing the specified text. Text to place inside the comment. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Gets the token being writen. The token being writen. Specifies the member serialization options for the . All public members are serialized by default. Members can be excluded using or . This is the default member serialization mode. Only members must be marked with or are serialized. This member serialization mode can also be set by marking the class with . All public and private fields are serialized. Members can be excluded using or . This member serialization mode can also be set by marking the class with and setting IgnoreSerializableAttribute on to false. Specifies missing member handling options for the . Ignore a missing member and do not attempt to deserialize it. Throw a when a missing member is encountered during deserialization. Specifies null value handling options for the . Include null values when serializing and deserializing objects. Ignore null values when serializing and deserializing objects. Specifies how object creation is handled by the . Reuse existing objects, create new objects when needed. Only reuse existing objects. Always create new objects. Specifies reference handling options for the . Note that references cannot be preserved when a value is set via a non-default constructor such as types that implement ISerializable. Do not preserve references when serializing types. Preserve references when serializing into a JSON object structure. Preserve references when serializing into a JSON array structure. Preserve references when serializing. Specifies reference loop handling options for the . Throw a when a loop is encountered. Ignore loop references and do not serialize. Serialize loop references. Indicating whether a property is required. The property is not required. The default state. The property must be defined in JSON but can be a null value. The property must be defined in JSON and cannot be a null value. Contains the JSON schema extension methods. Determines whether the is valid. The source to test. The schema to test with. true if the specified is valid; otherwise, false. Determines whether the is valid. The source to test. The schema to test with. When this method returns, contains any error messages generated while validating. true if the specified is valid; otherwise, false. Validates the specified . The source to test. The schema to test with. Validates the specified . The source to test. The schema to test with. The validation event handler. An in-memory representation of a JSON Schema. Initializes a new instance of the class. Reads a from the specified . The containing the JSON Schema to read. The object representing the JSON Schema. Reads a from the specified . The containing the JSON Schema to read. The to use when resolving schema references. The object representing the JSON Schema. Load a from a string that contains schema JSON. A that contains JSON. A populated from the string that contains JSON. Parses the specified json. The json. The resolver. A populated from the string that contains JSON. Writes this schema to a . A into which this method will write. Writes this schema to a using the specified . A into which this method will write. The resolver used. Returns a that represents the current . A that represents the current . Gets or sets the id. Gets or sets the title. Gets or sets whether the object is required. Gets or sets whether the object is read only. Gets or sets whether the object is visible to users. Gets or sets whether the object is transient. Gets or sets the description of the object. Gets or sets the types of values allowed by the object. The type. Gets or sets the pattern. The pattern. Gets or sets the minimum length. The minimum length. Gets or sets the maximum length. The maximum length. Gets or sets a number that the value should be divisble by. A number that the value should be divisble by. Gets or sets the minimum. The minimum. Gets or sets the maximum. The maximum. Gets or sets a flag indicating whether the value can not equal the number defined by the "minimum" attribute. A flag indicating whether the value can not equal the number defined by the "minimum" attribute. Gets or sets a flag indicating whether the value can not equal the number defined by the "maximum" attribute. A flag indicating whether the value can not equal the number defined by the "maximum" attribute. Gets or sets the minimum number of items. The minimum number of items. Gets or sets the maximum number of items. The maximum number of items. Gets or sets the of items. The of items. Gets or sets a value indicating whether items in an array are validated using the instance at their array position from . true if items are validated using their array position; otherwise, false. Gets or sets the of additional items. The of additional items. Gets or sets a value indicating whether additional items are allowed. true if additional items are allowed; otherwise, false. Gets or sets whether the array items must be unique. Gets or sets the of properties. The of properties. Gets or sets the of additional properties. The of additional properties. Gets or sets the pattern properties. The pattern properties. Gets or sets a value indicating whether additional properties are allowed. true if additional properties are allowed; otherwise, false. Gets or sets the required property if this property is present. The required property if this property is present. Gets or sets the a collection of valid enum values allowed. A collection of valid enum values allowed. Gets or sets disallowed types. The disallow types. Gets or sets the default value. The default value. Gets or sets the collection of that this schema extends. The collection of that this schema extends. Gets or sets the format. The format. Returns detailed information about the schema exception. Initializes a new instance of the class. Initializes a new instance of the class with a specified error message. The error message that explains the reason for the exception. Initializes a new instance of the class with a specified error message and a reference to the inner exception that is the cause of this exception. The error message that explains the reason for the exception. The exception that is the cause of the current exception, or a null reference (Nothing in Visual Basic) if no inner exception is specified. Gets the line number indicating where the error occurred. The line number indicating where the error occurred. Gets the line position indicating where the error occurred. The line position indicating where the error occurred. Gets the path to the JSON where the error occurred. The path to the JSON where the error occurred. Generates a from a specified . Generate a from the specified type. The type to generate a from. A generated from the specified type. Generate a from the specified type. The type to generate a from. The used to resolve schema references. A generated from the specified type. Generate a from the specified type. The type to generate a from. Specify whether the generated root will be nullable. A generated from the specified type. Generate a from the specified type. The type to generate a from. The used to resolve schema references. Specify whether the generated root will be nullable. A generated from the specified type. Gets or sets how undefined schemas are handled by the serializer. Gets or sets the contract resolver. The contract resolver. Resolves from an id. Initializes a new instance of the class. Gets a for the specified reference. The id. A for the specified reference. Gets or sets the loaded schemas. The loaded schemas. The value types allowed by the . No type specified. String type. Float type. Integer type. Boolean type. Object type. Array type. Null type. Any type. Specifies undefined schema Id handling options for the . Do not infer a schema Id. Use the .NET type name as the schema Id. Use the assembly qualified .NET type name as the schema Id. Returns detailed information related to the . Gets the associated with the validation error. The JsonSchemaException associated with the validation error. Gets the path of the JSON location where the validation error occurred. The path of the JSON location where the validation error occurred. Gets the text description corresponding to the validation error. The text description. Represents the callback method that will handle JSON schema validation events and the . Allows users to control class loading and mandate what class to load. When overridden in a derived class, controls the binding of a serialized object to a type. Specifies the name of the serialized object. Specifies the name of the serialized object The type of the object the formatter creates a new instance of. When overridden in a derived class, controls the binding of a serialized object to a type. The type of the object the formatter creates a new instance of. Specifies the name of the serialized object. Specifies the name of the serialized object. Resolves member mappings for a type, camel casing property names. Used by to resolves a for a given . Used by to resolves a for a given . Resolves the contract for a given type. The type to resolve a contract for. The contract for a given type. Initializes a new instance of the class. Initializes a new instance of the class. If set to true the will use a cached shared with other resolvers of the same type. Sharing the cache will significantly performance because expensive reflection will only happen once but could cause unexpected behavior if different instances of the resolver are suppose to produce different results. When set to false it is highly recommended to reuse instances with the . Resolves the contract for a given type. The type to resolve a contract for. The contract for a given type. Gets the serializable members for the type. The type to get serializable members for. The serializable members for the type. Creates a for the given type. Type of the object. A for the given type. Creates the constructor parameters. The constructor to create properties for. The type's member properties. Properties for the given . Creates a for the given . The matching member property. The constructor parameter. A created for the given . Resolves the default for the contract. Type of the object. The contract's default . Creates a for the given type. Type of the object. A for the given type. Creates a for the given type. Type of the object. A for the given type. Creates a for the given type. Type of the object. A for the given type. Creates a for the given type. Type of the object. A for the given type. Creates a for the given type. Type of the object. A for the given type. Determines which contract type is created for the given type. Type of the object. A for the given type. Creates properties for the given . The type to create properties for. /// The member serialization mode for the type. Properties for the given . Creates the used by the serializer to get and set values from a member. The member. The used by the serializer to get and set values from a member. Creates a for the given . The member's parent . The member to create a for. A created for the given . Resolves the name of the property. Name of the property. Name of the property. Gets the resolved name of the property. Name of the property. Name of the property. Gets a value indicating whether members are being get and set using dynamic code generation. This value is determined by the runtime permissions available. true if using dynamic code generation; otherwise, false. Gets or sets the default members search flags. The default members search flags. Gets or sets a value indicating whether compiler generated members should be serialized. true if serialized compiler generated members; otherwise, false. Initializes a new instance of the class. Resolves the name of the property. Name of the property. The property name camel cased. Used to resolve references when serializing and deserializing JSON by the . Resolves a reference to its object. The serialization context. The reference to resolve. The object that Gets the reference for the sepecified object. The serialization context. The object to get a reference for. The reference to the object. Determines whether the specified object is referenced. The serialization context. The object to test for a reference. true if the specified object is referenced; otherwise, false. Adds a reference to the specified object. The serialization context. The reference. The object to reference. The default serialization binder used when resolving and loading classes from type names. When overridden in a derived class, controls the binding of a serialized object to a type. Specifies the name of the serialized object. Specifies the name of the serialized object. The type of the object the formatter creates a new instance of. When overridden in a derived class, controls the binding of a serialized object to a type. The type of the object the formatter creates a new instance of. Specifies the name of the serialized object. Specifies the name of the serialized object. Provides information surrounding an error. Gets the error. The error. Gets the original object that caused the error. The original object that caused the error. Gets the member that caused the error. The member that caused the error. Gets the path of the JSON location where the error occurred. The path of the JSON location where the error occurred. Gets or sets a value indicating whether this is handled. true if handled; otherwise, false. Provides data for the Error event. Initializes a new instance of the class. The current object. The error context. Gets the current object the error event is being raised against. The current object the error event is being raised against. Gets the error context. The error context. Represents a trace writer. Writes the specified trace level, message and optional exception. The at which to write this trace. The trace message. The trace exception. This parameter is optional. Gets the that will be used to filter the trace messages passed to the writer. For example a filter level of Info will exclude Verbose messages and include Info, Warning and Error messages. The that will be used to filter the trace messages passed to the writer. Provides methods to get and set values. Sets the value. The target to set the value on. The value to set on the target. Gets the value. The target to get the value from. The value. Contract details for a used by the . Contract details for a used by the . Contract details for a used by the . Gets the underlying type for the contract. The underlying type for the contract. Gets or sets the type created during deserialization. The type created during deserialization. Gets or sets whether this type contract is serialized as a reference. Whether this type contract is serialized as a reference. Gets or sets the default for this contract. The converter. Gets or sets all methods called immediately after deserialization of the object. The methods called immediately after deserialization of the object. Gets or sets all methods called during deserialization of the object. The methods called during deserialization of the object. Gets or sets all methods called after serialization of the object graph. The methods called after serialization of the object graph. Gets or sets all methods called before serialization of the object. The methods called before serialization of the object. Gets or sets all method called when an error is thrown during the serialization of the object. The methods called when an error is thrown during the serialization of the object. Gets or sets the method called immediately after deserialization of the object. The method called immediately after deserialization of the object. Gets or sets the method called during deserialization of the object. The method called during deserialization of the object. Gets or sets the method called after serialization of the object graph. The method called after serialization of the object graph. Gets or sets the method called before serialization of the object. The method called before serialization of the object. Gets or sets the method called when an error is thrown during the serialization of the object. The method called when an error is thrown during the serialization of the object. Gets or sets the default creator method used to create the object. The default creator method used to create the object. Gets or sets a value indicating whether the default creator is non public. true if the default object creator is non-public; otherwise, false. Initializes a new instance of the class. The underlying type for the contract. Gets or sets the default collection items . The converter. Gets or sets a value indicating whether the collection items preserve object references. true if collection items preserve object references; otherwise, false. Gets or sets the collection item reference loop handling. The reference loop handling. Gets or sets the collection item type name handling. The type name handling. Initializes a new instance of the class. The underlying type for the contract. Gets the of the collection items. The of the collection items. Gets a value indicating whether the collection type is a multidimensional array. true if the collection type is a multidimensional array; otherwise, false. Handles serialization callback events. The object that raised the callback event. The streaming context. Handles serialization error callback events. The object that raised the callback event. The streaming context. The error context. Sets extension data for an object during deserialization. The object to set extension data on. The extension data key. The extension data value. Gets extension data for an object during serialization. The object to set extension data on. Contract details for a used by the . Initializes a new instance of the class. The underlying type for the contract. Gets or sets the property name resolver. The property name resolver. Gets the of the dictionary keys. The of the dictionary keys. Gets the of the dictionary values. The of the dictionary values. Contract details for a used by the . Initializes a new instance of the class. The underlying type for the contract. Contract details for a used by the . Initializes a new instance of the class. The underlying type for the contract. Gets or sets the object member serialization. The member object serialization. Gets or sets a value that indicates whether the object's properties are required. A value indicating whether the object's properties are required. Gets the object's properties. The object's properties. Gets the constructor parameters required for any non-default constructor Gets or sets the override constructor used to create the object. This is set when a constructor is marked up using the JsonConstructor attribute. The override constructor. Gets or sets the parametrized constructor used to create the object. The parametrized constructor. Gets or sets the extension data setter. Gets or sets the extension data getter. Contract details for a used by the . Initializes a new instance of the class. The underlying type for the contract. Maps a JSON property to a .NET member or constructor parameter. Returns a that represents this instance. A that represents this instance. Gets or sets the name of the property. The name of the property. Gets or sets the type that declared this property. The type that declared this property. Gets or sets the order of serialization and deserialization of a member. The numeric order of serialization or deserialization. Gets or sets the name of the underlying member or parameter. The name of the underlying member or parameter. Gets the that will get and set the during serialization. The that will get and set the during serialization. Gets or sets the type of the property. The type of the property. Gets or sets the for the property. If set this converter takes presidence over the contract converter for the property type. The converter. Gets or sets the member converter. The member converter. Gets or sets a value indicating whether this is ignored. true if ignored; otherwise, false. Gets or sets a value indicating whether this is readable. true if readable; otherwise, false. Gets or sets a value indicating whether this is writable. true if writable; otherwise, false. Gets or sets a value indicating whether this has a member attribute. true if has a member attribute; otherwise, false. Gets the default value. The default value. Gets or sets a value indicating whether this is required. A value indicating whether this is required. Gets or sets a value indicating whether this property preserves object references. true if this instance is reference; otherwise, false. Gets or sets the property null value handling. The null value handling. Gets or sets the property default value handling. The default value handling. Gets or sets the property reference loop handling. The reference loop handling. Gets or sets the property object creation handling. The object creation handling. Gets or sets or sets the type name handling. The type name handling. Gets or sets a predicate used to determine whether the property should be serialize. A predicate used to determine whether the property should be serialize. Gets or sets a predicate used to determine whether the property should be serialized. A predicate used to determine whether the property should be serialized. Gets or sets an action used to set whether the property has been deserialized. An action used to set whether the property has been deserialized. Gets or sets the converter used when serializing the property's collection items. The collection's items converter. Gets or sets whether this property's collection items are serialized as a reference. Whether this property's collection items are serialized as a reference. Gets or sets the the type name handling used when serializing the property's collection items. The collection's items type name handling. Gets or sets the the reference loop handling used when serializing the property's collection items. The collection's items reference loop handling. A collection of objects. Initializes a new instance of the class. The type. When implemented in a derived class, extracts the key from the specified element. The element from which to extract the key. The key for the specified element. Adds a object. The property to add to the collection. Gets the closest matching object. First attempts to get an exact case match of propertyName and then a case insensitive match. Name of the property. A matching property if found. Gets a property by property name. The name of the property to get. Type property name string comparison. A matching property if found. Contract details for a used by the . Initializes a new instance of the class. The underlying type for the contract. Represents a trace writer that writes to memory. When the trace message limit is reached then old trace messages will be removed as new messages are added. Initializes a new instance of the class. Writes the specified trace level, message and optional exception. The at which to write this trace. The trace message. The trace exception. This parameter is optional. Returns an enumeration of the most recent trace messages. An enumeration of the most recent trace messages. Returns a of the most recent trace messages. A of the most recent trace messages. Gets the that will be used to filter the trace messages passed to the writer. For example a filter level of Info will exclude Verbose messages and include Info, Warning and Error messages. The that will be used to filter the trace messages passed to the writer. Represents a method that constructs an object. The object type to create. When applied to a method, specifies that the method is called when an error occurs serializing an object. Get and set values for a using reflection. Initializes a new instance of the class. The member info. Sets the value. The target to set the value on. The value to set on the target. Gets the value. The target to get the value from. The value. Specifies how strings are escaped when writing JSON text. Only control characters (e.g. newline) are escaped. All non-ASCII and control characters (e.g. newline) are escaped. HTML (<, >, &, ', ") and control characters (e.g. newline) are escaped. Specifies what messages to output for the class. Output no tracing and debugging messages. Output error-handling messages. Output warnings and error-handling messages. Output informational messages, warnings, and error-handling messages. Output all debugging and tracing messages. Specifies type name handling options for the . Do not include the .NET type name when serializing types. Include the .NET type name when serializing into a JSON object structure. Include the .NET type name when serializing into a JSON array structure. Always include the .NET type name when serializing. Include the .NET type name when the type of the object being serialized is not the same as its declared type. Determines whether the collection is null or empty. The collection. true if the collection is null or empty; otherwise, false. Adds the elements of the specified collection to the specified generic IList. The list to add to. The collection of elements to add. Returns the index of the first occurrence in a sequence by using a specified IEqualityComparer. The type of the elements of source. A sequence in which to locate a value. The object to locate in the sequence An equality comparer to compare values. The zero-based index of the first occurrence of value within the entire sequence, if found; otherwise, –1. Converts the value to the specified type. The value to convert. The culture to use when converting. The type to convert the value to. The converted type. Converts the value to the specified type. The value to convert. The culture to use when converting. The type to convert the value to. The converted value if the conversion was successful or the default value of T if it failed. true if initialValue was converted successfully; otherwise, false. Converts the value to the specified type. If the value is unable to be converted, the value is checked whether it assignable to the specified type. The value to convert. The culture to use when converting. The type to convert or cast the value to. The converted type. If conversion was unsuccessful, the initial value is returned if assignable to the target type. Gets a dictionary of the names and values of an Enum type. Gets a dictionary of the names and values of an Enum type. The enum type to get names and values for. Gets the type of the typed collection's items. The type. The type of the typed collection's items. Gets the member's underlying type. The member. The underlying type of the member. Determines whether the member is an indexed property. The member. true if the member is an indexed property; otherwise, false. Determines whether the property is an indexed property. The property. true if the property is an indexed property; otherwise, false. Gets the member's value on the object. The member. The target object. The member's value on the object. Sets the member's value on the target object. The member. The target. The value. Determines whether the specified MemberInfo can be read. The MemberInfo to determine whether can be read. /// if set to true then allow the member to be gotten non-publicly. true if the specified MemberInfo can be read; otherwise, false. Determines whether the specified MemberInfo can be set. The MemberInfo to determine whether can be set. if set to true then allow the member to be set non-publicly. if set to true then allow the member to be set if read-only. true if the specified MemberInfo can be set; otherwise, false. Builds a string. Unlike StringBuilder this class lets you reuse it's internal buffer. Determines whether the string is all white space. Empty string will return false. The string to test whether it is all white space. true if the string is all white space; otherwise, false. Nulls an empty string. The string. Null if the string was null, otherwise the string unchanged. Specifies the state of the . An exception has been thrown, which has left the in an invalid state. You may call the method to put the in the Closed state. Any other method calls results in an being thrown. The method has been called. An object is being written. A array is being written. A constructor is being written. A property is being written. A write method has not been called. ================================================ FILE: packages/Newtonsoft.Json.6.0.2/lib/portable-net45+wp80+win8+wpa81/Newtonsoft.Json.xml ================================================ Newtonsoft.Json Represents a BSON Oid (object id). Initializes a new instance of the class. The Oid value. Gets or sets the value of the Oid. The value of the Oid. Represents a reader that provides fast, non-cached, forward-only access to serialized Json data. Represents a reader that provides fast, non-cached, forward-only access to serialized Json data. Initializes a new instance of the class with the specified . Reads the next JSON token from the stream. true if the next token was read successfully; false if there are no more tokens to read. Reads the next JSON token from the stream as a . A . This method will return null at the end of an array. Reads the next JSON token from the stream as a . A . This method will return null at the end of an array. Reads the next JSON token from the stream as a . A or a null reference if the next JSON token is null. This method will return null at the end of an array. Reads the next JSON token from the stream as a . A . This method will return null at the end of an array. Reads the next JSON token from the stream as a . A . This method will return null at the end of an array. Reads the next JSON token from the stream as a . A . This method will return null at the end of an array. Skips the children of the current token. Sets the current token. The new token. Sets the current token and value. The new token. The value. Sets the state based on current token type. Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources. Releases unmanaged and - optionally - managed resources true to release both managed and unmanaged resources; false to release only unmanaged resources. Changes the to Closed. Gets the current reader state. The current reader state. Gets or sets a value indicating whether the underlying stream or should be closed when the reader is closed. true to close the underlying stream or when the reader is closed; otherwise false. The default is true. Gets or sets a value indicating whether multiple pieces of JSON content can be read from a continuous stream without erroring. true to support reading multiple pieces of JSON content; otherwise false. The default is false. Gets the quotation mark character used to enclose the value of a string. Get or set how time zones are handling when reading JSON. Get or set how date formatted strings, e.g. "\/Date(1198908717056)\/" and "2012-03-21T05:40Z", are parsed when reading JSON. Get or set how floating point numbers, e.g. 1.0 and 9.9, are parsed when reading JSON text. Gets or sets the maximum depth allowed when reading JSON. Reading past this depth will throw a . Gets the type of the current JSON token. Gets the text value of the current JSON token. Gets The Common Language Runtime (CLR) type for the current JSON token. Gets the depth of the current token in the JSON document. The depth of the current token in the JSON document. Gets the path of the current JSON token. Gets or sets the culture used when reading JSON. Defaults to . Specifies the state of the reader. The Read method has not been called. The end of the file has been reached successfully. Reader is at a property. Reader is at the start of an object. Reader is in an object. Reader is at the start of an array. Reader is in an array. The Close method has been called. Reader has just read a value. Reader is at the start of a constructor. Reader in a constructor. An error occurred that prevents the read operation from continuing. The end of the file has been reached successfully. Initializes a new instance of the class. The stream. Initializes a new instance of the class. The reader. Initializes a new instance of the class. The stream. if set to true the root object will be read as a JSON array. The used when reading values from BSON. Initializes a new instance of the class. The reader. if set to true the root object will be read as a JSON array. The used when reading values from BSON. Reads the next JSON token from the stream as a . A or a null reference if the next JSON token is null. This method will return null at the end of an array. Reads the next JSON token from the stream as a . A . This method will return null at the end of an array. Reads the next JSON token from the stream as a . A . This method will return null at the end of an array. Reads the next JSON token from the stream as a . A . This method will return null at the end of an array. Reads the next JSON token from the stream as a . A . This method will return null at the end of an array. Reads the next JSON token from the stream as a . A . This method will return null at the end of an array. Reads the next JSON token from the stream. true if the next token was read successfully; false if there are no more tokens to read. Changes the to Closed. Gets or sets a value indicating whether binary data reading should compatible with incorrect Json.NET 3.5 written binary. true if binary data reading will be compatible with incorrect Json.NET 3.5 written binary; otherwise, false. Gets or sets a value indicating whether the root object will be read as a JSON array. true if the root object will be read as a JSON array; otherwise, false. Gets or sets the used when reading values from BSON. The used when reading values from BSON. Represents a writer that provides a fast, non-cached, forward-only way of generating JSON data. Represents a writer that provides a fast, non-cached, forward-only way of generating Json data. Creates an instance of the JsonWriter class. Flushes whatever is in the buffer to the underlying streams and also flushes the underlying stream. Closes this stream and the underlying stream. Writes the beginning of a Json object. Writes the end of a Json object. Writes the beginning of a Json array. Writes the end of an array. Writes the start of a constructor with the given name. The name of the constructor. Writes the end constructor. Writes the property name of a name/value pair on a JSON object. The name of the property. Writes the property name of a name/value pair on a JSON object. The name of the property. A flag to indicate whether the text should be escaped when it is written as a JSON property name. Writes the end of the current Json object or array. Writes the current token and its children. The to read the token from. Writes the current token. The to read the token from. A flag indicating whether the current token's children should be written. Writes the specified end token. The end token to write. Writes indent characters. Writes the JSON value delimiter. Writes an indent space. Writes a null value. Writes an undefined value. Writes raw JSON without changing the writer's state. The raw JSON to write. Writes raw JSON where a value is expected and updates the writer's state. The raw JSON to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. An error will raised if the value cannot be written as a single JSON token. The value to write. Writes out a comment /*...*/ containing the specified text. Text to place inside the comment. Writes out the given white space. The string of white space characters. Sets the state of the JsonWriter, The JsonToken being written. The value being written. Gets or sets a value indicating whether the underlying stream or should be closed when the writer is closed. true to close the underlying stream or when the writer is closed; otherwise false. The default is true. Gets the top. The top. Gets the state of the writer. Gets the path of the writer. Indicates how JSON text output is formatted. Get or set how dates are written to JSON text. Get or set how time zones are handling when writing JSON text. Get or set how strings are escaped when writing JSON text. Get or set how special floating point numbers, e.g. , and , are written to JSON text. Get or set how and values are formatting when writing JSON text. Gets or sets the culture used when writing JSON. Defaults to . Initializes a new instance of the class. The stream. Initializes a new instance of the class. The writer. Flushes whatever is in the buffer to the underlying streams and also flushes the underlying stream. Writes the end. The token. Writes out a comment /*...*/ containing the specified text. Text to place inside the comment. Writes the start of a constructor with the given name. The name of the constructor. Writes raw JSON. The raw JSON to write. Writes raw JSON where a value is expected and updates the writer's state. The raw JSON to write. Writes the beginning of a Json array. Writes the beginning of a Json object. Writes the property name of a name/value pair on a Json object. The name of the property. Closes this stream and the underlying stream. Writes a value. An error will raised if the value cannot be written as a single JSON token. The value to write. Writes a null value. Writes an undefined value. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value that represents a BSON object id. The Object ID value to write. Writes a BSON regex. The regex pattern. The regex options. Gets or sets the used when writing values to BSON. When set to no conversion will occur. The used when writing values to BSON. Specifies how constructors are used when initializing objects during deserialization by the . First attempt to use the public default constructor, then fall back to single paramatized constructor, then the non-public default constructor. Json.NET will use a non-public default constructor before falling back to a paramatized constructor. Converts a to and from JSON and BSON. Converts an object to and from JSON. Writes the JSON representation of the object. The to write to. The value. The calling serializer. Reads the JSON representation of the object. The to read from. Type of the object. The existing value of object being read. The calling serializer. The object value. Determines whether this instance can convert the specified object type. Type of the object. true if this instance can convert the specified object type; otherwise, false. Gets the of the JSON produced by the JsonConverter. The of the JSON produced by the JsonConverter. Gets a value indicating whether this can read JSON. true if this can read JSON; otherwise, false. Gets a value indicating whether this can write JSON. true if this can write JSON; otherwise, false. Writes the JSON representation of the object. The to write to. The value. The calling serializer. Reads the JSON representation of the object. The to read from. Type of the object. The existing value of object being read. The calling serializer. The object value. Determines whether this instance can convert the specified object type. Type of the object. true if this instance can convert the specified object type; otherwise, false. Create a custom object The object type to convert. Writes the JSON representation of the object. The to write to. The value. The calling serializer. Reads the JSON representation of the object. The to read from. Type of the object. The existing value of object being read. The calling serializer. The object value. Creates an object which will then be populated by the serializer. Type of the object. The created object. Determines whether this instance can convert the specified object type. Type of the object. true if this instance can convert the specified object type; otherwise, false. Gets a value indicating whether this can write JSON. true if this can write JSON; otherwise, false. Provides a base class for converting a to and from JSON. Determines whether this instance can convert the specified object type. Type of the object. true if this instance can convert the specified object type; otherwise, false. Converts a F# discriminated union type to and from JSON. Writes the JSON representation of the object. The to write to. The value. The calling serializer. Reads the JSON representation of the object. The to read from. Type of the object. The existing value of object being read. The calling serializer. The object value. Determines whether this instance can convert the specified object type. Type of the object. true if this instance can convert the specified object type; otherwise, false. Converts an ExpandoObject to and from JSON. Writes the JSON representation of the object. The to write to. The value. The calling serializer. Reads the JSON representation of the object. The to read from. Type of the object. The existing value of object being read. The calling serializer. The object value. Determines whether this instance can convert the specified object type. Type of the object. true if this instance can convert the specified object type; otherwise, false. Gets a value indicating whether this can write JSON. true if this can write JSON; otherwise, false. Converts a to and from the ISO 8601 date format (e.g. 2008-04-12T12:53Z). Writes the JSON representation of the object. The to write to. The value. The calling serializer. Reads the JSON representation of the object. The to read from. Type of the object. The existing value of object being read. The calling serializer. The object value. Gets or sets the date time styles used when converting a date to and from JSON. The date time styles used when converting a date to and from JSON. Gets or sets the date time format used when converting a date to and from JSON. The date time format used when converting a date to and from JSON. Gets or sets the culture used when converting a date to and from JSON. The culture used when converting a date to and from JSON. Converts a to and from a JavaScript date constructor (e.g. new Date(52231943)). Writes the JSON representation of the object. The to write to. The value. The calling serializer. Reads the JSON representation of the object. The to read from. Type of the object. The existing property value of the JSON that is being converted. The calling serializer. The object value. Converts a to and from JSON. Writes the JSON representation of the object. The to write to. The value. The calling serializer. Reads the JSON representation of the object. The to read from. Type of the object. The existing value of object being read. The calling serializer. The object value. Determines whether this instance can convert the specified object type. Type of the object. true if this instance can convert the specified object type; otherwise, false. Converts a to and from JSON and BSON. Writes the JSON representation of the object. The to write to. The value. The calling serializer. Reads the JSON representation of the object. The to read from. Type of the object. The existing value of object being read. The calling serializer. The object value. Determines whether this instance can convert the specified object type. Type of the object. true if this instance can convert the specified object type; otherwise, false. Converts an to and from its name string value. Initializes a new instance of the class. Writes the JSON representation of the object. The to write to. The value. The calling serializer. Reads the JSON representation of the object. The to read from. Type of the object. The existing value of object being read. The calling serializer. The object value. Determines whether this instance can convert the specified object type. Type of the object. true if this instance can convert the specified object type; otherwise, false. Gets or sets a value indicating whether the written enum text should be camel case. true if the written enum text will be camel case; otherwise, false. Gets or sets a value indicating whether integer values are allowed. true if integers are allowed; otherwise, false. Converts a to and from a string (e.g. "1.2.3.4"). Writes the JSON representation of the object. The to write to. The value. The calling serializer. Reads the JSON representation of the object. The to read from. Type of the object. The existing property value of the JSON that is being converted. The calling serializer. The object value. Determines whether this instance can convert the specified object type. Type of the object. true if this instance can convert the specified object type; otherwise, false. Converts XML to and from JSON. Writes the JSON representation of the object. The to write to. The calling serializer. The value. Reads the JSON representation of the object. The to read from. Type of the object. The existing value of object being read. The calling serializer. The object value. Checks if the attributeName is a namespace attribute. Attribute name to test. The attribute name prefix if it has one, otherwise an empty string. True if attribute name is for a namespace attribute, otherwise false. Determines whether this instance can convert the specified value type. Type of the value. true if this instance can convert the specified value type; otherwise, false. Gets or sets the name of the root element to insert when deserializing to XML if the JSON structure has produces multiple root elements. The name of the deserialize root element. Gets or sets a flag to indicate whether to write the Json.NET array attribute. This attribute helps preserve arrays when converting the written XML back to JSON. true if the array attibute is written to the XML; otherwise, false. Gets or sets a value indicating whether to write the root JSON object. true if the JSON root object is omitted; otherwise, false. Specifies how dates are formatted when writing JSON text. Dates are written in the ISO 8601 format, e.g. "2012-03-21T05:40Z". Dates are written in the Microsoft JSON format, e.g. "\/Date(1198908717056)\/". Specifies how date formatted strings, e.g. "\/Date(1198908717056)\/" and "2012-03-21T05:40Z", are parsed when reading JSON text. Date formatted strings are not parsed to a date type and are read as strings. Date formatted strings, e.g. "\/Date(1198908717056)\/" and "2012-03-21T05:40Z", are parsed to . Date formatted strings, e.g. "\/Date(1198908717056)\/" and "2012-03-21T05:40Z", are parsed to . Specifies how to treat the time value when converting between string and . Treat as local time. If the object represents a Coordinated Universal Time (UTC), it is converted to the local time. Treat as a UTC. If the object represents a local time, it is converted to a UTC. Treat as a local time if a is being converted to a string. If a string is being converted to , convert to a local time if a time zone is specified. Time zone information should be preserved when converting. Specifies default value handling options for the . Include members where the member value is the same as the member's default value when serializing objects. Included members are written to JSON. Has no effect when deserializing. Ignore members where the member value is the same as the member's default value when serializing objects so that is is not written to JSON. This option will ignore all default values (e.g. null for objects and nullable typesl; 0 for integers, decimals and floating point numbers; and false for booleans). The default value ignored can be changed by placing the on the property. Members with a default value but no JSON will be set to their default value when deserializing. Ignore members where the member value is the same as the member's default value when serializing objects and sets members to their default value when deserializing. Specifies float format handling options when writing special floating point numbers, e.g. , and with . Write special floating point values as strings in JSON, e.g. "NaN", "Infinity", "-Infinity". Write special floating point values as symbols in JSON, e.g. NaN, Infinity, -Infinity. Note that this will produce non-valid JSON. Write special floating point values as the property's default value in JSON, e.g. 0.0 for a property, null for a property. Specifies how floating point numbers, e.g. 1.0 and 9.9, are parsed when reading JSON text. Floating point numbers are parsed to . Floating point numbers are parsed to . Indicates the method that will be used during deserialization for locating and loading assemblies. In simple mode, the assembly used during deserialization need not match exactly the assembly used during serialization. Specifically, the version numbers need not match as the LoadWithPartialName method is used to load the assembly. In full mode, the assembly used during deserialization must match exactly the assembly used during serialization. The Load method of the Assembly class is used to load the assembly. Specifies formatting options for the . No special formatting is applied. This is the default. Causes child objects to be indented according to the and settings. Provides an interface to enable a class to return line and position information. Gets a value indicating whether the class can return line information. true if LineNumber and LinePosition can be provided; otherwise, false. Gets the current line number. The current line number or 0 if no line information is available (for example, HasLineInfo returns false). Gets the current line position. The current line position or 0 if no line information is available (for example, HasLineInfo returns false). Instructs the how to serialize the collection. Instructs the how to serialize the object. Initializes a new instance of the class. Initializes a new instance of the class with the specified container Id. The container Id. Gets or sets the id. The id. Gets or sets the title. The title. Gets or sets the description. The description. Gets the collection's items converter. The collection's items converter. Gets or sets a value that indicates whether to preserve object references. true to keep object reference; otherwise, false. The default is false. Gets or sets a value that indicates whether to preserve collection's items references. true to keep collection's items object references; otherwise, false. The default is false. Gets or sets the reference loop handling used when serializing the collection's items. The reference loop handling. Gets or sets the type name handling used when serializing the collection's items. The type name handling. Initializes a new instance of the class. Initializes a new instance of the class with a flag indicating whether the array can contain null items A flag indicating whether the array can contain null items. Initializes a new instance of the class with the specified container Id. The container Id. Gets or sets a value indicating whether null items are allowed in the collection. true if null items are allowed in the collection; otherwise, false. Instructs the to use the specified constructor when deserializing that object. Provides methods for converting between common language runtime types and JSON types. Represents JavaScript's boolean value true as a string. This field is read-only. Represents JavaScript's boolean value false as a string. This field is read-only. Represents JavaScript's null as a string. This field is read-only. Represents JavaScript's undefined as a string. This field is read-only. Represents JavaScript's positive infinity as a string. This field is read-only. Represents JavaScript's negative infinity as a string. This field is read-only. Represents JavaScript's NaN as a string. This field is read-only. Converts the to its JSON string representation. The value to convert. A JSON string representation of the . Converts the to its JSON string representation using the specified. The value to convert. The format the date will be converted to. The time zone handling when the date is converted to a string. A JSON string representation of the . Converts the to its JSON string representation. The value to convert. A JSON string representation of the . Converts the to its JSON string representation using the specified. The value to convert. The format the date will be converted to. A JSON string representation of the . Converts the to its JSON string representation. The value to convert. A JSON string representation of the . Converts the to its JSON string representation. The value to convert. A JSON string representation of the . Converts the to its JSON string representation. The value to convert. A JSON string representation of the . Converts the to its JSON string representation. The value to convert. A JSON string representation of the . Converts the to its JSON string representation. The value to convert. A JSON string representation of the . Converts the to its JSON string representation. The value to convert. A JSON string representation of the . Converts the to its JSON string representation. The value to convert. A JSON string representation of the . Converts the to its JSON string representation. The value to convert. A JSON string representation of the . Converts the to its JSON string representation. The value to convert. A JSON string representation of the . Converts the to its JSON string representation. The value to convert. A JSON string representation of the . Converts the to its JSON string representation. The value to convert. A JSON string representation of the . Converts the to its JSON string representation. The value to convert. A JSON string representation of the . Converts the to its JSON string representation. The value to convert. A JSON string representation of the . Converts the to its JSON string representation. The value to convert. A JSON string representation of the . Converts the to its JSON string representation. The value to convert. A JSON string representation of the . Converts the to its JSON string representation. The value to convert. A JSON string representation of the . Converts the to its JSON string representation. The value to convert. A JSON string representation of the . Converts the to its JSON string representation. The value to convert. A JSON string representation of the . Converts the to its JSON string representation. The value to convert. The string delimiter character. A JSON string representation of the . Converts the to its JSON string representation. The value to convert. A JSON string representation of the . Serializes the specified object to a JSON string. The object to serialize. A JSON string representation of the object. Serializes the specified object to a JSON string using formatting. The object to serialize. Indicates how the output is formatted. A JSON string representation of the object. Serializes the specified object to a JSON string using a collection of . The object to serialize. A collection converters used while serializing. A JSON string representation of the object. Serializes the specified object to a JSON string using formatting and a collection of . The object to serialize. Indicates how the output is formatted. A collection converters used while serializing. A JSON string representation of the object. Serializes the specified object to a JSON string using . The object to serialize. The used to serialize the object. If this is null, default serialization settings will be is used. A JSON string representation of the object. Serializes the specified object to a JSON string using a type, formatting and . The object to serialize. The used to serialize the object. If this is null, default serialization settings will be is used. The type of the value being serialized. This parameter is used when is Auto to write out the type name if the type of the value does not match. Specifing the type is optional. A JSON string representation of the object. Serializes the specified object to a JSON string using formatting and . The object to serialize. Indicates how the output is formatted. The used to serialize the object. If this is null, default serialization settings will be is used. A JSON string representation of the object. Serializes the specified object to a JSON string using a type, formatting and . The object to serialize. Indicates how the output is formatted. The used to serialize the object. If this is null, default serialization settings will be is used. The type of the value being serialized. This parameter is used when is Auto to write out the type name if the type of the value does not match. Specifing the type is optional. A JSON string representation of the object. Asynchronously serializes the specified object to a JSON string. Serialization will happen on a new thread. The object to serialize. A task that represents the asynchronous serialize operation. The value of the TResult parameter contains a JSON string representation of the object. Asynchronously serializes the specified object to a JSON string using formatting. Serialization will happen on a new thread. The object to serialize. Indicates how the output is formatted. A task that represents the asynchronous serialize operation. The value of the TResult parameter contains a JSON string representation of the object. Asynchronously serializes the specified object to a JSON string using formatting and a collection of . Serialization will happen on a new thread. The object to serialize. Indicates how the output is formatted. The used to serialize the object. If this is null, default serialization settings will be is used. A task that represents the asynchronous serialize operation. The value of the TResult parameter contains a JSON string representation of the object. Deserializes the JSON to a .NET object. The JSON to deserialize. The deserialized object from the Json string. Deserializes the JSON to a .NET object using . The JSON to deserialize. The used to deserialize the object. If this is null, default serialization settings will be is used. The deserialized object from the JSON string. Deserializes the JSON to the specified .NET type. The JSON to deserialize. The of object being deserialized. The deserialized object from the Json string. Deserializes the JSON to the specified .NET type. The type of the object to deserialize to. The JSON to deserialize. The deserialized object from the Json string. Deserializes the JSON to the given anonymous type. The anonymous type to deserialize to. This can't be specified traditionally and must be infered from the anonymous type passed as a parameter. The JSON to deserialize. The anonymous type object. The deserialized anonymous type from the JSON string. Deserializes the JSON to the given anonymous type using . The anonymous type to deserialize to. This can't be specified traditionally and must be infered from the anonymous type passed as a parameter. The JSON to deserialize. The anonymous type object. The used to deserialize the object. If this is null, default serialization settings will be is used. The deserialized anonymous type from the JSON string. Deserializes the JSON to the specified .NET type using a collection of . The type of the object to deserialize to. The JSON to deserialize. Converters to use while deserializing. The deserialized object from the JSON string. Deserializes the JSON to the specified .NET type using . The type of the object to deserialize to. The object to deserialize. The used to deserialize the object. If this is null, default serialization settings will be is used. The deserialized object from the JSON string. Deserializes the JSON to the specified .NET type using a collection of . The JSON to deserialize. The type of the object to deserialize. Converters to use while deserializing. The deserialized object from the JSON string. Deserializes the JSON to the specified .NET type using . The JSON to deserialize. The type of the object to deserialize to. The used to deserialize the object. If this is null, default serialization settings will be is used. The deserialized object from the JSON string. Asynchronously deserializes the JSON to the specified .NET type. Deserialization will happen on a new thread. The type of the object to deserialize to. The JSON to deserialize. A task that represents the asynchronous deserialize operation. The value of the TResult parameter contains the deserialized object from the JSON string. Asynchronously deserializes the JSON to the specified .NET type using . Deserialization will happen on a new thread. The type of the object to deserialize to. The JSON to deserialize. The used to deserialize the object. If this is null, default serialization settings will be is used. A task that represents the asynchronous deserialize operation. The value of the TResult parameter contains the deserialized object from the JSON string. Asynchronously deserializes the JSON to the specified .NET type. Deserialization will happen on a new thread. The JSON to deserialize. A task that represents the asynchronous deserialize operation. The value of the TResult parameter contains the deserialized object from the JSON string. Asynchronously deserializes the JSON to the specified .NET type using . Deserialization will happen on a new thread. The JSON to deserialize. The type of the object to deserialize to. The used to deserialize the object. If this is null, default serialization settings will be is used. A task that represents the asynchronous deserialize operation. The value of the TResult parameter contains the deserialized object from the JSON string. Populates the object with values from the JSON string. The JSON to populate values from. The target object to populate values onto. Populates the object with values from the JSON string using . The JSON to populate values from. The target object to populate values onto. The used to deserialize the object. If this is null, default serialization settings will be is used. Asynchronously populates the object with values from the JSON string using . The JSON to populate values from. The target object to populate values onto. The used to deserialize the object. If this is null, default serialization settings will be is used. A task that represents the asynchronous populate operation. Serializes the to a JSON string. The node to convert to JSON. A JSON string of the XNode. Serializes the to a JSON string using formatting. The node to convert to JSON. Indicates how the output is formatted. A JSON string of the XNode. Serializes the to a JSON string using formatting and omits the root object if is true. The node to serialize. Indicates how the output is formatted. Omits writing the root object. A JSON string of the XNode. Deserializes the from a JSON string. The JSON string. The deserialized XNode Deserializes the from a JSON string nested in a root elment specified by . The JSON string. The name of the root element to append when deserializing. The deserialized XNode Deserializes the from a JSON string nested in a root elment specified by and writes a .NET array attribute for collections. The JSON string. The name of the root element to append when deserializing. A flag to indicate whether to write the Json.NET array attribute. This attribute helps preserve arrays when converting the written XML back to JSON. The deserialized XNode Gets or sets a function that creates default . Default settings are automatically used by serialization methods on , and and on . To serialize without using any default settings create a with . Instructs the to use the specified when serializing the member or class. Initializes a new instance of the class. Type of the converter. Gets the type of the converter. The type of the converter. Represents a collection of . Instructs the how to serialize the collection. Initializes a new instance of the class. Initializes a new instance of the class with the specified container Id. The container Id. The exception thrown when an error occurs during Json serialization or deserialization. Initializes a new instance of the class. Initializes a new instance of the class with a specified error message. The error message that explains the reason for the exception. Initializes a new instance of the class with a specified error message and a reference to the inner exception that is the cause of this exception. The error message that explains the reason for the exception. The exception that is the cause of the current exception, or a null reference (Nothing in Visual Basic) if no inner exception is specified. Instructs the to deserialize properties with no matching class member into the specified collection and write values during serialization. Initializes a new instance of the class. Gets or sets a value that indicates whether to write extension data when serializing the object. true to write extension data when serializing the object; otherwise, false. The default is true. Gets or sets a value that indicates whether to read extension data when deserializing the object. true to read extension data when deserializing the object; otherwise, false. The default is true. Instructs the not to serialize the public field or public read/write property value. Instructs the how to serialize the object. Initializes a new instance of the class. Initializes a new instance of the class with the specified member serialization. The member serialization. Initializes a new instance of the class with the specified container Id. The container Id. Gets or sets the member serialization. The member serialization. Gets or sets a value that indicates whether the object's properties are required. A value indicating whether the object's properties are required. Instructs the to always serialize the member with the specified name. Initializes a new instance of the class. Initializes a new instance of the class with the specified name. Name of the property. Gets or sets the converter used when serializing the property's collection items. The collection's items converter. Gets or sets the null value handling used when serializing this property. The null value handling. Gets or sets the default value handling used when serializing this property. The default value handling. Gets or sets the reference loop handling used when serializing this property. The reference loop handling. Gets or sets the object creation handling used when deserializing this property. The object creation handling. Gets or sets the type name handling used when serializing this property. The type name handling. Gets or sets whether this property's value is serialized as a reference. Whether this property's value is serialized as a reference. Gets or sets the order of serialization and deserialization of a member. The numeric order of serialization or deserialization. Gets or sets a value indicating whether this property is required. A value indicating whether this property is required. Gets or sets the name of the property. The name of the property. Gets or sets the the reference loop handling used when serializing the property's collection items. The collection's items reference loop handling. Gets or sets the the type name handling used when serializing the property's collection items. The collection's items type name handling. Gets or sets whether this property's collection items are serialized as a reference. Whether this property's collection items are serialized as a reference. The exception thrown when an error occurs while reading Json text. Initializes a new instance of the class. Initializes a new instance of the class with a specified error message. The error message that explains the reason for the exception. Initializes a new instance of the class with a specified error message and a reference to the inner exception that is the cause of this exception. The error message that explains the reason for the exception. The exception that is the cause of the current exception, or a null reference (Nothing in Visual Basic) if no inner exception is specified. Gets the line number indicating where the error occurred. The line number indicating where the error occurred. Gets the line position indicating where the error occurred. The line position indicating where the error occurred. Gets the path to the JSON where the error occurred. The path to the JSON where the error occurred. The exception thrown when an error occurs during Json serialization or deserialization. Initializes a new instance of the class. Initializes a new instance of the class with a specified error message. The error message that explains the reason for the exception. Initializes a new instance of the class with a specified error message and a reference to the inner exception that is the cause of this exception. The error message that explains the reason for the exception. The exception that is the cause of the current exception, or a null reference (Nothing in Visual Basic) if no inner exception is specified. Serializes and deserializes objects into and from the JSON format. The enables you to control how objects are encoded into JSON. Initializes a new instance of the class. Creates a new instance. The will not use default settings. A new instance. The will not use default settings. Creates a new instance using the specified . The will not use default settings. The settings to be applied to the . A new instance using the specified . The will not use default settings. Creates a new instance. The will use default settings. A new instance. The will use default settings. Creates a new instance using the specified . The will use default settings. The settings to be applied to the . A new instance using the specified . The will use default settings. Populates the JSON values onto the target object. The that contains the JSON structure to reader values from. The target object to populate values onto. Populates the JSON values onto the target object. The that contains the JSON structure to reader values from. The target object to populate values onto. Deserializes the Json structure contained by the specified . The that contains the JSON structure to deserialize. The being deserialized. Deserializes the Json structure contained by the specified into an instance of the specified type. The containing the object. The of object being deserialized. The instance of being deserialized. Deserializes the Json structure contained by the specified into an instance of the specified type. The containing the object. The type of the object to deserialize. The instance of being deserialized. Deserializes the Json structure contained by the specified into an instance of the specified type. The containing the object. The of object being deserialized. The instance of being deserialized. Serializes the specified and writes the Json structure to a Stream using the specified . The used to write the Json structure. The to serialize. Serializes the specified and writes the Json structure to a Stream using the specified . The used to write the Json structure. The to serialize. The type of the value being serialized. This parameter is used when is Auto to write out the type name if the type of the value does not match. Specifing the type is optional. Serializes the specified and writes the Json structure to a Stream using the specified . The used to write the Json structure. The to serialize. The type of the value being serialized. This parameter is used when is Auto to write out the type name if the type of the value does not match. Specifing the type is optional. Serializes the specified and writes the Json structure to a Stream using the specified . The used to write the Json structure. The to serialize. Occurs when the errors during serialization and deserialization. Gets or sets the used by the serializer when resolving references. Gets or sets the used by the serializer when resolving type names. Gets or sets the used by the serializer when writing trace messages. The trace writer. Gets or sets how type name writing and reading is handled by the serializer. Gets or sets how a type name assembly is written and resolved by the serializer. The type name assembly format. Gets or sets how object references are preserved by the serializer. Get or set how reference loops (e.g. a class referencing itself) is handled. Get or set how missing members (e.g. JSON contains a property that isn't a member on the object) are handled during deserialization. Get or set how null values are handled during serialization and deserialization. Get or set how null default are handled during serialization and deserialization. Gets or sets how objects are created during deserialization. The object creation handling. Gets or sets how constructors are used during deserialization. The constructor handling. Gets a collection that will be used during serialization. Collection that will be used during serialization. Gets or sets the contract resolver used by the serializer when serializing .NET objects to JSON and vice versa. Gets or sets the used by the serializer when invoking serialization callback methods. The context. Indicates how JSON text output is formatted. Get or set how dates are written to JSON text. Get or set how time zones are handling during serialization and deserialization. Get or set how date formatted strings, e.g. "\/Date(1198908717056)\/" and "2012-03-21T05:40Z", are parsed when reading JSON. Get or set how floating point numbers, e.g. 1.0 and 9.9, are parsed when reading JSON text. Get or set how special floating point numbers, e.g. , and , are written as JSON text. Get or set how strings are escaped when writing JSON text. Get or set how and values are formatting when writing JSON text. Gets or sets the culture used when reading JSON. Defaults to . Gets or sets the maximum depth allowed when reading JSON. Reading past this depth will throw a . Gets a value indicating whether there will be a check for additional JSON content after deserializing an object. true if there will be a check for additional JSON content after deserializing an object; otherwise, false. Specifies the settings on a object. Initializes a new instance of the class. Gets or sets how reference loops (e.g. a class referencing itself) is handled. Reference loop handling. Gets or sets how missing members (e.g. JSON contains a property that isn't a member on the object) are handled during deserialization. Missing member handling. Gets or sets how objects are created during deserialization. The object creation handling. Gets or sets how null values are handled during serialization and deserialization. Null value handling. Gets or sets how null default are handled during serialization and deserialization. The default value handling. Gets or sets a collection that will be used during serialization. The converters. Gets or sets how object references are preserved by the serializer. The preserve references handling. Gets or sets how type name writing and reading is handled by the serializer. The type name handling. Gets or sets how a type name assembly is written and resolved by the serializer. The type name assembly format. Gets or sets how constructors are used during deserialization. The constructor handling. Gets or sets the contract resolver used by the serializer when serializing .NET objects to JSON and vice versa. The contract resolver. Gets or sets the used by the serializer when resolving references. The reference resolver. Gets or sets the used by the serializer when writing trace messages. The trace writer. Gets or sets the used by the serializer when resolving type names. The binder. Gets or sets the error handler called during serialization and deserialization. The error handler called during serialization and deserialization. Gets or sets the used by the serializer when invoking serialization callback methods. The context. Get or set how and values are formatting when writing JSON text. Gets or sets the maximum depth allowed when reading JSON. Reading past this depth will throw a . Indicates how JSON text output is formatted. Get or set how dates are written to JSON text. Get or set how time zones are handling during serialization and deserialization. Get or set how date formatted strings, e.g. "\/Date(1198908717056)\/" and "2012-03-21T05:40Z", are parsed when reading JSON. Get or set how special floating point numbers, e.g. , and , are written as JSON. Get or set how floating point numbers, e.g. 1.0 and 9.9, are parsed when reading JSON text. Get or set how strings are escaped when writing JSON text. Gets or sets the culture used when reading JSON. Defaults to . Gets a value indicating whether there will be a check for additional content after deserializing an object. true if there will be a check for additional content after deserializing an object; otherwise, false. Represents a reader that provides fast, non-cached, forward-only access to JSON text data. Initializes a new instance of the class with the specified . The TextReader containing the XML data to read. Reads the next JSON token from the stream. true if the next token was read successfully; false if there are no more tokens to read. Reads the next JSON token from the stream as a . A or a null reference if the next JSON token is null. This method will return null at the end of an array. Reads the next JSON token from the stream as a . A . This method will return null at the end of an array. Reads the next JSON token from the stream as a . A . This method will return null at the end of an array. Reads the next JSON token from the stream as a . A . This method will return null at the end of an array. Reads the next JSON token from the stream as a . A . This method will return null at the end of an array. Reads the next JSON token from the stream as a . A . This method will return null at the end of an array. Changes the state to closed. Gets a value indicating whether the class can return line information. true if LineNumber and LinePosition can be provided; otherwise, false. Gets the current line number. The current line number or 0 if no line information is available (for example, HasLineInfo returns false). Gets the current line position. The current line position or 0 if no line information is available (for example, HasLineInfo returns false). Represents a writer that provides a fast, non-cached, forward-only way of generating Json data. Creates an instance of the JsonWriter class using the specified . The TextWriter to write to. Flushes whatever is in the buffer to the underlying streams and also flushes the underlying stream. Closes this stream and the underlying stream. Writes the beginning of a Json object. Writes the beginning of a Json array. Writes the start of a constructor with the given name. The name of the constructor. Writes the specified end token. The end token to write. Writes the property name of a name/value pair on a Json object. The name of the property. Writes the property name of a name/value pair on a JSON object. The name of the property. A flag to indicate whether the text should be escaped when it is written as a JSON property name. Writes indent characters. Writes the JSON value delimiter. Writes an indent space. Writes a value. An error will raised if the value cannot be written as a single JSON token. The value to write. Writes a null value. Writes an undefined value. Writes raw JSON. The raw JSON to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes out a comment /*...*/ containing the specified text. Text to place inside the comment. Writes out the given white space. The string of white space characters. Gets or sets how many IndentChars to write for each level in the hierarchy when is set to Formatting.Indented. Gets or sets which character to use to quote attribute values. Gets or sets which character to use for indenting when is set to Formatting.Indented. Gets or sets a value indicating whether object names will be surrounded with quotes. Specifies the type of Json token. This is returned by the if a method has not been called. An object start token. An array start token. A constructor start token. An object property name. A comment. Raw JSON. An integer. A float. A string. A boolean. A null token. An undefined token. An object end token. An array end token. A constructor end token. A Date. Byte data. Represents a reader that provides validation. Initializes a new instance of the class that validates the content returned from the given . The to read from while validating. Reads the next JSON token from the stream as a . A . Reads the next JSON token from the stream as a . A or a null reference if the next JSON token is null. Reads the next JSON token from the stream as a . A . Reads the next JSON token from the stream as a . A . This method will return null at the end of an array. Reads the next JSON token from the stream as a . A . This method will return null at the end of an array. Reads the next JSON token from the stream as a . A . Reads the next JSON token from the stream. true if the next token was read successfully; false if there are no more tokens to read. Sets an event handler for receiving schema validation errors. Gets the text value of the current JSON token. Gets the depth of the current token in the JSON document. The depth of the current token in the JSON document. Gets the path of the current JSON token. Gets the quotation mark character used to enclose the value of a string. Gets the type of the current JSON token. Gets the Common Language Runtime (CLR) type for the current JSON token. Gets or sets the schema. The schema. Gets the used to construct this . The specified in the constructor. The exception thrown when an error occurs while reading Json text. Initializes a new instance of the class. Initializes a new instance of the class with a specified error message. The error message that explains the reason for the exception. Initializes a new instance of the class with a specified error message and a reference to the inner exception that is the cause of this exception. The error message that explains the reason for the exception. The exception that is the cause of the current exception, or a null reference (Nothing in Visual Basic) if no inner exception is specified. Gets the path to the JSON where the error occurred. The path to the JSON where the error occurred. Contains the LINQ to JSON extension methods. Returns a collection of tokens that contains the ancestors of every token in the source collection. The type of the objects in source, constrained to . An of that contains the source collection. An of that contains the ancestors of every node in the source collection. Returns a collection of tokens that contains the descendants of every token in the source collection. The type of the objects in source, constrained to . An of that contains the source collection. An of that contains the descendants of every node in the source collection. Returns a collection of child properties of every object in the source collection. An of that contains the source collection. An of that contains the properties of every object in the source collection. Returns a collection of child values of every object in the source collection with the given key. An of that contains the source collection. The token key. An of that contains the values of every node in the source collection with the given key. Returns a collection of child values of every object in the source collection. An of that contains the source collection. An of that contains the values of every node in the source collection. Returns a collection of converted child values of every object in the source collection with the given key. The type to convert the values to. An of that contains the source collection. The token key. An that contains the converted values of every node in the source collection with the given key. Returns a collection of converted child values of every object in the source collection. The type to convert the values to. An of that contains the source collection. An that contains the converted values of every node in the source collection. Converts the value. The type to convert the value to. A cast as a of . A converted value. Converts the value. The source collection type. The type to convert the value to. A cast as a of . A converted value. Returns a collection of child tokens of every array in the source collection. The source collection type. An of that contains the source collection. An of that contains the values of every node in the source collection. Returns a collection of converted child tokens of every array in the source collection. An of that contains the source collection. The type to convert the values to. The source collection type. An that contains the converted values of every node in the source collection. Returns the input typed as . An of that contains the source collection. The input typed as . Returns the input typed as . The source collection type. An of that contains the source collection. The input typed as . Represents a collection of objects. The type of token Gets the with the specified key. Represents a JSON array. Represents a token that can contain other tokens. Represents an abstract JSON token. Compares the values of two tokens, including the values of all descendant tokens. The first to compare. The second to compare. true if the tokens are equal; otherwise false. Adds the specified content immediately after this token. A content object that contains simple content or a collection of content objects to be added after this token. Adds the specified content immediately before this token. A content object that contains simple content or a collection of content objects to be added before this token. Returns a collection of the ancestor tokens of this token. A collection of the ancestor tokens of this token. Returns a collection of the sibling tokens after this token, in document order. A collection of the sibling tokens after this tokens, in document order. Returns a collection of the sibling tokens before this token, in document order. A collection of the sibling tokens before this token, in document order. Gets the with the specified key converted to the specified type. The type to convert the token to. The token key. The converted token value. Returns a collection of the child tokens of this token, in document order. An of containing the child tokens of this , in document order. Returns a collection of the child tokens of this token, in document order, filtered by the specified type. The type to filter the child tokens on. A containing the child tokens of this , in document order. Returns a collection of the child values of this token, in document order. The type to convert the values to. A containing the child values of this , in document order. Removes this token from its parent. Replaces this token with the specified token. The value. Writes this token to a . A into which this method will write. A collection of which will be used when writing the token. Returns the indented JSON for this token. The indented JSON for this token. Returns the JSON for this token using the given formatting and converters. Indicates how the output is formatted. A collection of which will be used when writing the token. The JSON for this token using the given formatting and converters. Performs an explicit conversion from to . The value. The result of the conversion. Performs an explicit conversion from to . The value. The result of the conversion. Performs an explicit conversion from to . The value. The result of the conversion. Performs an explicit conversion from to . The value. The result of the conversion. Performs an explicit conversion from to . The value. The result of the conversion. Performs an explicit conversion from to . The value. The result of the conversion. Performs an explicit conversion from to . The value. The result of the conversion. Performs an explicit conversion from to . The value. The result of the conversion. Performs an explicit conversion from to . The value. The result of the conversion. Performs an explicit conversion from to . The value. The result of the conversion. Performs an explicit conversion from to . The value. The result of the conversion. Performs an explicit conversion from to . The value. The result of the conversion. Performs an explicit conversion from to . The value. The result of the conversion. Performs an explicit conversion from to . The value. The result of the conversion. Performs an explicit conversion from to . The value. The result of the conversion. Performs an explicit conversion from to . The value. The result of the conversion. Performs an explicit conversion from to . The value. The result of the conversion. Performs an explicit conversion from to . The value. The result of the conversion. Performs an explicit conversion from to . The value. The result of the conversion. Performs an explicit conversion from to . The value. The result of the conversion. Performs an explicit conversion from to . The value. The result of the conversion. Performs an explicit conversion from to . The value. The result of the conversion. Performs an explicit conversion from to . The value. The result of the conversion. Performs an explicit conversion from to . The value. The result of the conversion. Performs an explicit conversion from to . The value. The result of the conversion. Performs an explicit conversion from to . The value. The result of the conversion. Performs an explicit conversion from to . The value. The result of the conversion. Performs an explicit conversion from to . The value. The result of the conversion. Performs an explicit conversion from to . The value. The result of the conversion. Performs an explicit conversion from to . The value. The result of the conversion. Performs an explicit conversion from to . The value. The result of the conversion. Performs an explicit conversion from to . The value. The result of the conversion. Performs an explicit conversion from to . The value. The result of the conversion. Performs an explicit conversion from to . The value. The result of the conversion. Performs an explicit conversion from to . The value. The result of the conversion. Performs an explicit conversion from to . The value. The result of the conversion. Performs an explicit conversion from to . The value. The result of the conversion. Performs an implicit conversion from to . The value to create a from. The initialized with the specified value. Performs an implicit conversion from to . The value to create a from. The initialized with the specified value. Performs an implicit conversion from to . The value to create a from. The initialized with the specified value. Performs an implicit conversion from to . The value to create a from. The initialized with the specified value. Performs an implicit conversion from to . The value to create a from. The initialized with the specified value. Performs an implicit conversion from to . The value to create a from. The initialized with the specified value. Performs an implicit conversion from to . The value to create a from. The initialized with the specified value. Performs an implicit conversion from to . The value to create a from. The initialized with the specified value. Performs an implicit conversion from to . The value to create a from. The initialized with the specified value. Performs an implicit conversion from to . The value to create a from. The initialized with the specified value. Performs an implicit conversion from to . The value to create a from. The initialized with the specified value. Performs an implicit conversion from to . The value to create a from. The initialized with the specified value. Performs an implicit conversion from to . The value to create a from. The initialized with the specified value. Performs an implicit conversion from to . The value to create a from. The initialized with the specified value. Performs an implicit conversion from to . The value to create a from. The initialized with the specified value. Performs an implicit conversion from to . The value to create a from. The initialized with the specified value. Performs an implicit conversion from to . The value to create a from. The initialized with the specified value. Performs an implicit conversion from to . The value to create a from. The initialized with the specified value. Performs an implicit conversion from to . The value to create a from. The initialized with the specified value. Performs an implicit conversion from to . The value to create a from. The initialized with the specified value. Performs an implicit conversion from to . The value to create a from. The initialized with the specified value. Performs an implicit conversion from to . The value to create a from. The initialized with the specified value. Performs an implicit conversion from to . The value to create a from. The initialized with the specified value. Performs an implicit conversion from to . The value to create a from. The initialized with the specified value. Performs an implicit conversion from to . The value to create a from. The initialized with the specified value. Performs an implicit conversion from to . The value to create a from. The initialized with the specified value. Performs an implicit conversion from to . The value to create a from. The initialized with the specified value. Performs an implicit conversion from to . The value to create a from. The initialized with the specified value. Performs an implicit conversion from to . The value to create a from. The initialized with the specified value. Performs an implicit conversion from to . The value to create a from. The initialized with the specified value. Performs an implicit conversion from to . The value to create a from. The initialized with the specified value. Performs an implicit conversion from to . The value to create a from. The initialized with the specified value. Performs an implicit conversion from to . The value to create a from. The initialized with the specified value. Performs an implicit conversion from to . The value to create a from. The initialized with the specified value. Performs an implicit conversion from to . The value to create a from. The initialized with the specified value. Creates an for this token. An that can be used to read this token and its descendants. Creates a from an object. The object that will be used to create . A with the value of the specified object Creates a from an object using the specified . The object that will be used to create . The that will be used when reading the object. A with the value of the specified object Creates the specified .NET type from the . The object type that the token will be deserialized to. The new object created from the JSON value. Creates the specified .NET type from the . The object type that the token will be deserialized to. The new object created from the JSON value. Creates the specified .NET type from the using the specified . The object type that the token will be deserialized to. The that will be used when creating the object. The new object created from the JSON value. Creates the specified .NET type from the using the specified . The object type that the token will be deserialized to. The that will be used when creating the object. The new object created from the JSON value. Creates a from a . An positioned at the token to read into this . An that contains the token and its descendant tokens that were read from the reader. The runtime type of the token is determined by the token type of the first token encountered in the reader. Load a from a string that contains JSON. A that contains JSON. A populated from the string that contains JSON. Creates a from a . An positioned at the token to read into this . An that contains the token and its descendant tokens that were read from the reader. The runtime type of the token is determined by the token type of the first token encountered in the reader. Selects a using a JPath expression. Selects the token that matches the object path. A that contains a JPath expression. A , or null. Selects a using a JPath expression. Selects the token that matches the object path. A that contains a JPath expression. A flag to indicate whether an error should be thrown if no tokens are found when evaluating part of the expression. A . Selects a collection of elements using a JPath expression. A that contains a JPath expression. An that contains the selected elements. Selects a collection of elements using a JPath expression. A that contains a JPath expression. A flag to indicate whether an error should be thrown if no tokens are found when evaluating part of the expression. An that contains the selected elements. Returns the responsible for binding operations performed on this object. The expression tree representation of the runtime value. The to bind this object. Returns the responsible for binding operations performed on this object. The expression tree representation of the runtime value. The to bind this object. Creates a new instance of the . All child tokens are recursively cloned. A new instance of the . Gets a comparer that can compare two tokens for value equality. A that can compare two nodes for value equality. Gets or sets the parent. The parent. Gets the root of this . The root of this . Gets the node type for this . The type. Gets a value indicating whether this token has child tokens. true if this token has child values; otherwise, false. Gets the next sibling token of this node. The that contains the next sibling token. Gets the previous sibling token of this node. The that contains the previous sibling token. Gets the path of the JSON token. Gets the with the specified key. The with the specified key. Get the first child token of this token. A containing the first child token of the . Get the last child token of this token. A containing the last child token of the . Raises the event. The instance containing the event data. Returns a collection of the child tokens of this token, in document order. An of containing the child tokens of this , in document order. Returns a collection of the child values of this token, in document order. The type to convert the values to. A containing the child values of this , in document order. Returns a collection of the descendant tokens for this token in document order. An containing the descendant tokens of the . Adds the specified content as children of this . The content to be added. Adds the specified content as the first children of this . The content to be added. Creates an that can be used to add tokens to the . An that is ready to have content written to it. Replaces the children nodes of this token with the specified content. The content. Removes the child nodes from this token. Occurs when the items list of the collection has changed, or the collection is reset. Gets the container's children tokens. The container's children tokens. Gets a value indicating whether this token has child tokens. true if this token has child values; otherwise, false. Get the first child token of this token. A containing the first child token of the . Get the last child token of this token. A containing the last child token of the . Gets the count of child JSON tokens. The count of child JSON tokens Initializes a new instance of the class. Initializes a new instance of the class from another object. A object to copy from. Initializes a new instance of the class with the specified content. The contents of the array. Initializes a new instance of the class with the specified content. The contents of the array. Loads an from a . A that will be read for the content of the . A that contains the JSON that was read from the specified . Load a from a string that contains JSON. A that contains JSON. A populated from the string that contains JSON. Creates a from an object. The object that will be used to create . A with the values of the specified object Creates a from an object. The object that will be used to create . The that will be used to read the object. A with the values of the specified object Writes this token to a . A into which this method will write. A collection of which will be used when writing the token. Determines the index of a specific item in the . The object to locate in the . The index of if found in the list; otherwise, -1. Inserts an item to the at the specified index. The zero-based index at which should be inserted. The object to insert into the . is not a valid index in the . The is read-only. Removes the item at the specified index. The zero-based index of the item to remove. is not a valid index in the . The is read-only. Returns an enumerator that iterates through the collection. A that can be used to iterate through the collection. Adds an item to the . The object to add to the . The is read-only. Removes all items from the . The is read-only. Determines whether the contains a specific value. The object to locate in the . true if is found in the ; otherwise, false. Copies to. The array. Index of the array. Removes the first occurrence of a specific object from the . The object to remove from the . true if was successfully removed from the ; otherwise, false. This method also returns false if is not found in the original . The is read-only. Gets the container's children tokens. The container's children tokens. Gets the node type for this . The type. Gets the with the specified key. The with the specified key. Gets or sets the at the specified index. Gets a value indicating whether the is read-only. true if the is read-only; otherwise, false. Represents a JSON constructor. Initializes a new instance of the class. Initializes a new instance of the class from another object. A object to copy from. Initializes a new instance of the class with the specified name and content. The constructor name. The contents of the constructor. Initializes a new instance of the class with the specified name and content. The constructor name. The contents of the constructor. Initializes a new instance of the class with the specified name. The constructor name. Writes this token to a . A into which this method will write. A collection of which will be used when writing the token. Loads an from a . A that will be read for the content of the . A that contains the JSON that was read from the specified . Gets the container's children tokens. The container's children tokens. Gets or sets the name of this constructor. The constructor name. Gets the node type for this . The type. Gets the with the specified key. The with the specified key. Represents a collection of objects. The type of token An empty collection of objects. Initializes a new instance of the struct. The enumerable. Returns an enumerator that iterates through the collection. A that can be used to iterate through the collection. Returns an enumerator that iterates through a collection. An object that can be used to iterate through the collection. Determines whether the specified is equal to this instance. The to compare with this instance. true if the specified is equal to this instance; otherwise, false. Returns a hash code for this instance. A hash code for this instance, suitable for use in hashing algorithms and data structures like a hash table. Gets the with the specified key. Represents a JSON object. Initializes a new instance of the class. Initializes a new instance of the class from another object. A object to copy from. Initializes a new instance of the class with the specified content. The contents of the object. Initializes a new instance of the class with the specified content. The contents of the object. Gets an of this object's properties. An of this object's properties. Gets a the specified name. The property name. A with the specified name or null. Gets an of this object's property values. An of this object's property values. Loads an from a . A that will be read for the content of the . A that contains the JSON that was read from the specified . Load a from a string that contains JSON. A that contains JSON. A populated from the string that contains JSON. Creates a from an object. The object that will be used to create . A with the values of the specified object Creates a from an object. The object that will be used to create . The that will be used to read the object. A with the values of the specified object Writes this token to a . A into which this method will write. A collection of which will be used when writing the token. Gets the with the specified property name. Name of the property. The with the specified property name. Gets the with the specified property name. The exact property name will be searched for first and if no matching property is found then the will be used to match a property. Name of the property. One of the enumeration values that specifies how the strings will be compared. The with the specified property name. Tries to get the with the specified property name. The exact property name will be searched for first and if no matching property is found then the will be used to match a property. Name of the property. The value. One of the enumeration values that specifies how the strings will be compared. true if a value was successfully retrieved; otherwise, false. Adds the specified property name. Name of the property. The value. Removes the property with the specified name. Name of the property. true if item was successfully removed; otherwise, false. Tries the get value. Name of the property. The value. true if a value was successfully retrieved; otherwise, false. Returns an enumerator that iterates through the collection. A that can be used to iterate through the collection. Raises the event with the provided arguments. Name of the property. Returns the responsible for binding operations performed on this object. The expression tree representation of the runtime value. The to bind this object. Gets the container's children tokens. The container's children tokens. Occurs when a property value changes. Gets the node type for this . The type. Gets the with the specified key. The with the specified key. Gets or sets the with the specified property name. Represents a JSON property. Initializes a new instance of the class from another object. A object to copy from. Initializes a new instance of the class. The property name. The property content. Initializes a new instance of the class. The property name. The property content. Writes this token to a . A into which this method will write. A collection of which will be used when writing the token. Loads an from a . A that will be read for the content of the . A that contains the JSON that was read from the specified . Gets the container's children tokens. The container's children tokens. Gets the property name. The property name. Gets or sets the property value. The property value. Gets the node type for this . The type. Represents a raw JSON string. Represents a value in JSON (string, integer, date, etc). Initializes a new instance of the class from another object. A object to copy from. Initializes a new instance of the class with the given value. The value. Initializes a new instance of the class with the given value. The value. Initializes a new instance of the class with the given value. The value. Initializes a new instance of the class with the given value. The value. Initializes a new instance of the class with the given value. The value. Initializes a new instance of the class with the given value. The value. Initializes a new instance of the class with the given value. The value. Initializes a new instance of the class with the given value. The value. Initializes a new instance of the class with the given value. The value. Initializes a new instance of the class with the given value. The value. Initializes a new instance of the class with the given value. The value. Initializes a new instance of the class with the given value. The value. Initializes a new instance of the class with the given value. The value. Initializes a new instance of the class with the given value. The value. Creates a comment with the given value. The value. A comment with the given value. Creates a string with the given value. The value. A string with the given value. Writes this token to a . A into which this method will write. A collection of which will be used when writing the token. Indicates whether the current object is equal to another object of the same type. true if the current object is equal to the parameter; otherwise, false. An object to compare with this object. Determines whether the specified is equal to the current . The to compare with the current . true if the specified is equal to the current ; otherwise, false. The parameter is null. Serves as a hash function for a particular type. A hash code for the current . Returns a that represents this instance. A that represents this instance. Returns a that represents this instance. The format. A that represents this instance. Returns a that represents this instance. The format provider. A that represents this instance. Returns a that represents this instance. The format. The format provider. A that represents this instance. Returns the responsible for binding operations performed on this object. The expression tree representation of the runtime value. The to bind this object. Compares the current instance with another object of the same type and returns an integer that indicates whether the current instance precedes, follows, or occurs in the same position in the sort order as the other object. An object to compare with this instance. A 32-bit signed integer that indicates the relative order of the objects being compared. The return value has these meanings: Value Meaning Less than zero This instance is less than . Zero This instance is equal to . Greater than zero This instance is greater than . is not the same type as this instance. Gets a value indicating whether this token has child tokens. true if this token has child values; otherwise, false. Gets the node type for this . The type. Gets or sets the underlying token value. The underlying token value. Initializes a new instance of the class from another object. A object to copy from. Initializes a new instance of the class. The raw json. Creates an instance of with the content of the reader's current token. The reader. An instance of with the content of the reader's current token. Compares tokens to determine whether they are equal. Determines whether the specified objects are equal. The first object of type to compare. The second object of type to compare. true if the specified objects are equal; otherwise, false. Returns a hash code for the specified object. The for which a hash code is to be returned. A hash code for the specified object. The type of is a reference type and is null. Represents a reader that provides fast, non-cached, forward-only access to serialized Json data. Initializes a new instance of the class. The token to read from. Reads the next JSON token from the stream as a . A or a null reference if the next JSON token is null. This method will return null at the end of an array. Reads the next JSON token from the stream as a . A . This method will return null at the end of an array. Reads the next JSON token from the stream as a . A . This method will return null at the end of an array. Reads the next JSON token from the stream as a . A . This method will return null at the end of an array. Reads the next JSON token from the stream as a . A . This method will return null at the end of an array. Reads the next JSON token from the stream as a . A . This method will return null at the end of an array. Reads the next JSON token from the stream. true if the next token was read successfully; false if there are no more tokens to read. Specifies the type of token. No token type has been set. A JSON object. A JSON array. A JSON constructor. A JSON object property. A comment. An integer value. A float value. A string value. A boolean value. A null value. An undefined value. A date value. A raw JSON value. A collection of bytes value. A Guid value. A Uri value. A TimeSpan value. Represents a writer that provides a fast, non-cached, forward-only way of generating Json data. Initializes a new instance of the class writing to the given . The container being written to. Initializes a new instance of the class. Flushes whatever is in the buffer to the underlying streams and also flushes the underlying stream. Closes this stream and the underlying stream. Writes the beginning of a Json object. Writes the beginning of a Json array. Writes the start of a constructor with the given name. The name of the constructor. Writes the end. The token. Writes the property name of a name/value pair on a Json object. The name of the property. Writes a value. An error will raised if the value cannot be written as a single JSON token. The value to write. Writes a null value. Writes an undefined value. Writes raw JSON. The raw JSON to write. Writes out a comment /*...*/ containing the specified text. Text to place inside the comment. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Writes a value. The value to write. Gets the token being writen. The token being writen. Specifies the member serialization options for the . All public members are serialized by default. Members can be excluded using or . This is the default member serialization mode. Only members must be marked with or are serialized. This member serialization mode can also be set by marking the class with . All public and private fields are serialized. Members can be excluded using or . This member serialization mode can also be set by marking the class with and setting IgnoreSerializableAttribute on to false. Specifies missing member handling options for the . Ignore a missing member and do not attempt to deserialize it. Throw a when a missing member is encountered during deserialization. Specifies null value handling options for the . Include null values when serializing and deserializing objects. Ignore null values when serializing and deserializing objects. Specifies how object creation is handled by the . Reuse existing objects, create new objects when needed. Only reuse existing objects. Always create new objects. Specifies reference handling options for the . Note that references cannot be preserved when a value is set via a non-default constructor such as types that implement ISerializable. Do not preserve references when serializing types. Preserve references when serializing into a JSON object structure. Preserve references when serializing into a JSON array structure. Preserve references when serializing. Specifies reference loop handling options for the . Throw a when a loop is encountered. Ignore loop references and do not serialize. Serialize loop references. Indicating whether a property is required. The property is not required. The default state. The property must be defined in JSON but can be a null value. The property must be defined in JSON and cannot be a null value. Contains the JSON schema extension methods. Determines whether the is valid. The source to test. The schema to test with. true if the specified is valid; otherwise, false. Determines whether the is valid. The source to test. The schema to test with. When this method returns, contains any error messages generated while validating. true if the specified is valid; otherwise, false. Validates the specified . The source to test. The schema to test with. Validates the specified . The source to test. The schema to test with. The validation event handler. An in-memory representation of a JSON Schema. Initializes a new instance of the class. Reads a from the specified . The containing the JSON Schema to read. The object representing the JSON Schema. Reads a from the specified . The containing the JSON Schema to read. The to use when resolving schema references. The object representing the JSON Schema. Load a from a string that contains schema JSON. A that contains JSON. A populated from the string that contains JSON. Parses the specified json. The json. The resolver. A populated from the string that contains JSON. Writes this schema to a . A into which this method will write. Writes this schema to a using the specified . A into which this method will write. The resolver used. Returns a that represents the current . A that represents the current . Gets or sets the id. Gets or sets the title. Gets or sets whether the object is required. Gets or sets whether the object is read only. Gets or sets whether the object is visible to users. Gets or sets whether the object is transient. Gets or sets the description of the object. Gets or sets the types of values allowed by the object. The type. Gets or sets the pattern. The pattern. Gets or sets the minimum length. The minimum length. Gets or sets the maximum length. The maximum length. Gets or sets a number that the value should be divisble by. A number that the value should be divisble by. Gets or sets the minimum. The minimum. Gets or sets the maximum. The maximum. Gets or sets a flag indicating whether the value can not equal the number defined by the "minimum" attribute. A flag indicating whether the value can not equal the number defined by the "minimum" attribute. Gets or sets a flag indicating whether the value can not equal the number defined by the "maximum" attribute. A flag indicating whether the value can not equal the number defined by the "maximum" attribute. Gets or sets the minimum number of items. The minimum number of items. Gets or sets the maximum number of items. The maximum number of items. Gets or sets the of items. The of items. Gets or sets a value indicating whether items in an array are validated using the instance at their array position from . true if items are validated using their array position; otherwise, false. Gets or sets the of additional items. The of additional items. Gets or sets a value indicating whether additional items are allowed. true if additional items are allowed; otherwise, false. Gets or sets whether the array items must be unique. Gets or sets the of properties. The of properties. Gets or sets the of additional properties. The of additional properties. Gets or sets the pattern properties. The pattern properties. Gets or sets a value indicating whether additional properties are allowed. true if additional properties are allowed; otherwise, false. Gets or sets the required property if this property is present. The required property if this property is present. Gets or sets the a collection of valid enum values allowed. A collection of valid enum values allowed. Gets or sets disallowed types. The disallow types. Gets or sets the default value. The default value. Gets or sets the collection of that this schema extends. The collection of that this schema extends. Gets or sets the format. The format. Returns detailed information about the schema exception. Initializes a new instance of the class. Initializes a new instance of the class with a specified error message. The error message that explains the reason for the exception. Initializes a new instance of the class with a specified error message and a reference to the inner exception that is the cause of this exception. The error message that explains the reason for the exception. The exception that is the cause of the current exception, or a null reference (Nothing in Visual Basic) if no inner exception is specified. Gets the line number indicating where the error occurred. The line number indicating where the error occurred. Gets the line position indicating where the error occurred. The line position indicating where the error occurred. Gets the path to the JSON where the error occurred. The path to the JSON where the error occurred. Generates a from a specified . Generate a from the specified type. The type to generate a from. A generated from the specified type. Generate a from the specified type. The type to generate a from. The used to resolve schema references. A generated from the specified type. Generate a from the specified type. The type to generate a from. Specify whether the generated root will be nullable. A generated from the specified type. Generate a from the specified type. The type to generate a from. The used to resolve schema references. Specify whether the generated root will be nullable. A generated from the specified type. Gets or sets how undefined schemas are handled by the serializer. Gets or sets the contract resolver. The contract resolver. Resolves from an id. Initializes a new instance of the class. Gets a for the specified reference. The id. A for the specified reference. Gets or sets the loaded schemas. The loaded schemas. The value types allowed by the . No type specified. String type. Float type. Integer type. Boolean type. Object type. Array type. Null type. Any type. Specifies undefined schema Id handling options for the . Do not infer a schema Id. Use the .NET type name as the schema Id. Use the assembly qualified .NET type name as the schema Id. Returns detailed information related to the . Gets the associated with the validation error. The JsonSchemaException associated with the validation error. Gets the path of the JSON location where the validation error occurred. The path of the JSON location where the validation error occurred. Gets the text description corresponding to the validation error. The text description. Represents the callback method that will handle JSON schema validation events and the . Allows users to control class loading and mandate what class to load. When overridden in a derived class, controls the binding of a serialized object to a type. Specifies the name of the serialized object. Specifies the name of the serialized object The type of the object the formatter creates a new instance of. When overridden in a derived class, controls the binding of a serialized object to a type. The type of the object the formatter creates a new instance of. Specifies the name of the serialized object. Specifies the name of the serialized object. Resolves member mappings for a type, camel casing property names. Used by to resolves a for a given . Used by to resolves a for a given . Resolves the contract for a given type. The type to resolve a contract for. The contract for a given type. Initializes a new instance of the class. Initializes a new instance of the class. If set to true the will use a cached shared with other resolvers of the same type. Sharing the cache will significantly performance because expensive reflection will only happen once but could cause unexpected behavior if different instances of the resolver are suppose to produce different results. When set to false it is highly recommended to reuse instances with the . Resolves the contract for a given type. The type to resolve a contract for. The contract for a given type. Gets the serializable members for the type. The type to get serializable members for. The serializable members for the type. Creates a for the given type. Type of the object. A for the given type. Creates the constructor parameters. The constructor to create properties for. The type's member properties. Properties for the given . Creates a for the given . The matching member property. The constructor parameter. A created for the given . Resolves the default for the contract. Type of the object. The contract's default . Creates a for the given type. Type of the object. A for the given type. Creates a for the given type. Type of the object. A for the given type. Creates a for the given type. Type of the object. A for the given type. Creates a for the given type. Type of the object. A for the given type. Creates a for the given type. Type of the object. A for the given type. Creates a for the given type. Type of the object. A for the given type. Determines which contract type is created for the given type. Type of the object. A for the given type. Creates properties for the given . The type to create properties for. /// The member serialization mode for the type. Properties for the given . Creates the used by the serializer to get and set values from a member. The member. The used by the serializer to get and set values from a member. Creates a for the given . The member's parent . The member to create a for. A created for the given . Resolves the name of the property. Name of the property. Name of the property. Gets the resolved name of the property. Name of the property. Name of the property. Gets a value indicating whether members are being get and set using dynamic code generation. This value is determined by the runtime permissions available. true if using dynamic code generation; otherwise, false. Gets or sets a value indicating whether compiler generated members should be serialized. true if serialized compiler generated members; otherwise, false. Initializes a new instance of the class. Resolves the name of the property. Name of the property. The property name camel cased. Get and set values for a using dynamic methods. Provides methods to get and set values. Sets the value. The target to set the value on. The value to set on the target. Gets the value. The target to get the value from. The value. Initializes a new instance of the class. The member info. Sets the value. The target to set the value on. The value to set on the target. Gets the value. The target to get the value from. The value. Used to resolve references when serializing and deserializing JSON by the . Resolves a reference to its object. The serialization context. The reference to resolve. The object that Gets the reference for the sepecified object. The serialization context. The object to get a reference for. The reference to the object. Determines whether the specified object is referenced. The serialization context. The object to test for a reference. true if the specified object is referenced; otherwise, false. Adds a reference to the specified object. The serialization context. The reference. The object to reference. The default serialization binder used when resolving and loading classes from type names. When overridden in a derived class, controls the binding of a serialized object to a type. Specifies the name of the serialized object. Specifies the name of the serialized object. The type of the object the formatter creates a new instance of. When overridden in a derived class, controls the binding of a serialized object to a type. The type of the object the formatter creates a new instance of. Specifies the name of the serialized object. Specifies the name of the serialized object. Provides information surrounding an error. Gets the error. The error. Gets the original object that caused the error. The original object that caused the error. Gets the member that caused the error. The member that caused the error. Gets the path of the JSON location where the error occurred. The path of the JSON location where the error occurred. Gets or sets a value indicating whether this is handled. true if handled; otherwise, false. Provides data for the Error event. Initializes a new instance of the class. The current object. The error context. Gets the current object the error event is being raised against. The current object the error event is being raised against. Gets the error context. The error context. Represents a trace writer. Writes the specified trace level, message and optional exception. The at which to write this trace. The trace message. The trace exception. This parameter is optional. Gets the that will be used to filter the trace messages passed to the writer. For example a filter level of Info will exclude Verbose messages and include Info, Warning and Error messages. The that will be used to filter the trace messages passed to the writer. Contract details for a used by the . Contract details for a used by the . Contract details for a used by the . Gets the underlying type for the contract. The underlying type for the contract. Gets or sets the type created during deserialization. The type created during deserialization. Gets or sets whether this type contract is serialized as a reference. Whether this type contract is serialized as a reference. Gets or sets the default for this contract. The converter. Gets or sets all methods called immediately after deserialization of the object. The methods called immediately after deserialization of the object. Gets or sets all methods called during deserialization of the object. The methods called during deserialization of the object. Gets or sets all methods called after serialization of the object graph. The methods called after serialization of the object graph. Gets or sets all methods called before serialization of the object. The methods called before serialization of the object. Gets or sets all method called when an error is thrown during the serialization of the object. The methods called when an error is thrown during the serialization of the object. Gets or sets the method called immediately after deserialization of the object. The method called immediately after deserialization of the object. Gets or sets the method called during deserialization of the object. The method called during deserialization of the object. Gets or sets the method called after serialization of the object graph. The method called after serialization of the object graph. Gets or sets the method called before serialization of the object. The method called before serialization of the object. Gets or sets the method called when an error is thrown during the serialization of the object. The method called when an error is thrown during the serialization of the object. Gets or sets the default creator method used to create the object. The default creator method used to create the object. Gets or sets a value indicating whether the default creator is non public. true if the default object creator is non-public; otherwise, false. Initializes a new instance of the class. The underlying type for the contract. Gets or sets the default collection items . The converter. Gets or sets a value indicating whether the collection items preserve object references. true if collection items preserve object references; otherwise, false. Gets or sets the collection item reference loop handling. The reference loop handling. Gets or sets the collection item type name handling. The type name handling. Initializes a new instance of the class. The underlying type for the contract. Gets the of the collection items. The of the collection items. Gets a value indicating whether the collection type is a multidimensional array. true if the collection type is a multidimensional array; otherwise, false. Handles serialization callback events. The object that raised the callback event. The streaming context. Handles serialization error callback events. The object that raised the callback event. The streaming context. The error context. Sets extension data for an object during deserialization. The object to set extension data on. The extension data key. The extension data value. Gets extension data for an object during serialization. The object to set extension data on. Contract details for a used by the . Initializes a new instance of the class. The underlying type for the contract. Gets or sets the property name resolver. The property name resolver. Gets the of the dictionary keys. The of the dictionary keys. Gets the of the dictionary values. The of the dictionary values. Contract details for a used by the . Initializes a new instance of the class. The underlying type for the contract. Gets the object's properties. The object's properties. Gets or sets the property name resolver. The property name resolver. Contract details for a used by the . Initializes a new instance of the class. The underlying type for the contract. Contract details for a used by the . Initializes a new instance of the class. The underlying type for the contract. Gets or sets the object member serialization. The member object serialization. Gets or sets a value that indicates whether the object's properties are required. A value indicating whether the object's properties are required. Gets the object's properties. The object's properties. Gets the constructor parameters required for any non-default constructor Gets or sets the override constructor used to create the object. This is set when a constructor is marked up using the JsonConstructor attribute. The override constructor. Gets or sets the parametrized constructor used to create the object. The parametrized constructor. Gets or sets the extension data setter. Gets or sets the extension data getter. Contract details for a used by the . Initializes a new instance of the class. The underlying type for the contract. Maps a JSON property to a .NET member or constructor parameter. Returns a that represents this instance. A that represents this instance. Gets or sets the name of the property. The name of the property. Gets or sets the type that declared this property. The type that declared this property. Gets or sets the order of serialization and deserialization of a member. The numeric order of serialization or deserialization. Gets or sets the name of the underlying member or parameter. The name of the underlying member or parameter. Gets the that will get and set the during serialization. The that will get and set the during serialization. Gets or sets the type of the property. The type of the property. Gets or sets the for the property. If set this converter takes presidence over the contract converter for the property type. The converter. Gets or sets the member converter. The member converter. Gets or sets a value indicating whether this is ignored. true if ignored; otherwise, false. Gets or sets a value indicating whether this is readable. true if readable; otherwise, false. Gets or sets a value indicating whether this is writable. true if writable; otherwise, false. Gets or sets a value indicating whether this has a member attribute. true if has a member attribute; otherwise, false. Gets the default value. The default value. Gets or sets a value indicating whether this is required. A value indicating whether this is required. Gets or sets a value indicating whether this property preserves object references. true if this instance is reference; otherwise, false. Gets or sets the property null value handling. The null value handling. Gets or sets the property default value handling. The default value handling. Gets or sets the property reference loop handling. The reference loop handling. Gets or sets the property object creation handling. The object creation handling. Gets or sets or sets the type name handling. The type name handling. Gets or sets a predicate used to determine whether the property should be serialize. A predicate used to determine whether the property should be serialize. Gets or sets a predicate used to determine whether the property should be serialized. A predicate used to determine whether the property should be serialized. Gets or sets an action used to set whether the property has been deserialized. An action used to set whether the property has been deserialized. Gets or sets the converter used when serializing the property's collection items. The collection's items converter. Gets or sets whether this property's collection items are serialized as a reference. Whether this property's collection items are serialized as a reference. Gets or sets the the type name handling used when serializing the property's collection items. The collection's items type name handling. Gets or sets the the reference loop handling used when serializing the property's collection items. The collection's items reference loop handling. A collection of objects. Initializes a new instance of the class. The type. When implemented in a derived class, extracts the key from the specified element. The element from which to extract the key. The key for the specified element. Adds a object. The property to add to the collection. Gets the closest matching object. First attempts to get an exact case match of propertyName and then a case insensitive match. Name of the property. A matching property if found. Gets a property by property name. The name of the property to get. Type property name string comparison. A matching property if found. Contract details for a used by the . Initializes a new instance of the class. The underlying type for the contract. Represents a trace writer that writes to memory. When the trace message limit is reached then old trace messages will be removed as new messages are added. Initializes a new instance of the class. Writes the specified trace level, message and optional exception. The at which to write this trace. The trace message. The trace exception. This parameter is optional. Returns an enumeration of the most recent trace messages. An enumeration of the most recent trace messages. Returns a of the most recent trace messages. A of the most recent trace messages. Gets the that will be used to filter the trace messages passed to the writer. For example a filter level of Info will exclude Verbose messages and include Info, Warning and Error messages. The that will be used to filter the trace messages passed to the writer. Represents a method that constructs an object. The object type to create. When applied to a method, specifies that the method is called when an error occurs serializing an object. Get and set values for a using reflection. Initializes a new instance of the class. The member info. Sets the value. The target to set the value on. The value to set on the target. Gets the value. The target to get the value from. The value. Specifies how strings are escaped when writing JSON text. Only control characters (e.g. newline) are escaped. All non-ASCII and control characters (e.g. newline) are escaped. HTML (<, >, &, ', ") and control characters (e.g. newline) are escaped. Specifies what messages to output for the class. Output no tracing and debugging messages. Output error-handling messages. Output warnings and error-handling messages. Output informational messages, warnings, and error-handling messages. Output all debugging and tracing messages. Specifies type name handling options for the . Do not include the .NET type name when serializing types. Include the .NET type name when serializing into a JSON object structure. Include the .NET type name when serializing into a JSON array structure. Always include the .NET type name when serializing. Include the .NET type name when the type of the object being serialized is not the same as its declared type. Determines whether the collection is null or empty. The collection. true if the collection is null or empty; otherwise, false. Adds the elements of the specified collection to the specified generic IList. The list to add to. The collection of elements to add. Returns the index of the first occurrence in a sequence by using a specified IEqualityComparer. The type of the elements of source. A sequence in which to locate a value. The object to locate in the sequence An equality comparer to compare values. The zero-based index of the first occurrence of value within the entire sequence, if found; otherwise, –1. Converts the value to the specified type. The value to convert. The culture to use when converting. The type to convert the value to. The converted type. Converts the value to the specified type. The value to convert. The culture to use when converting. The type to convert the value to. The converted value if the conversion was successful or the default value of T if it failed. true if initialValue was converted successfully; otherwise, false. Converts the value to the specified type. If the value is unable to be converted, the value is checked whether it assignable to the specified type. The value to convert. The culture to use when converting. The type to convert or cast the value to. The converted type. If conversion was unsuccessful, the initial value is returned if assignable to the target type. Helper method for generating a MetaObject which calls a specific method on Dynamic that returns a result Helper method for generating a MetaObject which calls a specific method on Dynamic, but uses one of the arguments for the result. Helper method for generating a MetaObject which calls a specific method on Dynamic, but uses one of the arguments for the result. Returns a Restrictions object which includes our current restrictions merged with a restriction limiting our type Gets a dictionary of the names and values of an Enum type. Gets a dictionary of the names and values of an Enum type. The enum type to get names and values for. Gets the type of the typed collection's items. The type. The type of the typed collection's items. Gets the member's underlying type. The member. The underlying type of the member. Determines whether the member is an indexed property. The member. true if the member is an indexed property; otherwise, false. Determines whether the property is an indexed property. The property. true if the property is an indexed property; otherwise, false. Gets the member's value on the object. The member. The target object. The member's value on the object. Sets the member's value on the target object. The member. The target. The value. Determines whether the specified MemberInfo can be read. The MemberInfo to determine whether can be read. /// if set to true then allow the member to be gotten non-publicly. true if the specified MemberInfo can be read; otherwise, false. Determines whether the specified MemberInfo can be set. The MemberInfo to determine whether can be set. if set to true then allow the member to be set non-publicly. if set to true then allow the member to be set if read-only. true if the specified MemberInfo can be set; otherwise, false. Builds a string. Unlike StringBuilder this class lets you reuse it's internal buffer. Determines whether the string is all white space. Empty string will return false. The string to test whether it is all white space. true if the string is all white space; otherwise, false. Nulls an empty string. The string. Null if the string was null, otherwise the string unchanged. Specifies the state of the . An exception has been thrown, which has left the in an invalid state. You may call the method to put the in the Closed state. Any other method calls results in an being thrown. The method has been called. An object is being written. A array is being written. A constructor is being written. A property is being written. A write method has not been called. ================================================ FILE: packages/Newtonsoft.Json.6.0.2/tools/install.ps1 ================================================ 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 ================================================ FILE: packages/QrCode.Net.0.4.0.0/lib/net35/Gma.QrCodeNet.Encoding.xml ================================================ Gma.QrCodeNet.Encoding ISO/IEC 18004:2000 Chapter 8.4.3 Alphanumeric Page 21 Returns the bit representation of input data. Returns bit representation of value. See Chapter 8.4 Data encodation, Table 2 — Mode indicators Defines the length of the Character Count Indicator, which varies according to themode and the symbol version in use Number of bits in Character Count Indicator. See Chapter 8.4 Data encodation, Table 3 — Number of bits in Character Count Indicator. Constant from Chapter 8.4.3 Alphanumeric Mode. P.21 BitCount from chapter 8.4.3. P22 Table at chapter 8.4.3. P.21 Convert char to int value Alpha Numeric Char Table from chapter 8.4.3 P21 ISO/IEC 18004:2000 Table 3 Page 18 Used to define length of the Character Count Indicator Returns the 0 based index of the row from Chapter 8.4 Data encodation, Table 3 — Number of bits in Character Count Indicator. ISO/IEC 18004:2000 Chapter 8.1 Page 14 DataEncode is combination of Data analysis and Data encodation step. Which uses sub functions under several different namespaces ISO/IEC 18004:2006 Chapter 6.4.2 Mode indicator = 0111 Page 23 Initialize ECI Set. AppendOption is enum under ECISet Use NameToValue during Encode. ValueToName during Decode ISO/IEC 18004:2006E ECI Designator Page 24 Range: 0 ~ 999999 Number of Codewords(Byte) for ECI Assignment Value ISO/IEC 18004:2006E ECI Designator Page 24 Range: 0 ~ 999999 Number of bits for ECI Assignment Value ISO/IEC 18004:2006E ECI Designator Page 24 Range: 0 ~ 999999 Number of bits for ECI Header ECI table in Dictionary collection ISO/IEC 18004:2006 Chapter 6.4.2 Page 24. Length indicator for number of ECI codewords ISO/IEC 18004:2006 Chapter 6.4.2 Page 24. 1 codeword length = 0. Any additional codeword add 1 to front. Eg: 3 = 110 Bits required for each one is: one = 1, two = 2, three = 3 EightBitByte is a bit complicate compare to other encoding. It can accept several different encoding table from global ECI table. For different country, default encoding is different. JP use shift_jis, International spec use iso-8859-1 China use ASCII which is first part of normal char table. Between 00 to 7E Korean and Thai should have their own default encoding as well. But so far I can not find their specification freely online. QrCode.Net will use international standard which is iso-8859-1 as default encoding. And use UTF8 as suboption for any string that not belong to any char table or other encoder. ISO/IEC 18004:2000 Chapter 8.4.4 Page 22 Bitcount, Chapter 8.4.4, P.24 EightBitByte encoder's encoding will change according to different region Default encoding is "iso-8859-1" Use to recognise which mode and encoding name to use for input string. input string content Output encoding name Mode and Encoding name Encoding.GetEncoding.GetBytes will transform char to 0x3F if that char not belong to current encoding table. 0x3F is '?' Check char from startPos for string content. input string content start check position -2 Numeric encode, -1 AlphaNum encode, Index of failed check pos Use given encoding to check input string from starting position. If encoding table is suitable solution. it will return -1. Else it will return failed encoding position. input string encoding name. Check ECI table starting position -1 if from starting position to end encoding success. Else return fail position Check input string content. Whether it can apply Kanji encode or not. String input content -1 if it can apply Kanji encode, -2 should use utf8 encode, 0 check for other encode. ISO/IEC 18004:2000 Chapter 8.4.5 Page 23 Bitcount according to ISO/IEC 18004:2000 Kanji mode Page 25 Multiply value for Most significant byte. Chapter 8.4.5 P.24 See Chapter 8.4.5 P.24 Kanji Mode ISO/IEC 18004:2000 Chapter 8.4.2 Page 19 Calculate int length by search for Most significant bit Input Number Most significant bit Search for right side bit of Most significant bit input number lower boundary. At start should be 0 higher boundary. At start should be 32 Most significant bit - 1 With input number and polynomial number. Method will calculate BCH value and return input number Polynomial number BCH value ISO/IEC 18004:2000 Chapter 8.7.3 Page 46 6.9 Format information The Format Information is a 15 bit sequence containing 5 data bits, with 10 error correction bits calculated using the (15, 5) BCH code. ISO/IEC 18004:2000 Chapter 8.9 Page 53 From Appendix C in JISX0510:2004 (p.65). From Appendix C in JISX0510:2004 (p.65). Embed format information to tristatematrix. Process combination of create info bits, BCH error correction bits calculation, embed towards matrix. ISO/IEC 18004:2000 Chapter 8.9 Page 53 Embed version information for version larger or equal to 7. ISO/IEC 18004:2000 Chapter 8.10 Page 54 Embed version information to Matrix Only for version greater or equal to 7 Matrix version number Generate error correction blocks. Then out put with codewords BitList ISO/IEC 18004/2006 P45, 46. Chapter 6.6 Constructing final message codewords sequence. Datacodewords from DataEncodation.DataEncode Total number of bytes Number of data bytes Number of Error Correction blocks codewords BitList contain datacodewords and ECCodewords ISO/IEC 18004:2000 Chapter 8.8.2 Page 52 Calculate penalty value for first rule. ISO/IEC 18004:2000 Chapter 8.8.2 Page 52 ISO/IEC 18004:2000 Chapter 8.8.2 Page 52 Calculate penalty value for Third rule. ISO/IEC 18004:2000 Chapter 8.8.2 Page 52 Calculate penalty value for Fourth rule. Perform O(n) search for available x modules Description of PenaltyFactory. This class contain two variables. BitMatrix for QrCode isContainMatrix for indicate whether QrCode contains BitMatrix or not. BitMatrix will equal to null if isContainMatrix is false. Contain most of common constant variables. S ISO/IEC 18004:2006(E) Page 45 Chapter Generating the error correction codewords Primative Polynomial = Bin 100011101 = Dec 285 0xEC 0x11 URL:http://en.wikipedia.org/wiki/Byte-order_mark Default QrEncoder will set ErrorCorrectionLevel as M QrEncoder with parameter ErrorCorrectionLevel. Encode string content to QrCode matrix This exception for string content is null, empty or too large Try to encode content False if input content is empty, null or too large. Encode byte array content to QrCode matrix This exception for string content is null, empty or too large Try to encode content False if input content is empty, null or too large. Description of GaloisField256. Powers of a in GF table. Where a = 2 log ( power of a) in GF table. Where a = 2 Product of two values. In other words. a multiply b Quotient of two values. In other words. a devided b Description of GeneratorPolynomial. After create GeneratorPolynomial. Keep it as long as possible. Unless QRCode encode is done or no more QRCode need to generate. Get generator by degree. (Largest degree for that generator) Generator Build Generator if we can not find specific degree of generator from cache coefficient position. where (coefficient)x^degree Add another Polynomial to current one The polynomial need to add or subtract to current one Result polynomial after add or subtract Multiply current Polynomial to anotherone. Result polynomial after multiply Multiplay scalar to current polynomial result of polynomial after multiply scalar divide current polynomial by "other" Result polynomial after divide Encode an array of data codeword with GaloisField 256. Array of data codewords for a single block. Number of error correction codewords for data codewords Cached or newly create GeneratorPolynomial Return error correction codewords array Convert data codewords to int array. And add error correction space at end of that array data codewords array data codewords length Num of error correction bytes Int array for data codewords array follow by error correction space Reassembly error correction codewords. As Polynomial class will eliminate zero monomial at front. Remainder byte array after divide. Error correction codewords length Error correction codewords Return value will be internal array itself. Not deep/shallow copy. This method will create BitList that contain terminator, padding and pad codewords for given datacodewords. Use it to full fill the data codewords capacity. Thus avoid massive empty bits. ISO/IEC 18004:2006 P. 32 33. Terminator / Bit stream to codeword conversion Method will add terminator bits at end of baseList Num of bits for datacodewords without terminator Total number of datacodewords for specific version. Receive it under Version/VersionTable Bitlist that contain Terminator, padding and padcodewords Return value will be deep copy of array. Width for current version number of Error correction blocks for group 1 Number of error correction blocks for group 2 Number of data bytes per block for group 1 Number of data bytes per block for group 2 Number of error correction bytes per block Get Error Correction Blocks Initialize for NumBlocks and ErrorCorrectionCodewordsPerBlock Use this exception for null or empty input string or when input string is too large. L M Q H Get Error Correction Blocks by level Determine which version to use Number of bits for encoded content Encoding name for EightBitByte VersionDetail and ECI Decide which version group it belong to number of bits for bitlist where it contain DataBits encode from input content and ECI header Error correction level Mode Version group index for VERSION_GROUP Use number of data bits(header + eci header + data bits from EncoderBase) to search for proper version to use between min and max boundary. Boundary define by DynamicSearchIndicator method. We only need totalCodeWords, dataCodewords and number of blocks. Other variable can be calculate through equation by given that three variables. This table try to use original table layout for easier error detection. ISO/IEC 18004/2006 Tabler 9 Page 38 Only include non-micro QRCode Sorted list Lock Class, that any change to Text or ErrorCorrectLevel won't cause it to update QrCode Matrix Unlock Class, then update QrCodeMatrix and repaint Freeze Class, Any value change to Brush, QuietZoneModule won't cause immediately repaint. It won't stop any repaint cause by other action. Unfreeze and repaint immediately. Get Qr SquareBitMatrix as two dimentional bool array. It will be deep copy of control's internal bitmatrix. null if matrix is null, else full matrix Return whether if class is freezed. Return whether if class is locked Lock Class, that any change to Text or ErrorCorrectLevel won't cause it to update QrCode Matrix Unlock Class, then update QrCodeMatrix and redraw image Freeze Class, Any value change to Brush, QuietZoneModule won't cause immediately redraw image. Unfreeze and redraw immediately. Get Qr SquareBitMatrix as two dimentional bool array. It will be deep copy of control's internal bitmatrix. null if matrix is null, else full matrix Return whether if class is freezed. Return whether if class is locked Calculate background and fronntcolor's contrast ratio. To assist dark module and light module's choose. Higher ratio means easier to decode by decoder. Black and White will have highest ratio = 21. light module color dark module color Contrast object. Initialize Renderer. Default brushes will be black and white. Initialize Renderer. Draw QrCode to DrawingBrush DrawingBrush, Stretch = uniform LightBrush will not use by this method, DrawingBrush will only contain DarkBrush part. Use LightBrush to fill background of main uielement for more flexible placement Construct QrCode geometry. It will only include geometry for Dark colour module QrCode dark colour module geometry. Size = QrMatrix width x width Construct DrawingBrush with input Drawing DrawingBrush where Stretch = uniform Write image file to stream Default DPI will be 96, 96 Write image file to stream DPI = DPI.X, DPI.Y(Dots per inch) Module pixel width QrCode pixel width Initializes a Encapsulated PostScript renderer. DarkColor used to draw Dark modules of the QrCode LightColor used to draw Light modules and QuietZone of the QrCode. Setting to a transparent color (A = 0) allows transparent light modules so the QR Code blends in the existing background. In that case the existing background should remain light and rather uniform, and higher error correction levels are recommended. Renders the matrix in an Encapsuled PostScript format. The matrix to be rendered Size in points (1 inch contains 72 point in PostScript) of a module Output stream that must be writable Outputs the EPS header with mandatory declarations, variable declarations and function definitions. The matrix to be rendered Size in points (1 inch contains 72 point in PostScript) of a module Output text stream Outputs the background unless it is defined as transparent. The background is used for light modules and quiet zone. The matrix to be rendered Output text stream Draw a square for each dark module The matrix to be rendered Output text stream Use the 'image' or 'colorimage' PostScript command to render modules The matrix to be rendered Output text stream Outputs the mandatory EPS footer. Output text stream ISizeCalculation for the way to calculate QrCode's pixel size. Ex for ISizeCalculation:FixedCodeSize, FixedModuleSize DarkColor used to draw Dark modules of the QrCode LightColor used to draw Light modules and QuietZone of the QrCode. Setting to a transparent color (A = 0) allows transparent light modules so the QR Code blends in the existing background. In that case the existing background should remain light and rather uniform, and higher error correction levels are recommended. Selection of the technique used to draw the modules. 'Squares' draws vector squares one by one; 'Image' uses the 'image' or 'colorimage' PostScript command. 'Squares' supports transparency of light modules and often has smaller file size for color QR Codes. 'Image' might be faster to render on some devices as it is a single command. FixedCodeSize is strategy for rendering QrCode at fixed Size. Fixed size for QrCode pixel width. Pixel width have to be bigger than QrCode's matrix width(include quiet zone) QrCode matrix width is between 25 ~ 182(version 1 ~ 40). Interface function that use by Rendering class. QrCode matrix width Module pixel size and QrCode pixel width QrCodeWidth is pixel size of QrCode you would like to print out. It have to be greater than QrCode's matrix width(include quiet zone). QrCode matrix width is between 25 ~ 182(version 1 ~ 40). Number of quietZone modules FixedModuleSize is strategy for rendering QrCode with fixed module pixel size. Module pixel size number of quiet zone modules Interface function that use by Rendering class. QrCode matrix width Module pixel size and QrCode pixel width Module pixel size. Have to greater than zero Number of quietZone modules Initialize Renderer. Default brushes will be black and white. The way of calculate Size Initialize Renderer The way of calculate Size Drawing Bitmatrix to winform graphics. Default position will be 0, 0 Draw background only for null matrix DarkBrush or LightBrush is null Drawing Bitmatrix to winform graphics. Draw background only for null matrix DarkBrush or LightBrush is null Saves QrCode Image to specified stream in the specified format Stream or Format is null The image was saved with the wrong image format You should avoid saving an image to the same stream that was used to construct. Doing so might damage the stream If any additional data has been written to the stream before saving the image, the image data in the stream will be corrupted Using MetaFile Class to create metafile. temp control create to use as object to get temp graphics for Hdc. Drawing on the metaGraphics will record as vector metaFile. DarkBrush for drawing Dark module of QrCode ISizeCalculation for the way to calculate QrCode's pixel size. Ex for ISizeCalculation:FixedCodeSize, FixedModuleSize Clear all pixel with given color. Must not be null, or pixel width, pixel height equal to zero Exception should be expect with null writeablebitmap or pixel width, height equal to zero. Draw rectangle with given color. Must not be null, or pixel width, pixel height equal to zero Exception should be expect with null writeablebitmap or pixel width, height equal to zero. Copies characters between buffers New buffer Buffer to copy from Number of character to copy Initialize renderer Size calculation strategy Initialize renderer Size calculation strategy Color for dark module Color for light module Draw QrCode at given writeable bitmap Draw QrCode at given writeable bitmap at offset location Draw quiet zone at offset x,y Draw qrCode dark modules at given position. (It will also include quiet zone area. Set it to zero to exclude quiet zone) Bitmatrix, wBitmap should not equal to null wBitmap's pixel width or height should not equal to zero Occure when ErrorCorrectLevel or Text changed QrCode matrix cache updated. Update Geometry if is unlocked. This method is use to update QuietZone after use method SetQuietZoneModule If Class is locked, it won't update Geometry or quietzone. Unlock class will cause class to update Geometry and quietZone. Get Qr SquareBitMatrix as two dimentional bool array. It will be deep copy of control's internal bitmatrix. null if matrix is null, else full matrix Return whether if class is locked Encode and Update bitmap when ErrorCorrectlevel or Text changed. If Class is locked, it won't update QrMatrix cache. Unlock class will cause class to update QrMatrix Cache and redraw bitmap. Freeze Class, Any value change to Brush, QuietZoneModule won't cause immediately redraw bitmap. Unfreeze and redraw immediately. QrCode matrix cache updated. Get Qr SquareBitMatrix as two dimentional bool array. It will be deep copy of control's internal bitmatrix. null if matrix is null, else full matrix Return whether if class is locked Return whether if class is freezed. ================================================ FILE: packages/QrCode.Net.0.4.0.0/lib/net40/Gma.QrCodeNet.Encoding.XML ================================================ Gma.QrCodeNet.Encoding Table at chapter 8.4.3. P.21 Convert char to int value Alpha Numeric Char Table from chapter 8.4.3 P21 ISO/IEC 18004:2000 Table 3 Page 18 Used to define length of the Character Count Indicator Returns the 0 based index of the row from Chapter 8.4 Data encodation, Table 3 — Number of bits in Character Count Indicator. ISO/IEC 18004:2000 Chapter 8.1 Page 14 DataEncode is combination of Data analysis and Data encodation step. Which uses sub functions under several different namespaces ISO/IEC 18004:2006 Chapter 6.4.2 Mode indicator = 0111 Page 23 Initialize ECI Set. AppendOption is enum under ECISet Use NameToValue during Encode. ValueToName during Decode ISO/IEC 18004:2006E ECI Designator Page 24 Range: 0 ~ 999999 Number of Codewords(Byte) for ECI Assignment Value ISO/IEC 18004:2006E ECI Designator Page 24 Range: 0 ~ 999999 Number of bits for ECI Assignment Value ISO/IEC 18004:2006E ECI Designator Page 24 Range: 0 ~ 999999 Number of bits for ECI Header ECI table in Dictionary collection ISO/IEC 18004:2006 Chapter 6.4.2 Page 24. Length indicator for number of ECI codewords ISO/IEC 18004:2006 Chapter 6.4.2 Page 24. 1 codeword length = 0. Any additional codeword add 1 to front. Eg: 3 = 110 Bits required for each one is: one = 1, two = 2, three = 3 Use to recognise which mode and encoding name to use for input string. input string content Output encoding name Mode and Encoding name Encoding.GetEncoding.GetBytes will transform char to 0x3F if that char not belong to current encoding table. 0x3F is '?' Check char from startPos for string content. input string content start check position -2 Numeric encode, -1 AlphaNum encode, Index of failed check pos Use given encoding to check input string from starting position. If encoding table is suitable solution. it will return -1. Else it will return failed encoding position. input string encoding name. Check ECI table starting position -1 if from starting position to end encoding success. Else return fail position Check input string content. Whether it can apply Kanji encode or not. String input content -1 if it can apply Kanji encode, -2 should use utf8 encode, 0 check for other encode. Calculate int length by search for Most significant bit Input Number Most significant bit Search for right side bit of Most significant bit input number lower boundary. At start should be 0 higher boundary. At start should be 32 Most significant bit - 1 With input number and polynomial number. Method will calculate BCH value and return input number Polynomial number BCH value ISO/IEC 18004:2000 Chapter 8.7.3 Page 46 6.9 Format information The Format Information is a 15 bit sequence containing 5 data bits, with 10 error correction bits calculated using the (15, 5) BCH code. ISO/IEC 18004:2000 Chapter 8.9 Page 53 From Appendix C in JISX0510:2004 (p.65). From Appendix C in JISX0510:2004 (p.65). Embed format information to tristatematrix. Process combination of create info bits, BCH error correction bits calculation, embed towards matrix. ISO/IEC 18004:2000 Chapter 8.9 Page 53 Embed version information for version larger or equal to 7. ISO/IEC 18004:2000 Chapter 8.10 Page 54 Embed version information to Matrix Only for version greater or equal to 7 Matrix version number Generate error correction blocks. Then out put with codewords BitList ISO/IEC 18004/2006 P45, 46. Chapter 6.6 Constructing final message codewords sequence. Datacodewords from DataEncodation.DataEncode Total number of bytes Number of data bytes Number of Error Correction blocks codewords BitList contain datacodewords and ECCodewords ISO/IEC 18004:2000 Chapter 8.8.2 Page 52 Calculate penalty value for first rule. ISO/IEC 18004:2000 Chapter 8.8.2 Page 52 ISO/IEC 18004:2000 Chapter 8.8.2 Page 52 Calculate penalty value for Third rule. ISO/IEC 18004:2000 Chapter 8.8.2 Page 52 Calculate penalty value for Fourth rule. Perform O(n) search for available x modules Description of PenaltyFactory. EightBitByte is a bit complicate compare to other encoding. It can accept several different encoding table from global ECI table. For different country, default encoding is different. JP use shift_jis, International spec use iso-8859-1 China use ASCII which is first part of normal char table. Between 00 to 7E Korean and Thai should have their own default encoding as well. But so far I can not find their specification freely online. QrCode.Net will use international standard which is iso-8859-1 as default encoding. And use UTF8 as suboption for any string that not belong to any char table or other encoder. ISO/IEC 18004:2000 Chapter 8.4.4 Page 22 Returns the bit representation of input data. Returns bit representation of value. See Chapter 8.4 Data encodation, Table 2 — Mode indicators Defines the length of the Character Count Indicator, which varies according to themode and the symbol version in use Number of bits in Character Count Indicator. See Chapter 8.4 Data encodation, Table 3 — Number of bits in Character Count Indicator. Bitcount, Chapter 8.4.4, P.24 EightBitByte encoder's encoding will change according to different region Default encoding is "iso-8859-1" ISO/IEC 18004:2000 Chapter 8.4.5 Page 23 Bitcount according to ISO/IEC 18004:2000 Kanji mode Page 25 Multiply value for Most significant byte. Chapter 8.4.5 P.24 See Chapter 8.4.5 P.24 Kanji Mode Description of GaloisField256. Powers of a in GF table. Where a = 2 log ( power of a) in GF table. Where a = 2 Product of two values. In other words. a multiply b Quotient of two values. In other words. a devided b Description of GeneratorPolynomial. After create GeneratorPolynomial. Keep it as long as possible. Unless QRCode encode is done or no more QRCode need to generate. Get generator by degree. (Largest degree for that generator) Generator Build Generator if we can not find specific degree of generator from cache coefficient position. where (coefficient)x^degree Add another Polynomial to current one The polynomial need to add or subtract to current one Result polynomial after add or subtract Multiply current Polynomial to anotherone. Result polynomial after multiply Multiplay scalar to current polynomial result of polynomial after multiply scalar divide current polynomial by "other" Result polynomial after divide Encode an array of data codeword with GaloisField 256. Array of data codewords for a single block. Number of error correction codewords for data codewords Cached or newly create GeneratorPolynomial Return error correction codewords array Convert data codewords to int array. And add error correction space at end of that array data codewords array data codewords length Num of error correction bytes Int array for data codewords array follow by error correction space Reassembly error correction codewords. As Polynomial class will eliminate zero monomial at front. Remainder byte array after divide. Error correction codewords length Error correction codewords Contain most of common constant variables. S ISO/IEC 18004:2006(E) Page 45 Chapter Generating the error correction codewords Primative Polynomial = Bin 100011101 = Dec 285 0xEC 0x11 URL:http://en.wikipedia.org/wiki/Byte-order_mark Return value will be internal array itself. Not deep/shallow copy. This method will create BitList that contain terminator, padding and pad codewords for given datacodewords. Use it to full fill the data codewords capacity. Thus avoid massive empty bits. ISO/IEC 18004:2006 P. 32 33. Terminator / Bit stream to codeword conversion Method will add terminator bits at end of baseList Num of bits for datacodewords without terminator Total number of datacodewords for specific version. Receive it under Version/VersionTable Bitlist that contain Terminator, padding and padcodewords Return value will be deep copy of array. Width for current version number of Error correction blocks for group 1 Number of error correction blocks for group 2 Number of data bytes per block for group 1 Number of data bytes per block for group 2 Number of error correction bytes per block Get Error Correction Blocks Initialize for NumBlocks and ErrorCorrectionCodewordsPerBlock Use this exception for null or empty input string or when input string is too large. L M Q H Get Error Correction Blocks by level Determine which version to use Number of bits for encoded content Encoding name for EightBitByte VersionDetail and ECI Decide which version group it belong to number of bits for bitlist where it contain DataBits encode from input content and ECI header Error correction level Mode Version group index for VERSION_GROUP Use number of data bits(header + eci header + data bits from EncoderBase) to search for proper version to use between min and max boundary. Boundary define by DynamicSearchIndicator method. We only need totalCodeWords, dataCodewords and number of blocks. Other variable can be calculate through equation by given that three variables. This table try to use original table layout for easier error detection. ISO/IEC 18004/2006 Tabler 9 Page 38 Only include non-micro QRCode Sorted list ISO/IEC 18004:2000 Chapter 8.4.3 Alphanumeric Page 21 Constant from Chapter 8.4.3 Alphanumeric Mode. P.21 BitCount from chapter 8.4.3. P22 ISO/IEC 18004:2000 Chapter 8.4.2 Page 19 Default QrEncoder will set ErrorCorrectionLevel as M QrEncoder with parameter ErrorCorrectionLevel. Encode string content to QrCode matrix This exception for string content is null, empty or too large Try to encode content False if input content is empty, null or too large. Encode byte array content to QrCode matrix This exception for string content is null, empty or too large Try to encode content False if input content is empty, null or too large. This class contain two variables. BitMatrix for QrCode isContainMatrix for indicate whether QrCode contains BitMatrix or not. BitMatrix will equal to null if isContainMatrix is false. Lock Class, that any change to Text or ErrorCorrectLevel won't cause it to update QrCode Matrix Unlock Class, then update QrCodeMatrix and repaint Freeze Class, Any value change to Brush, QuietZoneModule won't cause immediately repaint. It won't stop any repaint cause by other action. Unfreeze and repaint immediately. Get Qr SquareBitMatrix as two dimentional bool array. It will be deep copy of control's internal bitmatrix. null if matrix is null, else full matrix Return whether if class is freezed. Return whether if class is locked Lock Class, that any change to Text or ErrorCorrectLevel won't cause it to update QrCode Matrix Unlock Class, then update QrCodeMatrix and redraw image Freeze Class, Any value change to Brush, QuietZoneModule won't cause immediately redraw image. Unfreeze and redraw immediately. Get Qr SquareBitMatrix as two dimentional bool array. It will be deep copy of control's internal bitmatrix. null if matrix is null, else full matrix Return whether if class is freezed. Return whether if class is locked Calculate background and fronntcolor's contrast ratio. To assist dark module and light module's choose. Higher ratio means easier to decode by decoder. Black and White will have highest ratio = 21. light module color dark module color Contrast object. Initialize renderer Size calculation strategy Initialize renderer Size calculation strategy Color for dark module Color for light module Draw QrCode at given writeable bitmap Draw QrCode at given writeable bitmap at offset location Draw quiet zone at offset x,y Draw qrCode dark modules at given position. (It will also include quiet zone area. Set it to zero to exclude quiet zone) Bitmatrix, wBitmap should not equal to null wBitmap's pixel width or height should not equal to zero Initialize Renderer. Default brushes will be black and white. Initialize Renderer. Draw QrCode to DrawingBrush DrawingBrush, Stretch = uniform LightBrush will not use by this method, DrawingBrush will only contain DarkBrush part. Use LightBrush to fill background of main uielement for more flexible placement Construct QrCode geometry. It will only include geometry for Dark colour module QrCode dark colour module geometry. Size = QrMatrix width x width Construct DrawingBrush with input Drawing DrawingBrush where Stretch = uniform Write image file to stream Default DPI will be 96, 96 Write image file to stream DPI = DPI.X, DPI.Y(Dots per inch) Module pixel width QrCode pixel width Initializes a Encapsulated PostScript renderer. DarkColor used to draw Dark modules of the QrCode LightColor used to draw Light modules and QuietZone of the QrCode. Setting to a transparent color (A = 0) allows transparent light modules so the QR Code blends in the existing background. In that case the existing background should remain light and rather uniform, and higher error correction levels are recommended. Renders the matrix in an Encapsuled PostScript format. The matrix to be rendered Size in points (1 inch contains 72 point in PostScript) of a module Output stream that must be writable Outputs the EPS header with mandatory declarations, variable declarations and function definitions. The matrix to be rendered Size in points (1 inch contains 72 point in PostScript) of a module Output text stream Outputs the background unless it is defined as transparent. The background is used for light modules and quiet zone. The matrix to be rendered Output text stream Draw a square for each dark module The matrix to be rendered Output text stream Use the 'image' or 'colorimage' PostScript command to render modules The matrix to be rendered Output text stream Outputs the mandatory EPS footer. Output text stream ISizeCalculation for the way to calculate QrCode's pixel size. Ex for ISizeCalculation:FixedCodeSize, FixedModuleSize DarkColor used to draw Dark modules of the QrCode LightColor used to draw Light modules and QuietZone of the QrCode. Setting to a transparent color (A = 0) allows transparent light modules so the QR Code blends in the existing background. In that case the existing background should remain light and rather uniform, and higher error correction levels are recommended. Selection of the technique used to draw the modules. 'Squares' draws vector squares one by one; 'Image' uses the 'image' or 'colorimage' PostScript command. 'Squares' supports transparency of light modules and often has smaller file size for color QR Codes. 'Image' might be faster to render on some devices as it is a single command. FixedCodeSize is strategy for rendering QrCode at fixed Size. Fixed size for QrCode pixel width. Pixel width have to be bigger than QrCode's matrix width(include quiet zone) QrCode matrix width is between 25 ~ 182(version 1 ~ 40). Interface function that use by Rendering class. QrCode matrix width Module pixel size and QrCode pixel width QrCodeWidth is pixel size of QrCode you would like to print out. It have to be greater than QrCode's matrix width(include quiet zone). QrCode matrix width is between 25 ~ 182(version 1 ~ 40). Number of quietZone modules FixedModuleSize is strategy for rendering QrCode with fixed module pixel size. Module pixel size number of quiet zone modules Interface function that use by Rendering class. QrCode matrix width Module pixel size and QrCode pixel width Module pixel size. Have to greater than zero Number of quietZone modules Initialize Renderer. Default brushes will be black and white. The way of calculate Size Initialize Renderer The way of calculate Size Drawing Bitmatrix to winform graphics. Default position will be 0, 0 Draw background only for null matrix DarkBrush or LightBrush is null Drawing Bitmatrix to winform graphics. Draw background only for null matrix DarkBrush or LightBrush is null Saves QrCode Image to specified stream in the specified format Stream or Format is null The image was saved with the wrong image format You should avoid saving an image to the same stream that was used to construct. Doing so might damage the stream If any additional data has been written to the stream before saving the image, the image data in the stream will be corrupted Using MetaFile Class to create metafile. temp control create to use as object to get temp graphics for Hdc. Drawing on the metaGraphics will record as vector metaFile. DarkBrush for drawing Dark module of QrCode ISizeCalculation for the way to calculate QrCode's pixel size. Ex for ISizeCalculation:FixedCodeSize, FixedModuleSize Clear all pixel with given color. Must not be null, or pixel width, pixel height equal to zero Exception should be expect with null writeablebitmap or pixel width, height equal to zero. Draw rectangle with given color. Must not be null, or pixel width, pixel height equal to zero Exception should be expect with null writeablebitmap or pixel width, height equal to zero. Copies characters between buffers New buffer Buffer to copy from Number of character to copy Occure when ErrorCorrectLevel or Text changed QrCode matrix cache updated. Update Geometry if is unlocked. This method is use to update QuietZone after use method SetQuietZoneModule If Class is locked, it won't update Geometry or quietzone. Unlock class will cause class to update Geometry and quietZone. Get Qr SquareBitMatrix as two dimentional bool array. It will be deep copy of control's internal bitmatrix. null if matrix is null, else full matrix Return whether if class is locked Encode and Update bitmap when ErrorCorrectlevel or Text changed. If Class is locked, it won't update QrMatrix cache. Unlock class will cause class to update QrMatrix Cache and redraw bitmap. Freeze Class, Any value change to Brush, QuietZoneModule won't cause immediately redraw bitmap. Unfreeze and redraw immediately. QrCode matrix cache updated. Get Qr SquareBitMatrix as two dimentional bool array. It will be deep copy of control's internal bitmatrix. null if matrix is null, else full matrix Return whether if class is locked Return whether if class is freezed. GeneratedInternalTypeHelper CreateInstance GetPropertyValue SetPropertyValue CreateDelegate AddEventHandler ================================================ FILE: packages/QrCode.Net.0.4.0.0/lib/net45/Gma.QrCodeNet.Encoding.xml ================================================ Gma.QrCodeNet.Encoding ISO/IEC 18004:2000 Chapter 8.4.3 Alphanumeric Page 21 Returns the bit representation of input data. Returns bit representation of value. See Chapter 8.4 Data encodation, Table 2 — Mode indicators Defines the length of the Character Count Indicator, which varies according to themode and the symbol version in use Number of bits in Character Count Indicator. See Chapter 8.4 Data encodation, Table 3 — Number of bits in Character Count Indicator. Constant from Chapter 8.4.3 Alphanumeric Mode. P.21 BitCount from chapter 8.4.3. P22 Table at chapter 8.4.3. P.21 Convert char to int value Alpha Numeric Char Table from chapter 8.4.3 P21 ISO/IEC 18004:2000 Table 3 Page 18 Used to define length of the Character Count Indicator Returns the 0 based index of the row from Chapter 8.4 Data encodation, Table 3 — Number of bits in Character Count Indicator. ISO/IEC 18004:2000 Chapter 8.1 Page 14 DataEncode is combination of Data analysis and Data encodation step. Which uses sub functions under several different namespaces ISO/IEC 18004:2006 Chapter 6.4.2 Mode indicator = 0111 Page 23 Initialize ECI Set. AppendOption is enum under ECISet Use NameToValue during Encode. ValueToName during Decode ISO/IEC 18004:2006E ECI Designator Page 24 Range: 0 ~ 999999 Number of Codewords(Byte) for ECI Assignment Value ISO/IEC 18004:2006E ECI Designator Page 24 Range: 0 ~ 999999 Number of bits for ECI Assignment Value ISO/IEC 18004:2006E ECI Designator Page 24 Range: 0 ~ 999999 Number of bits for ECI Header ECI table in Dictionary collection ISO/IEC 18004:2006 Chapter 6.4.2 Page 24. Length indicator for number of ECI codewords ISO/IEC 18004:2006 Chapter 6.4.2 Page 24. 1 codeword length = 0. Any additional codeword add 1 to front. Eg: 3 = 110 Bits required for each one is: one = 1, two = 2, three = 3 EightBitByte is a bit complicate compare to other encoding. It can accept several different encoding table from global ECI table. For different country, default encoding is different. JP use shift_jis, International spec use iso-8859-1 China use ASCII which is first part of normal char table. Between 00 to 7E Korean and Thai should have their own default encoding as well. But so far I can not find their specification freely online. QrCode.Net will use international standard which is iso-8859-1 as default encoding. And use UTF8 as suboption for any string that not belong to any char table or other encoder. ISO/IEC 18004:2000 Chapter 8.4.4 Page 22 Bitcount, Chapter 8.4.4, P.24 EightBitByte encoder's encoding will change according to different region Default encoding is "iso-8859-1" Use to recognise which mode and encoding name to use for input string. input string content Output encoding name Mode and Encoding name Encoding.GetEncoding.GetBytes will transform char to 0x3F if that char not belong to current encoding table. 0x3F is '?' Check char from startPos for string content. input string content start check position -2 Numeric encode, -1 AlphaNum encode, Index of failed check pos Use given encoding to check input string from starting position. If encoding table is suitable solution. it will return -1. Else it will return failed encoding position. input string encoding name. Check ECI table starting position -1 if from starting position to end encoding success. Else return fail position Check input string content. Whether it can apply Kanji encode or not. String input content -1 if it can apply Kanji encode, -2 should use utf8 encode, 0 check for other encode. ISO/IEC 18004:2000 Chapter 8.4.5 Page 23 Bitcount according to ISO/IEC 18004:2000 Kanji mode Page 25 Multiply value for Most significant byte. Chapter 8.4.5 P.24 See Chapter 8.4.5 P.24 Kanji Mode ISO/IEC 18004:2000 Chapter 8.4.2 Page 19 Calculate int length by search for Most significant bit Input Number Most significant bit Search for right side bit of Most significant bit input number lower boundary. At start should be 0 higher boundary. At start should be 32 Most significant bit - 1 With input number and polynomial number. Method will calculate BCH value and return input number Polynomial number BCH value ISO/IEC 18004:2000 Chapter 8.7.3 Page 46 6.9 Format information The Format Information is a 15 bit sequence containing 5 data bits, with 10 error correction bits calculated using the (15, 5) BCH code. ISO/IEC 18004:2000 Chapter 8.9 Page 53 From Appendix C in JISX0510:2004 (p.65). From Appendix C in JISX0510:2004 (p.65). Embed format information to tristatematrix. Process combination of create info bits, BCH error correction bits calculation, embed towards matrix. ISO/IEC 18004:2000 Chapter 8.9 Page 53 Embed version information for version larger or equal to 7. ISO/IEC 18004:2000 Chapter 8.10 Page 54 Embed version information to Matrix Only for version greater or equal to 7 Matrix version number Generate error correction blocks. Then out put with codewords BitList ISO/IEC 18004/2006 P45, 46. Chapter 6.6 Constructing final message codewords sequence. Datacodewords from DataEncodation.DataEncode Total number of bytes Number of data bytes Number of Error Correction blocks codewords BitList contain datacodewords and ECCodewords ISO/IEC 18004:2000 Chapter 8.8.2 Page 52 Calculate penalty value for first rule. ISO/IEC 18004:2000 Chapter 8.8.2 Page 52 ISO/IEC 18004:2000 Chapter 8.8.2 Page 52 Calculate penalty value for Third rule. ISO/IEC 18004:2000 Chapter 8.8.2 Page 52 Calculate penalty value for Fourth rule. Perform O(n) search for available x modules Description of PenaltyFactory. This class contain two variables. BitMatrix for QrCode isContainMatrix for indicate whether QrCode contains BitMatrix or not. BitMatrix will equal to null if isContainMatrix is false. Contain most of common constant variables. S ISO/IEC 18004:2006(E) Page 45 Chapter Generating the error correction codewords Primative Polynomial = Bin 100011101 = Dec 285 0xEC 0x11 URL:http://en.wikipedia.org/wiki/Byte-order_mark Default QrEncoder will set ErrorCorrectionLevel as M QrEncoder with parameter ErrorCorrectionLevel. Encode string content to QrCode matrix This exception for string content is null, empty or too large Try to encode content False if input content is empty, null or too large. Encode byte array content to QrCode matrix This exception for string content is null, empty or too large Try to encode content False if input content is empty, null or too large. Description of GaloisField256. Powers of a in GF table. Where a = 2 log ( power of a) in GF table. Where a = 2 Product of two values. In other words. a multiply b Quotient of two values. In other words. a devided b Description of GeneratorPolynomial. After create GeneratorPolynomial. Keep it as long as possible. Unless QRCode encode is done or no more QRCode need to generate. Get generator by degree. (Largest degree for that generator) Generator Build Generator if we can not find specific degree of generator from cache coefficient position. where (coefficient)x^degree Add another Polynomial to current one The polynomial need to add or subtract to current one Result polynomial after add or subtract Multiply current Polynomial to anotherone. Result polynomial after multiply Multiplay scalar to current polynomial result of polynomial after multiply scalar divide current polynomial by "other" Result polynomial after divide Encode an array of data codeword with GaloisField 256. Array of data codewords for a single block. Number of error correction codewords for data codewords Cached or newly create GeneratorPolynomial Return error correction codewords array Convert data codewords to int array. And add error correction space at end of that array data codewords array data codewords length Num of error correction bytes Int array for data codewords array follow by error correction space Reassembly error correction codewords. As Polynomial class will eliminate zero monomial at front. Remainder byte array after divide. Error correction codewords length Error correction codewords Return value will be internal array itself. Not deep/shallow copy. This method will create BitList that contain terminator, padding and pad codewords for given datacodewords. Use it to full fill the data codewords capacity. Thus avoid massive empty bits. ISO/IEC 18004:2006 P. 32 33. Terminator / Bit stream to codeword conversion Method will add terminator bits at end of baseList Num of bits for datacodewords without terminator Total number of datacodewords for specific version. Receive it under Version/VersionTable Bitlist that contain Terminator, padding and padcodewords Return value will be deep copy of array. Width for current version number of Error correction blocks for group 1 Number of error correction blocks for group 2 Number of data bytes per block for group 1 Number of data bytes per block for group 2 Number of error correction bytes per block Get Error Correction Blocks Initialize for NumBlocks and ErrorCorrectionCodewordsPerBlock Use this exception for null or empty input string or when input string is too large. L M Q H Get Error Correction Blocks by level Determine which version to use Number of bits for encoded content Encoding name for EightBitByte VersionDetail and ECI Decide which version group it belong to number of bits for bitlist where it contain DataBits encode from input content and ECI header Error correction level Mode Version group index for VERSION_GROUP Use number of data bits(header + eci header + data bits from EncoderBase) to search for proper version to use between min and max boundary. Boundary define by DynamicSearchIndicator method. We only need totalCodeWords, dataCodewords and number of blocks. Other variable can be calculate through equation by given that three variables. This table try to use original table layout for easier error detection. ISO/IEC 18004/2006 Tabler 9 Page 38 Only include non-micro QRCode Sorted list Lock Class, that any change to Text or ErrorCorrectLevel won't cause it to update QrCode Matrix Unlock Class, then update QrCodeMatrix and repaint Freeze Class, Any value change to Brush, QuietZoneModule won't cause immediately repaint. It won't stop any repaint cause by other action. Unfreeze and repaint immediately. Get Qr SquareBitMatrix as two dimentional bool array. It will be deep copy of control's internal bitmatrix. null if matrix is null, else full matrix Return whether if class is freezed. Return whether if class is locked Lock Class, that any change to Text or ErrorCorrectLevel won't cause it to update QrCode Matrix Unlock Class, then update QrCodeMatrix and redraw image Freeze Class, Any value change to Brush, QuietZoneModule won't cause immediately redraw image. Unfreeze and redraw immediately. Get Qr SquareBitMatrix as two dimentional bool array. It will be deep copy of control's internal bitmatrix. null if matrix is null, else full matrix Return whether if class is freezed. Return whether if class is locked Calculate background and fronntcolor's contrast ratio. To assist dark module and light module's choose. Higher ratio means easier to decode by decoder. Black and White will have highest ratio = 21. light module color dark module color Contrast object. Initialize Renderer. Default brushes will be black and white. Initialize Renderer. Draw QrCode to DrawingBrush DrawingBrush, Stretch = uniform LightBrush will not use by this method, DrawingBrush will only contain DarkBrush part. Use LightBrush to fill background of main uielement for more flexible placement Construct QrCode geometry. It will only include geometry for Dark colour module QrCode dark colour module geometry. Size = QrMatrix width x width Construct DrawingBrush with input Drawing DrawingBrush where Stretch = uniform Write image file to stream Default DPI will be 96, 96 Write image file to stream DPI = DPI.X, DPI.Y(Dots per inch) Module pixel width QrCode pixel width Initializes a Encapsulated PostScript renderer. DarkColor used to draw Dark modules of the QrCode LightColor used to draw Light modules and QuietZone of the QrCode. Setting to a transparent color (A = 0) allows transparent light modules so the QR Code blends in the existing background. In that case the existing background should remain light and rather uniform, and higher error correction levels are recommended. Renders the matrix in an Encapsuled PostScript format. The matrix to be rendered Size in points (1 inch contains 72 point in PostScript) of a module Output stream that must be writable Outputs the EPS header with mandatory declarations, variable declarations and function definitions. The matrix to be rendered Size in points (1 inch contains 72 point in PostScript) of a module Output text stream Outputs the background unless it is defined as transparent. The background is used for light modules and quiet zone. The matrix to be rendered Output text stream Draw a square for each dark module The matrix to be rendered Output text stream Use the 'image' or 'colorimage' PostScript command to render modules The matrix to be rendered Output text stream Outputs the mandatory EPS footer. Output text stream ISizeCalculation for the way to calculate QrCode's pixel size. Ex for ISizeCalculation:FixedCodeSize, FixedModuleSize DarkColor used to draw Dark modules of the QrCode LightColor used to draw Light modules and QuietZone of the QrCode. Setting to a transparent color (A = 0) allows transparent light modules so the QR Code blends in the existing background. In that case the existing background should remain light and rather uniform, and higher error correction levels are recommended. Selection of the technique used to draw the modules. 'Squares' draws vector squares one by one; 'Image' uses the 'image' or 'colorimage' PostScript command. 'Squares' supports transparency of light modules and often has smaller file size for color QR Codes. 'Image' might be faster to render on some devices as it is a single command. FixedCodeSize is strategy for rendering QrCode at fixed Size. Fixed size for QrCode pixel width. Pixel width have to be bigger than QrCode's matrix width(include quiet zone) QrCode matrix width is between 25 ~ 182(version 1 ~ 40). Interface function that use by Rendering class. QrCode matrix width Module pixel size and QrCode pixel width QrCodeWidth is pixel size of QrCode you would like to print out. It have to be greater than QrCode's matrix width(include quiet zone). QrCode matrix width is between 25 ~ 182(version 1 ~ 40). Number of quietZone modules FixedModuleSize is strategy for rendering QrCode with fixed module pixel size. Module pixel size number of quiet zone modules Interface function that use by Rendering class. QrCode matrix width Module pixel size and QrCode pixel width Module pixel size. Have to greater than zero Number of quietZone modules Initialize Renderer. Default brushes will be black and white. The way of calculate Size Initialize Renderer The way of calculate Size Drawing Bitmatrix to winform graphics. Default position will be 0, 0 Draw background only for null matrix DarkBrush or LightBrush is null Drawing Bitmatrix to winform graphics. Draw background only for null matrix DarkBrush or LightBrush is null Saves QrCode Image to specified stream in the specified format Stream or Format is null The image was saved with the wrong image format You should avoid saving an image to the same stream that was used to construct. Doing so might damage the stream If any additional data has been written to the stream before saving the image, the image data in the stream will be corrupted Using MetaFile Class to create metafile. temp control create to use as object to get temp graphics for Hdc. Drawing on the metaGraphics will record as vector metaFile. DarkBrush for drawing Dark module of QrCode ISizeCalculation for the way to calculate QrCode's pixel size. Ex for ISizeCalculation:FixedCodeSize, FixedModuleSize Clear all pixel with given color. Must not be null, or pixel width, pixel height equal to zero Exception should be expect with null writeablebitmap or pixel width, height equal to zero. Draw rectangle with given color. Must not be null, or pixel width, pixel height equal to zero Exception should be expect with null writeablebitmap or pixel width, height equal to zero. Copies characters between buffers New buffer Buffer to copy from Number of character to copy Initialize renderer Size calculation strategy Initialize renderer Size calculation strategy Color for dark module Color for light module Draw QrCode at given writeable bitmap Draw QrCode at given writeable bitmap at offset location Draw quiet zone at offset x,y Draw qrCode dark modules at given position. (It will also include quiet zone area. Set it to zero to exclude quiet zone) Bitmatrix, wBitmap should not equal to null wBitmap's pixel width or height should not equal to zero Occure when ErrorCorrectLevel or Text changed QrCode matrix cache updated. Update Geometry if is unlocked. This method is use to update QuietZone after use method SetQuietZoneModule If Class is locked, it won't update Geometry or quietzone. Unlock class will cause class to update Geometry and quietZone. Get Qr SquareBitMatrix as two dimentional bool array. It will be deep copy of control's internal bitmatrix. null if matrix is null, else full matrix Return whether if class is locked Encode and Update bitmap when ErrorCorrectlevel or Text changed. If Class is locked, it won't update QrMatrix cache. Unlock class will cause class to update QrMatrix Cache and redraw bitmap. Freeze Class, Any value change to Brush, QuietZoneModule won't cause immediately redraw bitmap. Unfreeze and redraw immediately. QrCode matrix cache updated. Get Qr SquareBitMatrix as two dimentional bool array. It will be deep copy of control's internal bitmatrix. null if matrix is null, else full matrix Return whether if class is locked Return whether if class is freezed. ================================================ FILE: packages/QrCode.Net.0.4.0.0/lib/netcore45/Gma.QrCodeNet.Encoding.xml ================================================ Gma.QrCodeNet.Encoding ISO/IEC 18004:2000 Chapter 8.4.3 Alphanumeric Page 21 Returns the bit representation of input data. Returns bit representation of value. See Chapter 8.4 Data encodation, Table 2 — Mode indicators Defines the length of the Character Count Indicator, which varies according to themode and the symbol version in use Number of bits in Character Count Indicator. See Chapter 8.4 Data encodation, Table 3 — Number of bits in Character Count Indicator. Constant from Chapter 8.4.3 Alphanumeric Mode. P.21 BitCount from chapter 8.4.3. P22 Table at chapter 8.4.3. P.21 Convert char to int value Alpha Numeric Char Table from chapter 8.4.3 P21 ISO/IEC 18004:2000 Table 3 Page 18 Used to define length of the Character Count Indicator Returns the 0 based index of the row from Chapter 8.4 Data encodation, Table 3 — Number of bits in Character Count Indicator. ISO/IEC 18004:2000 Chapter 8.1 Page 14 DataEncode is combination of Data analysis and Data encodation step. Which uses sub functions under several different namespaces ISO/IEC 18004:2006 Chapter 6.4.2 Mode indicator = 0111 Page 23 Initialize ECI Set. AppendOption is enum under ECISet Use NameToValue during Encode. ValueToName during Decode ISO/IEC 18004:2006E ECI Designator Page 24 Range: 0 ~ 999999 Number of Codewords(Byte) for ECI Assignment Value ISO/IEC 18004:2006E ECI Designator Page 24 Range: 0 ~ 999999 Number of bits for ECI Assignment Value ISO/IEC 18004:2006E ECI Designator Page 24 Range: 0 ~ 999999 Number of bits for ECI Header ECI table in Dictionary collection ISO/IEC 18004:2006 Chapter 6.4.2 Page 24. Length indicator for number of ECI codewords ISO/IEC 18004:2006 Chapter 6.4.2 Page 24. 1 codeword length = 0. Any additional codeword add 1 to front. Eg: 3 = 110 Bits required for each one is: one = 1, two = 2, three = 3 EightBitByte is a bit complicate compare to other encoding. It can accept several different encoding table from global ECI table. For different country, default encoding is different. JP use shift_jis, International spec use iso-8859-1 China use ASCII which is first part of normal char table. Between 00 to 7E Korean and Thai should have their own default encoding as well. But so far I can not find their specification freely online. QrCode.Net will use international standard which is iso-8859-1 as default encoding. And use UTF8 as suboption for any string that not belong to any char table or other encoder. ISO/IEC 18004:2000 Chapter 8.4.4 Page 22 Bitcount, Chapter 8.4.4, P.24 EightBitByte encoder's encoding will change according to different region Default encoding is "iso-8859-1" Use to recognise which mode and encoding name to use for input string. input string content Output encoding name Mode and Encoding name Encoding.GetEncoding.GetBytes will transform char to 0x3F if that char not belong to current encoding table. 0x3F is '?' Check char from startPos for string content. input string content start check position -2 Numeric encode, -1 AlphaNum encode, Index of failed check pos Use given encoding to check input string from starting position. If encoding table is suitable solution. it will return -1. Else it will return failed encoding position. input string encoding name. Check ECI table starting position -1 if from starting position to end encoding success. Else return fail position Check input string content. Whether it can apply Kanji encode or not. String input content -1 if it can apply Kanji encode, -2 should use utf8 encode, 0 check for other encode. ISO/IEC 18004:2000 Chapter 8.4.5 Page 23 Bitcount according to ISO/IEC 18004:2000 Kanji mode Page 25 Multiply value for Most significant byte. Chapter 8.4.5 P.24 See Chapter 8.4.5 P.24 Kanji Mode ISO/IEC 18004:2000 Chapter 8.4.2 Page 19 Calculate int length by search for Most significant bit Input Number Most significant bit Search for right side bit of Most significant bit input number lower boundary. At start should be 0 higher boundary. At start should be 32 Most significant bit - 1 With input number and polynomial number. Method will calculate BCH value and return input number Polynomial number BCH value ISO/IEC 18004:2000 Chapter 8.7.3 Page 46 6.9 Format information The Format Information is a 15 bit sequence containing 5 data bits, with 10 error correction bits calculated using the (15, 5) BCH code. ISO/IEC 18004:2000 Chapter 8.9 Page 53 From Appendix C in JISX0510:2004 (p.65). From Appendix C in JISX0510:2004 (p.65). Embed format information to tristatematrix. Process combination of create info bits, BCH error correction bits calculation, embed towards matrix. ISO/IEC 18004:2000 Chapter 8.9 Page 53 Embed version information for version larger or equal to 7. ISO/IEC 18004:2000 Chapter 8.10 Page 54 Embed version information to Matrix Only for version greater or equal to 7 Matrix version number Generate error correction blocks. Then out put with codewords BitList ISO/IEC 18004/2006 P45, 46. Chapter 6.6 Constructing final message codewords sequence. Datacodewords from DataEncodation.DataEncode Total number of bytes Number of data bytes Number of Error Correction blocks codewords BitList contain datacodewords and ECCodewords ISO/IEC 18004:2000 Chapter 8.8.2 Page 52 Calculate penalty value for first rule. ISO/IEC 18004:2000 Chapter 8.8.2 Page 52 ISO/IEC 18004:2000 Chapter 8.8.2 Page 52 Calculate penalty value for Third rule. ISO/IEC 18004:2000 Chapter 8.8.2 Page 52 Calculate penalty value for Fourth rule. Perform O(n) search for available x modules Description of PenaltyFactory. This class contain two variables. BitMatrix for QrCode isContainMatrix for indicate whether QrCode contains BitMatrix or not. BitMatrix will equal to null if isContainMatrix is false. Contain most of common constant variables. S ISO/IEC 18004:2006(E) Page 45 Chapter Generating the error correction codewords Primative Polynomial = Bin 100011101 = Dec 285 0xEC 0x11 URL:http://en.wikipedia.org/wiki/Byte-order_mark Default QrEncoder will set ErrorCorrectionLevel as M QrEncoder with parameter ErrorCorrectionLevel. Encode string content to QrCode matrix This exception for string content is null, empty or too large Try to encode content False if input content is empty, null or too large. Encode byte array content to QrCode matrix This exception for string content is null, empty or too large Try to encode content False if input content is empty, null or too large. Description of GaloisField256. Powers of a in GF table. Where a = 2 log ( power of a) in GF table. Where a = 2 Product of two values. In other words. a multiply b Quotient of two values. In other words. a devided b Description of GeneratorPolynomial. After create GeneratorPolynomial. Keep it as long as possible. Unless QRCode encode is done or no more QRCode need to generate. Get generator by degree. (Largest degree for that generator) Generator Build Generator if we can not find specific degree of generator from cache coefficient position. where (coefficient)x^degree Add another Polynomial to current one The polynomial need to add or subtract to current one Result polynomial after add or subtract Multiply current Polynomial to anotherone. Result polynomial after multiply Multiplay scalar to current polynomial result of polynomial after multiply scalar divide current polynomial by "other" Result polynomial after divide Encode an array of data codeword with GaloisField 256. Array of data codewords for a single block. Number of error correction codewords for data codewords Cached or newly create GeneratorPolynomial Return error correction codewords array Convert data codewords to int array. And add error correction space at end of that array data codewords array data codewords length Num of error correction bytes Int array for data codewords array follow by error correction space Reassembly error correction codewords. As Polynomial class will eliminate zero monomial at front. Remainder byte array after divide. Error correction codewords length Error correction codewords Return value will be internal array itself. Not deep/shallow copy. This method will create BitList that contain terminator, padding and pad codewords for given datacodewords. Use it to full fill the data codewords capacity. Thus avoid massive empty bits. ISO/IEC 18004:2006 P. 32 33. Terminator / Bit stream to codeword conversion Method will add terminator bits at end of baseList Num of bits for datacodewords without terminator Total number of datacodewords for specific version. Receive it under Version/VersionTable Bitlist that contain Terminator, padding and padcodewords Return value will be deep copy of array. Width for current version number of Error correction blocks for group 1 Number of error correction blocks for group 2 Number of data bytes per block for group 1 Number of data bytes per block for group 2 Number of error correction bytes per block Get Error Correction Blocks Initialize for NumBlocks and ErrorCorrectionCodewordsPerBlock Use this exception for null or empty input string or when input string is too large. L M Q H Get Error Correction Blocks by level Determine which version to use Number of bits for encoded content Encoding name for EightBitByte VersionDetail and ECI Decide which version group it belong to number of bits for bitlist where it contain DataBits encode from input content and ECI header Error correction level Mode Version group index for VERSION_GROUP Use number of data bits(header + eci header + data bits from EncoderBase) to search for proper version to use between min and max boundary. Boundary define by DynamicSearchIndicator method. We only need totalCodeWords, dataCodewords and number of blocks. Other variable can be calculate through equation by given that three variables. This table try to use original table layout for easier error detection. ISO/IEC 18004/2006 Tabler 9 Page 38 Only include non-micro QRCode Sorted list Calculate background and fronntcolor's contrast ratio. To assist dark module and light module's choose. Higher ratio means easier to decode by decoder. Black and White will have highest ratio = 21. light module color dark module color Contrast object. Module pixel width QrCode pixel width Initializes a Encapsulated PostScript renderer. DarkColor used to draw Dark modules of the QrCode LightColor used to draw Light modules and QuietZone of the QrCode. Setting to a transparent color (A = 0) allows transparent light modules so the QR Code blends in the existing background. In that case the existing background should remain light and rather uniform, and higher error correction levels are recommended. Renders the matrix in an Encapsuled PostScript format. The matrix to be rendered Size in points (1 inch contains 72 point in PostScript) of a module Output stream that must be writable Outputs the EPS header with mandatory declarations, variable declarations and function definitions. The matrix to be rendered Size in points (1 inch contains 72 point in PostScript) of a module Output text stream Outputs the background unless it is defined as transparent. The background is used for light modules and quiet zone. The matrix to be rendered Output text stream Draw a square for each dark module The matrix to be rendered Output text stream Use the 'image' or 'colorimage' PostScript command to render modules The matrix to be rendered Output text stream Outputs the mandatory EPS footer. Output text stream ISizeCalculation for the way to calculate QrCode's pixel size. Ex for ISizeCalculation:FixedCodeSize, FixedModuleSize DarkColor used to draw Dark modules of the QrCode LightColor used to draw Light modules and QuietZone of the QrCode. Setting to a transparent color (A = 0) allows transparent light modules so the QR Code blends in the existing background. In that case the existing background should remain light and rather uniform, and higher error correction levels are recommended. Selection of the technique used to draw the modules. 'Squares' draws vector squares one by one; 'Image' uses the 'image' or 'colorimage' PostScript command. 'Squares' supports transparency of light modules and often has smaller file size for color QR Codes. 'Image' might be faster to render on some devices as it is a single command. ================================================ FILE: packages/QrCode.Net.0.4.0.0/lib/netcore45/Themes/Generic.xaml ================================================  ================================================ FILE: packages/QrCode.Net.0.4.0.0/lib/sl5/Gma.QrCodeNet.Encoding.xml ================================================ Gma.QrCodeNet.Encoding ISO/IEC 18004:2000 Chapter 8.4.3 Alphanumeric Page 21 Returns the bit representation of input data. Returns bit representation of value. See Chapter 8.4 Data encodation, Table 2 — Mode indicators Defines the length of the Character Count Indicator, which varies according to themode and the symbol version in use Number of bits in Character Count Indicator. See Chapter 8.4 Data encodation, Table 3 — Number of bits in Character Count Indicator. Constant from Chapter 8.4.3 Alphanumeric Mode. P.21 BitCount from chapter 8.4.3. P22 Table at chapter 8.4.3. P.21 Convert char to int value Alpha Numeric Char Table from chapter 8.4.3 P21 ISO/IEC 18004:2000 Table 3 Page 18 Used to define length of the Character Count Indicator Returns the 0 based index of the row from Chapter 8.4 Data encodation, Table 3 — Number of bits in Character Count Indicator. ISO/IEC 18004:2000 Chapter 8.1 Page 14 DataEncode is combination of Data analysis and Data encodation step. Which uses sub functions under several different namespaces ISO/IEC 18004:2006 Chapter 6.4.2 Mode indicator = 0111 Page 23 Initialize ECI Set. AppendOption is enum under ECISet Use NameToValue during Encode. ValueToName during Decode ISO/IEC 18004:2006E ECI Designator Page 24 Range: 0 ~ 999999 Number of Codewords(Byte) for ECI Assignment Value ISO/IEC 18004:2006E ECI Designator Page 24 Range: 0 ~ 999999 Number of bits for ECI Assignment Value ISO/IEC 18004:2006E ECI Designator Page 24 Range: 0 ~ 999999 Number of bits for ECI Header ECI table in Dictionary collection ISO/IEC 18004:2006 Chapter 6.4.2 Page 24. Length indicator for number of ECI codewords ISO/IEC 18004:2006 Chapter 6.4.2 Page 24. 1 codeword length = 0. Any additional codeword add 1 to front. Eg: 3 = 110 Bits required for each one is: one = 1, two = 2, three = 3 EightBitByte is a bit complicate compare to other encoding. It can accept several different encoding table from global ECI table. For different country, default encoding is different. JP use shift_jis, International spec use iso-8859-1 China use ASCII which is first part of normal char table. Between 00 to 7E Korean and Thai should have their own default encoding as well. But so far I can not find their specification freely online. QrCode.Net will use international standard which is iso-8859-1 as default encoding. And use UTF8 as suboption for any string that not belong to any char table or other encoder. ISO/IEC 18004:2000 Chapter 8.4.4 Page 22 Bitcount, Chapter 8.4.4, P.24 EightBitByte encoder's encoding will change according to different region Default encoding is "iso-8859-1" Use to recognise which mode and encoding name to use for input string. input string content Output encoding name Mode and Encoding name Encoding.GetEncoding.GetBytes will transform char to 0x3F if that char not belong to current encoding table. 0x3F is '?' Check char from startPos for string content. input string content start check position -2 Numeric encode, -1 AlphaNum encode, Index of failed check pos Use given encoding to check input string from starting position. If encoding table is suitable solution. it will return -1. Else it will return failed encoding position. input string encoding name. Check ECI table starting position -1 if from starting position to end encoding success. Else return fail position Check input string content. Whether it can apply Kanji encode or not. String input content -1 if it can apply Kanji encode, -2 should use utf8 encode, 0 check for other encode. ISO/IEC 18004:2000 Chapter 8.4.5 Page 23 Bitcount according to ISO/IEC 18004:2000 Kanji mode Page 25 Multiply value for Most significant byte. Chapter 8.4.5 P.24 See Chapter 8.4.5 P.24 Kanji Mode ISO/IEC 18004:2000 Chapter 8.4.2 Page 19 Calculate int length by search for Most significant bit Input Number Most significant bit Search for right side bit of Most significant bit input number lower boundary. At start should be 0 higher boundary. At start should be 32 Most significant bit - 1 With input number and polynomial number. Method will calculate BCH value and return input number Polynomial number BCH value ISO/IEC 18004:2000 Chapter 8.7.3 Page 46 6.9 Format information The Format Information is a 15 bit sequence containing 5 data bits, with 10 error correction bits calculated using the (15, 5) BCH code. ISO/IEC 18004:2000 Chapter 8.9 Page 53 From Appendix C in JISX0510:2004 (p.65). From Appendix C in JISX0510:2004 (p.65). Embed format information to tristatematrix. Process combination of create info bits, BCH error correction bits calculation, embed towards matrix. ISO/IEC 18004:2000 Chapter 8.9 Page 53 Embed version information for version larger or equal to 7. ISO/IEC 18004:2000 Chapter 8.10 Page 54 Embed version information to Matrix Only for version greater or equal to 7 Matrix version number Generate error correction blocks. Then out put with codewords BitList ISO/IEC 18004/2006 P45, 46. Chapter 6.6 Constructing final message codewords sequence. Datacodewords from DataEncodation.DataEncode Total number of bytes Number of data bytes Number of Error Correction blocks codewords BitList contain datacodewords and ECCodewords ISO/IEC 18004:2000 Chapter 8.8.2 Page 52 Calculate penalty value for first rule. ISO/IEC 18004:2000 Chapter 8.8.2 Page 52 ISO/IEC 18004:2000 Chapter 8.8.2 Page 52 Calculate penalty value for Third rule. ISO/IEC 18004:2000 Chapter 8.8.2 Page 52 Calculate penalty value for Fourth rule. Perform O(n) search for available x modules Description of PenaltyFactory. This class contain two variables. BitMatrix for QrCode isContainMatrix for indicate whether QrCode contains BitMatrix or not. BitMatrix will equal to null if isContainMatrix is false. Contain most of common constant variables. S ISO/IEC 18004:2006(E) Page 45 Chapter Generating the error correction codewords Primative Polynomial = Bin 100011101 = Dec 285 0xEC 0x11 URL:http://en.wikipedia.org/wiki/Byte-order_mark Default QrEncoder will set ErrorCorrectionLevel as M QrEncoder with parameter ErrorCorrectionLevel. Encode string content to QrCode matrix This exception for string content is null, empty or too large Try to encode content False if input content is empty, null or too large. Encode byte array content to QrCode matrix This exception for string content is null, empty or too large Try to encode content False if input content is empty, null or too large. Description of GaloisField256. Powers of a in GF table. Where a = 2 log ( power of a) in GF table. Where a = 2 Product of two values. In other words. a multiply b Quotient of two values. In other words. a devided b Description of GeneratorPolynomial. After create GeneratorPolynomial. Keep it as long as possible. Unless QRCode encode is done or no more QRCode need to generate. Get generator by degree. (Largest degree for that generator) Generator Build Generator if we can not find specific degree of generator from cache coefficient position. where (coefficient)x^degree Add another Polynomial to current one The polynomial need to add or subtract to current one Result polynomial after add or subtract Multiply current Polynomial to anotherone. Result polynomial after multiply Multiplay scalar to current polynomial result of polynomial after multiply scalar divide current polynomial by "other" Result polynomial after divide Encode an array of data codeword with GaloisField 256. Array of data codewords for a single block. Number of error correction codewords for data codewords Cached or newly create GeneratorPolynomial Return error correction codewords array Convert data codewords to int array. And add error correction space at end of that array data codewords array data codewords length Num of error correction bytes Int array for data codewords array follow by error correction space Reassembly error correction codewords. As Polynomial class will eliminate zero monomial at front. Remainder byte array after divide. Error correction codewords length Error correction codewords Return value will be internal array itself. Not deep/shallow copy. This method will create BitList that contain terminator, padding and pad codewords for given datacodewords. Use it to full fill the data codewords capacity. Thus avoid massive empty bits. ISO/IEC 18004:2006 P. 32 33. Terminator / Bit stream to codeword conversion Method will add terminator bits at end of baseList Num of bits for datacodewords without terminator Total number of datacodewords for specific version. Receive it under Version/VersionTable Bitlist that contain Terminator, padding and padcodewords Return value will be deep copy of array. Width for current version number of Error correction blocks for group 1 Number of error correction blocks for group 2 Number of data bytes per block for group 1 Number of data bytes per block for group 2 Number of error correction bytes per block Get Error Correction Blocks Initialize for NumBlocks and ErrorCorrectionCodewordsPerBlock Use this exception for null or empty input string or when input string is too large. L M Q H Get Error Correction Blocks by level Determine which version to use Number of bits for encoded content Encoding name for EightBitByte VersionDetail and ECI Decide which version group it belong to number of bits for bitlist where it contain DataBits encode from input content and ECI header Error correction level Mode Version group index for VERSION_GROUP Use number of data bits(header + eci header + data bits from EncoderBase) to search for proper version to use between min and max boundary. Boundary define by DynamicSearchIndicator method. We only need totalCodeWords, dataCodewords and number of blocks. Other variable can be calculate through equation by given that three variables. This table try to use original table layout for easier error detection. ISO/IEC 18004/2006 Tabler 9 Page 38 Only include non-micro QRCode Sorted list Calculate background and fronntcolor's contrast ratio. To assist dark module and light module's choose. Higher ratio means easier to decode by decoder. Black and White will have highest ratio = 21. light module color dark module color Contrast object. ================================================ FILE: packages/repositories.config ================================================  ================================================ FILE: packages/xunit.1.9.2/lib/net20/xunit.dll.tdnet ================================================ xUnit.net {0}.{1}.{2} build {3} xunit.runner.tdnet.dll Xunit.Runner.TdNet.TdNetRunner ================================================ FILE: packages/xunit.1.9.2/lib/net20/xunit.xml ================================================ xunit Contains various static methods that are used to verify that conditions are met during the process of running tests. Initializes a new instance of the class. Verifies that a collection contains a given object. The type of the object to be verified The object expected to be in the collection The collection to be inspected Thrown when the object is not present in the collection Verifies that a collection contains a given object, using an equality comparer. The type of the object to be verified The object expected to be in the collection The collection to be inspected The comparer used to equate objects in the collection with the expected object Thrown when the object is not present in the collection Verifies that a string contains a given sub-string, using the current culture. The sub-string expected to be in the string The string to be inspected Thrown when the sub-string is not present inside the string Verifies that a string contains a given sub-string, using the given comparison type. The sub-string expected to be in the string The string to be inspected The type of string comparison to perform Thrown when the sub-string is not present inside the string Verifies that a collection does not contain a given object. The type of the object to be compared The object that is expected not to be in the collection The collection to be inspected Thrown when the object is present inside the container Verifies that a collection does not contain a given object, using an equality comparer. The type of the object to be compared The object that is expected not to be in the collection The collection to be inspected The comparer used to equate objects in the collection with the expected object Thrown when the object is present inside the container Verifies that a string does not contain a given sub-string, using the current culture. The sub-string which is expected not to be in the string The string to be inspected Thrown when the sub-string is present inside the string Verifies that a string does not contain a given sub-string, using the current culture. The sub-string which is expected not to be in the string The string to be inspected The type of string comparison to perform Thrown when the sub-string is present inside the given string Verifies that a block of code does not throw any exceptions. A delegate to the code to be tested Verifies that a collection is empty. The collection to be inspected Thrown when the collection is null Thrown when the collection is not empty Verifies that two objects are equal, using a default comparer. The type of the objects to be compared The expected value The value to be compared against Thrown when the objects are not equal Verifies that two objects are equal, using a custom equatable comparer. The type of the objects to be compared The expected value The value to be compared against The comparer used to compare the two objects Thrown when the objects are not equal Verifies that two values are equal, within the number of decimal places given by . The expected value The value to be compared against The number of decimal places (valid values: 0-15) Thrown when the values are not equal Verifies that two values are equal, within the number of decimal places given by . The expected value The value to be compared against The number of decimal places (valid values: 0-15) Thrown when the values are not equal Verifies that two sequences are equivalent, using a default comparer. The type of the objects to be compared The expected value The value to be compared against Thrown when the objects are not equal Verifies that two sequences are equivalent, using a custom equatable comparer. The type of the objects to be compared The expected value The value to be compared against The comparer used to compare the two objects Thrown when the objects are not equal Do not call this method. Verifies that the condition is false. The condition to be tested Thrown if the condition is not false Verifies that the condition is false. The condition to be tested The message to show when the condition is not false Thrown if the condition is not false Verifies that a value is within a given range. The type of the value to be compared The actual value to be evaluated The (inclusive) low value of the range The (inclusive) high value of the range Thrown when the value is not in the given range Verifies that a value is within a given range, using a comparer. The type of the value to be compared The actual value to be evaluated The (inclusive) low value of the range The (inclusive) high value of the range The comparer used to evaluate the value's range Thrown when the value is not in the given range Verifies that an object is of the given type or a derived type. The type the object should be The object to be evaluated The object, casted to type T when successful Thrown when the object is not the given type Verifies that an object is of the given type or a derived type. The type the object should be The object to be evaluated Thrown when the object is not the given type Verifies that an object is not exactly the given type. The type the object should not be The object to be evaluated Thrown when the object is the given type Verifies that an object is not exactly the given type. The type the object should not be The object to be evaluated Thrown when the object is the given type Verifies that an object is exactly the given type (and not a derived type). The type the object should be The object to be evaluated The object, casted to type T when successful Thrown when the object is not the given type Verifies that an object is exactly the given type (and not a derived type). The type the object should be The object to be evaluated Thrown when the object is not the given type Verifies that a collection is not empty. The collection to be inspected Thrown when a null collection is passed Thrown when the collection is empty Verifies that two objects are not equal, using a default comparer. The type of the objects to be compared The expected object The actual object Thrown when the objects are equal Verifies that two objects are not equal, using a custom equality comparer. The type of the objects to be compared The expected object The actual object The comparer used to examine the objects Thrown when the objects are equal Verifies that two sequences are not equivalent, using a default comparer. The type of the objects to be compared The expected object The actual object Thrown when the objects are equal Verifies that two sequences are not equivalent, using a custom equality comparer. The type of the objects to be compared The expected object The actual object The comparer used to compare the two objects Thrown when the objects are equal Verifies that a value is not within a given range, using the default comparer. The type of the value to be compared The actual value to be evaluated The (inclusive) low value of the range The (inclusive) high value of the range Thrown when the value is in the given range Verifies that a value is not within a given range, using a comparer. The type of the value to be compared The actual value to be evaluated The (inclusive) low value of the range The (inclusive) high value of the range The comparer used to evaluate the value's range Thrown when the value is in the given range Verifies that an object reference is not null. The object to be validated Thrown when the object is not null Verifies that two objects are not the same instance. The expected object instance The actual object instance Thrown when the objects are the same instance Verifies that an object reference is null. The object to be inspected Thrown when the object reference is not null Verifies that the provided object raised INotifyPropertyChanged.PropertyChanged as a result of executing the given test code. The object which should raise the notification The property name for which the notification should be raised The test code which should cause the notification to be raised Thrown when the notification is not raised Verifies that two objects are the same instance. The expected object instance The actual object instance Thrown when the objects are not the same instance Verifies that the given collection contains only a single element of the given type. The collection. The single item in the collection. Thrown when the collection does not contain exactly one element. Verifies that the given collection contains only a single element of the given value. The collection may or may not contain other values. The collection. The value to find in the collection. The single item in the collection. Thrown when the collection does not contain exactly one element. Verifies that the given collection contains only a single element of the given type. The collection type. The collection. The single item in the collection. Thrown when the collection does not contain exactly one element. Verifies that the given collection contains only a single element of the given type which matches the given predicate. The collection may or may not contain other values which do not match the given predicate. The collection type. The collection. The item matching predicate. The single item in the filtered collection. Thrown when the filtered collection does not contain exactly one element. Verifies that the exact exception is thrown (and not a derived exception type). The type of the exception expected to be thrown A delegate to the code to be tested The exception that was thrown, when successful Thrown when an exception was not thrown, or when an exception of the incorrect type is thrown Verifies that the exact exception is thrown (and not a derived exception type). Generally used to test property accessors. The type of the exception expected to be thrown A delegate to the code to be tested The exception that was thrown, when successful Thrown when an exception was not thrown, or when an exception of the incorrect type is thrown Verifies that the exact exception is thrown (and not a derived exception type). The type of the exception expected to be thrown A delegate to the code to be tested The exception that was thrown, when successful Thrown when an exception was not thrown, or when an exception of the incorrect type is thrown Verifies that the exact exception is thrown (and not a derived exception type). Generally used to test property accessors. The type of the exception expected to be thrown A delegate to the code to be tested The exception that was thrown, when successful Thrown when an exception was not thrown, or when an exception of the incorrect type is thrown Verifies that an expression is true. The condition to be inspected Thrown when the condition is false Verifies that an expression is true. The condition to be inspected The message to be shown when the condition is false Thrown when the condition is false Used by the PropertyChanged. Used by the Throws and DoesNotThrow methods. Used by the Throws and DoesNotThrow methods. This command sets up the necessary trace listeners and standard output/error listeners to capture Assert/Debug.Trace failures, output to stdout/stderr, and Assert/Debug.Write text. It also captures any exceptions that are thrown and packages them as FailedResults, including the possibility that the configuration file is messed up (which is exposed when we attempt to manipulate the trace listener list). Base class used by commands which delegate to inner commands. Interface which represents the ability to invoke of a test method. Executes the test method. The instance of the test class Returns information about the test run Creates the start XML to be sent to the callback when the test is about to start running. Return the of the start node, or null if the test is known that it will not be running. Gets the display name of the test method. Determines if the test runner infrastructure should create a new instance of the test class before running the test. Determines if the test should be limited to running a specific amount of time before automatically failing. The timeout value, in milliseconds; if zero, the test will not have a timeout. Creates a new instance of the class. The inner command to delegate to. Initializes a new instance of the class. The command that will be wrapped. The test method. Represents an implementation of to be used with tests which are decorated with the . Represents an xUnit.net test command. The method under test. Initializes a new instance of the class. The method under test. The display name of the test. The timeout, in milliseconds. Gets the name of the method under test. Gets the name of the type under test. Initializes a new instance of the class. The test method. Base class for exceptions that have actual and expected values The base assert exception class Initializes a new instance of the class. Initializes a new instance of the class. The user message to be displayed Initializes a new instance of the class. The user message to be displayed The inner exception Initializes a new instance of the class. The user message to be displayed The stack trace to be displayed Determines whether to exclude a line from the stack frame. By default, this method removes all stack frames from methods beginning with Xunit.Assert or Xunit.Sdk. The stack frame to be filtered. Return true to exclude the line from the stack frame; false, otherwise. Filters the stack trace to remove all lines that occur within the testing framework. The original stack trace The filtered stack trace Gets a string representation of the frames on the call stack at the time the current exception was thrown. A string that describes the contents of the call stack, with the most recent method call appearing first. Gets the user message Creates a new instance of the class. The expected value The actual value The user message to be shown Creates a new instance of the class. The expected value The actual value The user message to be shown Set to true to skip the check for difference position Gets the actual value. Gets the expected value. Gets a message that describes the current exception. Includes the expected and actual values. The error message that explains the reason for the exception, or an empty string(""). 1 Exception thrown when a collection unexpectedly does not contain the expected value. Creates a new instance of the class. The expected object value Creates a new instance of the class. The expected object value The actual value Exception to be thrown from when the number of parameter values does not the test method signature. Exception thrown when code unexpectedly fails change a property. Creates a new instance of the class. Call this constructor when no exception was thrown. The name of the property that was expected to be changed. Exception thrown when the collection did not contain exactly one element. Initializes a new instance of the class. The numbers of items in the collection. Initializes a new instance of the class. The numbers of items in the collection. The object expected to be in the collection. Internal class used for version-resilient test runners. DO NOT CALL DIRECTLY. Version-resilient runners should link against xunit.runner.utility.dll and use ExecutorWrapper instead. Exception thrown when the value is unexpectedly not of the given type or a derived type. Creates a new instance of the class. The expected type The actual object value Allows the user to record actions for a test. Records any exception which is thrown by the given code. The code which may thrown an exception. Returns the exception that was thrown by the code; null, otherwise. Records any exception which is thrown by the given code that has a return value. Generally used for testing property accessors. The code which may thrown an exception. Returns the exception that was thrown by the code; null, otherwise. Exception that is thrown when one or more exceptions are thrown from the After method of a . Initializes a new instance of the class. The exceptions. Initializes a new instance of the class. The exceptions. Gets the list of exceptions thrown in the After method. Gets a message that describes the current exception. Gets a string representation of the frames on the call stack at the time the current exception was thrown. Implementation of which executes the instances attached to a test method. Initializes a new instance of the class. The inner command. The method. Executes the test method. The instance of the test class Returns information about the test run This class supports the xUnit.net infrastructure and is not intended to be used directly from your code. This API supports the xUnit.net infrastructure and is not intended to be used directly from your code. This API supports the xUnit.net infrastructure and is not intended to be used directly from your code. This API supports the xUnit.net infrastructure and is not intended to be used directly from your code. Guard class, used for guard clauses and argument validation Base class which contains XML manipulation helper methods Interface that represents a single test result. Converts the test result into XML that is consumed by the test runners. The parent node. The newly created XML node. The amount of time spent in execution Adds the test execution time to the XML node. The XML node. Utility methods for dealing with exceptions. Gets the message for the exception, including any inner exception messages. The exception The formatted message Gets the stack trace for the exception, including any inner exceptions. The exception The formatted stack trace Rethrows an exception object without losing the existing stack trace information The exception to re-throw. For more information on this technique, see http://www.dotnetjunkies.com/WebLog/chris.taylor/archive/2004/03/03/8353.aspx A dictionary which contains multiple unique values for each key. The type of the key. The type of the value. Adds the value for the given key. If the key does not exist in the dictionary yet, it will add it. The key. The value. Removes all keys and values from the dictionary. Determines whether the dictionary contains to specified key and value. The key. The value. Calls the delegate once for each key/value pair in the dictionary. Removes the given key and all of its values. Removes the given value from the given key. If this was the last value for the key, then the key is removed as well. The key. The value. Gets the values for the given key. Gets the count of the keys in the dictionary. Gets the keys. XML utility methods Adds an attribute to an XML node. The XML node. The attribute name. The attribute value. Adds a child element to an XML node. The parent XML node. The child element name. The new child XML element. Sets the inner text of the XML node, properly escaping it as necessary. The element whose inner text will be set. The inner text to be escaped and then set. Exception that is thrown when a call to Debug.Assert() fails. Creates a new instance of the class. The original assert message Creates a new instance of the class. The original assert message The original assert detailed message Gets the original assert detailed message. Gets the original assert message. Gets a message that describes the current exception. Exception thrown when a collection unexpectedly contains the expected value. Creates a new instance of the class. The expected object value Exception thrown when code unexpectedly throws an exception. Creates a new instance of the class. Actual exception THIS CONSTRUCTOR IS FOR UNIT TESTING PURPOSES ONLY. Gets a string representation of the frames on the call stack at the time the current exception was thrown. A string that describes the contents of the call stack, with the most recent method call appearing first. Exception thrown when a collection is unexpectedly not empty. Creates a new instance of the class. Exception thrown when two values are unexpectedly not equal. Creates a new instance of the class. The expected object value The actual object value Creates a new instance of the class. The expected object value The actual object value Set to true to skip the check for difference position Exception thrown when a value is unexpectedly true. Creates a new instance of the class. The user message to be display, or null for the default message Exception thrown when a value is unexpectedly not in the given range. Creates a new instance of the class. The actual object value The low value of the range The high value of the range Gets the actual object value Gets the high value of the range Gets the low value of the range Gets a message that describes the current exception. The error message that explains the reason for the exception, or an empty string(""). Exception thrown when the value is unexpectedly of the exact given type. Creates a new instance of the class. The expected type The actual object value Exception thrown when the value is unexpectedly not of the exact given type. Creates a new instance of the class. The expected type The actual object value Used to decorate xUnit.net test classes that utilize fixture classes. An instance of the fixture data is initialized just before the first test in the class is run, and if it implements IDisposable, is disposed after the last test in the class is run. The type of the fixture Called on the test class just before each test method is run, passing the fixture data so that it can be used for the test. All test runs share the same instance of fixture data. The fixture data Exception thrown when a value is unexpectedly in the given range. Creates a new instance of the class. The actual object value The low value of the range The high value of the range Gets the actual object value Gets the high value of the range Gets the low value of the range Gets a message that describes the current exception. The error message that explains the reason for the exception, or an empty string(""). Base attribute which indicates a test method interception (allows code to be run before and after the test is run). This method is called after the test method is executed. The method under test This method is called before the test method is executed. The method under test Exception thrown when a collection is unexpectedly empty. Creates a new instance of the class. Exception thrown when two values are unexpectedly equal. Creates a new instance of the class. Exception thrown when an object is unexpectedly null. Creates a new instance of the class. Exception thrown when two values are unexpected the same instance. Creates a new instance of the class. Exception thrown when an object reference is unexpectedly not null. Creates a new instance of the class. Command that automatically creates the instance of the test class and disposes it (if it implements ). Creates a new instance of the object. The command that is bring wrapped The method under test Executes the test method. Creates a new instance of the class under tests and passes it to the inner command. Also catches any exceptions and converts them into s. The instance of the test class Returns information about the test run Command used to wrap a which has associated fixture data. Creates a new instance of the class. The inner command The fixtures to be set on the test class Sets the fixtures on the test class by calling SetFixture, then calls the inner command. The instance of the test class Returns information about the test run A timer class used to figure out how long tests take to run. On most .NET implementations this will use the class because it's a high resolution timer; however, on Silverlight/CoreCLR, it will use (which will provide lower resolution results). Creates a new instance of the class. Starts timing. Stops timing. Gets how long the timer ran, in milliseconds. In order for this to be valid, both and must have been called. Attribute used to decorate a test method with arbitrary name/value pairs ("traits"). Creates a new instance of the class. The trait name The trait value Gets the trait name. Gets the trait value. Runner that executes an synchronously. Execute the . The test class command to execute The methods to execute; if null or empty, all methods will be executed The start run callback The end run result callback A with the results of the test run Factory for objects, based on the type under test. Creates the test class command, which implements , for a given type. The type under test The test class command, if the class is a test class; null, otherwise Creates the test class command, which implements , for a given type. The type under test The test class command, if the class is a test class; null, otherwise Represents an xUnit.net test class Interface which describes the ability to executes all the tests in a test class. Allows the test class command to choose the next test to be run from the list of tests that have not yet been run, thereby allowing it to choose the run order. The tests remaining to be run The index of the test that should be run Execute actions to be run after all the test methods of this test class are run. Returns the thrown during execution, if any; null, otherwise Execute actions to be run before any of the test methods of this test class are run. Returns the thrown during execution, if any; null, otherwise Enumerates the test commands for a given test method in this test class. The method under test The test commands for the given test method Enumerates the methods which are test methods in this test class. The test methods Determines if a given refers to a test method. The test method to validate True if the method is a test method; false, otherwise Gets the object instance that is under test. May return null if you wish the test framework to create a new object instance for each test method. Gets or sets the type that is being tested Creates a new instance of the class. Creates a new instance of the class. The type under test Creates a new instance of the class. The type under test Chooses the next test to run, randomly, using the . The tests remaining to be run The index of the test that should be run Execute actions to be run after all the test methods of this test class are run. Returns the thrown during execution, if any; null, otherwise Execute actions to be run before any of the test methods of this test class are run. Returns the thrown during execution, if any; null, otherwise Enumerates the test commands for a given test method in this test class. The method under test The test commands for the given test method Enumerates the methods which are test methods in this test class. The test methods Determines if a given refers to a test method. The test method to validate True if the method is a test method; false, otherwise Gets the object instance that is under test. May return null if you wish the test framework to create a new object instance for each test method. Gets or sets the randomizer used to determine the order in which tests are run. Sets the type that is being tested Implementation of that represents a skipped test. Creates a new instance of the class. The method that is being skipped The display name for the test. If null, the fully qualified type name is used. The reason the test was skipped. Gets the skip reason. Factory for creating objects. Make instances of objects for the given class and method. The class command The method under test The set of objects A command wrapper which times the running of a command. Creates a new instance of the class. The command that will be timed. Executes the inner test method, gathering the amount of time it takes to run. Returns information about the test run Wraps a command which should fail if it runs longer than the given timeout value. Creates a new instance of the class. The command to be run The timout, in milliseconds The method under test Executes the test method, failing if it takes too long. Returns information about the test run Attributes used to decorate a test fixture that is run with an alternate test runner. The test runner must implement the interface. Creates a new instance of the class. The class which implements ITestClassCommand and acts as the runner for the test fixture. Gets the test class command. Exception thrown when two object references are unexpectedly not the same instance. Creates a new instance of the class. The expected object reference The actual object reference Contains the test results from an assembly. Contains multiple test results, representing them as a composite test result. Adds a test result to the composite test result list. Gets the test results. Creates a new instance of the class. The filename of the assembly Creates a new instance of the class. The filename of the assembly The configuration filename Converts the test result into XML that is consumed by the test runners. The parent node. The newly created XML node. Gets the fully qualified filename of the configuration file. Gets the directory where the assembly resides. Gets the number of failed results. Gets the fully qualified filename of the assembly. Gets the number of passed results. Gets the number of skipped results. Contains the test results from a test class. Creates a new instance of the class. The type under test Creates a new instance of the class. The simple name of the type under test The fully qualified name of the type under test The namespace of the type under test Sets the exception thrown by the test fixture. The thrown exception Converts the test result into XML that is consumed by the test runners. The parent node. The newly created XML node. Gets the fully qualified test fixture exception type, when an exception has occurred. Gets the number of tests which failed. Gets the fully qualified name of the type under test. Gets the test fixture exception message, when an exception has occurred. Gets the simple name of the type under test. Gets the namespace of the type under test. Gets the number of tests which passed. Gets the number of tests which were skipped. Gets the test fixture exception stack trace, when an exception has occurred. Represents a failed test result. Represents the results from running a test method Initializes a new instance of the class. The traits for the test method are discovered using reflection. The method under test. The display name for the test. If null, the fully qualified type name is used. Initializes a new instance of the class. The name of the method under test. The type of the method under test. The display name for the test. If null, the fully qualified type name is used. The traits. Converts the test result into XML that is consumed by the test runners. The parent node. The newly created XML node. Gets or sets the display name of the method under test. This is the value that's shown during failures and in the resulting output XML. Gets the name of the method under test. Gets or sets the standard output/standard error from the test that was captured while the test was running. Gets the traits attached to the test method. Gets the name of the type under test. Creates a new instance of the class. The method under test The exception throw by the test The display name for the test. If null, the fully qualified type name is used. Creates a new instance of the class. The name of the method under test The name of the type under test The display name of the test The custom properties attached to the test method The full type name of the exception throw The exception message The exception stack trace Converts the test result into XML that is consumed by the test runners. The parent node. The newly created XML node. Gets the exception type thrown by the test method. Gets the exception message thrown by the test method. Gets the stack trace of the exception thrown by the test method. Represents a passing test result. Create a new instance of the class. The method under test The display name for the test. If null, the fully qualified type name is used. Create a new instance of the class. The name of the method under test The name of the type under test The display name for the test. If null, the fully qualified type name is used. The custom properties attached to the test method Converts the test result into XML that is consumed by the test runners. The parent node. The newly created XML node. Represents a skipped test result. Creates a new instance of the class. Uses reflection to discover the skip reason. The method under test The display name for the test. If null, the fully qualified type name is used. The reason the test was skipped. Creates a new instance of the class. The name of the method under test The name of the type under test The display name for the test. If null, the fully qualified type name is used. The traits attached to the method under test The skip reason Converts the test result into XML that is consumed by the test runners. The parent node. The newly created XML node. Gets the skip reason. Represents information about an attribute. Gets the instance of the attribute, if available. The type of the attribute The instance of the attribute, if available. Gets an initialized property value of the attribute. The type of the property The name of the property The property value Represents information about a method. Creates an instance of the type where this test method was found. If using reflection, this should be the ReflectedType. A new instance of the type. Gets all the custom attributes for the method that are of the given type. The type of the attribute The matching attributes that decorate the method Determines if the method has at least one instance of the given attribute type. The type of the attribute True if the method has at least one instance of the given attribute type; false, otherwise Invokes the test on the given class, with the given parameters. The instance of the test class (may be null if the test method is static). The parameters to be passed to the test method. Gets a value which represents the class that this method was reflected from (i.e., equivalent to MethodInfo.ReflectedType) Gets a value indicating whether the method is abstract. Gets a value indicating whether the method is static. Gets the underlying for the method, if available. Gets the name of the method. Gets the fully qualified type name of the return type. Gets the fully qualified type name of the type that this method belongs to. If using reflection, this should be the ReflectedType. Represents information about a type. Gets all the custom attributes for the type that are of the given attribute type. The type of the attribute The matching attributes that decorate the type Gets a test method by name. The name of the method The method, if it exists; null, otherwise. Gets all the methods Determines if the type has at least one instance of the given attribute type. The type of the attribute True if the type has at least one instance of the given attribute type; false, otherwise Determines if the type implements the given interface. The type of the interface True if the type implements the given interface; false, otherwise Gets a value indicating whether the type is abstract. Gets a value indicating whether the type is sealed. Gets the underlying object, if available. Utility class which inspects methods for test information Gets the display name. The method to be inspected The display name Gets the skip reason from a test method. The method to be inspected The skip reason Gets the test commands for a test method. The method to be inspected The objects for the test method Gets the timeout value for a test method. The method to be inspected The timeout, in milliseconds Gets the traits on a test method. The method to be inspected A dictionary of the traits Determines whether a test method has a timeout. The method to be inspected True if the method has a timeout; false, otherwise Determines whether a test method has traits. The method to be inspected True if the method has traits; false, otherwise Determines whether a test method should be skipped. The method to be inspected True if the method should be skipped; false, otherwise Determines whether a method is a test method. A test method must be decorated with the (or derived class) and must not be abstract. The method to be inspected True if the method is a test method; false, otherwise Wrapper to implement and using reflection. Converts an into an using reflection. Converts a into an using reflection. The method to wrap The wrapper Converts a into an using reflection. The type to wrap The wrapper Utility class which inspects types for test information Determines if a type contains any test methods The type to be inspected True if the class contains any test methods; false, otherwise Retrieves the type to run the test class with from the , if present. The type to be inspected The type of the test class runner, if present; null, otherwise Retrieves a list of the test methods from the test class. The type to be inspected The test methods Determines if the test class has a applied to it. The type to be inspected True if the test class has a run with attribute; false, otherwise Determines if the type implements . The type to be inspected True if the type implements ; false, otherwise Determines whether the specified type is abstract. The type. true if the specified type is abstract; otherwise, false. Determines whether the specified type is static. The type. true if the specified type is static; otherwise, false. Determines if a class is a test class. The type to be inspected True if the type is a test class; false, otherwise Attribute that is applied to a method to indicate that it is a fact that should be run by the test runner. It can also be extended to support a customized definition of a test method. Creates instances of which represent individual intended invocations of the test method. The method under test An enumerator through the desired test method invocations Enumerates the test commands represented by this test method. Derived classes should override this method to return instances of , one per execution of a test method. The test method The test commands which will execute the test runs for the given method Gets the name of the test to be used when the test is skipped. Defaults to null, which will cause the fully qualified test name to be used. Obsolete. Please use the property instead. Marks the test so that it will not be run, and gets or sets the skip reason Marks the test as failing if it does not finish running within the given time period, in milliseconds; set to 0 or less to indicate the method has no timeout Exception thrown when code unexpectedly fails to throw an exception. Creates a new instance of the class. Call this constructor when no exception was thrown. The type of the exception that was expected Creates a new instance of the class. Call this constructor when an exception of the wrong type was thrown. The type of the exception that was expected The actual exception that was thrown THIS CONSTRUCTOR IS FOR UNIT TESTING PURPOSES ONLY. Gets a string representation of the frames on the call stack at the time the current exception was thrown. A string that describes the contents of the call stack, with the most recent method call appearing first. Exception thrown when a test method exceeds the given timeout value Creates a new instance of the class. The timeout value, in milliseconds Exception thrown when a value is unexpectedly false. Creates a new instance of the class. The user message to be displayed, or null for the default message ================================================ FILE: packages/xunit.1.9.2/xunit.1.9.2.nuspec ================================================ xunit 1.9.2 xUnit.net James Newkirk, Brad Wilson James Newkirk, Brad Wilson http://xunit.codeplex.com/license https://github.com/xunit/xunit http://download.codeplex.com/Download?ProjectName=xunit&DownloadId=365445 false xUnit.net is a developer testing framework, built to support Test Driven Development, with a design goal of extreme simplicity and alignment with framework features. en-US ================================================ FILE: test/FrameworkCoreTest/AccessTokenTest.cs ================================================ using Moq; using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using WX.Api; using WX.Model; using WX.Model.ApiRequests; using Xunit; namespace FrameworkCoreTest { public class AccessTokenTest { [Fact] public void GetAccessTokenCore() { var appid = new AppIdentication("wx7fc05579394bd02c", "26f8f072c53e97d0033e3589e7de4e84"); var request = new AccessTokenRequest(appid); IApiClient client = new DefaultApiClient(); var response = client.Execute(request); Console.WriteLine(response.ToString()); } [Fact] public void MatchMessageTest() { var appid = new AppIdentication("wx7fc05579394bd02c", "26f8f072c53e97d0033e3589e7de4e84"); var request = new AccessTokenRequest(appid); var mock = new Mock(); mock.Setup(d => d.DoExecute(request)).Returns("{\"access_token\":\"ACCESS_TOKEN\",\"expires_in\":7200}"); var testobj = mock.Object.Execute(request); Console.WriteLine(testobj); } [Fact] public void ErrorMessageTest() { var appid = new AppIdentication("wx7fc05579394bd02c", "26f8f072c53e97d0033e3589e7de4e84"); var request = new AccessTokenRequest(appid); var mock = new Mock(); mock.Setup(d => d.DoExecute(request)).Returns("{\"errcode\":40013,\"errmsg\":\"invalid appid\"}"); var testobj = mock.Object.Execute(request); Console.WriteLine(testobj); } } } ================================================ FILE: test/FrameworkCoreTest/Api/CustomeServiceGetRecordTest.cs ================================================ using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using WX.Model.ApiRequests; using WX.Model.ApiResponses; using Xunit; namespace FrameworkCoreTest { public class CustomeServiceGetRecordTest : MockPostApiBaseTest { [Fact] public void MockCustomServiceGetRecordTest() { MockSetup(false); var response = mock_client.Object.Execute(this.Request); Assert.Equal(false, response.IsError); Assert.Equal(2, response.RecordList.Count()); foreach (var r in response.RecordList) { Console.WriteLine("{0}:{1}", r.Worker, r.Text); } } [Fact] public void MockCustomServiceGetRecordErrorTest() { MockSetup(true); var response = mock_client.Object.Execute(this.Request); Assert.Equal(true, response.IsError); Console.WriteLine(response.ToString()); } protected override CustomServiceGetRecordRequest InitRequestObject() { return new CustomServiceGetRecordRequest { StartTime = new DateTime(2014,1,1), EndTime = new DateTime(2014,3,1), AccessToken = "123", OpenId = "123", PageIndex = 1, PageSize = 10 }; } protected override string GetReturnResult(bool errResult) { if (errResult) { return "{\"errcode\":40029,\"errmsg\":\"invalid code\"}"; } return @"{ ""recordlist"": [ { ""worker"": "" test1"", ""openid"": ""oDF3iY9WMaswOPWjCIp_f3Bnpljk"", ""opercode"": 2002, ""time"": 1400563710, ""text"": "" 您好,客服test1为您服务。"" }, { ""worker"": "" test1"", ""openid"": ""oDF3iY9WMaswOPWjCIp_f3Bnpljk"", ""opercode"": 2003, ""time"": 1400563731, ""text"": "" 你好,有什么事情? "" }, ] }"; } } } ================================================ FILE: test/FrameworkCoreTest/Api/CustomserviceKfsessionCloseTest.cs ================================================ using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using WX.Model.ApiRequests; using WX.Model.ApiResponses; using Xunit; namespace FrameworkCoreTest.Api { public class CustomserviceKfsessionCloseTest : MockPostApiBaseTest { protected override CustomserviceKfsessionCloseRequest InitRequestObject() { return new CustomserviceKfsessionCloseRequest { AccessToken = "123", KfAccount = "kf@kf.com", OpenId = "asdf", Text = "zsdfa" }; } protected override string GetReturnResult(bool errResult) { if (errResult) return s_errmsg; return @" { ""errcode"" : 0, ""errmsg"" : ""ok"" }"; } public override CustomserviceKfsessionCloseResponse GetResponse() { return mock_client.Object.Execute(Request); } } } ================================================ FILE: test/FrameworkCoreTest/Api/CustomserviceKfsessionCreateTest.cs ================================================ using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using WX.Model.ApiRequests; using WX.Model.ApiResponses; using Xunit; namespace FrameworkCoreTest.Api { public class CustomserviceKfsessionCreateTest : MockPostApiBaseTest { protected override CustomserviceKfsessionCreateRequest InitRequestObject() { return new CustomserviceKfsessionCreateRequest { AccessToken = "123", KfAccount = "kf@kf.com", OpenId = "123lkjzcv", Text = "this is test text" }; } protected override string GetReturnResult(bool errResult) { if (errResult) return s_errmsg; return @"{ ""kf_account"" : ""test1@test"", ""openid"" : ""OPENID"", ""text"" : ""这是一段附加信息"" }"; } public override CustomserviceKfsessionCreateResponse GetResponse() { return mock_client.Object.Execute(Request); } } } ================================================ FILE: test/FrameworkCoreTest/Api/CustomserviceKfsessionGetsessionTest.cs ================================================ using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using WX.Model.ApiRequests; using WX.Model.ApiResponses; using Xunit; namespace FrameworkCoreTest.Api { public class CustomserviceKfsessionGetsessionTest : MockPostApiBaseTest { protected override CustomserviceKfsessionGetsessionRequest InitRequestObject() { return new CustomserviceKfsessionGetsessionRequest { AccessToken = "123", OpenId = "openid" }; } protected override string GetReturnResult(bool errResult) { if (errResult) return s_errmsg; return @"{ ""createtime"" : 123456789, ""errcode"" : 0, ""errmsg"" : ""ok"", ""kf_account"" : ""test1@test"" }"; } public override CustomserviceKfsessionGetsessionResponse GetResponse() { return mock_client.Object.Execute(Request); } } } ================================================ FILE: test/FrameworkCoreTest/Api/DAtacubeGetarticletotalTest.cs ================================================ using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using WX.Model.ApiRequests; using WX.Model.ApiResponses; using Xunit; namespace FrameworkCoreTest.Api { public class DatacubeGetarticletotalTest : MockPostApiBaseTest { protected override DatacubeGetarticletotalRequest InitRequestObject() { return new DatacubeGetarticletotalRequest { AccessToken = "123", BeginDate = "2015-04-01", EndDate = "2015-04-16" }; } public override DatacubeGetArticlesResponse GetResponse() { return mock_client.Object.Execute(Request); } protected override string GetReturnResult(bool errResult) { if (errResult) return s_errmsg; return @"{ ""list"": [ { ""ref_date"": ""2014-12-14"", ""msgid"": ""202457380_1"", ""title"": ""马航丢画记"", ""details"": [ { ""stat_date"": ""2014-12-14"", ""target_user"": 261917, ""int_page_read_user"": 23676, ""int_page_read_count"": 25615, ""ori_page_read_user"": 29, ""ori_page_read_count"": 34, ""share_user"": 122, ""share_count"": 994, ""add_to_fav_user"": 1, ""add_to_fav_count"": 3 }, //后续还会列出所有stat_date符合“ref_date(群发的日期)到接口调用日期”(但最多只统计7天)的数据 ] }, //后续还有ref_date(群发的日期)在begin_date和end_date之间的群发文章的数据 ] }"; } } } ================================================ FILE: test/FrameworkCoreTest/Api/DatacubeGetInterfaceTest.cs ================================================ using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using WX.Model.ApiRequests; using WX.Model.ApiResponses; using Xunit; namespace FrameworkCoreTest.Api { public class DatacubeGetInterfaceTest : MockPostApiBaseTest { protected override DatacubeGetInterfaceSummaryHourRequest InitRequestObject() { return new DatacubeGetInterfaceSummaryHourRequest { AccessToken = "123", BeginDate = "2015-04-12", EndDate = "2015-04-13" }; } protected override string GetReturnResult(bool errResult) { if (errResult) return s_errmsg; return @"{ ""list"": [ { ""ref_date"": ""2014-12-01"", ""ref_hour"": 0, ""callback_count"": 331, ""fail_count"": 18, ""total_time_cost"": 167870, ""max_time_cost"": 5042 } //后续还有不同ref_hour的数据 ] }"; } public override DatacubeGetInterfaceResponse GetResponse() { return mock_client.Object.Execute(Request); } } } ================================================ FILE: test/FrameworkCoreTest/Api/DatacubeGetUpStreamMsgTest.cs ================================================ using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using WX.Model.ApiRequests; using WX.Model.ApiResponses; using Xunit; namespace FrameworkCoreTest.Api { public class DatacubeGetUpStreamMsgTest : MockPostApiBaseTest { protected override DatacubeGetUpStreamMsgRequest InitRequestObject() { return new DatacubeGetUpStreamMsgRequest { AccessToken = "123", BeginDate = "2015-04-12", EndDate = "2015-04-13" }; } protected override string GetReturnResult(bool errResult) { if (errResult) return s_errmsg; return @"{ ""list"": [ { ""ref_date"": ""2014-12-07"", ""msg_type"": 1, ""msg_user"": 282, ""msg_count"": 817 } //后续还有同一ref_date的不同msg_type的数据,以及不同ref_date(在时间范围内)的数据 ] }"; } public override DatacubeGetStreamMsgResponse GetResponse() { return mock_client.Object.Execute(Request); } } } ================================================ FILE: test/FrameworkCoreTest/Api/DatacubeGetUserCumulateTest.cs ================================================ using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using WX.Model.ApiRequests; using WX.Model.ApiResponses; using Xunit; namespace FrameworkCoreTest { public class DatacubeGetUserCumulateTest : MockPostApiBaseTest { protected override DatacubeGetUserCumulateRequest InitRequestObject() { return new DatacubeGetUserCumulateRequest { AccessToken = "123", BeginDate = "2015-04-04", EndDate = "2015-04-07" }; } protected override string GetReturnResult(bool errResult) { if (errResult) return s_errmsg; return @"{ ""list"": [ { ""ref_date"": ""2014-12-07"", ""cumulate_user"": 1217056 }, //后续还有ref_date在begin_date和end_date之间的数据 ] }"; } public override DatacubeGetUserCumulateResponse GetResponse() { return mock_client.Object.Execute(Request); } } } ================================================ FILE: test/FrameworkCoreTest/Api/DatacubeGetUserSummaryTest.cs ================================================ using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using WX.Model.ApiRequests; using WX.Model.ApiResponses; using Xunit; namespace FrameworkCoreTest.Api { public class DatacubeGetUserSummaryTest : MockPostApiBaseTest { protected override DatacubeGetUserSummaryRequest InitRequestObject() { return new DatacubeGetUserSummaryRequest { AccessToken = "123", BeginDate = "2015-1-1", EndDate = "2015-1-5" }; } protected override string GetReturnResult(bool errResult) { if (errResult) return s_errmsg; return @"{ ""list"": [ { ""ref_date"": ""2014-12-07"", ""cumulate_user"": 1217056 }, //后续还有ref_date在begin_date和end_date之间的数据 ] }"; } public override DatacubeGetUserSummaryResponse GetResponse() { return mock_client.Object.Execute(Request); } } } ================================================ FILE: test/FrameworkCoreTest/Api/DatacubeGetarticlesummaryTest.cs ================================================ using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using WX.Model.ApiRequests; using WX.Model.ApiResponses; using Xunit; namespace FrameworkCoreTest.Api { public class DatacubeGetarticlesummaryTest : MockPostApiBaseTest { protected override DatacubeGetarticlesummaryRequest InitRequestObject() { return new DatacubeGetarticlesummaryRequest { AccessToken = "123", BeginDate = "2015-04-14", EndDate = "2015-04-16" }; } public override DatacubeGetArticlesResponse GetResponse() { return mock_client.Object.Execute(Request); } protected override string GetReturnResult(bool errResult) { if (errResult) return s_errmsg; return @"{ ""list"": [ { ""ref_date"": ""2014-12-08"", ""msgid"": ""10000050_1"", ""title"": ""12月27日 DiLi日报"", ""int_page_read_user"": 23676, ""int_page_read_count"": 25615, ""ori_page_read_user"": 29, ""ori_page_read_count"": 34, ""share_user"": 122, ""share_count"": 994, ""add_to_fav_user"": 1, ""add_to_fav_count"": 3 } //后续会列出该日期内所有被阅读过的文章(仅包括群发的文章)在当天的阅读次数等数据 ] }"; } } } ================================================ FILE: test/FrameworkCoreTest/Api/GetCurrentAutoreplyInfoTest.cs ================================================ using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using WX.Model.ApiRequests; using WX.Model.ApiResponses; using Xunit; namespace FrameworkCoreTest.Api { public class GetCurrentAutoreplyInfoTest : MockPostApiBaseTest { [Fact] public void MockCurrentAutoreplyInfoTest() { MockSetup(false); var response = mock_client.Object.Execute(Request); Assert.IsType(response); } protected override GetCurrentAutoreplyInfoRequest InitRequestObject() { return new GetCurrentAutoreplyInfoRequest { AccessToken = "123" }; } protected override string GetReturnResult(bool errResult) { if (errResult) return s_errmsg; return @"{ ""is_add_friend_reply_open"": 1, ""is_autoreply_open"": 1, ""add_friend_autoreply_info"": { ""type"": ""text"", ""content"": ""Thanks for your attention!"" }, ""message_default_autoreply_info"": { ""type"": ""text"", ""content"": ""Hello, this is autoreply!"" }, ""keyword_autoreply_info"": { ""list"": [ { ""rule_name"": ""autoreply-news"", ""create_time"": 1423028166, ""reply_mode"": ""reply_all"", ""keyword_list_info"": [ { ""type"": ""text"", ""match_mode"": ""contain"", ""content"": ""news测试""//此处content即为关键词内容 } ], ""reply_list_info"": [ { ""type"": ""news"", ""news_info"": { ""list"": [ { ""title"": ""it's news"", ""author"": ""jim"", ""digest"": ""it's digest"", ""show_cover"": 1, ""cover_url"": ""http://mmbiz.qpic.cn/mmbiz/GE7et87vE9vicuCibqXsX9GPPLuEtBfXfKbE8sWdt2DDcL0dMfQWJWTVn1N8DxI0gcRmrtqBOuwQHeuPKmFLK0ZQ/0"", ""content_url"": ""http://mp.weixin.qq.com/s?__biz=MjM5ODUwNTM3Ng==&mid=203929886&idx=1&sn=628f964cf0c6d84c026881b6959aea8b#rd"", ""source_url"": ""http://www.url.com"" } ] } }, { ""type"": ""news"", ""news_info"": { ""list"": [ { ""title"": ""MULTI_NEWS"", ""author"": ""JIMZHENG"", ""digest"": ""text"", ""show_cover"": 0, ""cover_url"": ""http://mmbiz.qpic.cn/mmbiz/GE7et87vE9vicuCibqXsX9GPPLuEtBfXfK0HKuBIa1A1cypS0uY1wickv70iaY1gf3I1DTszuJoS3lAVLvhTcm9sDA/0"", ""content_url"": ""http://mp.weixin.qq.com/s?__biz=MjM5ODUwNTM3Ng==&mid=204013432&idx=1&sn=80ce6d9abcb832237bf86c87e50fda15#rd"", ""source_url"": """" }, { ""title"": ""MULTI_NEWS4"", ""author"": ""JIMZHENG"", ""digest"": ""MULTI_NEWSMULTI_NEWSMULTI_NEWSMULTI_NEWSMULTI_NEWSMULT"", ""show_cover"": 1, ""cover_url"": ""http://mmbiz.qpic.cn/mmbiz/GE7et87vE9vicuCibqXsX9GPPLuEtBfXfKbE8sWdt2DDcL0dMfQWJWTVn1N8DxI0gcRmrtqBOuwQHeuPKmFLK0ZQ/0"", ""content_url"": ""http://mp.weixin.qq.com/s?__biz=MjM5ODUwNTM3Ng==&mid=204013432&idx=5&sn=b4ef73a915e7c2265e437096582774af#rd"", ""source_url"": """" } ] } } ] }, { ""rule_name"": ""autoreply-voice"", ""create_time"": 1423027971, ""reply_mode"": ""random_one"", ""keyword_list_info"": [ { ""type"": ""text"", ""match_mode"": ""contain"", ""content"": ""voice测试"" } ], ""reply_list_info"": [ { ""type"": ""voice"", ""content"": ""NESsxgHEvAcg3egJTtYj4uG1PTL6iPhratdWKDLAXYErhN6oEEfMdVyblWtBY5vp"" } ] }, { ""rule_name"": ""autoreply-text"", ""create_time"": 1423027926, ""reply_mode"": ""random_one"", ""keyword_list_info"": [ { ""type"": ""text"", ""match_mode"": ""contain"", ""content"": ""text测试"" } ], ""reply_list_info"": [ { ""type"": ""text"", ""content"": ""hello!text!"" } ] }, { ""rule_name"": ""autoreply-video"", ""create_time"": 1423027801, ""reply_mode"": ""random_one"", ""keyword_list_info"": [ { ""type"": ""text"", ""match_mode"": ""equal"", ""content"": ""video测试"" } ], ""reply_list_info"": [ { ""type"": ""video"", ""content"": ""http://61.182.133.153/vweixinp.tc.qq.com/1007_114bcede9a2244eeb5ab7f76d951df5f.f10.mp4?vkey=7183E5C952B16C3AB1991BA8138673DE1037CB82A29801A504B64A77F691BF9DF7AD054A9B7FE683&sha=0&save=1"" } ] } ] } }"; } } } ================================================ FILE: test/FrameworkCoreTest/Api/GetCurrentSelfmenuInfoTest.cs ================================================ using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using WX.Model.ApiRequests; using WX.Model.ApiResponses; using Xunit; namespace FrameworkCoreTest.Api { public class GetCurrentSelfmenuInfoTest : MockPostApiBaseTest { [Fact] public void GetCurrentSelfmenuTest() { MockSetup(false); var response = mock_client.Object.Execute(Request); Assert.IsType(response); //Console.WriteLine(response.IsError); } protected override GetCurrentSelfmenuInfoRequest InitRequestObject() { return new GetCurrentSelfmenuInfoRequest { AccessToken = "123" }; } protected override string GetReturnResult(bool errResult) { if (errResult) return s_errmsg; // return @"{ // ""is_menu_open"": 1, // ""selfmenu_info"": { // ""button"": [ // { // ""type"": ""click"", // ""name"": ""今日歌曲"", // ""key"": ""V1001_TODAY_MUSIC"" // }, // { // ""name"": ""菜单"", // ""sub_button"": { // ""list"": [ // { // ""type"": ""view"", // ""name"": ""搜索"", // ""url"": ""http://www.soso.com/"" // }, // { // ""type"": ""view"", // ""name"": ""视频"", // ""url"": ""http://v.qq.com/"" // }, // { // ""type"": ""click"", // ""name"": ""赞一下我们"", // ""key"": ""V1001_GOOD"" // } // ] // } // } // ] // } // }"; return @"{ ""is_menu_open"": 1, ""selfmenu_info"": { ""button"": [ { ""name"": ""button"", ""sub_button"": { ""list"": [ { ""type"": ""view"", ""name"": ""view_url"", ""url"": ""http://www.qq.com"" }, { ""type"": ""news"", ""name"": ""news"", ""news_info"": { ""list"": [ { ""title"": ""MULTI_NEWS"", ""author"": ""JIMZHENG"", ""digest"": ""text"", ""show_cover"": 0, ""cover_url"": ""http://mmbiz.qpic.cn/mmbiz/GE7et87vE9vicuCibqXsX9GPPLuEtBfXfK0HKuBIa1A1cypS0uY1wickv70iaY1gf3I1DTszuJoS3lAVLvhTcm9sDA/0"", ""content_url"": ""http://mp.weixin.qq.com/s?__biz=MjM5ODUwNTM3Ng==&mid=204013432&idx=1&sn=80ce6d9abcb832237bf86c87e50fda15#rd"", ""source_url"": """" }, { ""title"": ""MULTI_NEWS1"", ""author"": ""JIMZHENG"", ""digest"": ""MULTI_NEWS1"", ""show_cover"": 1, ""cover_url"": ""http://mmbiz.qpic.cn/mmbiz/GE7et87vE9vicuCibqXsX9GPPLuEtBfXfKnmnpXYgWmQD5gXUrEApIYBCgvh2yHsu3ic3anDUGtUCHwjiaEC5bicd7A/0"", ""content_url"": ""http://mp.weixin.qq.com/s?__biz=MjM5ODUwNTM3Ng==&mid=204013432&idx=2&sn=8226843afb14ecdecb08d9ce46bc1d37#rd"", ""source_url"": """" } ] } }, { ""type"": ""video"", ""name"": ""video"", ""value"": ""http://61.182.130.30/vweixinp.tc.qq.com/1007_114bcede9a2244eeb5ab7f76d951df5f.f10.mp4?vkey=77A42D0C2015FBB0A3653D29C571B5F4BBF1D243FBEF17F09C24FF1F2F22E30881BD350E360BC53F&sha=0&save=1"" }, { ""type"": ""voice"", ""name"": ""voice"", ""value"": ""nTXe3aghlQ4XYHa0AQPWiQQbFW9RVtaYTLPC1PCQx11qc9UB6CiUPFjdkeEtJicn"" } ] } }, { ""type"": ""text"", ""name"": ""text"", ""value"": ""This is text!"" }, { ""type"": ""img"", ""name"": ""photo"", ""value"": ""ax5Whs5dsoomJLEppAvftBUuH7CgXCZGFbFJifmbUjnQk_ierMHY99Y5d2Cv14RD"" } ] } }"; } } } ================================================ FILE: test/FrameworkCoreTest/Api/GroupCreateTest.cs ================================================ using Moq; using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using WX.Framework; using WX.Model; using WX.Model.ApiRequests; using WX.Model.ApiResponses; using Xunit; namespace FrameworkCoreTest { public class GroupCreateTest : MockPostApiBaseTest { [Fact] public void MockGroupCreateTest() { MockSetup(false); var response = mock_client.Object.Execute(Request); Console.WriteLine(response); } [Fact] public void MockGroupCreateErrorTest() { MockSetup(true); var response = mock_client.Object.Execute(Request); Console.WriteLine(response); } protected override string GetReturnResult(bool errResult) { if (!errResult) { return @"{ ""group"": { ""id"": 0, ""name"": ""未分组"", ""count"": 72596 } }"; } else { return "{\"errcode\":40013,\"errmsg\":\"invalid appid\"}"; } } protected override GroupsCreateRequest InitRequestObject() { return new GroupsCreateRequest { AccessToken = "123", Group = new Group { Name = "test" } }; } } } ================================================ FILE: test/FrameworkCoreTest/Api/GroupsGetIdTest.cs ================================================ using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using WX.Model.ApiRequests; using WX.Model.ApiResponses; using Xunit; namespace FrameworkCoreTest { public class GroupsGetIdTest : MockPostApiBaseTest { private static string m_openId = "oI1_vjirqEuoDttmL-eRcsO-G9to"; [Fact] public void MockGroupsGetIdTest() { MockSetup(false); Console.WriteLine(mock_client.Object.Execute(Request)); } [Fact] public void MockGroupsGetIdErrorTest() { MockSetup(true); Console.WriteLine(mock_client.Object.Execute(Request)); } protected override string GetReturnResult(bool errResult) { if (errResult) { return "{\"errcode\":40003,\"errmsg\":\"invalid openid\"}"; } else { return @"{ ""groupid"": 102 }"; } } protected override GroupsGetIdRequest InitRequestObject() { return new GroupsGetIdRequest { AccessToken = "123", OpenId = m_openId }; } } } ================================================ FILE: test/FrameworkCoreTest/Api/GroupsMembersUpdateTest.cs ================================================ using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using WX.Model.ApiRequests; using WX.Model.ApiResponses; using Xunit; namespace FrameworkCoreTest { public class GroupsMembersUpdateTest : MockPostApiBaseTest { [Fact] public void GroupsMembersUpdateJsonTest() { Console.WriteLine(Request.GetPostContent()); } [Fact] public void MockGroupsMemberUpdateTest() { MockSetup(false); var response = mock_client.Object.Execute(Request); Assert.Equal(0, response.ErrorCode); Assert.Equal("ok", response.ErrorMessage); Assert.Equal(false, response.IsError); } [Fact] public void MockGroupsMemberUpdateErrorTest() { MockSetup(true); var response = mock_client.Object.Execute(Request); Assert.Equal(40013, response.ErrorCode); Assert.Equal("invalid appid", response.ErrorMessage); Assert.Equal(true, response.IsError); } protected override GroupsMembersUpdateRequest InitRequestObject() { return new GroupsMembersUpdateRequest { AccessToken = "123", OpenId = "test_openid", ToGroupId = 100 }; } protected override string GetReturnResult(bool errResult) { if (errResult) return "{\"errcode\":40013,\"errmsg\":\"invalid appid\"}"; return "{\"errcode\": 0, \"errmsg\": \"ok\"}"; } } } ================================================ FILE: test/FrameworkCoreTest/Api/GroupsQueryTest.cs ================================================ using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using WX.Framework; using WX.Model.ApiRequests; using WX.Model.Exceptions; using Xunit; namespace FrameworkCoreTest { public class GroupsQueryTest : BaseTest { [Fact] public void GroupsQueryTestNoToken() { var request = new GroupsQueryRequest(); Assert.Throws(() => { m_client.Execute(request); }); } [Fact] public void MockGroupsQueryTest() { var request = new GroupsQueryRequest() { AccessToken = "asdf" }; var doresult = @"{ ""groups"": [ { ""id"": 0, ""name"": ""未分组"", ""count"": 72596 }, { ""id"": 1, ""name"": ""黑名单"", ""count"": 36 }, { ""id"": 2, ""name"": ""星标组"", ""count"": 8 }, { ""id"": 104, ""name"": ""华东媒"", ""count"": 4 }, { ""id"": 106, ""name"": ""★不测试组★"", ""count"": 1 } ] }"; mock_client.Setup(d => d.DoExecute(request)).Returns(doresult); var response = mock_client.Object.Execute(request); foreach (var group in response.Groups) { Console.WriteLine("id:{0}, name:{1}, count:{2}", group.ID, group.Name, group.Count); } } [Fact] public void GrousQueryTest() { //ApiAccessTokenManager.Instance.SetAppIdentity(m_appIdentity); var token = GetCurrentToken(); var request = new GroupsQueryRequest() { AccessToken = token }; var response = m_client.Execute(request); if (!response.IsError) { foreach (var group in response.Groups) { Console.WriteLine("id:{0}, name:{1}, count:{2}", group.ID, group.Name, group.Count); } } else { Console.WriteLine(response.ErrorCode + ", " + response.ErrorMessage); } } } } ================================================ FILE: test/FrameworkCoreTest/Api/GroupsUpdateTest.cs ================================================ using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using WX.Model.ApiRequests; using WX.Model.ApiResponses; using Xunit; namespace FrameworkCoreTest { public class GroupsUpdateTest : MockPostApiBaseTest { [Fact] public void GroupsUpdateRequestJsonTest() { Console.WriteLine(Request.GetPostContent()); } [Fact] public void MockGroupsUpdateTest() { MockSetup(false); var response = mock_client.Object.Execute(Request); Assert.Equal(0, response.ErrorCode); Assert.Equal("ok", response.ErrorMessage); } [Fact] public void MockGroupsUpdateError() { MockSetup(true); var response = mock_client.Object.Execute(Request); Assert.Equal(40013, response.ErrorCode); } protected override GroupsUpdateRequest InitRequestObject() { return new GroupsUpdateRequest { AccessToken = "123", Group = new WX.Model.Group { Name = "testupdate", ID = 100 } }; } protected override string GetReturnResult(bool errResult) { if (errResult) return "{\"errcode\":40013,\"errmsg\":\"invalid appid\"}"; return "{\"errcode\": 0, \"errmsg\": \"ok\"}"; } } } ================================================ FILE: test/FrameworkCoreTest/Api/MediaGetTest.cs ================================================ using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using WX.Model.ApiRequests; using WX.Model.ApiResponses; using Xunit; namespace FrameworkCoreTest { public class MediaGetTest : MockPostApiBaseTest { [Fact] public void MockMediaGetTest() { IsMock = true; MockSetup(false); var response = mock_client.Object.Execute(Request); Console.WriteLine(response); } [Fact] public void MockMediaGetErrorTest() { IsMock = true; MockSetup(true); var response = mock_client.Object.Execute(Request); Assert.Equal(true, response.IsError); Assert.Equal(40004, response.ErrorCode); } [Fact] public void ReallyMediaGetTest() { IsMock = false; var response = m_client.Execute(Request); Console.WriteLine(response); } protected override MediaGetRequest InitRequestObject() { return new MediaGetRequest { AccessToken = GetCurrentToken(), MediaId = "iofROOOriAPeiX6zeMG4rt2LKGWgav7kPKNZKxXqhc7l4BYCNx_JLWQyUfKqzR_i" }; } protected override string GetReturnResult(bool errResult) { if (errResult) return "{\"errcode\":40004,\"errmsg\":\"invalid media type\"}"; return "200"; } } } ================================================ FILE: test/FrameworkCoreTest/Api/MediaUploadNewsTest.cs ================================================ using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using WX.Api; using WX.Model.ApiResponses; using WX.Model.ApiRequests; using WX.Model; using Xunit; namespace FrameworkCoreTest { public class MediaUploadNewsTest : MockPostApiBaseTest { [Fact] public void MediaUploadNewsPostContentTest() { Console.WriteLine(Request.GetPostContent()); } [Fact] public void MockMediaUploadNewsTest() { MockSetup(false); var response = mock_client.Object.Execute(Request); Assert.Equal("news", response.Type); Assert.Equal(1391857799, response.CreatedAt); } [Fact] public void MockMediaUploadNewsErrorTest() { MockSetup(true); var response = mock_client.Object.Execute(Request); Assert.Equal(true, response.IsError); Console.WriteLine(response); } protected override MediaUploadNewsRequest InitRequestObject() { return new MediaUploadNewsRequest { AccessToken = "123", Articles = new List() { new ArticleMessage{ ThumbMediaId = "image1", Author = "jamesying", Title = "test news 1", Url= "newsurl1", Content = "content1", Description = "discription1" }, new ArticleMessage{ ThumbMediaId = "image2", Author = "jamesying", Title = "test news 2", Url= "newsurl2", Content = "content2", Description = "discription2" } } }; } protected override string GetReturnResult(bool errResult) { if (errResult) return "{\"errcode\":40018,\"errmsg\":\"invalid button name size\"}"; return @"{ ""type"":""news"", ""media_id"":""CsEf3ldqkAYJAU6EJeIkStVDSvffUJ54vqbThMgplD-VJXXof6ctX5fI6-aYyUiQ"", ""created_at"":1391857799 }"; } } } ================================================ FILE: test/FrameworkCoreTest/Api/MediaUploadTest.cs ================================================ using System; using System.Collections.Generic; using System.Collections.Specialized; using System.IO; using System.Linq; using System.Net; using System.Text; using System.Threading.Tasks; using WX.Common; using WX.Model; using WX.Model.ApiRequests; using WX.Model.ApiResponses; using Xunit; namespace FrameworkCoreTest { public class MediaUploadTest : MockPostApiBaseTest { [Fact] public void MediaUploadReallyTest() { var response = m_client.Execute(Request); if (response.IsError) Console.WriteLine(response.ToString()); Console.WriteLine(response.MediaId); } [Fact] public void MockMediaUploadTest() { IsMock = true; MockSetup(false); var response = mock_client.Object.Execute(Request); Assert.Equal("MEDIA_ID", response.MediaId); } [Fact] public void MockMediaUploadErrorTest() { IsMock = true; MockSetup(true); var response = mock_client.Object.Execute(Request); Assert.Equal(true, response.IsError); } protected override MediaUploadRequest InitRequestObject() { return new MediaUploadRequest { AccessToken = GetCurrentToken(), FilePath = @"C:\Users\JamesYing\Desktop\123.amr", MediaType = MediaType.Voice }; } protected override string GetReturnResult(bool errResult) { if (errResult) return s_errmsg; return "{\"type\":\"Image\",\"media_id\":\"MEDIA_ID\",\"created_at\":123456789}"; } } } ================================================ FILE: test/FrameworkCoreTest/Api/MenuCreateTest.cs ================================================ using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using Xunit; using WX.Model.ApiRequests; using WX.Model.ApiResponses; using WX.Model; using WX.Framework; namespace FrameworkCoreTest { public class MenuCreateTest : MockPostApiBaseTest { [Fact] public void MenuCreatePostContentTest() { Console.WriteLine(Request.GetPostContent()); } [Fact] public void MockMenuCreateTest() { MockSetup(false); var response = mock_client.Object.Execute(Request); Assert.Equal(false, response.IsError); Assert.Equal("ok", response.ErrorMessage); } [Fact] public void MockMenuCreateErrorTest() { MockSetup(true); var response = mock_client.Object.Execute(Request); Assert.Equal(true, response.IsError); } [Fact] public void ReallyMenuCreateTest() { var request = new MenuCreateRequest { AccessToken = GetCurrentToken(), Buttons = new List { new ClickButton{ Name = "博客", Url = "http://inday.cnblogs.com", Type = ClickButtonType.view }, new ClickButton{ Name = "文章", SubButton = new List{ new ClickButton{ Name = "推荐", Url = "http://www.cnblogs.com", Type = ClickButtonType.view }, new ClickButton { Name = "精华", Url = "http://www.cnblogs.com/pick/", Type = ClickButtonType.view } } }, new ClickButton{ Name = "新闻", Url="http://www.cnblogs.com/news/", Type = ClickButtonType.view }, } }; var response = m_client.Execute(request); if (response.IsError) { Console.WriteLine(response); } else { Assert.Equal(false, response.IsError); Assert.Equal("ok", response.ErrorMessage); } } protected override MenuCreateRequest InitRequestObject() { return new MenuCreateRequest { AccessToken = GetCurrentToken(), Buttons = new List { new ClickButton{ Name = "博客", Url = "http://inday.cnblogs.com", Type = ClickButtonType.view }, new ClickButton{ Name = "文章", SubButton = new List{ new ClickButton{ Name = "推荐", Url = "http://www.cnblogs.com", Type = ClickButtonType.view }, new ClickButton { Name = "精华", Url = "http://www.cnblogs.com/pick/", Type = ClickButtonType.view } } }, new ClickButton{ Name = "新闻", Url="http://www.cnblogs.com/news/", Type = ClickButtonType.view }, } }; } protected override string GetReturnResult(bool errResult) { if (errResult) return "{\"errcode\":40018,\"errmsg\":\"invalid button name size\"}"; return "{\"errcode\":0,\"errmsg\":\"ok\"}"; } } } ================================================ FILE: test/FrameworkCoreTest/Api/MenuGetTest.cs ================================================ using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using WX.Model.ApiRequests; using WX.Model.ApiResponses; using Xunit; namespace FrameworkCoreTest { public class MenuGetTest : MockPostApiBaseTest { [Fact] public void MockMenuGetTest() { MockSetup(false); var response = mock_client.Object.Execute(Request); Assert.Equal(false, response.IsError); foreach (var button in response.Menu.Buttons) { Console.WriteLine(button.Name); foreach (var sub in button.SubButton) { Console.WriteLine("sub : " + sub.Name); } } } protected override MenuGetRequest InitRequestObject() { return new MenuGetRequest { AccessToken = "123" }; } protected override string GetReturnResult(bool errResult) { if (errResult) { return "{\"errcode\":40018,\"errmsg\":\"invalid button name size\"}"; } return @"{""menu"":{""button"":[{""type"":""click"",""name"":""今日歌曲"",""key"":""V1001_TODAY_MUSIC"",""sub_button"":[]},{""type"":""click"",""name"":""歌手简介"",""key"":""V1001_TODAY_SINGER"",""sub_button"":[]},{""name"":""菜单"",""sub_button"":[{""type"":""view"",""name"":""搜索"",""url"":""http://www.soso.com/"",""sub_button"":[]},{""type"":""view"",""name"":""视频"",""url"":""http://v.qq.com/"",""sub_button"":[]},{""type"":""click"",""name"":""赞一下我们"",""key"":""V1001_GOOD"",""sub_button"":[]}]}]}}"; } } } ================================================ FILE: test/FrameworkCoreTest/Api/MessageCustomSendRequestTest.cs ================================================ using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using Xunit; using WX.Api; using WX.Model; using WX.Model.ApiRequests; using WX.Model.ApiResponses; namespace FrameworkCoreTest { public class MessageCustomSendRequestTest : MockPostApiBaseTest { [Fact] public void SendRequestTest() { var textRequest = new MessageCustomSendTextRequest { AccessToken = "123", ToUser = "james", Text = new TextMessage { Content = "test content" } }; var imageRequest = new MessageCustomSendImageRequest { ToUser = "james", Image = new ImageMessage { MediaId = "image_media_id" } }; var voiceRequest = new MessageCustomSendVoiceRequest { ToUser = "james", Voice = new VoiceMessage { MediaId = "voice_media_id" } }; var videoRequest = new MessageCustomSendVideoRequest { ToUser = "james", Video = new VideoMessage { MediaId = "video_media_id", Title = "video test title" } }; var musicRequest = new MessageCustomSendMusicRequest { ToUser = "james", Music = new MusicMessage { Title = "test music title", HQMusicUrl = "hqmusicurl", MusicUrl = "musicurl", ThumbMediaId = "media_id" } }; var newsRequest = new MessageCustomSendNewsRequest { ToUser = "james", News = new NewsMessage { Articles = new List { new NewsArticleMessage{ Title = "Happy Day", Description = "Is Really A Happy Day", Url = "url1", PicUrl = "picurl1" }, new NewsArticleMessage { Title = "Happy Day", Description = "Is Really A Happy Day", Url = "url2", PicUrl = "picurl2" } } } }; Console.WriteLine(textRequest.GetPostContent()); Console.WriteLine(imageRequest.GetPostContent()); Console.WriteLine(voiceRequest.GetPostContent()); Console.WriteLine(videoRequest.GetPostContent()); Console.WriteLine(musicRequest.GetPostContent()); Console.WriteLine(newsRequest.GetPostContent()); } [Fact] public void ReallyMessageCustomSendTextTest() { var request = new MessageCustomSendTextRequest { AccessToken = GetCurrentToken(), ToUser = "oI1_vjirqEuoDttmL-eRcsO-G9to", Text = new TextMessage { Content = "hello james1123" } }; var response = m_client.Execute(request); if (response.IsError) { Console.WriteLine(response); } else { Console.WriteLine("send is ok"); } } [Fact] public void ReallyMessageCustomSendNewsTest() { var request = new MessageCustomSendNewsRequest { AccessToken = GetCurrentToken(), ToUser = "oI1_vjirqEuoDttmL-eRcsO-G9to", News = new NewsMessage { Articles = new List { new NewsArticleMessage{ Title = "博客园", Description = "博客园,技术改变人生", Url = "http://inday.cnblogs.com", PicUrl = "http://static.cnblogs.com/images/logo_small.gif" }, new NewsArticleMessage{ Title = "博客园", Description = "博客园,技术改变人生", Url = "http://inday.cnblogs.com", PicUrl = "http://static.cnblogs.com/images/logo_small.gif" } } } }; var response = m_client.Execute(request); if (response.IsError) { Console.WriteLine(response); } else { Console.WriteLine("send is ok"); } } protected override MessageCustomSendRequest InitRequestObject() { throw new NotImplementedException(); } protected override string GetReturnResult(bool errResult) { throw new NotImplementedException(); } } } ================================================ FILE: test/FrameworkCoreTest/Api/MockGetcallbackipTestTest.cs ================================================ using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using WX.Model.ApiRequests; using WX.Model.ApiResponses; using Xunit; namespace FrameworkCoreTest { public class MockGetcallbackipTestTest : MockPostApiBaseTest { [Fact] public void MockCallbackiptest() { MockSetup(false); var response = mock_client.Object.Execute(Request); Assert.Equal(2, response.IPList.Count()); foreach (var ip in response.IPList) { Console.WriteLine(ip); } } protected override GetcallbackipRequest InitRequestObject() { return new GetcallbackipRequest() { AccessToken = "123" }; } protected override string GetReturnResult(bool errResult) { if (errResult) return s_errmsg; return "{\"ip_list\":[\"127.0.0.1\",\"127.0.0.1\"]}"; } } } ================================================ FILE: test/FrameworkCoreTest/Api/MockPostApiBaseTest.cs ================================================ using Newtonsoft.Json; using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using WX.Model.ApiRequests; using WX.Model.ApiResponses; using Xunit; namespace FrameworkCoreTest { public abstract class MockPostApiBaseTest : BaseTest where TRequest : ApiRequest where TResponse : ApiResponse { protected static string s_errmsg = "{\"errcode\":40007,\"errmsg\":\"invalid media_id\"}"; protected static string s_successmsg = "{\"errcode\":0,\"errmsg\":\"success\"}"; private TRequest m_request = null; public TRequest Request { get { if (m_request == null) { m_request = InitRequestObject(); m_request.Logger = new Logger(); } return m_request; } } protected abstract TRequest InitRequestObject(); protected bool IsMock { get; set; } public void MockSetup(bool errResult) { mock_client.Setup(d => d.DoExecute(Request)).Returns(GetReturnResult(errResult)); } protected abstract string GetReturnResult(bool errResult); public override string GetCurrentToken() { if (IsMock) return "123"; return base.GetCurrentToken(); } [Fact] public virtual void MockGetPostContent() { Console.WriteLine(Request.GetPostContent()); } [Fact] public virtual void MockResponseTypeTest() { MockSetup(false); var response = GetResponse(); Assert.IsType(response); var pro = response.GetType().GetProperties(); foreach (var p in pro) { Console.WriteLine("{0}:{1}", p.Name, JsonConvert.SerializeObject(p.GetValue(response))); } } public virtual TResponse GetResponse() { throw new NotImplementedException(); } protected string JsonSerialize(object obj) { return JsonConvert.SerializeObject(obj); } } } ================================================ FILE: test/FrameworkCoreTest/Api/OAuthAccessTokenTest.cs ================================================ using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using WX.Model.ApiRequests; using WX.Model.ApiResponses; using Xunit; namespace FrameworkCoreTest { public class OAuthAccessTokenTest : MockPostApiBaseTest { [Fact] public void MockSnsOAuthAccessTokenTest() { MockSetup(false); var response = mock_client.Object.Execute(Request); Assert.Equal("ACCESS_TOKEN", response.AccessToken); Assert.Equal(7200, response.ExpiresIn); Assert.Equal("OPENID", response.OpenId); Assert.Equal("REFRESH_TOKEN", response.RefreshToken); Assert.Equal("SCOPE", response.Scope); } [Fact] public void MockSnsOAuthAccessTokenErrorTest() { MockSetup(true); var response = mock_client.Object.Execute(Request); Console.WriteLine(response); } protected override SnsOAuthAccessTokenRequest InitRequestObject() { return new SnsOAuthAccessTokenRequest { AppID = "AppID", AppSecret = "SECRET", Code = "CODE" }; } protected override string GetReturnResult(bool errResult) { if (errResult) { return "{\"errcode\":40029,\"errmsg\":\"invalid code\"}"; } return @"{ ""access_token"":""ACCESS_TOKEN"", ""expires_in"":7200, ""refresh_token"":""REFRESH_TOKEN"", ""openid"":""OPENID"", ""scope"":""SCOPE"" }"; } } } ================================================ FILE: test/FrameworkCoreTest/Api/OAuthManagerTest.cs ================================================ using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using WX.OAuth; using Xunit; namespace FrameworkCoreTest { public class OAuthManagerTest { [Fact] public void BuildOAuthUrlScopeBaseTest() { var oauth = new OAuthHelper("wx7fc05579394bd02c"); Console.WriteLine(oauth.BuildOAuthUrl("http://wx.taogame.com/OAuth2Demo.aspx", WX.Model.OAuthScope.Base, "")); } [Fact] public void BuildOAuthUrlScopeUserInfoTest() { var oauth = new OAuthHelper("wx7fc05579394bd02c"); Console.WriteLine(oauth.BuildOAuthUrl("http://wx.taogame.com/OAuth2Demo.aspx", WX.Model.OAuthScope.UserInfo, "123123")); } } } ================================================ FILE: test/FrameworkCoreTest/Api/OAuthRefreshTokenTest.cs ================================================ using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using WX.Model.ApiRequests; using WX.Model.ApiResponses; using Xunit; namespace FrameworkCoreTest { public class OAuthRefreshTokenTest : MockPostApiBaseTest { [Fact] public void MockSnsOAuthRefreshTokenTest() { MockSetup(false); var response = mock_client.Object.Execute(Request); Assert.Equal("ACCESS_TOKEN", response.AccessToken); Assert.Equal(7200, response.ExpiresIn); Assert.Equal("OPENID", response.OpenId); Assert.Equal("REFRESH_TOKEN", response.RefreshToken); Assert.Equal("SCOPE", response.Scope); } [Fact] public void MockSnsOAuthRefreshTokenErrorTest() { MockSetup(true); var response = mock_client.Object.Execute(Request); Console.WriteLine(response); } protected override SnsOauthRefreshTokenRequest InitRequestObject() { return new SnsOauthRefreshTokenRequest { AppID = "APPID", RefreshToken = "REFRESH_TOKEN" }; } protected override string GetReturnResult(bool errResult) { if (errResult) { return "{\"errcode\":40029,\"errmsg\":\"invalid code\"}"; } return @"{ ""access_token"":""ACCESS_TOKEN"", ""expires_in"":7200, ""refresh_token"":""REFRESH_TOKEN"", ""openid"":""OPENID"", ""scope"":""SCOPE"" }"; } } } ================================================ FILE: test/FrameworkCoreTest/Api/QrCreatedRequestTestTest.cs ================================================ using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using WX.Model.ApiRequests; using WX.Model.ApiResponses; using Xunit; namespace FrameworkCoreTest { public class QrCreatedRequestTestTest : MockPostApiBaseTest { protected override QrcodeCreateRequest InitRequestObject() { return new QrcodeCreateRequest { AccessToken = "123", ActionInfo = new ActionInfo { Scene = new Scene { SceneId = 1234 } }, ActionName = ActionName.QR_LIMIT_SCENE, ExpireSeconds = 1000 }; } protected override string GetReturnResult(bool errResult) { if (errResult) return s_errmsg; throw new NotImplementedException(); } } } ================================================ FILE: test/FrameworkCoreTest/Api/RequestMessageTest.cs ================================================ using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Xml.Linq; using WX.Model; using Xunit; namespace FrameworkCoreTest { public class RequestMessageTest { [Fact] public void VoiceRequestMessageTest() { var xml = @" 1400120855 6013473282672558080 "; var doc = XDocument.Parse(xml); var midder = new MiddleMessage(doc.Element("xml")); var request = midder.RequestMessage as RequestVoiceMessage; if (request != null) { Console.WriteLine(request.Recognition); } } } } ================================================ FILE: test/FrameworkCoreTest/Api/ResponseMessageTest.cs ================================================ using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using WX.Model; using Xunit; namespace FrameworkCoreTest { public class ResponseMessageTest { [Fact] public void ResponseImageMessageTest() { var response = new ResponseImageMessage { FromUserName = "james", ToUserName = "ying", CreateTime = 123123, Image = new ImageMessage { MediaId = "123" } }; Console.WriteLine(response.Serializable()); } [Fact] public void ResponseVoiceMessageTest() { var response = new ResponseVoiceMessage { FromUserName = "jamesying", ToUserName = "ying", CreateTime = 123123, Voice = new VoiceMessage { MediaId = "123123" } }; Console.WriteLine(response.Serializable()); } [Fact] public void ResponseVideoMessageTest() { var response = new ResponseVideoMessage { FromUserName = "jamesying", ToUserName = "ying", CreateTime = 123123, Video = new VideoMessage { MediaId = "123123", Description = "123123", Title = "123123" } }; Console.WriteLine(response.Serializable()); } [Fact] public void ResponseMusicMessageTest() { var response = new ResponseMusicMessage { FromUserName = "jamesying", ToUserName = "ying", CreateTime = 123123, Music = new MusicMessage { MusicUrl = "asdfasdf", HQMusicUrl = "asdfasdf", ThumbMediaId = "asdfasdf", Description = "123123", Title = "123123" } }; Console.WriteLine(response.Serializable()); } [Fact] public void ResponseNewsMessageTest() { var response = new ResponseNewsMessage { FromUserName = "jamesying", ToUserName = "ying", ArticleCount = 1, Articles = new List { new ArticleMessage{ Author = "james", Url = "http://www.test.com", ThumbMediaId = "http://123123123.com", Content = "test content", PicUrl = "aljslkdjflkasdf", Description = "askdlfkjasdf", Title = "test title" }, } }; Console.WriteLine(response.Serializable()); } } } ================================================ FILE: test/FrameworkCoreTest/Api/SNSUserInfoTest.cs ================================================ using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using WX.Model; using WX.Model.ApiRequests; using WX.Model.ApiResponses; using Xunit; namespace FrameworkCoreTest { public class SNSUserInfoTest : MockPostApiBaseTest { [Fact] public void MockSNSUserInfoTest() { MockSetup(false); var response = mock_client.Object.Execute(Request); Assert.Equal("NICKNAME", response.NickName); Assert.Equal("1", response.Sex); Assert.Equal(2, response.Privilege.Count()); } [Fact] public void MockSNSUserInfoErrorTest() { MockSetup(true); var response = mock_client.Object.Execute(Request); Console.WriteLine(response); } protected override SnsUserInfoRequest InitRequestObject() { return new SnsUserInfoRequest { Lang = Language.CN, OAuthToken = "ACCESS_TOKEN", OpenId = "OPENID" }; } protected override string GetReturnResult(bool errResult) { if (errResult) return "{\"errcode\":40003,\"errmsg\":\" invalid openid \"}"; return @"{ ""openid"":"" OPENID"", ""nickname"": ""NICKNAME"", ""sex"":""1"", ""province"":""PROVINCE"", ""city"":""CITY"", ""country"":""COUNTRY"", ""headimgurl"":""http://wx.qlogo.cn/mmopen/g3MonUZtNHkdmzicIlibx6iaFqAc56vxLSUfpb6n5WKSYVY0ChQKkiaJSgQ1dZuTOgvLLrhJbERQQ4eMsv84eavHiaiceqxibJxCfHe/46"", ""privilege"":[ ""PRIVILEGE1"", ""PRIVILEGE2"" ] }"; } } } ================================================ FILE: test/FrameworkCoreTest/Api/ShorturlRequestTestTest.cs ================================================ using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using WX.Model.ApiRequests; using WX.Model.ApiResponses; using Xunit; namespace FrameworkCoreTest { public class ShorturlRequestTestTest : MockPostApiBaseTest { protected override ShorturlRequest InitRequestObject() { return new ShorturlRequest { AccessToken = "123", Action = ConvertType.Long2Short, Url = "http://www.jamesying.com" }; } protected override string GetReturnResult(bool errResult) { if (errResult) return s_errmsg; return "{\"errcode\":0,\"errmsg\":\"ok\",\"short_url\":\"http:\\/\\/w.url.cn\\/s\\/AvCo6Ih\"}"; } } } ================================================ FILE: test/FrameworkCoreTest/Api/UserGetTest.cs ================================================ using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using Xunit; using WX.Model.ApiResponses; using WX.Model.ApiRequests; using WX.Framework; namespace FrameworkCoreTest { public class UserGetTest : MockPostApiBaseTest { [Fact] public void MockUserGetTest() { MockSetup(false); var response = mock_client.Object.Execute(Request); Assert.Equal(2, response.Total); Assert.Equal(2, response.Count); Assert.Equal(2, response.Data.OpenIds.Length); Assert.Equal("NEXT_OPENID", response.NextOpenId); } [Fact] public void MockUserGetErrorTest() { MockSetup(true); var response = mock_client.Object.Execute(Request); Assert.Equal(40013, response.ErrorCode); } [Fact] public void ReallyUserGetTest() { var request = new UserGetRequest { AccessToken = GetCurrentToken(), NextOpenId = "oI1_vjreLbQfGy79Thnsh4ziJZNo" }; var response = m_client.Execute(request); if (!response.IsError) { foreach (var user in response.Data.OpenIds) { Console.WriteLine(user); } } } protected override UserGetRequest InitRequestObject() { return new UserGetRequest { AccessToken = GetCurrentToken(), NextOpenId = "" }; } protected override string GetReturnResult(bool errResult) { if (errResult) { return "{\"errcode\":40013,\"errmsg\":\"invalid appid\"}"; } return "{\"total\":2,\"count\":2,\"data\":{\"openid\":[\"OPENID1\",\"OPENID2\"]},\"next_openid\":\"NEXT_OPENID\"}"; } } } ================================================ FILE: test/FrameworkCoreTest/Api/UserInfoTest.cs ================================================ using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using WX.Model.ApiRequests; using WX.Model.ApiResponses; using Xunit; namespace FrameworkCoreTest { public class UserInfoTest : MockPostApiBaseTest { [Fact] public void MockUserInfoTest() { MockSetup(false); var response = mock_client.Object.Execute(Request); Assert.Equal(false, response.IsError); Assert.Equal("o6_bmjrPTlm6_2sgVt7hMZOPfL2M", response.OpenId); Assert.Equal("广州", response.City); Assert.Equal("o6_bmasdasdsad6_2sgVt7hMZOPfL", response.UnionID); } [Fact] public void MockUserInfoErrorTest() { MockSetup(true); var response = mock_client.Object.Execute(Request); Assert.Equal(true, response.IsError); Console.WriteLine(response); } protected override UserInfoRequest InitRequestObject() { return new UserInfoRequest { AccessToken = "asdf", Lang = "zh_cn", OpenId = "asdf" }; } protected override string GetReturnResult(bool errResult) { if (errResult) return "{\"errcode\":40013,\"errmsg\":\"invalid appid\"}"; return @"{ ""subscribe"": 1, ""openid"": ""o6_bmjrPTlm6_2sgVt7hMZOPfL2M"", ""nickname"": ""Band"", ""sex"": 1, ""language"": ""zh_CN"", ""city"": ""广州"", ""province"": ""广东"", ""country"": ""中国"", ""headimgurl"": ""http://wx.qlogo.cn/mmopen/g3MonUZtNHkdmzicIlibx6iaFqAc56vxLSUfpb6n5WKSYVY0ChQKkiaJSgQ1dZuTOgvLLrhJbERQQ4eMsv84eavHiaiceqxibJxCfHe/0"", ""subscribe_time"": 1382694957, ""unionid"": ""o6_bmasdasdsad6_2sgVt7hMZOPfL"" }"; } } } ================================================ FILE: test/FrameworkCoreTest/App.config ================================================  ================================================ FILE: test/FrameworkCoreTest/BaseTest.cs ================================================ using Moq; using System; using System.Collections.Generic; using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; using WX.Api; using WX.Framework; using WX.Logger; using WX.Model; namespace FrameworkCoreTest { public abstract class BaseTest { private static string tokenfile = "token.txt"; static BaseTest() { //ApiAccessTokenManager.Instance.SetAppIdentity(m_appIdentity); } protected IApiClient m_client = new DefaultApiClient(); protected Mock mock_client = new Mock(); // protected Mock mock_logger = new Mock(); public virtual string GetCurrentToken() { if (File.Exists(tokenfile)) { var strs = File.ReadAllText(tokenfile, Encoding.UTF8); var splitstrs = strs.Split(new char[] { '|' }); var token = splitstrs[0]; var expirtime = DateTime.Parse(splitstrs[1]); if (expirtime <= DateTime.Now) { return GetToken(); } return token; } else { return GetToken(); } } private string GetToken() { var token = ApiAccessTokenManager.Instance.GetCurrentToken(); var expirtime = ApiAccessTokenManager.Instance.ExpireTime; File.WriteAllText(tokenfile, token + "|" + expirtime.ToString(), Encoding.UTF8); return token; } } } ================================================ FILE: test/FrameworkCoreTest/CustomserviceKfsessionGetsessionlistTest.cs ================================================ using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using WX.Model.ApiRequests; using WX.Model.ApiResponses; using Xunit; namespace FrameworkCoreTest { public class CustomserviceKfsessionGetsessionlistTest : MockPostApiBaseTest { protected override CustomserviceKfsessionGetsessionlistRequest InitRequestObject() { return new CustomserviceKfsessionGetsessionlistRequest { KfAccount = "test.123@.com", AccessToken = "123" }; } protected override string GetReturnResult(bool errResult) { if (errResult) return s_errmsg; return @" { ""sessionlist"" : [ { ""createtime"" : 123456789, ""openid"" : ""OPENID"" }, { ""createtime"" : 123456789, ""openid"" : ""OPENID"" } ] }"; } public override CustomserviceKfsessionGetsessionlistResponse GetResponse() { return mock_client.Object.Execute(Request); } } } ================================================ FILE: test/FrameworkCoreTest/CustomserviceKfsessionGetwaitcaseTest.cs ================================================ using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using WX.Model.ApiRequests; using WX.Model.ApiResponses; using Xunit; namespace FrameworkCoreTest { public class CustomserviceKfsessionGetwaitcaseTest : MockPostApiBaseTest { protected override CustomserviceKfsessionGetwaitcaseRequest InitRequestObject() { return new CustomserviceKfsessionGetwaitcaseRequest{ AccessToken = "123" }; } protected override string GetReturnResult(bool errResult) { if (errResult) return s_errmsg; return @"{ ""count"" : 150, ""waitcaselist"" : [ { ""createtime"" : 123456789, ""kf_account"" : ""test1@test"", ""openid"" : ""OPENID"" }, { ""createtime"" : 123456789, ""kf_account"" : """", ""openid"" : ""OPENID"" } ] }"; } public override CustomserviceKfsessionGetwaitcaseResponse GetResponse() { return mock_client.Object.Execute(Request); } } } ================================================ FILE: test/FrameworkCoreTest/FrameworkCoreTest.csproj ================================================  Debug AnyCPU {2DE1B569-2437-47E0-AA51-84CDCCB2968A} Library Properties FrameworkCoreTest FrameworkCoreTest v4.5 512 ..\..\ true true full false bin\Debug\ DEBUG;TRACE prompt 4 pdbonly true bin\Release\ TRACE prompt 4 ..\..\packages\Moq.4.2.1402.2112\lib\net40\Moq.dll False ..\..\packages\Newtonsoft.Json.6.0.2\lib\net45\Newtonsoft.Json.dll ..\..\packages\xunit.1.9.2\lib\net20\xunit.dll {5765cfa5-1892-4a06-81a8-f5e4c8a28dff} WXFramework ================================================ FILE: test/FrameworkCoreTest/Logger.cs ================================================ using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using WX.Logger; namespace FrameworkCoreTest { public class Logger : ILogger { public void Log(string content) { Console.WriteLine("log:" + content); } public void Warn(string content) { Console.WriteLine("Warn:" + content); } public void Error(string content) { Console.WriteLine("Error:" + content); } public void Exception(string content) { Console.WriteLine("Exception:" + content); } } } ================================================ FILE: test/FrameworkCoreTest/Merchant/CreateTest.cs ================================================ using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using WX.Model; using WX.Model.ApiRequests; using WX.Model.ApiResponses; using Xunit; namespace FrameworkCoreTest.Merchant { public class CreateTest : MockPostApiBaseTest { [Fact] public void MockMerchantCreateTest() { MockSetup(false); var response = mock_client.Object.Execute(Request); Assert.Equal(true, !response.IsError); Assert.Equal("pDF3iwkjal4lazkapsdfiwekrjadf", response.ProductID); } [Fact] public void MockMerchantCreateGetPostContent() { Console.WriteLine(Request.GetPostContent()); } protected override MerchantCreateRequest InitRequestObject() { return new MerchantCreateRequest { AccessToken = "123", ProductInfo = GetProduct() }; } protected override string GetReturnResult(bool errResult) { if (errResult) return s_errmsg; return @"{""errcode"":0, ""errmsg"":""success"", ""product_id"":""pDF3iwkjal4lazkapsdfiwekrjadf""}"; } private ProductInfo GetProduct() { var product = new Product { Name = "test product 1", OriPrice = 999, MainImage = "http://image1.product1.jpg", BuyLimit = 1, Categories = new string[] { "530707078" }, Properties = new List { new ProductProperty{ VID = "107979797", ID = "121321"} }, Detail = new List { new ProductDetail{ Text = "hello world"} }, Images = new string[] { "http://img2.product1.jgp" }, SkuInfos = new List { new SkuInfo{ ID = "107575757", VID = new string[]{"2222", "3333"}} } }; var skulist = new List{ new Sku{ SkuID = "1075741873:1079742386", Price = 30, IconUrl = "http://sku1icon.jpg", ProductCode = "testing", OriPrice = 90000, Quantity = 10 } }; var attrext = new Attrext { IsPostFree = false, IsHasReceipt = true, IsSupportReplace = false, IsUnderGuaranty = false, Location = new Location { Country = "中国", City = "上海市", Province = "上海市", Address = "重庆南路" } }; var delivery = new Delivery { DeliveryType = 1, TemplateID = 1 }; var productInfo = new ProductInfo { ProductBase = product, SkuList = skulist, Attrext = attrext, DeliveryInfo = delivery }; return productInfo; } } } ================================================ FILE: test/FrameworkCoreTest/Merchant/MerchantCategoryGetskuTest.cs ================================================ using Newtonsoft.Json; using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using WX.Model; using WX.Model.ApiRequests; using WX.Model.ApiResponses; using Xunit; namespace FrameworkCoreTest.Merchant { public class MerchantCategoryGetskuTest : MockPostApiBaseTest { [Fact] public void MerchantCategoryGetskuSuccess() { MockSetup(false); var response = mock_client.Object.Execute(Request); Assert.Equal(false, response.IsError); Assert.Equal(2, response.SkuTables.Count()); } protected override MerchantCategoryGetskuRequest InitRequestObject() { return new MerchantCategoryGetskuRequest { AccessToken = "123", CateID = 123123 }; } protected override string GetReturnResult(bool errResult) { if (errResult) return s_errmsg; var result = new { errcode = 0, errmsg = "success", sku_table = new List { new SkuTable{ SkuTableID = "1111", Name = "1111", ValueList = new List{ new SkuValue{ Id = "value1", Name = "value1"}, new SkuValue{Id = "value2", Name = "value2"} } }, new SkuTable{ SkuTableID = "2222", Name = "2222", ValueList = new List{ new SkuValue{ Id = "value3", Name = "value3"}, new SkuValue{Id = "value4", Name = "value4"} } }, } }; Console.WriteLine(JsonConvert.SerializeObject(result)); return JsonConvert.SerializeObject(result); } } } ================================================ FILE: test/FrameworkCoreTest/Merchant/MerchantCategoryGetsubTest.cs ================================================ using Newtonsoft.Json; using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using WX.Model; using WX.Model.ApiRequests; using WX.Model.ApiResponses; using Xunit; namespace FrameworkCoreTest.Merchant { public class MerchantCategoryGetsubTest : MockPostApiBaseTest { [Fact] public void MockMerchantCategoryGetsubSuccessTest() { MockSetup(false); var response = mock_client.Object.Execute(Request); Assert.Equal(false, response.IsError); Assert.Equal(3, response.CateList.Count()); } protected override MerchantCategoryGetsubRequest InitRequestObject() { return new MerchantCategoryGetsubRequest { CateID = 123, AccessToken = "123" }; } protected override string GetReturnResult(bool errResult) { if (errResult) return s_errmsg; var result = new { errcode = 0, errmsg = "success", cate_list = new List { new Cate{ Id = "123", Name = "1111"}, new Cate{Id = "222", Name= "2222"}, new Cate{Id = "333", Name = "333"} } }; Console.WriteLine(JsonConvert.SerializeObject(result)); return JsonConvert.SerializeObject(result); } } } ================================================ FILE: test/FrameworkCoreTest/Merchant/MerchantCommonUploadimgTest.cs ================================================ using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using WX.Model.ApiRequests; using WX.Model.ApiResponses; using Xunit; namespace FrameworkCoreTest.Merchant { public class MerchantCommonUploadimgTest : MockPostApiBaseTest { [Fact] public void MockSuccess() { MockSetup(false); var response = mock_client.Object.Execute(Request); Assert.Equal(false, response.IsError); Assert.Equal("http://uploadimg.jpg", response.ImageUrl); } protected override MerchantCommonUploadimgRequest InitRequestObject() { return new MerchantCommonUploadimgRequest { AccessToken = "123", FileName = "1.jpg", FilePath = "e:\\123" }; } protected override string GetReturnResult(bool errResult) { if (errResult) return s_errmsg; return JsonSerialize( new { errcode = 0, errmsg = "success", image_url = "http://uploadimg.jpg" }); } } } ================================================ FILE: test/FrameworkCoreTest/Merchant/MerchantDelTest.cs ================================================ using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using WX.Model.ApiRequests; using WX.Model.ApiResponses; using Xunit; namespace FrameworkCoreTest.Merchant { public class MerchantDelTest : MockPostApiBaseTest { [Fact] public void MockGetPostContent() { Console.WriteLine(Request.GetPostContent()); } [Fact] public void MockDeleteSuccess() { MockSetup(false); var response = mock_client.Object.Execute(Request); Assert.Equal(false, response.IsError); } protected override MerchantDelRequest InitRequestObject() { return new MerchantDelRequest { ProductID = "123456789", AccessToken = "123" }; } protected override string GetReturnResult(bool errResult) { if (errResult) return s_errmsg; return s_successmsg; } } } ================================================ FILE: test/FrameworkCoreTest/Merchant/MerchantExpressAddTest.cs ================================================ using Newtonsoft.Json; using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using WX.Model; using WX.Model.ApiRequests; using WX.Model.ApiResponses; using Xunit; namespace FrameworkCoreTest.Merchant { public class MerchantExpressAddTest : MockPostApiBaseTest { [Fact] public void MockMerchantExpressAddSuccess() { MockSetup(false); var response = mock_client.Object.Execute(Request); Assert.Equal(false, response.IsError); Assert.Equal(123456, response.TemplateID); } [Fact] public void MockGetPostContent() { Console.WriteLine(Request.GetPostContent()); } protected override MerchantExpressAddRequest InitRequestObject() { return new MerchantExpressAddRequest { AccessToken = "123", DeliveryTemplate = new WX.Model.DeliveryTemplate { Assumer = 0, Name = "template 1", Valuation = 0, TopFees = new List { new TopFee{ FeeType = 10000027, Normal = new NormalFee{ StartStandards = 1, StartFees = 2, AddStandards = 3, AddFees = 1 }, Customs = new List{ new CustomFee{ StartStandards = 1, StartFees = 100, AddStandards = 1, AddFees = 3, DestCountry = "China", DestProvince = "Guang Dong Sheng", DestCity = "GuangZhou" }, }, }, new TopFee{ FeeType = 10000028, Normal = new NormalFee{ StartStandards = 1, StartFees = 3, AddStandards = 3, AddFees = 2 }, Customs = new List{ new CustomFee{ StartStandards = 1, StartFees = 10, AddStandards = 1, AddFees = 30, DestCountry = "China", DestProvince = "Guang Dong Sheng", DestCity = "GuangZhou" }, }, }, new TopFee{ FeeType = 10000029, Normal = new NormalFee{ StartStandards = 1, StartFees = 2, AddStandards = 3, AddFees = 1 }, Customs = new List{ new CustomFee{ StartStandards = 1, StartFees = 100, AddStandards = 1, AddFees = 3, DestCountry = "China", DestProvince = "Guang Dong Sheng", DestCity = "GuangZhou" }, }, }, } } }; } protected override string GetReturnResult(bool errResult) { if (errResult) return s_errmsg; var result = new { errcode = 0, errmsg = "success", template_id = 123456 }; return JsonConvert.SerializeObject(result); } } } ================================================ FILE: test/FrameworkCoreTest/Merchant/MerchantExpressDelTest.cs ================================================ using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using WX.Model.ApiRequests; using WX.Model.ApiResponses; using Xunit; namespace FrameworkCoreTest.Merchant { public class MerchantExpressDelTest : MockPostApiBaseTest { [Fact] public void Fail() { MockSetup(true); var response = mock_client.Object.Execute(Request); Assert.Equal(true, response.IsError); } [Fact] public void Success() { MockSetup(false); var response = mock_client.Object.Execute(Request); Assert.Equal(false, response.IsError); } protected override MerchantExpressDelRequest InitRequestObject() { return new MerchantExpressDelRequest { AccessToken = "123", TemplateID = 123123 }; } protected override string GetReturnResult(bool errResult) { return errResult ? s_errmsg : s_successmsg; } } } ================================================ FILE: test/FrameworkCoreTest/Merchant/MerchantExpressGetallTest.cs ================================================ using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using WX.Model.ApiRequests; using WX.Model.ApiResponses; using Xunit; using WX.Model; using Newtonsoft.Json; namespace FrameworkCoreTest.Merchant { public class MerchantExpressGetallTest : MockPostApiBaseTest { [Fact] public void MockSuccess() { MockSetup(false); var response = mock_client.Object.Execute(Request); Assert.Equal(3, response.Templates.Count()); } [Fact] public override void MockGetPostContent() { Assert.Throws(typeof(NotImplementedException), () => base.MockGetPostContent()); } protected override MerchantExpressGetallRequest InitRequestObject() { return new MerchantExpressGetallRequest { AccessToken = "123" }; } protected override string GetReturnResult(bool errResult) { if (errResult) return s_errmsg; var result = new { errcode = 0, errmsg = "success", templates_info = new List { GetTemplate(1), GetTemplate(2), GetTemplate(3) } }; Console.WriteLine(JsonConvert.SerializeObject(result)); return JsonConvert.SerializeObject(result); } private DeliveryTemplate GetTemplate(long id) { return new DeliveryTemplate { ID = id, Assumer = 0, Name = "template 1", Valuation = 0, TopFees = new List { new TopFee{ FeeType = 10000027, Normal = new NormalFee{ StartStandards = 1, StartFees = 2, AddStandards = 3, AddFees = 1 }, Customs = new List{ new CustomFee{ StartStandards = 1, StartFees = 100, AddStandards = 1, AddFees = 3, DestCountry = "China", DestProvince = "Guang Dong Sheng", DestCity = "GuangZhou" }, }, }, new TopFee{ FeeType = 10000028, Normal = new NormalFee{ StartStandards = 1, StartFees = 3, AddStandards = 3, AddFees = 2 }, Customs = new List{ new CustomFee{ StartStandards = 1, StartFees = 10, AddStandards = 1, AddFees = 30, DestCountry = "China", DestProvince = "Guang Dong Sheng", DestCity = "GuangZhou" }, }, }, new TopFee{ FeeType = 10000029, Normal = new NormalFee{ StartStandards = 1, StartFees = 2, AddStandards = 3, AddFees = 1 }, Customs = new List{ new CustomFee{ StartStandards = 1, StartFees = 100, AddStandards = 1, AddFees = 3, DestCountry = "China", DestProvince = "Guang Dong Sheng", DestCity = "GuangZhou" }, }, }, } }; } } } ================================================ FILE: test/FrameworkCoreTest/Merchant/MerchantExpressGetbyidTest.cs ================================================ using Newtonsoft.Json; using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using WX.Model; using WX.Model.ApiRequests; using WX.Model.ApiResponses; using Xunit; namespace FrameworkCoreTest.Merchant { public class MerchantExpressGetbyidTest : MockPostApiBaseTest { [Fact] public void MockSuccess() { MockSetup(false); var response = mock_client.Object.Execute(Request); Assert.Equal(false, response.IsError); Assert.Equal(123456, response.TemplateInfo.ID); Assert.Equal("template 1", response.TemplateInfo.Name); Assert.Equal(3, response.TemplateInfo.TopFees.Count()); } protected override MerchantExpressGetbyidRequest InitRequestObject() { return new MerchantExpressGetbyidRequest { AccessToken = "123", TemplateID = 123456 }; } protected override string GetReturnResult(bool errResult) { if (errResult) return s_errmsg; var result = new { errcode = 0, errmsg = "success", template_info = new DeliveryTemplate { ID = 123456, Assumer = 0, Name = "template 1", Valuation = 0, TopFees = new List { new TopFee{ FeeType = 10000027, Normal = new NormalFee{ StartStandards = 1, StartFees = 2, AddStandards = 3, AddFees = 1 }, Customs = new List{ new CustomFee{ StartStandards = 1, StartFees = 100, AddStandards = 1, AddFees = 3, DestCountry = "China", DestProvince = "Guang Dong Sheng", DestCity = "GuangZhou" }, }, }, new TopFee{ FeeType = 10000028, Normal = new NormalFee{ StartStandards = 1, StartFees = 3, AddStandards = 3, AddFees = 2 }, Customs = new List{ new CustomFee{ StartStandards = 1, StartFees = 10, AddStandards = 1, AddFees = 30, DestCountry = "China", DestProvince = "Guang Dong Sheng", DestCity = "GuangZhou" }, }, }, new TopFee{ FeeType = 10000029, Normal = new NormalFee{ StartStandards = 1, StartFees = 2, AddStandards = 3, AddFees = 1 }, Customs = new List{ new CustomFee{ StartStandards = 1, StartFees = 100, AddStandards = 1, AddFees = 3, DestCountry = "China", DestProvince = "Guang Dong Sheng", DestCity = "GuangZhou" }, }, }, } } }; Console.WriteLine(JsonConvert.SerializeObject(result)); return JsonConvert.SerializeObject(result); } } } ================================================ FILE: test/FrameworkCoreTest/Merchant/MerchantExpressUpdateTest.cs ================================================ using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using WX.Model; using WX.Model.ApiRequests; using WX.Model.ApiResponses; using Xunit; namespace FrameworkCoreTest.Merchant { public class MerchantExpressUpdateTest : MockPostApiBaseTest { [Fact] public void Success() { MockSetup(false); var response = mock_client.Object.Execute(Request); Assert.Equal(false, response.IsError); } protected override MerchantExpressUpdateRequest InitRequestObject() { return new MerchantExpressUpdateRequest { TemplateID = 123456, AccessToken = "123", DeliveryTemplate = new WX.Model.DeliveryTemplate { Assumer = 0, Name = "template 1", Valuation = 0, TopFees = new List { new TopFee{ FeeType = 10000027, Normal = new NormalFee{ StartStandards = 1, StartFees = 2, AddStandards = 3, AddFees = 1 }, Customs = new List{ new CustomFee{ StartStandards = 1, StartFees = 100, AddStandards = 1, AddFees = 3, DestCountry = "China", DestProvince = "Guang Dong Sheng", DestCity = "GuangZhou" }, }, }, new TopFee{ FeeType = 10000028, Normal = new NormalFee{ StartStandards = 1, StartFees = 3, AddStandards = 3, AddFees = 2 }, Customs = new List{ new CustomFee{ StartStandards = 1, StartFees = 10, AddStandards = 1, AddFees = 30, DestCountry = "China", DestProvince = "Guang Dong Sheng", DestCity = "GuangZhou" }, }, }, new TopFee{ FeeType = 10000029, Normal = new NormalFee{ StartStandards = 1, StartFees = 2, AddStandards = 3, AddFees = 1 }, Customs = new List{ new CustomFee{ StartStandards = 1, StartFees = 100, AddStandards = 1, AddFees = 3, DestCountry = "China", DestProvince = "Guang Dong Sheng", DestCity = "GuangZhou" }, }, }, } } }; } protected override string GetReturnResult(bool errResult) { return errResult ? s_errmsg : s_successmsg; } } } ================================================ FILE: test/FrameworkCoreTest/Merchant/MerchantGetTest.cs ================================================ using Newtonsoft.Json; using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using WX.Model; using WX.Model.ApiRequests; using WX.Model.ApiResponses; using Xunit; namespace FrameworkCoreTest.Merchant { public class MerchantGetTest : MockPostApiBaseTest { [Fact] public void MockGetSuccessTest() { MockSetup(false); var response = mock_client.Object.Execute(Request); Assert.Equal("test product 1", response.ProductInfo.ProductBase.Name); Assert.Equal("123456789", response.ProductInfo.ProductID); } protected override MerchantGetRequest InitRequestObject() { return new MerchantGetRequest { AccessToken = "123", ProductID = "123456789" }; } protected override string GetReturnResult(bool errResult) { if (errResult) return s_errmsg; var result = JsonConvert.SerializeObject(new { errcode = 0, errmsg = "success", product_info = GetProduct() }); Console.WriteLine(result); return result; } private ProductInfo GetProduct() { var product = new Product { Name = "test product 1", OriPrice = 999, MainImage = "http://image1.product1.jpg", BuyLimit = 1, Categories = new string[] { "530707078" }, Properties = new List { new ProductProperty{ VID = "107979797", ID = "121321"} }, Detail = new List { new ProductDetail{ Text = "hello world"} }, Images = new string[] { "http://img2.product1.jgp" }, SkuInfos = new List { new SkuInfo{ ID = "107575757", VID = new string[]{"2222", "3333"}} } }; var skulist = new List{ new Sku{ SkuID = "1075741873:1079742386", Price = 30, IconUrl = "http://sku1icon.jpg", ProductCode = "testing", OriPrice = 90000, Quantity = 10 } }; var attrext = new Attrext { IsPostFree = false, IsHasReceipt = true, IsSupportReplace = false, IsUnderGuaranty = false, Location = new Location { Country = "中国", City = "上海市", Province = "上海市", Address = "重庆南路" } }; var delivery = new Delivery { DeliveryType = 1, TemplateID = 1 }; var productInfo = new ProductInfo { ProductBase = product, SkuList = skulist, Attrext = attrext, DeliveryInfo = delivery, ProductID = "123456789" }; return productInfo; } } } ================================================ FILE: test/FrameworkCoreTest/Merchant/MerchantGetbystatus.cs ================================================ using Newtonsoft.Json; using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using WX.Model; using WX.Model.ApiRequests; using WX.Model.ApiResponses; using Xunit; namespace FrameworkCoreTest.Merchant { public class MerchantGetbystatus : MockPostApiBaseTest { [Fact] public void MockMerchantGetBystatusTest() { MockSetup(false); var response = mock_client.Object.Execute(Request); Assert.Equal(false, response.IsError); Assert.Equal(3, response.ProductInfos.Count()); } protected override MerchantGetbystatusRequest InitRequestObject() { return new MerchantGetbystatusRequest { AccessToken = "123", Status = 0 }; } protected override string GetReturnResult(bool errResult) { if (errResult) return s_errmsg; var result = new { errcode = 0, errmsg = "success", products_info = new List { GetProduct("1"), GetProduct("2"), GetProduct("3") } }; Console.WriteLine(JsonConvert.SerializeObject(result)); return JsonConvert.SerializeObject(result); } private ProductInfo GetProduct(string productId) { var product = new Product { Name = "test product 1", OriPrice = 999, MainImage = "http://image1.product1.jpg", BuyLimit = 1, Categories = new string[] { "530707078" }, Properties = new List { new ProductProperty{ VID = "107979797", ID = "121321"} }, Detail = new List { new ProductDetail{ Text = "hello world"} }, Images = new string[] { "http://img2.product1.jgp" }, SkuInfos = new List { new SkuInfo{ ID = "107575757", VID = new string[]{"2222", "3333"}} } }; var skulist = new List{ new Sku{ SkuID = "1075741873:1079742386", Price = 30, IconUrl = "http://sku1icon.jpg", ProductCode = "testing", OriPrice = 90000, Quantity = 10 } }; var attrext = new Attrext { IsPostFree = false, IsHasReceipt = true, IsSupportReplace = false, IsUnderGuaranty = false, Location = new Location { Country = "中国", City = "上海市", Province = "上海市", Address = "重庆南路" } }; var delivery = new Delivery { DeliveryType = 1, TemplateID = 1 }; var productInfo = new ProductInfo { ProductBase = product, SkuList = skulist, Attrext = attrext, DeliveryInfo = delivery, ProductID = productId }; return productInfo; } } } ================================================ FILE: test/FrameworkCoreTest/Merchant/MerchantGetpropertyTest.cs ================================================ using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using WX.Model.ApiRequests; using WX.Model.ApiResponses; using Xunit; using WX.Model; using Newtonsoft.Json; namespace FrameworkCoreTest.Merchant { public class MerchantGetpropertyTest : MockPostApiBaseTest { [Fact] public void MerchantCategoryGetpropertySuccess() { MockSetup(false); var response = mock_client.Object.Execute(Request); Assert.Equal(false, response.IsError); Assert.Equal(1, response.Properties.Count()); } protected override MerchantCategoryGetpropertyRequest InitRequestObject() { return new MerchantCategoryGetpropertyRequest { CateID = 123123123, AccessToken = "123" }; } protected override string GetReturnResult(bool errResult) { if (errResult) return s_errmsg; var result = new { errcode = 0, errmsg = "success", properties = new List { new Property{ PropertyID = "107545189", Name = "brand", PropertyValues = new List{ new PropertyValue{ Id = "p1", Name = "p1"}, new PropertyValue{Id = "p2", Name = "p2"} }, }, } }; Console.WriteLine(JsonConvert.SerializeObject(result)); return JsonConvert.SerializeObject(result); } } } ================================================ FILE: test/FrameworkCoreTest/Merchant/MerchantGroupAddTest.cs ================================================ using Newtonsoft.Json; using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using WX.Model.ApiRequests; using WX.Model.ApiResponses; using Xunit; namespace FrameworkCoreTest.Merchant { public class MerchantGroupAddTest : MockPostApiBaseTest { [Fact] public void MockSuccess() { MockSetup(false); var response = mock_client.Object.Execute(Request); Assert.Equal(false, response.IsError); Assert.Equal(19, response.GroupID); } protected override MerchantGroupAddRequest InitRequestObject() { return new MerchantGroupAddRequest { GroupDetail = new WX.Model.MerchantGroupDetail { Name = "测试分组", ProductList = new string[] {"pdf3iy9ce1idje1","0dkajfdkjasldfkj3" } }, AccessToken = "123" }; } protected override string GetReturnResult(bool errResult) { if (errResult) return s_errmsg; return JsonSerialize(new { errcode = 0, errmsg = "success", group_id = 19 }); } } } ================================================ FILE: test/FrameworkCoreTest/Merchant/MerchantGroupDelTest.cs ================================================ using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using WX.Model.ApiRequests; using WX.Model.ApiResponses; using Xunit; namespace FrameworkCoreTest.Merchant { public class MerchantGroupDelTest : MockPostApiBaseTest { [Fact] public void MockSuccess() { MockSetup(false); var response = mock_client.Object.Execute(Request); Assert.Equal(false, response.IsError); } protected override MerchantGroupDelRequest InitRequestObject() { return new MerchantGroupDelRequest { AccessToken = "123", GroupID = 19 }; } protected override string GetReturnResult(bool errResult) { return errResult ? s_errmsg : s_successmsg; } } } ================================================ FILE: test/FrameworkCoreTest/Merchant/MerchantGroupGetallTest.cs ================================================ using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using WX.Model; using WX.Model.ApiRequests; using WX.Model.ApiResponses; using Xunit; namespace FrameworkCoreTest.Merchant { public class MerchantGroupGetallTest : MockPostApiBaseTest { [Fact] public void MockSuccess() { MockSetup(false); var response = mock_client.Object.Execute(Request); Assert.Equal(false, response.IsError); Assert.Equal(2, response.GroupsDetail.Count()); } protected override MerchantGroupGetallRequest InitRequestObject() { return new MerchantGroupGetallRequest { AccessToken = "123" }; } protected override string GetReturnResult(bool errResult) { if (errResult) return s_errmsg; return JsonSerialize(new { errcode = 0, errmsg = "success", groups_detail = new List { new MerchantGroupDetail{ GroupId = 200077549, Name = "last update"}, new MerchantGroupDetail{GroupId = 200079772, Name = "hot"} } }); } } } ================================================ FILE: test/FrameworkCoreTest/Merchant/MerchantGroupGetbyidTest.cs ================================================ using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using WX.Model.ApiRequests; using WX.Model.ApiResponses; using Xunit; namespace FrameworkCoreTest.Merchant { public class MerchantGroupGetbyidTest : MockPostApiBaseTest { [Fact] public void MockSuccess() { MockSetup(false); var response = mock_client.Object.Execute(Request); Assert.Equal(false, response.IsError); Assert.Equal(2000077549, response.GroupDetail.GroupId); Assert.Equal(3, response.GroupDetail.ProductList.Count()); } protected override MerchantGroupGetbyidRequest InitRequestObject() { return new MerchantGroupGetbyidRequest { AccessToken = "a123", GroupID = 29 }; } protected override string GetReturnResult(bool errResult) { if (errResult) return s_errmsg; return JsonSerialize(new { errcode = 0, errmsg = "success", group_detail = new { group_id = 2000077549, group_name = "last update", product_list = new string[]{ "product 1", "product 2", "product 3" } } }); } } } ================================================ FILE: test/FrameworkCoreTest/Merchant/MerchantGroupProductmodTest.cs ================================================ using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using WX.Model; using WX.Model.ApiRequests; using WX.Model.ApiResponses; using Xunit; namespace FrameworkCoreTest.Merchant { public class MerchantGroupProductmodTest : MockPostApiBaseTest { protected override MerchantGroupProductmodRequest InitRequestObject() { return new MerchantGroupProductmodRequest { AccessToken = "123", GroupDetail = new WX.Model.MerchantGroupDetail { GroupId = 28, Product = new List{ new ProductInfo{ ProductID = "product1", ModAction = 1}, new ProductInfo{ ProductID = "product2", ModAction = 2 } } } }; } protected override string GetReturnResult(bool errResult) { return errResult ? s_errmsg : s_successmsg; } } } ================================================ FILE: test/FrameworkCoreTest/Merchant/MerchantGroupPropertymodTest.cs ================================================ using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using WX.Model.ApiRequests; using WX.Model.ApiResponses; using Xunit; namespace FrameworkCoreTest.Merchant { public class MerchantGroupPropertymodTest : MockPostApiBaseTest { protected override MerchantGroupPropertymodRequest InitRequestObject() { return new MerchantGroupPropertymodRequest { AccessToken = "123", GroupDetail = new WX.Model.MerchantGroupDetail { GroupId = 29, Name = "特惠专场" } }; } protected override string GetReturnResult(bool errResult) { return errResult ? s_errmsg : s_successmsg; } } } ================================================ FILE: test/FrameworkCoreTest/Merchant/MerchantModproductstatusTest.cs ================================================ using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using WX.Model.ApiRequests; using WX.Model.ApiResponses; using Xunit; namespace FrameworkCoreTest.Merchant { public class MerchantModproductstatusTest : MockPostApiBaseTest { [Fact] public void MockMerchantModProductStatusTest() { MockSetup(false); var response = mock_client.Object.Execute(Request); Assert.Equal(false, response.IsError); } protected override MerchantModproductstatusRequest InitRequestObject() { return new MerchantModproductstatusRequest { ProductID = "123456789", Status = 0, AccessToken = "123" }; } protected override string GetReturnResult(bool errResult) { return errResult ? s_errmsg : s_successmsg; } } } ================================================ FILE: test/FrameworkCoreTest/Merchant/MerchantOrderCloseTest.cs ================================================ using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using WX.Model.ApiRequests; using WX.Model.ApiResponses; using Xunit; namespace FrameworkCoreTest.Merchant { public class MerchantOrderCloseTest : MockPostApiBaseTest { protected override MerchantOrderCloseRequest InitRequestObject() { return new MerchantOrderCloseRequest { AccessToken = "123", OrderID = "7197417460812584720" }; } protected override string GetReturnResult(bool errResult) { if (errResult) return s_errmsg; return s_successmsg; } } } ================================================ FILE: test/FrameworkCoreTest/Merchant/MerchantOrderGetbyfilterTest.cs ================================================ using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using WX.Model.ApiRequests; using WX.Model.ApiResponses; using Xunit; namespace FrameworkCoreTest.Merchant { public class MerchantOrderGetbyfilterTest : MockPostApiBaseTest { [Fact] public void MockSuccess() { MockSetup(false); var response = mock_client.Object.Execute(Request); Assert.Equal(2, response.OrderList.Count()); } protected override MerchantOrderGetbyfilterRequest InitRequestObject() { return new MerchantOrderGetbyfilterRequest { AccessToken = "123", Status = WX.Model.OrderStatus.All, BeginTime = new DateTime(2014,1,1), EndTime = new DateTime(2014,4,1) }; } protected override string GetReturnResult(bool errResult) { if (errResult) return s_errmsg; return JsonSerialize(new { errcode = 0, errmsg = "success", order_list = new[] { new { order_id = "7197417460812533543", order_status = 6, order_total_price = 6, order_create_time = 1394635817, order_express_price = 5, buyer_openid = "0DF3iY17NsDAW4UP2qzJXPsz1S9Q", buyer_nick = "likeacat", receiver_name = "zhang xiao mao", receiver_province = "guangdongsheng", receiver_city = "guangzhoushi", receiver_address = "huajingluyihao", receiver_mobile = "123456789", receiver_phone = "123456789", product_id = "pDF3iYx7KDQVGzB8kDg6Tge50kFo", product_name = "anlifang e-bar jlajsdkfj", product_price = 1, product_sku = "10000983:10000995;10001007:10001010", product_count = 1, product_img = "http://img2.paipaiimg.com/0000000/item-5232.jpg", delivery_id = "19006597372473", delivery_company = "059Yunda", trans_id = "1900000109201404103172199813" }, new { order_id = "7197417460812533545", order_status = 6, order_total_price = 6, order_create_time = 1394635817, order_express_price = 5, buyer_openid = "0DF3iY17NsDAW4UP2qzJXPsz1S9Q", buyer_nick = "likeacat", receiver_name = "zhang xiao mao", receiver_province = "guangdongsheng", receiver_city = "guangzhoushi", receiver_address = "huajingluyihao", receiver_mobile = "123456789", receiver_phone = "123456789", product_id = "pDF3iYx7KDQVGzB8kDg6Tge50kFo", product_name = "anlifang e-bar jlajsdkfj", product_price = 1, product_sku = "10000983:10000995;10001007:10001010", product_count = 1, product_img = "http://img2.paipaiimg.com/0000000/item-5232.jpg", delivery_id = "19006597372473", delivery_company = "059Yunda", trans_id = "1900000109201404103172199813" }, } }); } } } ================================================ FILE: test/FrameworkCoreTest/Merchant/MerchantOrderGetbyidTest.cs ================================================ using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using WX.Model.ApiRequests; using WX.Model.ApiResponses; using Xunit; namespace FrameworkCoreTest.Merchant { public class MerchantOrderGetbyidTest : MockPostApiBaseTest { [Fact] public void MockSuccess() { MockSetup(false); var response = mock_client.Object.Execute(Request); Assert.Equal("7197417460812533543", response.Order.OrderID); Assert.Equal(1394635817, response.Order.CreateTime); Assert.Equal("pDF3iYx7KDQVGzB8kDg6Tge50kFo", response.Order.ProductID); Assert.Equal(5, response.Order.ExpressPrice); } protected override MerchantOrderGetbyidRequest InitRequestObject() { return new MerchantOrderGetbyidRequest { AccessToken = "123", OrderID = "7197417460812584720" }; } protected override string GetReturnResult(bool errResult) { if (errResult) return s_errmsg; return JsonSerialize(new { errcode = 0, errmsg = "success", order = new { order_id = "7197417460812533543", order_status = 6, order_total_price = 6, order_create_time = 1394635817, order_express_price = 5, buyer_openid = "0DF3iY17NsDAW4UP2qzJXPsz1S9Q", buyer_nick = "likeacat", receiver_name = "zhang xiao mao", receiver_province = "guangdongsheng", receiver_city = "guangzhoushi", receiver_address = "huajingluyihao", receiver_mobile = "123456789", receiver_phone = "123456789", product_id = "pDF3iYx7KDQVGzB8kDg6Tge50kFo", product_name = "anlifang e-bar jlajsdkfj", product_price = 1, product_sku = "10000983:10000995;10001007:10001010", product_count = 1, product_img = "http://img2.paipaiimg.com/0000000/item-5232.jpg", delivery_id = "19006597372473", delivery_company = "059Yunda", trans_id = "1900000109201404103172199813" } }); } } } ================================================ FILE: test/FrameworkCoreTest/Merchant/MerchantOrderSetdeliveryTest.cs ================================================ using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using WX.Model; using WX.Model.ApiRequests; using WX.Model.ApiResponses; using Xunit; namespace FrameworkCoreTest.Merchant { public class MerchantOrderSetdeliveryTest : MockPostApiBaseTest { protected override MerchantOrderSetdeliveryRequest InitRequestObject() { return new MerchantOrderSetdeliveryRequest { AccessToken = "123", DeliveryCompany = DeliveryCompany.EMS, DeliveryTrackNo = "1900659372473", OrderID = "7197417460812533543" }; } protected override string GetReturnResult(bool errResult) { if (errResult) return s_errmsg; return s_successmsg; } } } ================================================ FILE: test/FrameworkCoreTest/Merchant/MerchantShelfAddTest.cs ================================================ using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using WX.Model; using WX.Model.ApiRequests; using WX.Model.ApiResponses; using Xunit; namespace FrameworkCoreTest.Merchant { public class MerchantShelfAddTest : MockPostApiBaseTest { [Fact] public void MerchantShelfAddPostContentTest() { var request = InitRequestObject(); Console.WriteLine(request.GetPostContent()); } protected override MerchantShelfAddRequest InitRequestObject() { var request = new MerchantShelfAddRequest() { ShelfBanner = "http//img1.sh-bus.com/banner.jpg", ShelfName = "test shelf" }; var one = new ShelfModuleOne(50, 2); var two = new ShelfModuleTwo(new long[] { 49, 50, 51, 52 }); var three = new ShelfModuleThree(52, "http://img1.sh-bus.com/three.jpg"); var four = new ShelfModuleFour(new List() { new ShelfGroupInfo{ GroupID = 49, Img = "http://img1.sh-bus.com/49.jpg" }, new ShelfGroupInfo{ GroupID = 50, Img = "http://img1.sh-bus.com/50.jpg" } }); var five = new ShelfModuleFive(new long[] { 49, 50, 51, 52, 53 }, "http://img.sh-bus.com/backup.jpg"); request.AddModules(one, two, three, four); return request; } protected override string GetReturnResult(bool errResult) { throw new NotImplementedException(); } } } ================================================ FILE: test/FrameworkCoreTest/Merchant/MerchantShelfDelTest.cs ================================================ using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using WX.Model.ApiRequests; using WX.Model.ApiResponses; using Xunit; namespace FrameworkCoreTest.Merchant { public class MerchantShelfDelTest : MockPostApiBaseTest { protected override MerchantShelfDelRequest InitRequestObject() { return new MerchantShelfDelRequest { AccessToken = "123", ShelfID = 19 }; } protected override string GetReturnResult(bool errResult) { throw new NotImplementedException(); } } } ================================================ FILE: test/FrameworkCoreTest/Merchant/MerchantShelfGetallTest.cs ================================================ using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using WX.Model; using WX.Model.ApiRequests; using WX.Model.ApiResponses; using Xunit; namespace FrameworkCoreTest.Merchant { public class MerchantShelfGetallTest : MockPostApiBaseTest { [Fact] public void MockSuccess() { MockSetup(false); var response = mock_client.Object.Execute(Request); Assert.Equal(false, response.IsError); Assert.Equal(2, response.Shelves.Count()); var first = response.Shelves.FirstOrDefault(); Assert.Equal(1, first.ShelfInfos.Modules.Count()); foreach (var shelf in response.Shelves) { Console.WriteLine("name:{0}", shelf.Name); Console.WriteLine("id:{0}", shelf.ShelfID); foreach (var module in shelf.ShelfInfos.Modules) { Console.WriteLine("module is module {0}", module.EID); } } } protected override MerchantShelfGetallRequest InitRequestObject() { return new MerchantShelfGetallRequest { AccessToken = "123" }; } protected override string GetReturnResult(bool errResult) { if (errResult) return s_errmsg; var one = new ShelfModuleOne(50, 2); var two = new ShelfModuleTwo(new long[] { 49, 50, 51, 52 }); var three = new ShelfModuleThree(52, "http://img1.sh-bus.com/three.jpg"); var four = new ShelfModuleFour(new List() { new ShelfGroupInfo{ GroupID = 49, Img = "http://img1.sh-bus.com/49.jpg" }, new ShelfGroupInfo{ GroupID = 50, Img = "http://img1.sh-bus.com/50.jpg" } }); var obj = new { errcode = 0, errmsg = "success", shelves = new List { new ShelfInfo{ Banner = "banner", Name = "shelf 1", ShelfID = 123, ShelfInfos = new ShelfModulesInfo{ Modules = new List{ new ShelfModuleFive( new long[]{2000080093, 2000080094, 2000080095}, "imgbackgournd.jpg" ) }, } }, new ShelfInfo{ Banner = "banner 2", Name = "shelf 2", ShelfID = 234, ShelfInfos = new ShelfModulesInfo(new List{one, two, three, four}) } } }; var result = JsonSerialize(obj); Console.WriteLine(result); return result; } } } ================================================ FILE: test/FrameworkCoreTest/Merchant/MerchantShelfGetbyidTest.cs ================================================ using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using WX.Model; using WX.Model.ApiRequests; using WX.Model.ApiResponses; using Xunit; namespace FrameworkCoreTest.Merchant { public class MerchantShelfGetbyidTest : MockPostApiBaseTest { [Fact] public void MockSuccess() { MockSetup(false); var response = mock_client.Object.Execute(Request); Assert.Equal(false, response.IsError); Assert.Equal(123, response.ShelfID); Assert.Equal(1, response.ShelfInfo.Modules.Count()); Assert.Equal(typeof(ShelfModuleFive), response.ShelfInfo.Modules.FirstOrDefault().GetType()); } protected override MerchantShelfGetbyidRequest InitRequestObject() { return new MerchantShelfGetbyidRequest { AccessToken = "123", ShelfID = 12312312 }; } protected override string GetReturnResult(bool errResult) { if (errResult) return s_errmsg; var shelf = new { errcode = 0, errmsg = "success", shelf_banner = "banner", shelf_name = "shelf 1", shelf_id = 123, shelf_info = new ShelfModulesInfo { Modules = new List{ new ShelfModuleFive( new long[]{2000080093, 2000080094, 2000080095}, "imgbackgournd.jpg" ) }, } }; var result = JsonSerialize(shelf); Console.WriteLine(result); return result; } } } ================================================ FILE: test/FrameworkCoreTest/Merchant/MerchantShelfUpdatestatusTest.cs ================================================ using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using WX.Model.ApiRequests; using WX.Model.ApiResponses; using Xunit; namespace FrameworkCoreTest.Merchant { public class MerchantShelfUpdatestatusTest : MockPostApiBaseTest { [Fact] public void MockSuccess() { MockSetup(false); var response = mock_client.Object.Execute(Request); Assert.Equal(false, response.IsError); Assert.Equal("http://mp.weixin.qq.com/bizmall/mallshelf?t=mall/list", response.ShelfUrl); } [Fact] public void MockThrow() { MockSetup(false); Request.Status = 3; Assert.Throws(typeof(ArgumentOutOfRangeException), () => { var response = mock_client.Object.Execute(Request); }); } protected override MerchantShelfUpdatestatusRequest InitRequestObject() { return new MerchantShelfUpdatestatusRequest { AccessToken = "123", ShelfID = 97, Status = 1 }; } protected override string GetReturnResult(bool errResult) { return errResult ? s_errmsg : JsonSerialize(new { errcode = 0, errmsg = "success", shelf_url = "http://mp.weixin.qq.com/bizmall/mallshelf?t=mall/list" }); } } } ================================================ FILE: test/FrameworkCoreTest/Merchant/MerchantStockAddTest.cs ================================================ using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using WX.Model.ApiRequests; using WX.Model.ApiResponses; using Xunit; namespace FrameworkCoreTest.Merchant { public class MerchantStockAddTest : MockPostApiBaseTest { [Fact] public void MockMerchantStockAddSuccess() { MockSetup(false); var response = mock_client.Object.Execute(Request); Assert.Equal(false, response.IsError); } [Fact] public void MockGetPostContent() { Console.WriteLine(Request.GetPostContent()); } protected override MerchantStockAddRequest InitRequestObject() { return new MerchantStockAddRequest { AccessToken = "123", ProductID = "pDf0123lj-asdf-j3kasdfjk", Quantity = 10, SkuInfo = "111:111;222:222" }; } protected override string GetReturnResult(bool errResult) { return errResult ? s_errmsg : s_successmsg; } } } ================================================ FILE: test/FrameworkCoreTest/Merchant/MerchantStockReductTest.cs ================================================ using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using WX.Model.ApiRequests; using WX.Model.ApiResponses; using Xunit; namespace FrameworkCoreTest.Merchant { public class MerchantStockReductTest : MockPostApiBaseTest { [Fact] public void MockMerchantStockReduceSuccess() { MockSetup(false); var response = mock_client.Object.Execute(Request); Assert.Equal(false, response.IsError); } [Fact] public void MockGetPostContent() { Console.WriteLine(Request.GetPostContent()); } protected override MerchantStockReduceRequest InitRequestObject() { return new MerchantStockReduceRequest { AccessToken = "123", ProductID = "pDf3iY5EYkMxs4-tF8xedyES5GqI", Quantity = 20, SkuInfo = "10000983:10000995;10001007:10001010" }; } protected override string GetReturnResult(bool errResult) { return errResult ? s_errmsg : s_successmsg; } } } ================================================ FILE: test/FrameworkCoreTest/Merchant/MerchantUpdateTest.cs ================================================ using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using WX.Model; using WX.Model.ApiRequests; using WX.Model.ApiResponses; using Xunit; namespace FrameworkCoreTest.Merchant { public class MerchantUpdateTest : MockPostApiBaseTest { [Fact] public void MockGetPostContent() { Console.WriteLine(Request.GetPostContent()); } [Fact] public void MockUpdateTest() { MockSetup(false); var response = mock_client.Object.Execute(Request); Assert.Equal(false, response.IsError); } protected override MerchantUpdateRequest InitRequestObject() { return new MerchantUpdateRequest { ProductInfo = GetProduct(), AccessToken = "123" }; } protected override string GetReturnResult(bool errResult) { return errResult ? s_errmsg : s_successmsg; } private ProductInfo GetProduct() { var product = new Product { Name = "test product 1", OriPrice = 999, MainImage = "http://image1.product1.jpg", BuyLimit = 1, Categories = new string[] { "530707078" }, Properties = new List { new ProductProperty{ VID = "107979797", ID = "121321"} }, Detail = new List { new ProductDetail{ Text = "hello world"} }, Images = new string[] { "http://img2.product1.jgp" }, SkuInfos = new List { new SkuInfo{ ID = "107575757", VID = new string[]{"2222", "3333"}} } }; var skulist = new List{ new Sku{ SkuID = "1075741873:1079742386", Price = 30, IconUrl = "http://sku1icon.jpg", ProductCode = "testing", OriPrice = 90000, Quantity = 10 } }; var attrext = new Attrext { IsPostFree = false, IsHasReceipt = true, IsSupportReplace = false, IsUnderGuaranty = false, Location = new Location { Country = "中国", City = "上海市", Province = "上海市", Address = "重庆南路" } }; var delivery = new Delivery { DeliveryType = 1, TemplateID = 1 }; var productInfo = new ProductInfo { ProductBase = product, SkuList = skulist, Attrext = attrext, DeliveryInfo = delivery, ProductID = "123456789" }; return productInfo; } } } ================================================ FILE: test/FrameworkCoreTest/Pay/PayOrderQueryTest.cs ================================================ using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using WX.Pay.Request; using WX.Pay.Response; using System.Configuration; namespace FrameworkCoreTest.Pay { public class PayOrderQueryTest : PayTest { protected override PayOrderqueryRequest GetRequest() { return new PayOrderqueryRequest { OutTradeNo = "DB123123123", NonceStr = "123123" }; } protected override string GetResponseXml() { throw new NotImplementedException(); } } } ================================================ FILE: test/FrameworkCoreTest/Pay/PayRefundTest.cs ================================================ using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using WX.Pay.Response; using WX.Pay.Request; namespace FrameworkCoreTest.Pay { public class PayRefundTest : PayTest { protected override PayRefundRequest GetRequest() { return new PayRefundRequest { AppId = "wx2421b1c4370ec43b", MchId = "10000100", NonceStr = "6cefdb308e1e2e8aabd48cf79e546a02", OpUserId = "10000100", OutRefundNo = "1415701182", OutTradeNo = "1415757673", RefundFee = 1, TotalFee = 1, }; } protected override string GetResponseXml() { return @" 1 0 "; } } } ================================================ FILE: test/FrameworkCoreTest/Pay/PayTest.cs ================================================ using Newtonsoft.Json; using System; using System.Collections.Generic; using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Xml.Serialization; using WX.Pay; using WX.Pay.Request; using WX.Pay.Response; using Xunit; using System.Configuration; namespace FrameworkCoreTest.Pay { public abstract class PayTest where T : PayRequest where K : PayResponse, new () { [Fact] public void MockTest() { T request = GetRequest(); Console.WriteLine("step start......"); Console.WriteLine("api url:{0}", request.Url); Console.WriteLine("api data:{0}", request.Serializable()); Console.WriteLine("------------------"); var xml = GetResponseXml(); Console.WriteLine("api response:{0}", xml); K k = ParseResponse(xml); Console.WriteLine(k.AppId); Console.WriteLine(k.DeviceInfo); Assert.IsType(k); var pro = k.GetType().GetProperties(); foreach (var p in pro) { Console.WriteLine("{0}:{1}", p.Name, JsonConvert.SerializeObject(p.GetValue(k))); } } [Fact] public void ReallyTest() { var client = new PayApiClient(); T request = GetRequest(); request.AppId = ConfigurationManager.AppSettings["wxappid"]; request.MchId = ConfigurationManager.AppSettings["mchid"]; request.PayApiSecret = ConfigurationManager.AppSettings["paysecret"]; client.Logger = new Logger(); Console.WriteLine("step start......"); Console.WriteLine("api url:{0}", request.Url); Console.WriteLine("api data:{0}", request.Serializable()); Console.WriteLine("------------------"); var response = client.Execute(request); Console.WriteLine("return code:" + response.ResultCode); Console.WriteLine("return message:" + response.ReturnMsg); Assert.IsType(response); var pro = response.GetType().GetProperties(); foreach (var p in pro) { Console.WriteLine("{0}:{1}", p.Name, JsonConvert.SerializeObject(p.GetValue(response))); } } protected abstract T GetRequest(); protected abstract string GetResponseXml(); protected K ParseResponse(string xml) { var stream = new MemoryStream(Encoding.UTF8.GetBytes(xml)); var xs = new XmlSerializer(typeof(K), ""); return (K)xs.Deserialize(stream); } } } ================================================ FILE: test/FrameworkCoreTest/Pay/PayUnifiedorderTest.cs ================================================ using System; using System.Collections.Generic; using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Xml.Serialization; using WX.Pay.Request; using WX.Pay.Response; namespace FrameworkCoreTest.Pay { public class PayUnifiedorderTest : PayTest { protected override PayUnifiedOrderRequest GetRequest() { return new PayUnifiedOrderRequest { AppId = "appid", PayApiSecret = "appsecret", DeviceInfo = "nubia z7", NonceStr = "suijishuzuu", Body = "Ipad mini 16G 白色", Detail = "Ipad mini 16G 白色", Attach = "说明", OutTradeNo = "1217752501201407033233368018", TotalFee = 888, SpbillCreateIp = "8.8.8.8", TimeStart = DateTime.Now.ToString("yyyyMMddHHmmss"), TimeExpire = DateTime.Now.AddDays(2).ToString("yyyyMMddHHmmss"), NotifyUrl = "http://www.test.com/notifyurl", }; } protected override string GetResponseXml() { return @" "; } } } ================================================ FILE: test/FrameworkCoreTest/Pay/ReallyPayUnifiedorderRequestTest.cs ================================================ using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using WX.Pay.Request; using WX.Pay.Response; namespace FrameworkCoreTest.Pay { public class ReallyPayUnifiedorderRequestTest : PayTest { protected override PayUnifiedOrderRequest GetRequest() { var date = DateTime.Today; return new PayUnifiedOrderRequest { Attach = "测试支付订单", Body = "测试支付订单", Detail = "测试支付订单", DeviceInfo = "test pay order", NonceStr = "123123", NotifyUrl = "http://www.sh-bus.com", OutTradeNo = "DB123123124", ProductId = "123123", SpbillCreateIp = "127.0.0.1", TimeStart = date.ToString("yyyyMMddHHmmss"), TimeExpire = date.AddDays(4).ToString("yyyyMMddHHmmss"), TotalFee = 100, TradeType = "NATIVE" }; } protected override string GetResponseXml() { throw new NotImplementedException(); } } } ================================================ FILE: test/FrameworkCoreTest/Properties/AssemblyInfo.cs ================================================ using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; // 有关程序集的常规信息通过以下 // 特性集控制。更改这些特性值可修改 // 与程序集关联的信息。 [assembly: AssemblyTitle("FrameworkCoreTest")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("FrameworkCoreTest")] [assembly: AssemblyCopyright("Copyright © 2014")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] // 将 ComVisible 设置为 false 使此程序集中的类型 // 对 COM 组件不可见。如果需要从 COM 访问此程序集中的类型, // 则将该类型上的 ComVisible 特性设置为 true。 [assembly: ComVisible(false)] // 如果此项目向 COM 公开,则下列 GUID 用于类型库的 ID [assembly: Guid("dd150401-33ef-495e-8ad7-d06e093101b9")] // 程序集的版本信息由下面四个值组成: // // 主版本 // 次版本 // 生成号 // 修订号 // // 可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值, // 方法是按如下所示使用“*”: // [assembly: AssemblyVersion("1.0.*")] [assembly: AssemblyVersion("2.0.0.0")] [assembly: AssemblyFileVersion("2.0.0.0")] ================================================ FILE: test/FrameworkCoreTest/Template/TemplateSendTest.cs ================================================ using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using WX.Model; using WX.Model.ApiRequests; using WX.Model.ApiResponses; using Xunit; namespace FrameworkCoreTest.Template { public class TemplateSendTest : MockPostApiBaseTest { [Fact] public void TemplateSend() { MockSetup(false); var response = mock_client.Object.Execute(Request); Assert.Equal(false, response.IsError); Assert.Equal(200228332, response.MsgID); } protected override TemplateSendRequest InitRequestObject() { var data = new Dictionary(); data.Add("first", new TemplateDataProperty("恭喜你购买成功", "#173177")); data.Add("keynote1", new TemplateDataProperty("巧克力", "#173177")); data.Add("keynote2", new TemplateDataProperty("39.8元", "#173177")); data.Add("keynote3", new TemplateDataProperty("2014年9月16日", "#173177")); data.Add("remark", new TemplateDataProperty("欢迎再次购买!", "#173177")); return new TemplateSendRequest { AccessToken = "123", TemplateID = "ngqIpbwh8bUfcSsECmogfXcV14J0tQlEpBO27izEYtY", Url = "ngqIpbwh8bUfcSsECmogfXcV14J0tQlEpBO27izEYtY", TopColor = "#FF0000", Data = data, ToUser = "123xc" }; } protected override string GetReturnResult(bool errResult) { if (errResult) return s_errmsg; return @"{ ""errcode"":0, ""errmsg"":""ok"", ""msgid"":200228332 }"; } } } ================================================ FILE: test/FrameworkCoreTest/Template/TemplateSetindustrayTest.cs ================================================ using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using WX.Model.ApiRequests; using WX.Model.ApiResponses; using Xunit; namespace FrameworkCoreTest.Template { public class TemplateSetindustrayTest : MockPostApiBaseTest { [Fact] public void GetPostContentTest() { Console.WriteLine(Request.GetPostContent()); } protected override TemplateApisetindustryRequest InitRequestObject() { return new TemplateApisetindustryRequest { Industry_id1 = WX.Model.TemplateIndustry.Travel, Industry_id2 = WX.Model.TemplateIndustry.Hotel, AccessToken = "123" }; } protected override string GetReturnResult(bool errResult) { if (errResult) return s_errmsg; throw new NotImplementedException(); } } } ================================================ FILE: test/FrameworkCoreTest/packages.config ================================================