Beispiel #1
0
        public async Task <ChromaInstance> CreateInstance(string apiBaseAddress)
        {
            var clientConfiguration = new ClientConfiguration()
            {
                BaseAddress = new Uri(apiBaseAddress)
            };

            var client = new ChromaHttpClient();

            client.Init(clientConfiguration);
            await client.Register(jsonAppDefinition);

            await client.Heartbeat();

            var localInstance = new ChromaInstance(client);

            localInstance.DestroyMessage += () =>
            {
                if (!instance.IsCompleted || instance.Result == localInstance)
                {
                    instance = null;
                }
            };
            return(localInstance);
        }
Beispiel #2
0
        public async Task <ChromaInstance> Instance(string apiBaseAddress = DEFAULT_BASE_ADDRESS)
        {
            if (instance != null)
            {
                return(instance);
            }

            var clientConfiguration = new ClientConfiguration()
            {
                BaseAddress = new Uri(apiBaseAddress)
            };

            var client = new ChromaHttpClient();

            client.Init(clientConfiguration);
            await client.Register(jsonAppDefinition).ConfigureAwait(false);

            await client.Heartbeat().ConfigureAwait(false);

            instance = new ChromaInstance(client);
            instance.DestroyMessage += () => instance = null;

            return(instance);
        }
Beispiel #3
0
 public Animation(ChromaInstance instance)
 {
     this.instance = instance;
     Frames        = new List <AnimationFrame>();
 }