/// <summary>
 /// Creates a new Parse SDK command runner.
 /// </summary>
 /// <param name="webClient">The <see cref="IWebClient"/> implementation instance to use.</param>
 /// <param name="installationController">The <see cref="IParseInstallationController"/> implementation instance to use.</param>
 public ParseCommandRunner(IWebClient webClient, IParseInstallationController installationController, IMetadataController metadataController, IServerConnectionData serverConnectionData, Lazy <IParseUserController> userController)
 {
     WebClient = webClient;
     InstallationController = installationController;
     MetadataController     = metadataController;
     ServerConnectionData   = serverConnectionData;
     UserController         = userController;
 }
Beispiel #2
0
        public MutableServiceHub SetDefaults(IServerConnectionData connectionData = default)
        {
            ServerConnectionData ??= connectionData;
            MetadataController ??= new MetadataController
            {
                EnvironmentData  = EnvironmentData.Inferred,
                HostManifestData = HostManifestData.Inferred
            };

            Cloner ??= new ConcurrentUserServiceHubCloner {
            };

            WebClient ??= new UniversalWebClient {
            };
            CacheController ??= new CacheController {
            };
            ClassController ??= new ParseObjectClassController {
            };

            Decoder ??= new ParseDataDecoder(ClassController);

            InstallationController ??= new ParseInstallationController(CacheController);
            CommandRunner ??= new ParseCommandRunner(WebClient, InstallationController, MetadataController, ServerConnectionData, new Lazy <IParseUserController>(() => UserController));

            CloudCodeController ??= new ParseCloudCodeController(CommandRunner, Decoder);
            ConfigurationController ??= new ParseConfigurationController(CommandRunner, CacheController, Decoder);
            FileController ??= new ParseFileController(CommandRunner);
            ObjectController ??= new ParseObjectController(CommandRunner, Decoder, ServerConnectionData);
            QueryController ??= new ParseQueryController(CommandRunner, Decoder);
            SessionController ??= new ParseSessionController(CommandRunner, Decoder);
            UserController ??= new ParseUserController(CommandRunner, Decoder);
            CurrentUserController ??= new ParseCurrentUserController(CacheController, ClassController, Decoder);

            AnalyticsController ??= new ParseAnalyticsController(CommandRunner);

            InstallationCoder ??= new ParseInstallationCoder(Decoder, ClassController);

            PushController ??= new ParsePushController(CommandRunner, CurrentUserController);
            CurrentInstallationController ??= new ParseCurrentInstallationController(InstallationController, CacheController, InstallationCoder, ClassController);
            PushChannelsController ??= new ParsePushChannelsController(CurrentInstallationController);
            InstallationDataFinalizer ??= new ParseInstallationDataFinalizer {
            };

            return(this);
        }
 public ParseObjectController(IParseCommandRunner commandRunner, IParseDataDecoder decoder, IServerConnectionData serverConnectionData) => (CommandRunner, Decoder, ServerConnectionData) = (commandRunner, decoder, serverConnectionData);
 /// <summary>
 /// Creates a new <see cref="ParseClient"/> and authenticates it as belonging to your application. This class is a hub for interacting with the SDK. The recommended way to use this class on client applications is to instantiate it, then call <see cref="Publicize"/> on it in your application entry point. This allows you to access <see cref="Instance"/>.
 /// </summary>
 /// <param name="serverConnectionData">The configuration to initialize Parse with.</param>
 /// <param name="serviceHub">A service hub to override internal services and thereby make the Parse SDK operate in a custom manner.</param>
 /// <param name="mutators">A set of <see cref="IServiceHubMutator"/> implementation instances to tweak the behaviour of the SDK.</param>
 public ParseClient(IServerConnectionData serverConnectionData, IServiceHub serviceHub = default, params IServiceHubMutator[] mutators)
 {
     Services = serviceHub is { } ? new OrchestrationServiceHub {