text
large_stringlengths 384
2.05k
| rank_avg
float64 1
4.19k
⌀ | rank_max
float64 1
8.21k
⌀ | rank_min
float64 1
5.03k
⌀ | rank_median
float64 1
4.21k
⌀ | rank_by_avgsim
float64 1
4.19k
⌀ | avgsim_to_github
float32 0.77
0.85
⌀ | dataset
large_stringclasses 1
value |
|---|---|---|---|---|---|---|---|
ef="https://opencollective.com/offline-plugin/backer/9/website" target="_blank"><img src="https://opencollective.com/offline-plugin/backer/9/avatar.svg"></a>
<a href="https://opencollective.com/offline-plugin/backer/10/website" target="_blank"><img src="https://opencollective.com/offline-plugin/backer/10/avatar.svg"></a>
<a href="https://opencollective.com/offline-plugin/backer/11/website" target="_blank"><img src="https://opencollective.com/offline-plugin/backer/11/avatar.svg"></a>
<a href="https://opencollective.com/offline-plugin/backer/12/website" target="_blank"><img src="https://opencollective.com/offline-plugin/backer/12/avatar.svg"></a>
<a href="https://opencollective.com/offline-plugin/backer/13/website" target="_blank"><img src="https://opencollective.com/offline-plugin/backer/13/avatar.svg"></a>
<a href="https://opencollective.com/offline-plugin/backer/14/website" target="_blank"><img src="https://opencollective.com/offline-plugin/backer/14/avatar.svg"></a>
<a href="https://opencollective.com/offline-plugin/backer/15/website" target="_blank"><img src="https://opencollective.com/offline-plugin/backer/15/avatar.svg"></a>
<a href="https://opencollective.com/offline-plugin/backer/16/website" target="_blank"><img src="https://opencollective.com/offline-plugin/backer/16/avatar.svg"></a>
<a href="https://opencollective.com/offline-plugin/backer/17/website" target="_blank"><img src="https://opencollective.com/offline-plugin/backer/17/avatar.svg"></a>
<a href="https://opencollective.com/offline-plugin/backer/18/website" target="_blank"><img src="https://opencollective.com/offline-plugin/backer/18/avatar.svg"></a>
<a href="https://opencollective.com/offline-plugin/backer/19/website" target="_blank"><img src="https://opencollective.com/offline-plugin/backer/19/avatar.svg"></a>
<a href="https://opencollective.com/offline-plugin/backer/20/website" target="_blank"><img src="https://opencollective.com/offline-plugin/backer/20/avatar.svg"></a>
<a href="https://opencollective.com/offline-plugin/backer/21/website" targe
| null | null | null | null | null | null |
github_plus_top10pct_by_avg
|
t="_blank"><img src="https://opencollective.com/offline-plugin/backer/21/avatar.svg"></a>
<a href="https://opencollective.com/offline-plugin/backer/22/website" target="_blank"><img src="https://opencollective.com/offline-plugin/backer/22/avatar.svg"></a>
<a href="https://opencollective.com/offline-plugin/backer/23/website" target="_blank"><img src="https://opencollective.com/offline-plugin/backer/23/avatar.svg"></a>
<a href="https://opencollective.com/offline-plugin/backer/24/website" target="_blank"><img src="https://opencollective.com/offline-plugin/backer/24/avatar.svg"></a>
<a href="https://opencollective.com/offline-plugin/backer/25/website" target="_blank"><img src="https://opencollective.com/offline-plugin/backer/25/avatar.svg"></a>
<a href="https://opencollective.com/offline-plugin/backer/26/website" target="_blank"><img src="https://opencollective.com/offline-plugin/backer/26/avatar.svg"></a>
<a href="https://opencollective.com/offline-plugin/backer/27/website" target="_blank"><img src="https://opencollective.com/offline-plugin/backer/27/avatar.svg"></a>
<a href="https://opencollective.com/offline-plugin/backer/28/website" target="_blank"><img src="https://opencollective.com/offline-plugin/backer/28/avatar.svg"></a>
<a href="https://opencollective.com/offline-plugin/backer/29/website" target="_blank"><img src="https://opencollective.com/offline-plugin/backer/29/avatar.svg"></a>
## Contribution
See [CONTRIBUTING](CONTRIBUTING.md)
## License
[MIT](LICENSE.md)
[Logo](logo/LICENSE.md)
## CHANGELOG
[CHANGELOG](CHANGELOG.md)
//
// BUserConnectionWrapper.m
// XMPPChat
//
// Created by Benjamin Smiley-andrews on 19/08/2016.
// Copyright © 2016 deluge. All rights reserved.
//
#import "BUserConnectionWrapper.h"
#import <ChatSDK/Core.h>
#define bAskKey @"ask"
@implementation BUserConnectionWrapper
+(BUserConnectionWrapper *) wrapperWithConnection:(id<PUserConnection>)connection {
return [[self alloc] initWithConnection:connection];
}
-(id) initWithConnection:(id<PUserConnection>) connection
| null | null | null | null | null | null |
github_plus_top10pct_by_avg
|
{
if ((self = [self init])) {
_connection = connection;
}
return self;
}
-(NSString *) ask {
return [_connection.meta metaStringForKey:bAskKey];
}
-(void) setAsk: (NSString *) ask {
[_connection setMetaValue:ask forKey:bAskKey];
}
@end
//
// Copyright (c) 2020 by SAP SE or an SAP affiliate company. All rights reserved. This file is licensed under the Apache Software License, v. 2 except as noted otherwise in the LICENSE file
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
'use strict'
const { HTTPError } = require('../lib/http-client')
const { createClient } = require('../lib/kubernetes-client')
describe('kubernetes-client', function () {
/* eslint no-unused-expressions: 0 */
const sandbox = sinon.createSandbox()
afterEach(function () {
sandbox.restore()
})
describe('Client', function () {
const bearer = 'bearer'
const namespace = 'namespace'
const name = 'name'
let testClient
let getSecretStub
beforeEach(function () {
testClient = createClient({ auth: { bearer } })
getSecretStub = sandbox.stub(testClient.core.secrets, 'get')
})
it('should create a client', function () {
expect(testClient.constructor.name).to.equal('Client')
expect(testClient.cluster.server.hostname).to.equal('kubernetes')
})
it('should read a kubeconfig from a secret', async function () {
getSecretStub.returns({
data: {
kubeconfig: Buffer.from('foo').toString('base64')
}
})
const
| null | null | null | null | null | null |
github_plus_top10pct_by_avg
|
kubeconfig = await testClient.getKubeconfig({ namespace, name })
expect(getSecretStub).to.be.calledOnceWith(namespace, name)
expect(kubeconfig).to.equal('foo')
})
it('should not find a kubeconfig in the secret', async function () {
getSecretStub.returns({
data: {}
})
try {
await testClient.getKubeconfig({ namespace, name })
expect.fail('expected "getKubeconfig" to throw not found')
} catch (err) {
expect(err).to.be.instanceof(HTTPError)
expect(err.response.statusCode).to.equal(404)
}
})
})
})
//
// RandomForest.h
// myopencv
//
// Created by lequan on 1/24/15.
// Copyright (c) 2015 lequan. All rights reserved.
//
#ifndef __myopencv__RandomForest__
#define __myopencv__RandomForest__
#include "Tree.h"
class RandomForest{
public:
std::vector<std::vector<Tree> > rfs_;
int max_numtrees_;
int num_landmark_;
int max_depth_;
int stages_;
double overlap_ratio_;
RandomForest(){
max_numtrees_ = global_params.max_numtrees;
num_landmark_ = global_params.landmark_num;
max_depth_ = global_params.max_depth;
overlap_ratio_ = global_params.bagging_overlap;
// resize the trees
rfs_.resize(num_landmark_);
for (int i=0;i<num_landmark_;i++){
rfs_[i].resize(max_numtrees_);
}
}
void Train(const std::vector<cv::Mat_<uchar> >& images,
const std::vector<cv::Mat_<double> >& ground_truth_shapes,
const std::vector<cv::Mat_<double> >& current_shapes,
const std::vector<BoundingBox> & bounding_boxs,
const cv::Mat_<double>& mean_shape,
const std::vector<cv::Mat_<double> >& shapes_residual,
int stages
);
void Read(std::ifstream& fin);
void Write(std::ofstream& fout);
};
#endif /* defined(__myopencv__RandomForest__) */
/*
* Copyright 2018 Google
*
* Licensed under the Apache License, Version 2
| null | null | null | null | null | null |
github_plus_top10pct_by_avg
|
.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#include "Firestore/core/src/firebase/firestore/remote/grpc_connection.h"
#include <algorithm>
#include <string>
#include <utility>
#include "Firestore/core/include/firebase/firestore/firestore_errors.h"
#include "Firestore/core/include/firebase/firestore/firestore_version.h"
#include "Firestore/core/src/firebase/firestore/auth/token.h"
#include "Firestore/core/src/firebase/firestore/model/database_id.h"
#include "Firestore/core/src/firebase/firestore/remote/grpc_root_certificate_finder.h"
#include "Firestore/core/src/firebase/firestore/util/filesystem.h"
#include "Firestore/core/src/firebase/firestore/util/hard_assert.h"
#include "Firestore/core/src/firebase/firestore/util/log.h"
#include "Firestore/core/src/firebase/firestore/util/string_format.h"
#include "absl/memory/memory.h"
#include "grpcpp/create_channel.h"
namespace firebase {
namespace firestore {
namespace remote {
using auth::Token;
using core::DatabaseInfo;
using model::DatabaseId;
using util::Path;
using util::Status;
using util::StatusOr;
using util::StringFormat;
namespace {
const char* const kXGoogAPIClientHeader = "x-goog-api-client";
const char* const kGoogleCloudResourcePrefix = "google-cloud-resource-prefix";
std::string MakeString(absl::string_view view) {
return view.data() ? std::string{view.data(), view.size()} : std::string{};
}
std::shared_ptr<grpc::ChannelCredentials> CreateSslCredentials(
const std::string& certificate) {
grpc::SslCredentialsOptions options;
options.pem_root_certs = certificate;
return grpc::Ss
| null | null | null | null | null | null |
github_plus_top10pct_by_avg
|
lCredentials(options);
}
struct HostConfig {
util::Path certificate_path;
std::string target_name;
bool use_insecure_channel = false;
};
using ConfigByHost = std::unordered_map<std::string, HostConfig>;
ConfigByHost& Config() {
static ConfigByHost config_by_host_;
return config_by_host_;
}
bool HasSpecialConfig(const std::string& host) {
return Config().find(host) != Config().end();
}
} // namespace
GrpcConnection::GrpcConnection(const DatabaseInfo& database_info,
util::AsyncQueue* worker_queue,
grpc::CompletionQueue* grpc_queue,
ConnectivityMonitor* connectivity_monitor)
: database_info_{&database_info},
worker_queue_{NOT_NULL(worker_queue)},
grpc_queue_{NOT_NULL(grpc_queue)},
connectivity_monitor_{NOT_NULL(connectivity_monitor)} {
RegisterConnectivityMonitor();
}
void GrpcConnection::Shutdown() {
// Fast finish any pending calls. This will not trigger the observers.
// Calls may unregister themselves on finish, so make a protective copy.
auto active_calls = active_calls_;
for (GrpcCall* call : active_calls) {
call->FinishImmediately();
}
}
std::unique_ptr<grpc::ClientContext> GrpcConnection::CreateContext(
const Token& credential) const {
absl::string_view token = credential.user().is_authenticated()
? credential.token()
: absl::string_view{};
auto context = absl::make_unique<grpc::ClientContext>();
if (token.data()) {
context->set_credentials(grpc::AccessTokenCredentials(MakeString(token)));
}
// TODO(dimond): This should ideally also include the gRPC version, however,
// gRPC defines the version as a macro, so it would be hardcoded based on
// version we have at compile time of the Firestore library, rather than the
// version available at runtime/at compile time by the user of the library.
//
// TODO(varconst): this should be configurable (e.g., "gl-cpp" or similar f
| null | null | null | null | null | null |
github_plus_top10pct_by_avg
|
or
// C++ SDK, etc.).
context->AddMetadata(
kXGoogAPIClientHeader,
StringFormat("gl-objc/ fire/%s grpc/", kFirestoreVersionString));
// This header is used to improve routing and project isolation by the
// backend.
const DatabaseId& db_id = database_info_->database_id();
context->AddMetadata(kGoogleCloudResourcePrefix,
StringFormat("projects/%s/databases/%s",
db_id.project_id(), db_id.database_id()));
return context;
}
void GrpcConnection::EnsureActiveStub() {
// TODO(varconst): find out in which cases a gRPC channel might shut down.
// This might be overkill.
if (!grpc_channel_ || grpc_channel_->GetState(/*try_to_connect=*/false) ==
GRPC_CHANNEL_SHUTDOWN) {
LOG_DEBUG("Creating Firestore stub.");
grpc_channel_ = CreateChannel();
grpc_stub_ = absl::make_unique<grpc::GenericStub>(grpc_channel_);
}
}
std::shared_ptr<grpc::Channel> GrpcConnection::CreateChannel() const {
const std::string& host = database_info_->host();
if (!HasSpecialConfig(host)) {
std::string root_certificate = LoadGrpcRootCertificate();
return grpc::CreateChannel(host, CreateSslCredentials(root_certificate));
}
const HostConfig& host_config = Config()[host];
// For the case when `Settings.sslEnabled == false`.
if (host_config.use_insecure_channel) {
return grpc::CreateChannel(host, grpc::InsecureChannelCredentials());
}
// For tests only
grpc::ChannelArguments args;
args.SetSslTargetNameOverride(host_config.target_name);
Path path = host_config.certificate_path;
StatusOr<std::string> test_certificate = ReadFile(path);
HARD_ASSERT(test_certificate.ok(),
StringFormat("Unable to open root certificates at file path %s",
path.ToUtf8String())
.c_str());
return grpc::CreateCustomChannel(
host, CreateSslCredentials(test_certificate.ValueOrDie()), args);
}
std::unique_ptr<GrpcStream> GrpcConnection::CreateStream
| null | null | null | null | null | null |
github_plus_top10pct_by_avg
|
(
absl::string_view rpc_name,
const Token& token,
GrpcStreamObserver* observer) {
EnsureActiveStub();
auto context = CreateContext(token);
auto call =
grpc_stub_->PrepareCall(context.get(), MakeString(rpc_name), grpc_queue_);
return absl::make_unique<GrpcStream>(std::move(context), std::move(call),
worker_queue_, this, observer);
}
std::unique_ptr<GrpcUnaryCall> GrpcConnection::CreateUnaryCall(
absl::string_view rpc_name,
const Token& token,
const grpc::ByteBuffer& message) {
EnsureActiveStub();
auto context = CreateContext(token);
auto call = grpc_stub_->PrepareUnaryCall(context.get(), MakeString(rpc_name),
message, grpc_queue_);
return absl::make_unique<GrpcUnaryCall>(std::move(context), std::move(call),
worker_queue_, this, message);
}
std::unique_ptr<GrpcStreamingReader> GrpcConnection::CreateStreamingReader(
absl::string_view rpc_name,
const Token& token,
const grpc::ByteBuffer& message) {
EnsureActiveStub();
auto context = CreateContext(token);
auto call =
grpc_stub_->PrepareCall(context.get(), MakeString(rpc_name), grpc_queue_);
return absl::make_unique<GrpcStreamingReader>(
std::move(context), std::move(call), worker_queue_, this, message);
}
void GrpcConnection::RegisterConnectivityMonitor() {
connectivity_monitor_->AddCallback(
[this](ConnectivityMonitor::NetworkStatus /*ignored*/) {
// Calls may unregister themselves on finish, so make a protective copy.
auto calls = active_calls_;
for (GrpcCall* call : calls) {
// This will trigger the observers.
call->FinishAndNotify(Status{FirestoreErrorCode::Unavailable,
"Network connectivity changed"});
}
// The old channel may hang for a long time trying to reestablish
// connection before eventually failing. Note that gRPC Objective-C
//
| null | null | null | null | null | null |
github_plus_top10pct_by_avg
|
client does the same thing:
// https://github.com/grpc/grpc/blob/fe11db09575f2dfbe1f88cd44bd417acc168e354/src/objective-c/GRPCClient/private/GRPCHost.m#L309-L314
grpc_channel_.reset();
});
}
void GrpcConnection::Register(GrpcCall* call) {
active_calls_.push_back(call);
}
void GrpcConnection::Unregister(GrpcCall* call) {
auto found = std::find(active_calls_.begin(), active_calls_.end(), call);
HARD_ASSERT(found != active_calls_.end(), "Missing a gRPC call");
active_calls_.erase(found);
}
/*static*/ void GrpcConnection::UseTestCertificate(
const std::string& host,
const Path& certificate_path,
const std::string& target_name) {
HARD_ASSERT(!host.empty(), "Empty host name");
HARD_ASSERT(!certificate_path.native_value().empty(),
"Empty path to test certificate");
HARD_ASSERT(!target_name.empty(), "Empty SSL target name");
HostConfig& host_config = Config()[host];
host_config.certificate_path = certificate_path;
host_config.target_name = target_name;
}
/*static*/ void GrpcConnection::UseInsecureChannel(const std::string& host) {
HARD_ASSERT(!host.empty(), "Empty host name");
HostConfig& host_config = Config()[host];
host_config.use_insecure_channel = true;
}
} // namespace remote
} // namespace firestore
} // namespace firebase
<Type Name="TaskCompletionSource" FullName="System.Threading.Tasks.TaskCompletionSource">
<TypeSignature Language="C#" Value="public class TaskCompletionSource" />
<TypeSignature Language="ILAsm" Value=".class public auto ansi beforefieldinit TaskCompletionSource extends System.Object" />
<TypeSignature Language="DocId" Value="T:System.Threading.Tasks.TaskCompletionSource" />
<TypeSignature Language="VB.NET" Value="Public Class TaskCompletionSource" />
<TypeSignature Language="C++ CLI" Value="public ref class TaskCompletionSource" />
<TypeSignature Language="F#" Value="type TaskCompletionSource = class" />
<AssemblyInfo>
<AssemblyName>System.Runtime</AssemblyName>
<AssemblyVersion>5.0.0.0
| null | null | null | null | null | null |
github_plus_top10pct_by_avg
|
</AssemblyVersion>
</AssemblyInfo>
<Base>
<BaseTypeName>System.Object</BaseTypeName>
</Base>
<Interfaces />
<Docs>
<summary>Represents the producer side of a <see cref="T:System.Threading.Tasks.Task" /> unbound to a delegate, providing access to the consumer side through the <see cref="T:System.Threading.Tasks.Task" /> property.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
It is often the case that a <xref:System.Threading.Tasks.Task> is desired to represent another asynchronous operation.
<xref:System.Threading.Tasks.TaskCompletionSource> is provided for this purpose. It enables the creation of a task that can be handed out to consumers, and those consumers can use the members of the task as they would any other. However, unlike most tasks, the state of a task created by a <xref:System.Threading.Tasks.TaskCompletionSource> is controlled explicitly by the methods on <xref:System.Threading.Tasks.TaskCompletionSource>. This enables the completion of the external asynchronous operation to be propagated to the underlying `Task`. The separation also ensures that consumers are not able to transition the state without access to the corresponding <xref:System.Threading.Tasks.TaskCompletionSource>.
All members of <xref:System.Threading.Tasks.TaskCompletionSource> are thread-safe and may be used from multiple threads concurrently.
]]></format>
</remarks>
</Docs>
<Members>
<Member MemberName=".ctor">
<MemberSignature Language="C#" Value="public TaskCompletionSource ();" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig specialname rtspecialname instance void .ctor() cil managed" />
<MemberSignature Language="DocId" Value="M:System.Threading.Tasks.TaskCompletionSource.#ctor" />
<MemberSignature Language="VB.NET" Value="Public Sub New ()" />
<MemberSignature Language="C++ CLI" Value="public:
 TaskCompletionSource();" />
<MemberType>Constructor</MemberType>
<AssemblyInfo>
| null | null | null | null | null | null |
github_plus_top10pct_by_avg
|
<AssemblyName>System.Runtime</AssemblyName>
<AssemblyVersion>5.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Parameters />
<Docs>
<summary>Creates a <see cref="T:System.Threading.Tasks.TaskCompletionSource" />.</summary>
<remarks>To be added.</remarks>
</Docs>
</Member>
<Member MemberName=".ctor">
<MemberSignature Language="C#" Value="public TaskCompletionSource (object state);" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig specialname rtspecialname instance void .ctor(object state) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Threading.Tasks.TaskCompletionSource.#ctor(System.Object)" />
<MemberSignature Language="VB.NET" Value="Public Sub New (state As Object)" />
<MemberSignature Language="C++ CLI" Value="public:
 TaskCompletionSource(System::Object ^ state);" />
<MemberSignature Language="F#" Value="new System.Threading.Tasks.TaskCompletionSource : obj -> System.Threading.Tasks.TaskCompletionSource" Usage="new System.Threading.Tasks.TaskCompletionSource state" />
<MemberType>Constructor</MemberType>
<AssemblyInfo>
<AssemblyName>System.Runtime</AssemblyName>
<AssemblyVersion>5.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Parameters>
<Parameter Name="state" Type="System.Object" />
</Parameters>
<Docs>
<param name="state">The state to use as the underlying <see cref="T:System.Threading.Tasks.Task" />'s <see langword="AsyncState" />.</param>
<summary>Creates a <see cref="T:System.Threading.Tasks.TaskCompletionSource" /> with the specified state.</summary>
<remarks>To be added.</remarks>
</Docs>
</Member>
<Member MemberName=".ctor">
<MemberSignature Language="C#" Value="public TaskCompletionSource (System.Threading.Tasks.TaskCreationOptions creationOptions);" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig specialname rtspecialname instance void .ctor(val
| null | null | null | null | null | null |
github_plus_top10pct_by_avg
|
uetype System.Threading.Tasks.TaskCreationOptions creationOptions) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Threading.Tasks.TaskCompletionSource.#ctor(System.Threading.Tasks.TaskCreationOptions)" />
<MemberSignature Language="VB.NET" Value="Public Sub New (creationOptions As TaskCreationOptions)" />
<MemberSignature Language="C++ CLI" Value="public:
 TaskCompletionSource(System::Threading::Tasks::TaskCreationOptions creationOptions);" />
<MemberSignature Language="F#" Value="new System.Threading.Tasks.TaskCompletionSource : System.Threading.Tasks.TaskCreationOptions -> System.Threading.Tasks.TaskCompletionSource" Usage="new System.Threading.Tasks.TaskCompletionSource creationOptions" />
<MemberType>Constructor</MemberType>
<AssemblyInfo>
<AssemblyName>System.Runtime</AssemblyName>
<AssemblyVersion>5.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Parameters>
<Parameter Name="creationOptions" Type="System.Threading.Tasks.TaskCreationOptions" />
</Parameters>
<Docs>
<param name="creationOptions">The options to use when creating the underlying <see cref="T:System.Threading.Tasks.Task" />.</param>
<summary>Creates a <see cref="T:System.Threading.Tasks.TaskCompletionSource" /> with the specified options.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
The <xref:System.Threading.Tasks.Task> created by this instance and accessible through its <xref:System.Threading.Tasks.TaskCompletionSource.Task> property will be instantiated using the specified `creationOptions`.
]]></format>
</remarks>
<exception cref="T:System.ArgumentOutOfRangeException">One or more of the specified <paramref name="creationOptions" /> are invalid for use with a <see cref="T:System.Threading.Tasks.TaskCompletionSource" />.
</exception>
</Docs>
</Member>
<Member MemberName=".ctor">
<MemberSignature Language="C#" Value="public TaskCompletion
| null | null | null | null | null | null |
github_plus_top10pct_by_avg
|
Source (object state, System.Threading.Tasks.TaskCreationOptions creationOptions);" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig specialname rtspecialname instance void .ctor(object state, valuetype System.Threading.Tasks.TaskCreationOptions creationOptions) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Threading.Tasks.TaskCompletionSource.#ctor(System.Object,System.Threading.Tasks.TaskCreationOptions)" />
<MemberSignature Language="VB.NET" Value="Public Sub New (state As Object, creationOptions As TaskCreationOptions)" />
<MemberSignature Language="C++ CLI" Value="public:
 TaskCompletionSource(System::Object ^ state, System::Threading::Tasks::TaskCreationOptions creationOptions);" />
<MemberSignature Language="F#" Value="new System.Threading.Tasks.TaskCompletionSource : obj * System.Threading.Tasks.TaskCreationOptions -> System.Threading.Tasks.TaskCompletionSource" Usage="new System.Threading.Tasks.TaskCompletionSource (state, creationOptions)" />
<MemberType>Constructor</MemberType>
<AssemblyInfo>
<AssemblyName>System.Runtime</AssemblyName>
<AssemblyVersion>5.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Parameters>
<Parameter Name="state" Type="System.Object" />
<Parameter Name="creationOptions" Type="System.Threading.Tasks.TaskCreationOptions" />
</Parameters>
<Docs>
<param name="state">The state to use as the underlying <see cref="T:System.Threading.Tasks.Task" />'s <see langword="AsyncState" />.</param>
<param name="creationOptions">The options to use when creating the underlying <see cref="T:System.Threading.Tasks.Task" />.</param>
<summary>Creates a <see cref="T:System.Threading.Tasks.TaskCompletionSource" /> with the specified state and options.</summary>
<remarks>To be added.</remarks>
<exception cref="T:System.ArgumentOutOfRangeException">One or more of the specified <paramref name="creationOptions" /> are invalid for use
| null | null | null | null | null | null |
github_plus_top10pct_by_avg
|
with a <see cref="T:System.Threading.Tasks.TaskCompletionSource" />.
</exception>
</Docs>
</Member>
<Member MemberName="SetCanceled">
<MemberSignature Language="C#" Value="public void SetCanceled ();" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig instance void SetCanceled() cil managed" />
<MemberSignature Language="DocId" Value="M:System.Threading.Tasks.TaskCompletionSource.SetCanceled" />
<MemberSignature Language="VB.NET" Value="Public Sub SetCanceled ()" />
<MemberSignature Language="C++ CLI" Value="public:
 void SetCanceled();" />
<MemberSignature Language="F#" Value="member this.SetCanceled : unit -> unit" Usage="taskCompletionSource.SetCanceled " />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Runtime</AssemblyName>
<AssemblyVersion>5.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Void</ReturnType>
</ReturnValue>
<Parameters />
<Docs>
<summary>Transitions the underlying <see cref="T:System.Threading.Tasks.Task" /> into the <see cref="F:System.Threading.Tasks.TaskStatus.Canceled" /> state.</summary>
<remarks>To be added.</remarks>
<exception cref="T:System.InvalidOperationException">The underlying <see cref="T:System.Threading.Tasks.Task" /> is already in one of the three final states: <see cref="F:System.Threading.Tasks.TaskStatus.RanToCompletion" />, <see cref="F:System.Threading.Tasks.TaskStatus.Faulted" />, or <see cref="F:System.Threading.Tasks.TaskStatus.Canceled" />.</exception>
</Docs>
</Member>
<Member MemberName="SetCanceled">
<MemberSignature Language="C#" Value="public void SetCanceled (System.Threading.CancellationToken cancellationToken);" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig instance void SetCanceled(valuetype System.Threading.CancellationToken cancellationToken) cil managed" />
<MemberSignature Language="DocId" V
| null | null | null | null | null | null |
github_plus_top10pct_by_avg
|
alue="M:System.Threading.Tasks.TaskCompletionSource.SetCanceled(System.Threading.CancellationToken)" />
<MemberSignature Language="VB.NET" Value="Public Sub SetCanceled (cancellationToken As CancellationToken)" />
<MemberSignature Language="C++ CLI" Value="public:
 void SetCanceled(System::Threading::CancellationToken cancellationToken);" />
<MemberSignature Language="F#" Value="member this.SetCanceled : System.Threading.CancellationToken -> unit" Usage="taskCompletionSource.SetCanceled cancellationToken" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Runtime</AssemblyName>
<AssemblyVersion>5.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Void</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="cancellationToken" Type="System.Threading.CancellationToken" />
</Parameters>
<Docs>
<param name="cancellationToken">The cancellation token with which to cancel the <see cref="T:System.Threading.Tasks.Task" />.</param>
<summary>Transitions the underlying <see cref="T:System.Threading.Tasks.Task" /> into the <see cref="F:System.Threading.Tasks.TaskStatus.Canceled" /> state using the specified token.</summary>
<remarks>To be added.</remarks>
<exception cref="T:System.InvalidOperationException">The underlying <see cref="T:System.Threading.Tasks.Task" /> is already in one of the three final states: <see cref="F:System.Threading.Tasks.TaskStatus.RanToCompletion" />, <see cref="F:System.Threading.Tasks.TaskStatus.Faulted" />, or <see cref="F:System.Threading.Tasks.TaskStatus.Canceled" />.</exception>
</Docs>
</Member>
<Member MemberName="SetException">
<MemberSignature Language="C#" Value="public void SetException (System.Collections.Generic.IEnumerable<Exception> exceptions);" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig instance void SetException(class System.Collections.Generic.IEn
| null | null | null | null | null | null |
github_plus_top10pct_by_avg
|
umerable`1<class System.Exception> exceptions) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Threading.Tasks.TaskCompletionSource.SetException(System.Collections.Generic.IEnumerable{System.Exception})" />
<MemberSignature Language="VB.NET" Value="Public Sub SetException (exceptions As IEnumerable(Of Exception))" />
<MemberSignature Language="C++ CLI" Value="public:
 void SetException(System::Collections::Generic::IEnumerable<Exception ^> ^ exceptions);" />
<MemberSignature Language="F#" Value="member this.SetException : seq<Exception> -> unit" Usage="taskCompletionSource.SetException exceptions" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Runtime</AssemblyName>
<AssemblyVersion>5.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Void</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="exceptions" Type="System.Collections.Generic.IEnumerable<System.Exception>" />
</Parameters>
<Docs>
<param name="exceptions">The collection of exceptions to bind to this <see cref="T:System.Threading.Tasks.Task" />.</param>
<summary>Transitions the underlying <see cref="T:System.Threading.Tasks.Task" /> into the <see cref="F:System.Threading.Tasks.TaskStatus.Faulted" /> state.</summary>
<remarks>To be added.</remarks>
<exception cref="T:System.ArgumentNullException">
<paramref name="exceptions" /> is <see langword="null" />.</exception>
<exception cref="T:System.ArgumentException">There are one or more <see langword="null" /> elements in <paramref name="exceptions" />.</exception>
<exception cref="T:System.InvalidOperationException">The underlying <see cref="T:System.Threading.Tasks.Task" /> is already in one of the three final states: <see cref="F:System.Threading.Tasks.TaskStatus.RanToCompletion" />, <see cref="F:System.Threading.Tasks.TaskStatus.Faulted" />, or <see
| null | null | null | null | null | null |
github_plus_top10pct_by_avg
|
cref="F:System.Threading.Tasks.TaskStatus.Canceled" />.</exception>
</Docs>
</Member>
<Member MemberName="SetException">
<MemberSignature Language="C#" Value="public void SetException (Exception exception);" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig instance void SetException(class System.Exception exception) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Threading.Tasks.TaskCompletionSource.SetException(System.Exception)" />
<MemberSignature Language="VB.NET" Value="Public Sub SetException (exception As Exception)" />
<MemberSignature Language="C++ CLI" Value="public:
 void SetException(Exception ^ exception);" />
<MemberSignature Language="F#" Value="member this.SetException : Exception -> unit" Usage="taskCompletionSource.SetException exception" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Runtime</AssemblyName>
<AssemblyVersion>5.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Void</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="exception" Type="System.Exception" />
</Parameters>
<Docs>
<param name="exception">The exception to bind to this <see cref="T:System.Threading.Tasks.Task" />.</param>
<summary>Transitions the underlying <see cref="T:System.Threading.Tasks.Task" /> into the <see cref="F:System.Threading.Tasks.TaskStatus.Faulted" /> state.</summary>
<remarks>To be added.</remarks>
<exception cref="T:System.ArgumentNullException">
<paramref name="exception" /> is <see langword="null" />.</exception>
<exception cref="T:System.InvalidOperationException">The underlying <see cref="T:System.Threading.Tasks.Task" /> is already in one of the three final states: <see cref="F:System.Threading.Tasks.TaskStatus.RanToCompletion" />, <see cref="F:System.Threading.Tasks.TaskStatus.Faulted" />, or <see cref="F:System.Threading.Ta
| null | null | null | null | null | null |
github_plus_top10pct_by_avg
|
sks.TaskStatus.Canceled" />.</exception>
</Docs>
</Member>
<Member MemberName="SetResult">
<MemberSignature Language="C#" Value="public void SetResult ();" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig instance void SetResult() cil managed" />
<MemberSignature Language="DocId" Value="M:System.Threading.Tasks.TaskCompletionSource.SetResult" />
<MemberSignature Language="VB.NET" Value="Public Sub SetResult ()" />
<MemberSignature Language="C++ CLI" Value="public:
 void SetResult();" />
<MemberSignature Language="F#" Value="member this.SetResult : unit -> unit" Usage="taskCompletionSource.SetResult " />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Runtime</AssemblyName>
<AssemblyVersion>5.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Void</ReturnType>
</ReturnValue>
<Parameters />
<Docs>
<summary>Transitions the underlying <see cref="T:System.Threading.Tasks.Task" /> into the <see cref="F:System.Threading.Tasks.TaskStatus.RanToCompletion" /> state.</summary>
<remarks>To be added.</remarks>
<exception cref="T:System.InvalidOperationException">The underlying <see cref="T:System.Threading.Tasks.Task" /> is already in one of the three final states: <see cref="F:System.Threading.Tasks.TaskStatus.RanToCompletion" />, <see cref="F:System.Threading.Tasks.TaskStatus.Faulted" />, or <see cref="F:System.Threading.Tasks.TaskStatus.Canceled" />.</exception>
</Docs>
</Member>
<Member MemberName="Task">
<MemberSignature Language="C#" Value="public System.Threading.Tasks.Task Task { get; }" />
<MemberSignature Language="ILAsm" Value=".property instance class System.Threading.Tasks.Task Task" />
<MemberSignature Language="DocId" Value="P:System.Threading.Tasks.TaskCompletionSource.Task" />
<MemberSignature Language="VB.NET" Value="Public ReadOnly Property Task As Task" />
<
| null | null | null | null | null | null |
github_plus_top10pct_by_avg
|
MemberSignature Language="C++ CLI" Value="public:
 property System::Threading::Tasks::Task ^ Task { System::Threading::Tasks::Task ^ get(); };" />
<MemberSignature Language="F#" Value="member this.Task : System.Threading.Tasks.Task" Usage="System.Threading.Tasks.TaskCompletionSource.Task" />
<MemberType>Property</MemberType>
<AssemblyInfo>
<AssemblyName>System.Runtime</AssemblyName>
<AssemblyVersion>5.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Threading.Tasks.Task</ReturnType>
</ReturnValue>
<Docs>
<summary>Gets the <see cref="T:System.Threading.Tasks.Task" /> created by this <see cref="T:System.Threading.Tasks.TaskCompletionSource" />.</summary>
<value>To be added.</value>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
This property gives a consumer access to the <xref:System.Threading.Tasks.TaskCompletionSource.Task> that's controlled by this instance.
The <xref:System.Threading.Tasks.TaskCompletionSource.SetResult>, <xref:System.Threading.Tasks.TaskCompletionSource.SetException(System.Exception)>, <xref:System.Threading.Tasks.TaskCompletionSource.SetException(System.Collections.Generic.IEnumerable{System.Exception})>, and <xref:System.Threading.Tasks.TaskCompletionSource.SetCanceled> methods (and their `Try` variants) on this instance all result in the relevant state transitions on this underlying `Task`.
]]></format>
</remarks>
</Docs>
</Member>
<Member MemberName="TrySetCanceled">
<MemberSignature Language="C#" Value="public bool TrySetCanceled ();" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig instance bool TrySetCanceled() cil managed" />
<MemberSignature Language="DocId" Value="M:System.Threading.Tasks.TaskCompletionSource.TrySetCanceled" />
<MemberSignature Language="VB.NET" Value="Public Function TrySetCanceled () As Boolean" />
<MemberSignature Language="C++ CLI" Value="
| null | null | null | null | null | null |
github_plus_top10pct_by_avg
|
public:
 bool TrySetCanceled();" />
<MemberSignature Language="F#" Value="member this.TrySetCanceled : unit -> bool" Usage="taskCompletionSource.TrySetCanceled " />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Runtime</AssemblyName>
<AssemblyVersion>5.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Boolean</ReturnType>
</ReturnValue>
<Parameters />
<Docs>
<summary>Attempts to transition the underlying <see cref="T:System.Threading.Tasks.Task" /> into the <see cref="F:System.Threading.Tasks.TaskStatus.Canceled" /> state.</summary>
<returns>
<see langword="true" /> if the operation was successful; otherwise, <see langword="false" />.</returns>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
This operation will return `false` if the <xref:System.Threading.Tasks.Task> is already in one of the three final states:
<xref:System.Threading.Tasks.TaskStatus.RanToCompletion>, <xref:System.Threading.Tasks.TaskStatus.Faulted>, or <xref:System.Threading.Tasks.TaskStatus.Canceled>.
]]></format>
</remarks>
</Docs>
</Member>
<Member MemberName="TrySetCanceled">
<MemberSignature Language="C#" Value="public bool TrySetCanceled (System.Threading.CancellationToken cancellationToken);" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig instance bool TrySetCanceled(valuetype System.Threading.CancellationToken cancellationToken) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Threading.Tasks.TaskCompletionSource.TrySetCanceled(System.Threading.CancellationToken)" />
<MemberSignature Language="VB.NET" Value="Public Function TrySetCanceled (cancellationToken As CancellationToken) As Boolean" />
<MemberSignature Language="C++ CLI" Value="public:
 bool TrySetCanceled(System::Threading::CancellationToken cancellationToken);" />
<MemberSignature Languag
| null | null | null | null | null | null |
github_plus_top10pct_by_avg
|
e="F#" Value="member this.TrySetCanceled : System.Threading.CancellationToken -> bool" Usage="taskCompletionSource.TrySetCanceled cancellationToken" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Runtime</AssemblyName>
<AssemblyVersion>5.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Boolean</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="cancellationToken" Type="System.Threading.CancellationToken" />
</Parameters>
<Docs>
<param name="cancellationToken">The cancellation token with which to cancel the <see cref="T:System.Threading.Tasks.Task" />.</param>
<summary>Attempts to transition the underlying <see cref="T:System.Threading.Tasks.Task" /> into the <see cref="F:System.Threading.Tasks.TaskStatus.Canceled" /> state.</summary>
<returns>
<see langword="true" /> if the operation was successful; otherwise, <see langword="false" />.</returns>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
This operation will return `false` if the <xref:System.Threading.Tasks.Task> is already in one of the three final states:
<xref:System.Threading.Tasks.TaskStatus.RanToCompletion>, <xref:System.Threading.Tasks.TaskStatus.Faulted>, or <xref:System.Threading.Tasks.TaskStatus.Canceled>.
]]></format>
</remarks>
</Docs>
</Member>
<Member MemberName="TrySetException">
<MemberSignature Language="C#" Value="public bool TrySetException (System.Collections.Generic.IEnumerable<Exception> exceptions);" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig instance bool TrySetException(class System.Collections.Generic.IEnumerable`1<class System.Exception> exceptions) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Threading.Tasks.TaskCompletionSource.TrySetException(System.Collections.Generic.IEnumerable{System.Exception})" />
<MemberSign
| null | null | null | null | null | null |
github_plus_top10pct_by_avg
|
ature Language="VB.NET" Value="Public Function TrySetException (exceptions As IEnumerable(Of Exception)) As Boolean" />
<MemberSignature Language="C++ CLI" Value="public:
 bool TrySetException(System::Collections::Generic::IEnumerable<Exception ^> ^ exceptions);" />
<MemberSignature Language="F#" Value="member this.TrySetException : seq<Exception> -> bool" Usage="taskCompletionSource.TrySetException exceptions" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Runtime</AssemblyName>
<AssemblyVersion>5.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Boolean</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="exceptions" Type="System.Collections.Generic.IEnumerable<System.Exception>" />
</Parameters>
<Docs>
<param name="exceptions">The collection of exceptions to bind to this <see cref="T:System.Threading.Tasks.Task" />.</param>
<summary>Attempts to transition the underlying <see cref="T:System.Threading.Tasks.Task" /> into the <see cref="F:System.Threading.Tasks.TaskStatus.Faulted" /> state.</summary>
<returns>
<see langword="true" /> if the operation was successful; otherwise, <see langword="false" />.</returns>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
This operation will return `false` if the <xref:System.Threading.Tasks.Task> is already in one of the three final states:
<xref:System.Threading.Tasks.TaskStatus.RanToCompletion>, <xref:System.Threading.Tasks.TaskStatus.Faulted>, or <xref:System.Threading.Tasks.TaskStatus.Canceled>.
]]></format>
</remarks>
<exception cref="T:System.ArgumentNullException">
<paramref name="exceptions" /> is <see langword="null" />.</exception>
<exception cref="T:System.ArgumentException">There are one or more <see langword="null" /> elements in <paramref name="exceptions" />.</exception>
<exce
| null | null | null | null | null | null |
github_plus_top10pct_by_avg
|
ption cref="T:System.ArgumentException">The <paramref name="exceptions" /> collection is empty.</exception>
</Docs>
</Member>
<Member MemberName="TrySetException">
<MemberSignature Language="C#" Value="public bool TrySetException (Exception exception);" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig instance bool TrySetException(class System.Exception exception) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Threading.Tasks.TaskCompletionSource.TrySetException(System.Exception)" />
<MemberSignature Language="VB.NET" Value="Public Function TrySetException (exception As Exception) As Boolean" />
<MemberSignature Language="C++ CLI" Value="public:
 bool TrySetException(Exception ^ exception);" />
<MemberSignature Language="F#" Value="member this.TrySetException : Exception -> bool" Usage="taskCompletionSource.TrySetException exception" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Runtime</AssemblyName>
<AssemblyVersion>5.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Boolean</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="exception" Type="System.Exception" />
</Parameters>
<Docs>
<param name="exception">The exception to bind to this <see cref="T:System.Threading.Tasks.Task" />.</param>
<summary>Attempts to transition the underlying <see cref="T:System.Threading.Tasks.Task" /> into the <see cref="F:System.Threading.Tasks.TaskStatus.Faulted" /> state.</summary>
<returns>
<see langword="true" /> if the operation was successful; otherwise, <see langword="false" />.</returns>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
This operation will return `false` if the <xref:System.Threading.Tasks.Task> is already in one of the three final states:
<xref:System.Threading.Tasks.TaskStatus.RanToCompletion>, <xref:System.Threadin
| null | null | null | null | null | null |
github_plus_top10pct_by_avg
|
g.Tasks.TaskStatus.Faulted>, or <xref:System.Threading.Tasks.TaskStatus.Canceled>.
]]></format>
</remarks>
<exception cref="T:System.ArgumentNullException">
<paramref name="exception" /> is <see langword="null" />.</exception>
</Docs>
</Member>
<Member MemberName="TrySetResult">
<MemberSignature Language="C#" Value="public bool TrySetResult ();" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig instance bool TrySetResult() cil managed" />
<MemberSignature Language="DocId" Value="M:System.Threading.Tasks.TaskCompletionSource.TrySetResult" />
<MemberSignature Language="VB.NET" Value="Public Function TrySetResult () As Boolean" />
<MemberSignature Language="C++ CLI" Value="public:
 bool TrySetResult();" />
<MemberSignature Language="F#" Value="member this.TrySetResult : unit -> bool" Usage="taskCompletionSource.TrySetResult " />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Runtime</AssemblyName>
<AssemblyVersion>5.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Boolean</ReturnType>
</ReturnValue>
<Parameters />
<Docs>
<summary>Attempts to transition the underlying <see cref="T:System.Threading.Tasks.Task" /> into the <see cref="F:System.Threading.Tasks.TaskStatus.RanToCompletion" /> state.</summary>
<returns>
<see langword="true" /> if the operation was successful; otherwise, <see langword="false" />.</returns>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
This operation will return `false` if the <xref:System.Threading.Tasks.Task> is already in one of the three final states:
<xref:System.Threading.Tasks.TaskStatus.RanToCompletion>, <xref:System.Threading.Tasks.TaskStatus.Faulted>, or <xref:System.Threading.Tasks.TaskStatus.Canceled>.
]]></format>
</remarks>
</Docs>
</Member>
</Members>
</Type>
class
| null | null | null | null | null | null |
github_plus_top10pct_by_avg
|
Logging {
public static enableDebug = false;
public static disableWarnings = false;
public static disableErrors = false;
private static TAG = "ApplicationInsights:";
public static info(message?: any, ...optionalParams: any[]) {
if(Logging.enableDebug) {
console.info(Logging.TAG + message, optionalParams);
}
}
public static warn(message?: any, ...optionalParams: any[]) {
if(!Logging.disableWarnings) {
console.warn(Logging.TAG + message, optionalParams);
}
}
}
export = Logging;
/*
This file is part of Ext JS 3.4
Copyright (c) 2011-2013 Sencha Inc
Contact: http://www.sencha.com/contact
GNU General Public License Usage
This file may be used under the terms of the GNU General Public License version 3.0 as
published by the Free Software Foundation and appearing in the file LICENSE included in the
packaging of this file.
Please review the following information to ensure the GNU General Public License version 3.0
requirements will be met: http://www.gnu.org/copyleft/gpl.html.
If you are unsure which license is appropriate for your use, please contact the sales department
at http://www.sencha.com/contact.
Build date: 2013-04-03 15:07:25
*/
.task {
background-image:url(../shared/icons/fam/cog.png) !important;
}
.task-folder {
background-image:url(../shared/icons/fam/folder_go.png) !important;
}
/**
* Copyright (C) 2016 Hyphenate Inc. All rights reserved.
* <p>
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* http://www.apache.org/licenses/LICENSE-2.0
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.fan
| null | null | null | null | null | null |
github_plus_top10pct_by_avg
|
xin.huangfangyi.main.fragment;
import android.app.ProgressDialog;
import android.content.Intent;
import android.view.ContextMenu;
import android.view.ContextMenu.ContextMenuInfo;
import android.view.LayoutInflater;
import android.view.MenuItem;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.AdapterView;
import android.widget.AdapterView.AdapterContextMenuInfo;
import android.widget.AdapterView.OnItemClickListener;
import android.widget.TextView;
import android.widget.Toast;
import com.alibaba.fastjson.JSONObject;
import com.fanxin.huangfangyi.DemoHelper;
import com.fanxin.huangfangyi.R;
import com.fanxin.huangfangyi.db.InviteMessgeDao;
import com.fanxin.huangfangyi.db.UserDao;
import com.fanxin.huangfangyi.main.FXConstant;
import com.fanxin.huangfangyi.main.activity.GroupListActivity;
import com.fanxin.huangfangyi.main.activity.NewFriendsActivity;
import com.fanxin.huangfangyi.main.activity.UserDetailsActivity;
import com.fanxin.huangfangyi.main.activity.LiveActivity;
import com.fanxin.huangfangyi.main.activity.LivesActivity;
import com.fanxin.huangfangyi.main.utils.OkHttpManager;
import com.fanxin.huangfangyi.main.utils.Param;
import com.fanxin.easeui.domain.EaseUser;
import com.fanxin.easeui.ui.EaseContactListFragment;
import com.hyphenate.chat.EMClient;
import com.hyphenate.chat.EMCmdMessageBody;
import com.hyphenate.chat.EMMessage;
import com.hyphenate.util.NetUtils;
import java.util.ArrayList;
import java.util.Hashtable;
import java.util.List;
import java.util.Map;
/**
* contact list
*
*/
public class ContactListFragment extends EaseContactListFragment implements View.OnClickListener {
private static final String TAG = ContactListFragment.class.getSimpleName();
private TextView tvUnread;
private InviteMessgeDao inviteMessgeDao;
@Override
protected void initView() {
super.initView();
View headerView = LayoutInflater.from(getActivity()).inflate(R.layout.fx_item_contact_list_header, null);
headerView.findViewById(R
| null | null | null | null | null | null |
github_plus_top10pct_by_avg
|
.id.re_newfriends).setOnClickListener(this);
headerView.findViewById(R.id.re_chatroom).setOnClickListener(this);
headerView.findViewById(R.id.re_tag).setOnClickListener(this);
headerView.findViewById(R.id.re_public).setOnClickListener(this);
tvUnread = (TextView) headerView.findViewById(R.id.tv_unread);
listView.addHeaderView(headerView);
this.titleBar.setVisibility(View.GONE);
getView().findViewById(R.id.search_bar_view).setVisibility(View.GONE);
registerForContextMenu(listView);
}
@Override
public void refresh() {
Map<String, EaseUser> m = DemoHelper.getInstance().getContactList();
if (m instanceof Hashtable<?, ?>) {
m = (Map<String, EaseUser>) ((Hashtable<String, EaseUser>) m).clone();
}
setContactsMap(m);
super.refresh();
if (inviteMessgeDao == null) {
inviteMessgeDao = new InviteMessgeDao(getActivity());
}
if (inviteMessgeDao.getUnreadMessagesCount() > 0) {
tvUnread.setVisibility(View.VISIBLE);
} else {
tvUnread.setVisibility(View.GONE);
}
}
@Override
protected void setUpView() {
titleBar.setRightImageResource(R.drawable.em_add);
titleBar.setRightLayoutClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
NetUtils.hasDataConnection(getActivity());
}
});
//设置联系人数据
Map<String, EaseUser> m = DemoHelper.getInstance().getContactList();
if (m instanceof Hashtable<?, ?>) {
m = (Map<String, EaseUser>) ((Hashtable<String, EaseUser>) m).clone();
}
setContactsMap(m);
super.setUpView();
listView.setOnItemClickListener(new OnItemClickListener() {
@Override
public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
try {
EaseUser user = ((EaseU
| null | null | null | null | null | null |
github_plus_top10pct_by_avg
|
ser) listView.getItemAtPosition(position));
if (user != null && user.getUserInfo() != null) {
startActivity(new Intent(getActivity(), UserDetailsActivity.class).putExtra(FXConstant.KEY_USER_INFO, user.getUserInfo()));
}
} catch (NullPointerException e) {
e.printStackTrace();
}
}
});
}
@Override
public void onDestroy() {
super.onDestroy();
}
@Override
public void onClick(View v) {
switch (v.getId()) {
case R.id.re_newfriends:
// 进入申请与通知页面
startActivity(new Intent(getActivity(), NewFriendsActivity.class));
break;
case R.id.re_chatroom:
// 进入群聊列表页面
startActivity(new Intent(getActivity(), GroupListActivity.class));
break;
case R.id.re_tag:
//进入直播间
// startActivity(new Intent(getActivity(), ChatActivity.class).putExtra("chatType", 3).
// putExtra("userId",FXConstant.FXLIVE_CHATROOM_ID));
startActivity(new Intent(getActivity(), LivesActivity.class));
break;
case R.id.re_public:
//进入Robot列表页面
startActivity(new Intent(getActivity(), LiveActivity.class));
break;
default:
break;
}
}
@Override
public void onCreateContextMenu(ContextMenu menu, View v, ContextMenuInfo menuInfo) {
super.onCreateContextMenu(menu, v, menuInfo);
toBeProcessUser = (EaseUser) listView.getItemAtPosition(((AdapterContextMenuInfo) menuInfo).position);
toBeProcessUsername = toBeProcessUser.getUsername();
getActivity().getMenuInflater().inflate(R.menu.em_context_contact_list, menu);
}
@Override
public boolean onContextItemSelected(MenuItem item) {
| null | null | null | null | null | null |
github_plus_top10pct_by_avg
|
if (item.getItemId() == R.id.delete_contact) {
//TODO 此接口需要调用后端接口
// Toast.makeText(getContext(),"此接口改调凡信后端接口,待更新...",Toast.LENGTH_LONG).show();
deleteContact(toBeProcessUser);
return true;
}
// else if (item.getItemId() == R.id.add_to_blacklist) {
// //TODO 此接口需要调用后端接口
// Toast.makeText(getContext(), "此接口改调凡信后端接口,待更新...", Toast.LENGTH_LONG).show();
// //moveToBlacklist(toBeProcessUsername);
// return true;
// }
return super.onContextItemSelected(item);
}
/**
* delete contact
*
* @param
*/
public void deleteContact(final EaseUser tobeDeleteUser) {
final String st1 = getResources().getString(R.string.deleting);
final String st2 = getResources().getString(R.string.Delete_failed);
final ProgressDialog pd = new ProgressDialog(getActivity());
pd.setMessage(st1);
pd.setCanceledOnTouchOutside(false);
pd.show();
List<Param> paramList = new ArrayList<>();
paramList.add(new Param("hxid_from", tobeDeleteUser.getUsername()));
paramList.add(new Param("hxid_to", DemoHelper.getInstance().getCurrentUsernName()));
OkHttpManager.getInstance().post(paramList, FXConstant.URL_DELETE_FRIEND, new OkHttpManager.HttpCallBack() {
@Override
public void onResponse(JSONObject jsonObject) {
pd.dismiss();
int code = jsonObject.getInteger("code");
if (code == 1000) {
InviteMessgeDao dao = new InviteMessgeDao(getActivity());
dao.deleteMessage(toBeProcessUser.getUsername());
UserDao userDao = new UserDao(getActivity());
userDao.deleteContact(tobeDeleteUser.getUsername());
DemoHelper.getInstance().getContactList().remove(tobeDeleteUser
| null | null | null | null | null | null |
github_plus_top10pct_by_avg
|
.getUsername());
contactList.remove(tobeDeleteUser);
contactListLayout.refresh();
sendCmdDeleteMsg(toBeProcessUser.getUsername());
Toast.makeText(getContext(), "删除成功", Toast.LENGTH_SHORT).show();
} else {
Toast.makeText(getContext(), st2, Toast.LENGTH_SHORT).show();
}
}
@Override
public void onFailure(String errorMsg) {
pd.dismiss();
Toast.makeText(getContext(), st2, Toast.LENGTH_SHORT).show();
}
});
// new Thread(new Runnable() {
// public void run() {
// try {
// EMClient.getInstance().contactManager().deleteContact(tobeDeleteUser.getUsername());
// // remove user from memory and database
// UserDao dao = new UserDao(getActivity());
// dao.deleteContact(tobeDeleteUser.getUsername());
// DemoHelper.getInstance().getContactList().remove(tobeDeleteUser.getUsername());
// getActivity().runOnUiThread(new Runnable() {
// public void run() {
// pd.dismiss();
// contactList.remove(tobeDeleteUser);
// contactListLayout.refresh();
//
// }
// });
// } catch (final Exception e) {
// getActivity().runOnUiThread(new Runnable() {
// public void run() {
// pd.dismiss();
// Toast.makeText(getActivity(), st2 + e.getMessage(), Toast.LENGTH_SHORT).show();
// }
// });
//
// }
// }
// }).start();
}
private void sendCmdDeleteMsg(String hxid) {
EMMessage cmdMsg = EMMessage.createSendMessage(EMMessage.Type.CMD);
| null | null | null | null | null | null |
github_plus_top10pct_by_avg
|
//支持单聊和群聊,默认单聊,
cmdMsg.setChatType(EMMessage.ChatType.Chat);
//action可以自定义
EMCmdMessageBody cmdBody = new EMCmdMessageBody(FXConstant.CMD_DELETE_FRIEND);
cmdMsg.setReceipt(hxid);
cmdMsg.addBody(cmdBody);
EMClient.getInstance().chatManager().sendMessage(cmdMsg);
}
}
ALTER TABLE STORE_INFO ADD COLUMN STATUS VARCHAR(50);
| null | null | null | null | null | null |
github_plus_top10pct_by_avg
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.