Exemplo n.º 1
0
        protected override void SolveInstance(IGH_DataAccess DA)
        {
            object         preAccount = null;
            SpeckleAccount Account    = null;

            DA.GetData(0, ref preAccount);

            Account = ((SpeckleAccount)preAccount.GetType().GetProperty("Value").GetValue(preAccount, null));

            if (Account == null)
            {
                return;
            }

            DA.SetDataList(0, OwnedStreams);
            DA.SetDataList(1, SharedStreams);

            if (Account == OldAccount)
            {
                return;
            }

            OldAccount = Account;

            Client.BaseUrl = Account.restApi; Client.AuthToken = Account.apiToken;
            Client.UserStreamsGetAsync().ContinueWith(tsk =>
            {
                OwnedStreams  = tsk.Result.OwnedStreams.ToList();
                SharedStreams = tsk.Result.SharedWithStreams.ToList();
                Rhino.RhinoApp.MainApplicationWindow.Invoke(ExpireComponent);
            });
        }