global::System.Threading.Tasks.Task <object> global::Orleans.CodeGeneration.IGrainMethodInvoker.Invoke(global::Orleans.Runtime.IAddressable grain, int interfaceId, int methodId, object[] arguments)
        {
            try
            { if (grain == null)
              {
                  throw new System.ArgumentNullException("grain");
              }
              switch (interfaceId)
              {
              case -974803324:        // IMyGrain1
                  switch (methodId)
                  {
                  case -1732333552:
                      return(((IMyGrain1)grain).SayHello().ContinueWith(t => { if (t.Status == System.Threading.Tasks.TaskStatus.Faulted)
                                                                               {
                                                                                   throw t.Exception;
                                                                               }
                                                                               return (object)t.Result; }));

                  default:
                      throw new NotImplementedException("interfaceId=" + interfaceId + ",methodId=" + methodId);
                  }

              default:
                  throw new System.InvalidCastException("interfaceId=" + interfaceId);
              }
            }
            catch (Exception ex)
            {
                var t = new System.Threading.Tasks.TaskCompletionSource <object>();
                t.SetException(ex);
                return(t.Task);
            }
        }
Example #2
0
        }     // End Sub OpenBrowser

        private static System.Threading.Tasks.Task <int> RunProcessAsync(System.Diagnostics.ProcessStartInfo startInfo)
        {
            System.Threading.Tasks.TaskCompletionSource <int> tcs = new System.Threading.Tasks.TaskCompletionSource <int>();

            System.Diagnostics.Process process = new System.Diagnostics.Process
            {
                StartInfo           = startInfo,
                EnableRaisingEvents = true
            };

            process.Exited += delegate(object sender, System.EventArgs args)
            {
                tcs.SetResult(process.ExitCode);
                process.Dispose();
            };

            try
            {
                process.Start();
            }
            catch (System.Exception ex)
            {
                tcs.SetException(ex);
            }

            return(tcs.Task);
        } // End Task RunProcessAsync
Example #3
0
        global::System.Threading.Tasks.Task <object> global::Orleans.CodeGeneration.IGrainMethodInvoker.Invoke(global::Orleans.Runtime.IAddressable grain, int interfaceId, int methodId, object[] arguments)
        {
            try
            { { if (grain == null)
                {
                    throw new System.ArgumentNullException("grain");
                }
                switch (interfaceId)
                {
                case 1167282281:      // IMessageObserver
                    switch (methodId)
                    {
                    case -679320403:
                        ((IMessageObserver)grain).Send((Microsoft.AspNet.SignalR.Messaging.Message[])arguments[0]); return(System.Threading.Tasks.Task.FromResult((object)true));

                    default:
                        throw new NotImplementedException("interfaceId=" + interfaceId + ",methodId=" + methodId);
                    }

                default:
                    throw new System.InvalidCastException("interfaceId=" + interfaceId);
                }
              } }
            catch (Exception ex)
            { {
                  var t = new System.Threading.Tasks.TaskCompletionSource <object>();
                  t.SetException(ex);
                  return(t.Task);
              } }
        }
Example #4
0
        global::System.Threading.Tasks.Task <object> global::Orleans.CodeGeneration.IGrainMethodInvoker.Invoke(global::Orleans.Runtime.IAddressable grain, int interfaceId, int methodId, object[] arguments)
        {
            try
            { { if (grain == null)
                {
                    throw new System.ArgumentNullException("grain");
                }
                switch (interfaceId)
                {
                case -1413064308:      // ISystemObserver
                    switch (methodId)
                    {
                    case -2130055570:
                        ((ISystemObserver)grain).HighTemperature((Double)arguments[0]); return(System.Threading.Tasks.Task.FromResult((object)true));

                    default:
                        throw new NotImplementedException("interfaceId=" + interfaceId + ",methodId=" + methodId);
                    }

                default:
                    throw new System.InvalidCastException("interfaceId=" + interfaceId);
                }
              } }
            catch (Exception ex)
            { {
                  var t = new System.Threading.Tasks.TaskCompletionSource <object>();
                  t.SetException(ex);
                  return(t.Task);
              } }
        }
Example #5
0
        global::System.Threading.Tasks.Task <object> global::Orleans.CodeGeneration.IGrainMethodInvoker.Invoke(global::Orleans.Runtime.IAddressable grain, int interfaceId, int methodId, object[] arguments)
        {
            try
            { { if (grain == null)
                {
                    throw new System.ArgumentNullException("grain");
                }
                switch (interfaceId)
                {
                case 148814687:      // IDecodeGrain
                    switch (methodId)
                    {
                    case 1114664117:
                        return(((IDecodeGrain)grain).Decode((String)arguments[0]).ContinueWith(t => { if (t.Status == System.Threading.Tasks.TaskStatus.Faulted)
                                                                                                      {
                                                                                                          throw t.Exception;
                                                                                                      }
                                                                                                      return (object)null; }));

                    default:
                        throw new NotImplementedException("interfaceId=" + interfaceId + ",methodId=" + methodId);
                    }

                default:
                    throw new System.InvalidCastException("interfaceId=" + interfaceId);
                }
              } }
            catch (Exception ex)
            { {
                  var t = new System.Threading.Tasks.TaskCompletionSource <object>();
                  t.SetException(ex);
                  return(t.Task);
              } }
        }
Example #6
0
        public static System.Threading.Tasks.Task LoginAsync(string username, string password)
        {
            var tcs = new System.Threading.Tasks.TaskCompletionSource <PTPrincipal>();

            PTIdentity.GetPTIdentity(username, password, (o, e) =>
            {
                if (e.Error == null && e.Object != null)
                {
                    SetPrincipal(e.Object);
                    tcs.SetResult(null);
                }
                else
                {
                    Logout();
                    if (e.Error != null)
                    {
                        tcs.SetException(e.Error.InnerException);
                    }
                    else
                    {
                        tcs.SetCanceled();
                    }
                }
            });
            return(tcs.Task);
        }
        global::System.Threading.Tasks.Task <object> global::Orleans.CodeGeneration.IGrainMethodInvoker.Invoke(global::Orleans.Runtime.IAddressable grain, int interfaceId, int methodId, object[] arguments)
        {
            try
            { if (grain == null)
              {
                  throw new System.ArgumentNullException("grain");
              }
              switch (interfaceId)
              {
              case -525402465:        // IHelloGrain
                  switch (methodId)
                  {
                  default:
                      throw new NotImplementedException("interfaceId=" + interfaceId + ",methodId=" + methodId);
                  }

              case 1928988877:             // IGrainWithIntegerKey
                  switch (methodId)
                  {
                  default:
                      throw new NotImplementedException("interfaceId=" + interfaceId + ",methodId=" + methodId);
                  }

              default:
                  throw new System.InvalidCastException("interfaceId=" + interfaceId);
              }
            }
            catch (Exception ex)
            {
                var t = new System.Threading.Tasks.TaskCompletionSource <object>();
                t.SetException(ex);
                return(t.Task);
            }
        }
Example #8
0
        global::System.Threading.Tasks.Task <object> global::Orleans.CodeGeneration.IGrainMethodInvoker.Invoke(global::Orleans.Runtime.IAddressable grain, int interfaceId, int methodId, object[] arguments)
        {
            try
            { if (grain == null)
              {
                  throw new System.ArgumentNullException("grain");
              }
              switch (interfaceId)
              {
              case 364124001:        // IEmployee
                  switch (methodId)
                  {
                  case 312402437:
                      return(((IEmployee)grain).GetLevel().ContinueWith(t => { if (t.Status == System.Threading.Tasks.TaskStatus.Faulted)
                                                                               {
                                                                                   throw t.Exception;
                                                                               }
                                                                               return (object)t.Result; }));

                  case -1461035780:
                      return(((IEmployee)grain).Promote((Int32)arguments[0]).ContinueWith(t => { if (t.Status == System.Threading.Tasks.TaskStatus.Faulted)
                                                                                                 {
                                                                                                     throw t.Exception;
                                                                                                 }
                                                                                                 return (object)null; }));

                  case 940043127:
                      return(((IEmployee)grain).GetManager().ContinueWith(t => { if (t.Status == System.Threading.Tasks.TaskStatus.Faulted)
                                                                                 {
                                                                                     throw t.Exception;
                                                                                 }
                                                                                 return (object)t.Result; }));

                  case -159913581:
                      return(((IEmployee)grain).SetManager((IManager)arguments[0]).ContinueWith(t => { if (t.Status == System.Threading.Tasks.TaskStatus.Faulted)
                                                                                                       {
                                                                                                           throw t.Exception;
                                                                                                       }
                                                                                                       return (object)null; }));

                  default:
                      throw new NotImplementedException("interfaceId=" + interfaceId + ",methodId=" + methodId);
                  }

              default:
                  throw new System.InvalidCastException("interfaceId=" + interfaceId);
              }
            }
            catch (Exception ex)
            {
                var t = new System.Threading.Tasks.TaskCompletionSource <object>();
                t.SetException(ex);
                return(t.Task);
            }
        }
Example #9
0
        global::System.Threading.Tasks.Task <object> global::Orleans.CodeGeneration.IGrainMethodInvoker.Invoke(global::Orleans.Runtime.IAddressable grain, int interfaceId, int methodId, object[] arguments)
        {
            try
            { if (grain == null)
              {
                  throw new System.ArgumentNullException("grain");
              }
              switch (interfaceId)
              {
              case 1313245371:        // IHelloGrain
                  switch (methodId)
                  {
                  case -61059369:
                      return(((IHelloGrain)grain).ReadSomething().ContinueWith(t => { if (t.Status == System.Threading.Tasks.TaskStatus.Faulted)
                                                                                      {
                                                                                          throw t.Exception;
                                                                                      }
                                                                                      return (object)t.Result; }));

                  case 59235890:
                      return(((IHelloGrain)grain).WriteSomething((String)arguments[0]).ContinueWith(t => { if (t.Status == System.Threading.Tasks.TaskStatus.Faulted)
                                                                                                           {
                                                                                                               throw t.Exception;
                                                                                                           }
                                                                                                           return (object)null; }));

                  case -454132849:
                      return(((IHelloGrain)grain).GetState().ContinueWith(t => { if (t.Status == System.Threading.Tasks.TaskStatus.Faulted)
                                                                                 {
                                                                                     throw t.Exception;
                                                                                 }
                                                                                 return (object)t.Result; }));

                  default:
                      throw new NotImplementedException("interfaceId=" + interfaceId + ",methodId=" + methodId);
                  }

              case -1277021679:             // IGrainWithStringKey
                  switch (methodId)
                  {
                  default:
                      throw new NotImplementedException("interfaceId=" + interfaceId + ",methodId=" + methodId);
                  }

              default:
                  throw new System.InvalidCastException("interfaceId=" + interfaceId);
              }
            }
            catch (Exception ex)
            {
                var t = new System.Threading.Tasks.TaskCompletionSource <object>();
                t.SetException(ex);
                return(t.Task);
            }
        }
Example #10
0
        global::System.Threading.Tasks.Task <object> global::Orleans.CodeGeneration.IGrainMethodInvoker.Invoke(global::Orleans.Runtime.IAddressable grain, int interfaceId, int methodId, object[] arguments)
        {
            try
            { { if (grain == null)
                {
                    throw new System.ArgumentNullException("grain");
                }
                switch (interfaceId)
                {
                case 1021785371:      // ISystemGrain
                    switch (methodId)
                    {
                    case 997261292:
                        return(((ISystemGrain)grain).SetTemperature((TemperatureReading)arguments[0]).ContinueWith(t => { if (t.Status == System.Threading.Tasks.TaskStatus.Faulted)
                                                                                                                          {
                                                                                                                              throw t.Exception;
                                                                                                                          }
                                                                                                                          return (object)null; }));

                    case 98774684:
                        return(((ISystemGrain)grain).GetTemperature().ContinueWith(t => { if (t.Status == System.Threading.Tasks.TaskStatus.Faulted)
                                                                                          {
                                                                                              throw t.Exception;
                                                                                          }
                                                                                          return (object)t.Result; }));

                    case 987286981:
                        return(((ISystemGrain)grain).Subscribe((ISystemObserver)arguments[0]).ContinueWith(t => { if (t.Status == System.Threading.Tasks.TaskStatus.Faulted)
                                                                                                                  {
                                                                                                                      throw t.Exception;
                                                                                                                  }
                                                                                                                  return (object)null; }));

                    case -1645784438:
                        return(((ISystemGrain)grain).Unsubscribe((ISystemObserver)arguments[0]).ContinueWith(t => { if (t.Status == System.Threading.Tasks.TaskStatus.Faulted)
                                                                                                                    {
                                                                                                                        throw t.Exception;
                                                                                                                    }
                                                                                                                    return (object)null; }));

                    default:
                        throw new NotImplementedException("interfaceId=" + interfaceId + ",methodId=" + methodId);
                    }

                default:
                    throw new System.InvalidCastException("interfaceId=" + interfaceId);
                }
              } }
            catch (Exception ex)
            { {
                  var t = new System.Threading.Tasks.TaskCompletionSource <object>();
                  t.SetException(ex);
                  return(t.Task);
              } }
        }
Example #11
0
        global::System.Threading.Tasks.Task <object> global::Orleans.CodeGeneration.IGrainMethodInvoker.Invoke(global::Orleans.Runtime.IAddressable grain, int interfaceId, int methodId, object[] arguments)
        {
            try
            { if (grain == null)
              {
                  throw new System.ArgumentNullException("grain");
              }
              switch (interfaceId)
              {
              case 372486725:        // IBeaconGrain
                  switch (methodId)
                  {
                  case -289883699:
                      return(((IBeaconGrain)grain).UpdateDevicePosition((Guid)arguments[0], (Double)arguments[1], (Double)arguments[2]).ContinueWith(t => { if (t.Status == System.Threading.Tasks.TaskStatus.Faulted)
                                                                                                                                                            {
                                                                                                                                                                throw t.Exception;
                                                                                                                                                            }
                                                                                                                                                            return (object)null; }));

                  case -1453378005:
                      return(((IBeaconGrain)grain).Leave((Guid)arguments[0]).ContinueWith(t => { if (t.Status == System.Threading.Tasks.TaskStatus.Faulted)
                                                                                                 {
                                                                                                     throw t.Exception;
                                                                                                 }
                                                                                                 return (object)null; }));

                  case -1285976066:
                      return(((IBeaconGrain)grain).GetDevices().ContinueWith(t => { if (t.Status == System.Threading.Tasks.TaskStatus.Faulted)
                                                                                    {
                                                                                        throw t.Exception;
                                                                                    }
                                                                                    return (object)t.Result; }));

                  default:
                      throw new NotImplementedException("interfaceId=" + interfaceId + ",methodId=" + methodId);
                  }

              case -1097320095:             // IGrainWithGuidKey
                  switch (methodId)
                  {
                  default:
                      throw new NotImplementedException("interfaceId=" + interfaceId + ",methodId=" + methodId);
                  }

              default:
                  throw new System.InvalidCastException("interfaceId=" + interfaceId);
              }
            }
            catch (Exception ex)
            {
                var t = new System.Threading.Tasks.TaskCompletionSource <object>();
                t.SetException(ex);
                return(t.Task);
            }
        }
Example #12
0
        global::System.Threading.Tasks.Task <object> global::Orleans.CodeGeneration.IGrainMethodInvoker.Invoke(global::Orleans.Runtime.IAddressable grain, int interfaceId, int methodId, object[] arguments)
        {
            try
            { if (grain == null)
              {
                  throw new System.ArgumentNullException("grain");
              }
              switch (interfaceId)
              {
              case 704364051:        // IDeviceGrain
                  switch (methodId)
                  {
                  case 184075932:
                      return(((IDeviceGrain)grain).UpdatePosition((Double)arguments[0], (Double)arguments[1]).ContinueWith(t => { if (t.Status == System.Threading.Tasks.TaskStatus.Faulted)
                                                                                                                                  {
                                                                                                                                      throw t.Exception;
                                                                                                                                  }
                                                                                                                                  return (object)null; }));

                  case -2035798409:
                      return(((IDeviceGrain)grain).GetSurroundingDevices().ContinueWith(t => { if (t.Status == System.Threading.Tasks.TaskStatus.Faulted)
                                                                                               {
                                                                                                   throw t.Exception;
                                                                                               }
                                                                                               return (object)t.Result; }));

                  case 1748567639:
                      return(((IDeviceGrain)grain).UpdatePositionAndGetSurroundingDevices((Double)arguments[0], (Double)arguments[1]).ContinueWith(t => { if (t.Status == System.Threading.Tasks.TaskStatus.Faulted)
                                                                                                                                                          {
                                                                                                                                                              throw t.Exception;
                                                                                                                                                          }
                                                                                                                                                          return (object)t.Result; }));

                  default:
                      throw new NotImplementedException("interfaceId=" + interfaceId + ",methodId=" + methodId);
                  }

              case -1097320095:             // IGrainWithGuidKey
                  switch (methodId)
                  {
                  default:
                      throw new NotImplementedException("interfaceId=" + interfaceId + ",methodId=" + methodId);
                  }

              default:
                  throw new System.InvalidCastException("interfaceId=" + interfaceId);
              }
            }
            catch (Exception ex)
            {
                var t = new System.Threading.Tasks.TaskCompletionSource <object>();
                t.SetException(ex);
                return(t.Task);
            }
        }
Example #13
0
        global::System.Threading.Tasks.Task <object> global::Orleans.CodeGeneration.IGrainMethodInvoker.Invoke(global::Orleans.Runtime.IAddressable grain, int interfaceId, int methodId, object[] arguments)
        {
            try
            { if (grain == null)
              {
                  throw new System.ArgumentNullException("grain");
              }
              switch (interfaceId)
              {
              case 1788928010:        // IDeviceGrain
                  switch (methodId)
                  {
                  case -1555867497:
                      return(((IDeviceGrain)grain).JoinSystem((System.String)arguments[0]).ContinueWith(t => { if (t.Status == System.Threading.Tasks.TaskStatus.Faulted)
                                                                                                               {
                                                                                                                   throw t.Exception;
                                                                                                               }
                                                                                                               return (object)null; }));

                  case -1788431855:
                      return(((IDeviceGrain)grain).SetTemperature((System.Double)arguments[0]).ContinueWith(t => { if (t.Status == System.Threading.Tasks.TaskStatus.Faulted)
                                                                                                                   {
                                                                                                                       throw t.Exception;
                                                                                                                   }
                                                                                                                   return (object)null; }));

                  case 98774684:
                      return(((IDeviceGrain)grain).GetTemperature().ContinueWith(t => { if (t.Status == System.Threading.Tasks.TaskStatus.Faulted)
                                                                                        {
                                                                                            throw t.Exception;
                                                                                        }
                                                                                        return (object)t.Result; }));

                  default:
                      throw new NotImplementedException("interfaceId=" + interfaceId + ",methodId=" + methodId);
                  }

              case -1277021679:             // IGrainWithStringKey
                  switch (methodId)
                  {
                  default:
                      throw new NotImplementedException("interfaceId=" + interfaceId + ",methodId=" + methodId);
                  }

              default:
                  throw new System.InvalidCastException("interfaceId=" + interfaceId);
              }
            }
            catch (Exception ex)
            {
                var t = new System.Threading.Tasks.TaskCompletionSource <object>();
                t.SetException(ex);
                return(t.Task);
            }
        }
Example #14
0
        global::System.Threading.Tasks.Task <object> global::Orleans.CodeGeneration.IGrainMethodInvoker.Invoke(global::Orleans.Runtime.IAddressable grain, int interfaceId, int methodId, object[] arguments)
        {
            try
            { { if (grain == null)
                {
                    throw new System.ArgumentNullException("grain");
                }
                switch (interfaceId)
                {
                case 679704130:      // ITeacher
                    switch (methodId)
                    {
                    case 2085948699:
                        return(((ITeacher)grain).SetName((String)arguments[0], (String)arguments[1]).ContinueWith(t => { if (t.Status == System.Threading.Tasks.TaskStatus.Faulted)
                                                                                                                         {
                                                                                                                             throw t.Exception;
                                                                                                                         }
                                                                                                                         return (object)null; }));

                    case -1168913303:
                        return(((ITeacher)grain).GetInfo().ContinueWith(t => { if (t.Status == System.Threading.Tasks.TaskStatus.Faulted)
                                                                               {
                                                                                   throw t.Exception;
                                                                               }
                                                                               return (object)t.Result; }));

                    case 91621796:
                        return(((ITeacher)grain).GetFullName().ContinueWith(t => { if (t.Status == System.Threading.Tasks.TaskStatus.Faulted)
                                                                                   {
                                                                                       throw t.Exception;
                                                                                   }
                                                                                   return (object)t.Result; }));

                    default:
                        throw new NotImplementedException("interfaceId=" + interfaceId + ",methodId=" + methodId);
                    }

                case -1097320095:           // IGrainWithGuidKey
                    switch (methodId)
                    {
                    default:
                        throw new NotImplementedException("interfaceId=" + interfaceId + ",methodId=" + methodId);
                    }

                default:
                    throw new System.InvalidCastException("interfaceId=" + interfaceId);
                }
              } }
            catch (Exception ex)
            { {
                  var t = new System.Threading.Tasks.TaskCompletionSource <object>();
                  t.SetException(ex);
                  return(t.Task);
              } }
        }
        global::System.Threading.Tasks.Task <object> global::Orleans.CodeGeneration.IGrainMethodInvoker.Invoke(global::Orleans.Runtime.IAddressable grain, int interfaceId, int methodId, object[] arguments)
        {
            try
            { if (grain == null)
              {
                  throw new System.ArgumentNullException("grain");
              }
              switch (interfaceId)
              {
              case 1530413783:        // IManager
                  switch (methodId)
                  {
                  case -1701259070:
                      return(((IManager)grain).AsEmployee().ContinueWith(t => { if (t.Status == System.Threading.Tasks.TaskStatus.Faulted)
                                                                                {
                                                                                    throw t.Exception;
                                                                                }
                                                                                return (object)t.Result; }));

                  case -675836216:
                      return(((IManager)grain).GetDirectReports().ContinueWith(t => { if (t.Status == System.Threading.Tasks.TaskStatus.Faulted)
                                                                                      {
                                                                                          throw t.Exception;
                                                                                      }
                                                                                      return (object)t.Result; }));

                  case -1731443267:
                      return(((IManager)grain).AddDirectReport((IEmployee)arguments[0]).ContinueWith(t => { if (t.Status == System.Threading.Tasks.TaskStatus.Faulted)
                                                                                                            {
                                                                                                                throw t.Exception;
                                                                                                            }
                                                                                                            return (object)null; }));

                  case -459995068:
                      return(((IManager)grain).Order((String)arguments[0]).ContinueWith(t => { if (t.Status == System.Threading.Tasks.TaskStatus.Faulted)
                                                                                               {
                                                                                                   throw t.Exception;
                                                                                               }
                                                                                               return (object)null; }));

                  default:
                      throw new NotImplementedException("interfaceId=" + interfaceId + ",methodId=" + methodId);
                  }

              default:
                  throw new System.InvalidCastException("interfaceId=" + interfaceId);
              }
            }
            catch (Exception ex)
            {
                var t = new System.Threading.Tasks.TaskCompletionSource <object>();
                t.SetException(ex);
                return(t.Task);
            }
        }
Example #16
0
 public void OnComplete(Task task)
 {
     if (task.IsSuccessful)
     {
         taskCompletionSource.SetResult(task?.Result?.JavaCast <TResult> ());
     }
     else
     {
         taskCompletionSource.SetException(task.Exception);
     }
 }
Example #17
0
        /// <summary>
        /// Saves the Model, first committing changes
        /// if ManagedObjectLifetime is true.
        /// </summary>
        protected virtual System.Threading.Tasks.Task <T> SaveAsync()
        {
            var tcs = new System.Threading.Tasks.TaskCompletionSource <T>();

            try
            {
                var savable = Model as Csla.Core.ISavable;
                if (ManageObjectLifetime)
                {
                    // clone the object if possible
                    ICloneable clonable = Model as ICloneable;
                    if (clonable != null)
                    {
                        savable = (Csla.Core.ISavable)clonable.Clone();
                    }

                    //apply changes
                    var undoable = savable as Csla.Core.ISupportUndo;
                    if (undoable != null)
                    {
                        undoable.ApplyEdit();
                    }
                }

                savable.Saved += (o, e) =>
                {
                    IsBusy = false;
                    if (e.Error == null)
                    {
                        var result = e.NewObject;
                        var model  = (T)result;
                        OnSaving(model);
                        Model = model;
                        tcs.SetResult(model);
                    }
                    else
                    {
                        Error = e.Error;
                        tcs.SetException(e.Error);
                    }
                    OnSaved();
                };
                Error  = null;
                IsBusy = true;
                savable.BeginSave();
            }
            catch (Exception ex)
            {
                IsBusy = false;
                Error  = ex;
                OnSaved();
            }
            return(tcs.Task);
        }
Example #18
0
        global::System.Threading.Tasks.Task <object> global::Orleans.CodeGeneration.IGrainMethodInvoker.Invoke(global::Orleans.Runtime.IAddressable grain, int interfaceId, int methodId, object[] arguments)
        {
            try
            { if (grain == null)
              {
                  throw new System.ArgumentNullException("grain");
              }
              switch (interfaceId)
              {
              case -720626290:        // IAggregatorGrain
                  switch (methodId)
                  {
                  case -274381691:
                      return(((IAggregatorGrain)grain).GetGrainInformation((Int32)arguments[0]).ContinueWith(t => { if (t.Status == System.Threading.Tasks.TaskStatus.Faulted)
                                                                                                                    {
                                                                                                                        throw t.Exception;
                                                                                                                    }
                                                                                                                    return (object)t.Result; }));

                  case 937813785:
                      return(((IAggregatorGrain)grain).SetColor((GrainInformation)arguments[0]).ContinueWith(t => { if (t.Status == System.Threading.Tasks.TaskStatus.Faulted)
                                                                                                                    {
                                                                                                                        throw t.Exception;
                                                                                                                    }
                                                                                                                    return (object)null; }));

                  default:
                      throw new NotImplementedException("interfaceId=" + interfaceId + ",methodId=" + methodId);
                  }

              case -1277021679:             // IGrainWithStringKey
                  switch (methodId)
                  {
                  default:
                      throw new NotImplementedException("interfaceId=" + interfaceId + ",methodId=" + methodId);
                  }

              default:
                  throw new System.InvalidCastException("interfaceId=" + interfaceId);
              }
            }
            catch (Exception ex)
            {
                var t = new System.Threading.Tasks.TaskCompletionSource <object>();
                t.SetException(ex);
                return(t.Task);
            }
        }
        global::System.Threading.Tasks.Task <object> global::Orleans.CodeGeneration.IGrainMethodInvoker.Invoke(global::Orleans.Runtime.IAddressable grain, int interfaceId, int methodId, object[] arguments)
        {
            try
            { if (grain == null)
              {
                  throw new System.ArgumentNullException("grain");
              }
              switch (interfaceId)
              {
              case 600369071:        // ICounter
                  switch (methodId)
                  {
                  case 732981053:
                      return(((ICounter)grain).IncrementCounter().ContinueWith(t => { if (t.Status == System.Threading.Tasks.TaskStatus.Faulted)
                                                                                      {
                                                                                          throw t.Exception;
                                                                                      }
                                                                                      return (object)null; }));

                  case 1574597839:
                      return(((ICounter)grain).ResetCounter().ContinueWith(t => { if (t.Status == System.Threading.Tasks.TaskStatus.Faulted)
                                                                                  {
                                                                                      throw t.Exception;
                                                                                  }
                                                                                  return (object)null; }));

                  case -1311190982:
                      return(((ICounter)grain).GetTotalCounter().ContinueWith(t => { if (t.Status == System.Threading.Tasks.TaskStatus.Faulted)
                                                                                     {
                                                                                         throw t.Exception;
                                                                                     }
                                                                                     return (object)t.Result; }));

                  default:
                      throw new NotImplementedException("interfaceId=" + interfaceId + ",methodId=" + methodId);
                  }

              default:
                  throw new System.InvalidCastException("interfaceId=" + interfaceId);
              }
            }
            catch (Exception ex)
            {
                var t = new System.Threading.Tasks.TaskCompletionSource <object>();
                t.SetException(ex);
                return(t.Task);
            }
        }
        global::System.Threading.Tasks.Task <object> global::Orleans.CodeGeneration.IGrainMethodInvoker.Invoke(global::Orleans.Runtime.IAddressable grain, int interfaceId, int methodId, object[] arguments)
        {
            try
            { if (grain == null)
              {
                  throw new System.ArgumentNullException("grain");
              }
              switch (interfaceId)
              {
              case -42832476:        // ICalculator
                  switch (methodId)
                  {
                  case -365058130:
                      return(((ICalculator)grain).Add((System.Int32)arguments[0]).ContinueWith(t => { if (t.Status == System.Threading.Tasks.TaskStatus.Faulted)
                                                                                                      {
                                                                                                          throw t.Exception;
                                                                                                      }
                                                                                                      return (object)t.Result; }));

                  case 22970774:
                      return(((ICalculator)grain).Subtract((System.Int32)arguments[0]).ContinueWith(t => { if (t.Status == System.Threading.Tasks.TaskStatus.Faulted)
                                                                                                           {
                                                                                                               throw t.Exception;
                                                                                                           }
                                                                                                           return (object)t.Result; }));

                  case 510627153:
                      return(((ICalculator)grain).Multiply((System.Int32)arguments[0]).ContinueWith(t => { if (t.Status == System.Threading.Tasks.TaskStatus.Faulted)
                                                                                                           {
                                                                                                               throw t.Exception;
                                                                                                           }
                                                                                                           return (object)t.Result; }));

                  default:
                      throw new NotImplementedException("interfaceId=" + interfaceId + ",methodId=" + methodId);
                  }

              default:
                  throw new System.InvalidCastException("interfaceId=" + interfaceId);
              }
            }
            catch (Exception ex)
            {
                var t = new System.Threading.Tasks.TaskCompletionSource <object>();
                t.SetException(ex);
                return(t.Task);
            }
        }
        global::System.Threading.Tasks.Task <object> global::Orleans.CodeGeneration.IGrainMethodInvoker.Invoke(global::Orleans.Runtime.IAddressable grain, int interfaceId, int methodId, object[] arguments)
        {
            try
            { if (grain == null)
              {
                  throw new System.ArgumentNullException("grain");
              }
              switch (interfaceId)
              {
              case -725616150:        // ICustomerGrain
                  switch (methodId)
                  {
                  case 316304768:
                      return(((ICustomerGrain)grain).SetName((String)arguments[0]).ContinueWith(t => { if (t.Status == System.Threading.Tasks.TaskStatus.Faulted)
                                                                                                       {
                                                                                                           throw t.Exception;
                                                                                                       }
                                                                                                       return (object)null; }));

                  case 1535020019:
                      return(((ICustomerGrain)grain).GetModel().ContinueWith(t => { if (t.Status == System.Threading.Tasks.TaskStatus.Faulted)
                                                                                    {
                                                                                        throw t.Exception;
                                                                                    }
                                                                                    return (object)t.Result; }));

                  default:
                      throw new NotImplementedException("interfaceId=" + interfaceId + ",methodId=" + methodId);
                  }

              case -1097320095:             // IGrainWithGuidKey
                  switch (methodId)
                  {
                  default:
                      throw new NotImplementedException("interfaceId=" + interfaceId + ",methodId=" + methodId);
                  }

              default:
                  throw new System.InvalidCastException("interfaceId=" + interfaceId);
              }
            }
            catch (Exception ex)
            {
                var t = new System.Threading.Tasks.TaskCompletionSource <object>();
                t.SetException(ex);
                return(t.Task);
            }
        }
Example #22
0
        static StackObject *SetException_2(ILIntepreter __intp, StackObject *__esp, IList <object> __mStack, CLRMethod __method, bool isNewObj)
        {
            ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
            StackObject *ptr_of_this_method;
            StackObject *__ret = ILIntepreter.Minus(__esp, 2);

            ptr_of_this_method = ILIntepreter.Minus(__esp, 1);
            System.Exception @exception = (System.Exception) typeof(System.Exception).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack));
            __intp.Free(ptr_of_this_method);

            ptr_of_this_method = ILIntepreter.Minus(__esp, 2);
            System.Threading.Tasks.TaskCompletionSource <Google.Protobuf.IMessageAdaptor.Adaptor> instance_of_this_method = (System.Threading.Tasks.TaskCompletionSource <Google.Protobuf.IMessageAdaptor.Adaptor>) typeof(System.Threading.Tasks.TaskCompletionSource <Google.Protobuf.IMessageAdaptor.Adaptor>).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack));
            __intp.Free(ptr_of_this_method);

            instance_of_this_method.SetException(@exception);

            return(__ret);
        }
Example #23
0
        global::System.Threading.Tasks.Task <object> global::Orleans.CodeGeneration.IGrainMethodInvoker.Invoke(global::Orleans.Runtime.IAddressable grain, int interfaceId, int methodId, object[] arguments)
        {
            try
            { if (grain == null)
              {
                  throw new System.ArgumentNullException("grain");
              }
              switch (interfaceId)
              {
              case 2060187244:        // ITransferTransactionProcessManager
                  switch (methodId)
                  {
                  case 1500745786:
                      return(((ITransferTransactionProcessManager)grain).ProcessTransferTransaction((Guid)arguments[0], (Guid)arguments[1], (Decimal)arguments[2]).ContinueWith(t => { if (t.Status == System.Threading.Tasks.TaskStatus.Faulted)
                                                                                                                                                                                       {
                                                                                                                                                                                           throw t.Exception;
                                                                                                                                                                                       }
                                                                                                                                                                                       return (object)null; }));

                  default:
                      throw new NotImplementedException("interfaceId=" + interfaceId + ",methodId=" + methodId);
                  }

              case 1928988877:             // IGrainWithIntegerKey
                  switch (methodId)
                  {
                  default:
                      throw new NotImplementedException("interfaceId=" + interfaceId + ",methodId=" + methodId);
                  }

              default:
                  throw new System.InvalidCastException("interfaceId=" + interfaceId);
              }
            }
            catch (Exception ex)
            {
                var t = new System.Threading.Tasks.TaskCompletionSource <object>();
                t.SetException(ex);
                return(t.Task);
            }
        }
Example #24
0
        global::System.Threading.Tasks.Task <object> global::Orleans.CodeGeneration.IGrainMethodInvoker.Invoke(global::Orleans.Runtime.IAddressable grain, int interfaceId, int methodId, object[] arguments)
        {
            try
            { { if (grain == null)
                {
                    throw new System.ArgumentNullException("grain");
                }
                switch (interfaceId)
                {
                case 1881073148:      // IChatUser
                    switch (methodId)
                    {
                    case 1824972864:
                        return(((IChatUser)grain).SendMessage((Guid)arguments[0], (String)arguments[1]).ContinueWith(t => { if (t.Status == System.Threading.Tasks.TaskStatus.Faulted)
                                                                                                                            {
                                                                                                                                throw t.Exception;
                                                                                                                            }
                                                                                                                            return (object)null; }));

                    case 1569111363:
                        return(((IChatUser)grain).ReceiveMessage((Guid)arguments[0], (String)arguments[1]).ContinueWith(t => { if (t.Status == System.Threading.Tasks.TaskStatus.Faulted)
                                                                                                                               {
                                                                                                                                   throw t.Exception;
                                                                                                                               }
                                                                                                                               return (object)null; }));

                    default:
                        throw new NotImplementedException("interfaceId=" + interfaceId + ",methodId=" + methodId);
                    }

                default:
                    throw new System.InvalidCastException("interfaceId=" + interfaceId);
                }
              } }
            catch (Exception ex)
            { {
                  var t = new System.Threading.Tasks.TaskCompletionSource <object>();
                  t.SetException(ex);
                  return(t.Task);
              } }
        }
Example #25
0
        global::System.Threading.Tasks.Task <object> global::Orleans.CodeGeneration.IGrainMethodInvoker.Invoke(global::Orleans.Runtime.IAddressable grain, int interfaceId, int methodId, object[] arguments)
        {
            try
            { if (grain == null)
              {
                  throw new System.ArgumentNullException("grain");
              }
              switch (interfaceId)
              {
              case 1391960172:        // IStartWorkflow
                  switch (methodId)
                  {
                  case 1420312199:
                      return(((IStartWorkflow)grain).Start().ContinueWith(t => { if (t.Status == System.Threading.Tasks.TaskStatus.Faulted)
                                                                                 {
                                                                                     throw t.Exception;
                                                                                 }
                                                                                 return (object)null; }));

                  default:
                      throw new NotImplementedException("interfaceId=" + interfaceId + ",methodId=" + methodId);
                  }

              case 1928988877:             // IGrainWithIntegerKey
                  switch (methodId)
                  {
                  default:
                      throw new NotImplementedException("interfaceId=" + interfaceId + ",methodId=" + methodId);
                  }

              default:
                  throw new System.InvalidCastException("interfaceId=" + interfaceId);
              }
            }
            catch (Exception ex)
            {
                var t = new System.Threading.Tasks.TaskCompletionSource <object>();
                t.SetException(ex);
                return(t.Task);
            }
        }
Example #26
0
        global::System.Threading.Tasks.Task <object> global::Orleans.CodeGeneration.IGrainMethodInvoker.Invoke(global::Orleans.Runtime.IAddressable grain, int interfaceId, int methodId, object[] arguments)
        {
            try
            { { if (grain == null)
                {
                    throw new System.ArgumentNullException("grain");
                }
                switch (interfaceId)
                {
                case 1150057381:      // IPubSubManager
                    switch (methodId)
                    {
                    case -203526534:
                        return(((IPubSubManager)grain).Register((IPubSubGrain)arguments[0]).ContinueWith(t => { if (t.Status == System.Threading.Tasks.TaskStatus.Faulted)
                                                                                                                {
                                                                                                                    throw t.Exception;
                                                                                                                }
                                                                                                                return (object)t.Result; }));

                    case -2125469177:
                        return(((IPubSubManager)grain).Unregister((IPubSubGrain)arguments[0]).ContinueWith(t => { if (t.Status == System.Threading.Tasks.TaskStatus.Faulted)
                                                                                                                  {
                                                                                                                      throw t.Exception;
                                                                                                                  }
                                                                                                                  return (object)null; }));

                    default:
                        throw new NotImplementedException("interfaceId=" + interfaceId + ",methodId=" + methodId);
                    }

                default:
                    throw new System.InvalidCastException("interfaceId=" + interfaceId);
                }
              } }
            catch (Exception ex)
            { {
                  var t = new System.Threading.Tasks.TaskCompletionSource <object>();
                  t.SetException(ex);
                  return(t.Task);
              } }
        }
Example #27
0
        global::System.Threading.Tasks.Task <object> global::Orleans.CodeGeneration.IGrainMethodInvoker.Invoke(global::Orleans.Runtime.IAddressable grain, int interfaceId, int methodId, object[] arguments)
        {
            try
            { if (grain == null)
              {
                  throw new System.ArgumentNullException("grain");
              }
              switch (interfaceId)
              {
              case 1814956545:        // ILogGrain
                  switch (methodId)
                  {
                  case 42839863:
                      return(((ILogGrain)grain).ExceptionAsync().ContinueWith(t => { if (t.Status == System.Threading.Tasks.TaskStatus.Faulted)
                                                                                     {
                                                                                         throw t.Exception;
                                                                                     }
                                                                                     return (object)t.Result; }));

                  case 1173360318:
                      return(((ILogGrain)grain).TraceAsync().ContinueWith(t => { if (t.Status == System.Threading.Tasks.TaskStatus.Faulted)
                                                                                 {
                                                                                     throw t.Exception;
                                                                                 }
                                                                                 return (object)t.Result; }));

                  default:
                      throw new NotImplementedException("interfaceId=" + interfaceId + ",methodId=" + methodId);
                  }

              default:
                  throw new System.InvalidCastException("interfaceId=" + interfaceId);
              }
            }
            catch (Exception ex)
            {
                var t = new System.Threading.Tasks.TaskCompletionSource <object>();
                t.SetException(ex);
                return(t.Task);
            }
        }
        global::System.Threading.Tasks.Task <object> global::Orleans.CodeGeneration.IGrainMethodInvoker.Invoke(global::Orleans.Runtime.IAddressable grain, int interfaceId, int methodId, object[] arguments)
        {
            try
            { if (grain == null)
              {
                  throw new System.ArgumentNullException("grain");
              }
              switch (interfaceId)
              {
              case -285330679:        // IHashtagGrain
                  switch (methodId)
                  {
                  case -1303993644:
                      return(((IHashtagGrain)grain).AddScore((Int32)arguments[0], (String)arguments[1]).ContinueWith(t => { if (t.Status == System.Threading.Tasks.TaskStatus.Faulted)
                                                                                                                            {
                                                                                                                                throw t.Exception;
                                                                                                                            }
                                                                                                                            return (object)null; }));

                  case -2004439872:
                      return(((IHashtagGrain)grain).GetTotals().ContinueWith(t => { if (t.Status == System.Threading.Tasks.TaskStatus.Faulted)
                                                                                    {
                                                                                        throw t.Exception;
                                                                                    }
                                                                                    return (object)t.Result; }));

                  default:
                      throw new NotImplementedException("interfaceId=" + interfaceId + ",methodId=" + methodId);
                  }

              default:
                  throw new System.InvalidCastException("interfaceId=" + interfaceId);
              }
            }
            catch (Exception ex)
            {
                var t = new System.Threading.Tasks.TaskCompletionSource <object>();
                t.SetException(ex);
                return(t.Task);
            }
        }
Example #29
0
        global::System.Threading.Tasks.Task <object> global::Orleans.CodeGeneration.IGrainMethodInvoker.Invoke(global::Orleans.Runtime.IAddressable grain, int interfaceId, int methodId, object[] arguments)
        {
            try
            { if (grain == null)
              {
                  throw new System.ArgumentNullException("grain");
              }
              switch (interfaceId)
              {
              case -1854587754:        // IHello
                  switch (methodId)
                  {
                  case -510773597:
                      return(((IHello)grain).SayHello((String)arguments[0]).ContinueWith(t => { if (t.Status == System.Threading.Tasks.TaskStatus.Faulted)
                                                                                                {
                                                                                                    throw t.Exception;
                                                                                                }
                                                                                                return (object)t.Result; }));

                  default:
                      throw new NotImplementedException("interfaceId=" + interfaceId + ",methodId=" + methodId);
                  }

              case 1928988877:             // IGrainWithIntegerKey
                  switch (methodId)
                  {
                  default:
                      throw new NotImplementedException("interfaceId=" + interfaceId + ",methodId=" + methodId);
                  }

              default:
                  throw new System.InvalidCastException("interfaceId=" + interfaceId);
              }
            }
            catch (Exception ex)
            {
                var t = new System.Threading.Tasks.TaskCompletionSource <object>();
                t.SetException(ex);
                return(t.Task);
            }
        }
Example #30
0
        global::System.Threading.Tasks.Task <object> global::Orleans.CodeGeneration.IGrainMethodInvoker.Invoke(global::Orleans.Runtime.IAddressable grain, int interfaceId, int methodId, object[] arguments)
        {
            try
            { if (grain == null)
              {
                  throw new System.ArgumentNullException("grain");
              }
              switch (interfaceId)
              {
              case -1784953168:        // ISystemGrain
                  switch (methodId)
                  {
                  case -1906793719:
                      return(((ISystemGrain)grain).SetTemperature((Double)arguments[0], (String)arguments[1]).ContinueWith(t => { if (t.Status == System.Threading.Tasks.TaskStatus.Faulted)
                                                                                                                                  {
                                                                                                                                      throw t.Exception;
                                                                                                                                  }
                                                                                                                                  return (object)null; }));

                  default:
                      throw new NotImplementedException("interfaceId=" + interfaceId + ",methodId=" + methodId);
                  }

              case -1277021679:             // IGrainWithStringKey
                  switch (methodId)
                  {
                  default:
                      throw new NotImplementedException("interfaceId=" + interfaceId + ",methodId=" + methodId);
                  }

              default:
                  throw new System.InvalidCastException("interfaceId=" + interfaceId);
              }
            }
            catch (Exception ex)
            {
                var t = new System.Threading.Tasks.TaskCompletionSource <object>();
                t.SetException(ex);
                return(t.Task);
            }
        }
Example #31
0
    public static System.Threading.Tasks.Task LoginAsync(string username, string password)
    {
        var tcs = new System.Threading.Tasks.TaskCompletionSource<PTPrincipal>();

        PTIdentity.GetPTIdentity(username, password, (o, e) =>
        {
            if (e.Error == null && e.Object != null)
            {
                SetPrincipal(e.Object);
                tcs.SetResult(null);
            }
            else
            {
                Logout();
                if (e.Error != null) 
                    tcs.SetException(e.Error.InnerException);
                else
                    tcs.SetCanceled();
            }
        });
        return tcs.Task;
    }
        global::System.Threading.Tasks.Task<object> global::Orleans.CodeGeneration.IGrainMethodInvoker.Invoke(global::Orleans.Runtime.IAddressable grain, int interfaceId, int methodId, object[] arguments)
        {

            try
            {                    if (grain == null) throw new System.ArgumentNullException("grain");
                switch (interfaceId)
                {
                    case 389679522:  // IPowerLineObserver
                        switch (methodId)
                        {
                            case 1671039887: 
                                ((IPowerLineObserver)grain).OverConsumption((Int32)arguments[0]); return System.Threading.Tasks.Task.FromResult((object)true);
                            default: 
                            throw new NotImplementedException("interfaceId="+interfaceId+",methodId="+methodId);
                        }
                    default:
                        throw new System.InvalidCastException("interfaceId="+interfaceId);
                }
            }
            catch(Exception ex)
            {
                var t = new System.Threading.Tasks.TaskCompletionSource<object>();
                t.SetException(ex);
                return t.Task;
            }
        }
Example #33
0
        global::System.Threading.Tasks.Task<object> global::Orleans.CodeGeneration.IGrainMethodInvoker.Invoke(global::Orleans.Runtime.IAddressable grain, int interfaceId, int methodId, object[] arguments)
        {

            try
            {                    if (grain == null) throw new System.ArgumentNullException("grain");
                switch (interfaceId)
                {
                    case -1277882208:  // IHello
                        switch (methodId)
                        {
                            case 1136607985: 
                                return ((IHello)grain).GetCustomers().ContinueWith(t => {if (t.Status == System.Threading.Tasks.TaskStatus.Faulted) throw t.Exception; return (object)t.Result; });
                            default: 
                            throw new NotImplementedException("interfaceId="+interfaceId+",methodId="+methodId);
                        }
                    default:
                        throw new System.InvalidCastException("interfaceId="+interfaceId);
                }
            }
            catch(Exception ex)
            {
                var t = new System.Threading.Tasks.TaskCompletionSource<object>();
                t.SetException(ex);
                return t.Task;
            }
        }
        global::System.Threading.Tasks.Task<object> global::Orleans.CodeGeneration.IGrainMethodInvoker.Invoke(global::Orleans.Runtime.IAddressable grain, int interfaceId, int methodId, object[] arguments)
        {

            try
            {                    if (grain == null) throw new System.ArgumentNullException("grain");
                switch (interfaceId)
                {
                    case 2060187244:  // ITransferTransactionProcessManager
                        switch (methodId)
                        {
                            case 1500745786: 
                                return ((ITransferTransactionProcessManager)grain).ProcessTransferTransaction((Guid)arguments[0], (Guid)arguments[1], (Decimal)arguments[2]).ContinueWith(t => {if (t.Status == System.Threading.Tasks.TaskStatus.Faulted) throw t.Exception; return (object)null; });
                            default: 
                            throw new NotImplementedException("interfaceId="+interfaceId+",methodId="+methodId);
                        }case 1928988877:  // IGrainWithIntegerKey
                        switch (methodId)
                        {
                            default: 
                            throw new NotImplementedException("interfaceId="+interfaceId+",methodId="+methodId);
                        }
                    default:
                        throw new System.InvalidCastException("interfaceId="+interfaceId);
                }
            }
            catch(Exception ex)
            {
                var t = new System.Threading.Tasks.TaskCompletionSource<object>();
                t.SetException(ex);
                return t.Task;
            }
        }
        global::System.Threading.Tasks.Task<object> global::Orleans.CodeGeneration.IGrainMethodInvoker.Invoke(global::Orleans.Runtime.IAddressable grain, int interfaceId, int methodId, object[] arguments)
        {

            try
            {                    if (grain == null) throw new System.ArgumentNullException("grain");
                switch (interfaceId)
                {
                    case 1529258251:  // IPowerLine
                        switch (methodId)
                        {
                            case -1348462830: 
                                return ((IPowerLine)grain).SetPowerCurrent((Int32)arguments[0]).ContinueWith(t => {if (t.Status == System.Threading.Tasks.TaskStatus.Faulted) throw t.Exception; return (object)null; });
                            case -449473587: 
                                return ((IPowerLine)grain).GetCurrentPower().ContinueWith(t => {if (t.Status == System.Threading.Tasks.TaskStatus.Faulted) throw t.Exception; return (object)t.Result; });
                            case 1042716812: 
                                return ((IPowerLine)grain).SubscribeForPowerNotifications((IPowerLineObserver)arguments[0]).ContinueWith(t => {if (t.Status == System.Threading.Tasks.TaskStatus.Faulted) throw t.Exception; return (object)null; });
                            default: 
                            throw new NotImplementedException("interfaceId="+interfaceId+",methodId="+methodId);
                        }
                    default:
                        throw new System.InvalidCastException("interfaceId="+interfaceId);
                }
            }
            catch(Exception ex)
            {
                var t = new System.Threading.Tasks.TaskCompletionSource<object>();
                t.SetException(ex);
                return t.Task;
            }
        }
        global::System.Threading.Tasks.Task<object> global::Orleans.CodeGeneration.IGrainMethodInvoker.Invoke(global::Orleans.Runtime.IAddressable grain, int interfaceId, int methodId, object[] arguments)
        {

            try
            {                    if (grain == null) throw new System.ArgumentNullException("grain");
                switch (interfaceId)
                {
                    case 1700701008:  // ICalculatorActor
                        switch (methodId)
                        {
                            case 567326490: 
                                return ((ICalculatorActor)grain).Set((Decimal)arguments[0]).ContinueWith(t => {if (t.Status == System.Threading.Tasks.TaskStatus.Faulted) throw t.Exception; return (object)t.Result; });
                            case 1818975443: 
                                return ((ICalculatorActor)grain).Add((Decimal)arguments[0]).ContinueWith(t => {if (t.Status == System.Threading.Tasks.TaskStatus.Faulted) throw t.Exception; return (object)t.Result; });
                            case 1048698314: 
                                return ((ICalculatorActor)grain).Multiply((Decimal)arguments[0]).ContinueWith(t => {if (t.Status == System.Threading.Tasks.TaskStatus.Faulted) throw t.Exception; return (object)t.Result; });
                            case -1887213722: 
                                return ((ICalculatorActor)grain).Divide((Decimal)arguments[0]).ContinueWith(t => {if (t.Status == System.Threading.Tasks.TaskStatus.Faulted) throw t.Exception; return (object)t.Result; });
                            case 974166974: 
                                return ((ICalculatorActor)grain).Reset().ContinueWith(t => {if (t.Status == System.Threading.Tasks.TaskStatus.Faulted) throw t.Exception; return (object)t.Result; });
                            case -940922787: 
                                return ((ICalculatorActor)grain).Get().ContinueWith(t => {if (t.Status == System.Threading.Tasks.TaskStatus.Faulted) throw t.Exception; return (object)t.Result; });
                            default: 
                            throw new NotImplementedException("interfaceId="+interfaceId+",methodId="+methodId);
                        }case -1097320095:  // IGrainWithGuidKey
                        switch (methodId)
                        {
                            default: 
                            throw new NotImplementedException("interfaceId="+interfaceId+",methodId="+methodId);
                        }
                    default:
                        throw new System.InvalidCastException("interfaceId="+interfaceId);
                }
            }
            catch(Exception ex)
            {
                var t = new System.Threading.Tasks.TaskCompletionSource<object>();
                t.SetException(ex);
                return t.Task;
            }
        }
        global::System.Threading.Tasks.Task<object> global::Orleans.CodeGeneration.IGrainMethodInvoker.Invoke(global::Orleans.Runtime.IAddressable grain, int interfaceId, int methodId, object[] arguments)
        {

            try
            {                    if (grain == null) throw new System.ArgumentNullException("grain");
                switch (interfaceId)
                {
                    case 523268002:  // IClient
                        switch (methodId)
                        {
                            case 1975541297: 
                                return ((IClient)grain).Run().ContinueWith(t => {if (t.Status == System.Threading.Tasks.TaskStatus.Faulted) throw t.Exception; return (object)null; });
                            case -2060440583: 
                                return ((IClient)grain).Pong((IDestination)arguments[0], (Message)arguments[1]).ContinueWith(t => {if (t.Status == System.Threading.Tasks.TaskStatus.Faulted) throw t.Exception; return (object)null; });
                            case 1682027821: 
                                return ((IClient)grain).Initialize((IDestination)arguments[0], (System.Int64)arguments[1]).ContinueWith(t => {if (t.Status == System.Threading.Tasks.TaskStatus.Faulted) throw t.Exception; return (object)null; });
                            case -1238941369: 
                                return ((IClient)grain).Subscribe((IClientObserver)arguments[0]).ContinueWith(t => {if (t.Status == System.Threading.Tasks.TaskStatus.Faulted) throw t.Exception; return (object)null; });
                            default: 
                            throw new NotImplementedException("interfaceId="+interfaceId+",methodId="+methodId);
                        }case -1277021679:  // IGrainWithStringKey
                        switch (methodId)
                        {
                            default: 
                            throw new NotImplementedException("interfaceId="+interfaceId+",methodId="+methodId);
                        }
                    default:
                        throw new System.InvalidCastException("interfaceId="+interfaceId);
                }
            }
            catch(Exception ex)
            {
                var t = new System.Threading.Tasks.TaskCompletionSource<object>();
                t.SetException(ex);
                return t.Task;
            }
        }
        global::System.Threading.Tasks.Task<object> global::Orleans.CodeGeneration.IGrainMethodInvoker.Invoke(global::Orleans.Runtime.IAddressable grain, int interfaceId, int methodId, object[] arguments)
        {

            try
            {                    if (grain == null) throw new System.ArgumentNullException("grain");
                switch (interfaceId)
                {
                    case -1781558670:  // IServices
                        switch (methodId)
                        {
                            case 1485641513: 
                                return ((IServices)grain).ConnectToServer((System.String)arguments[0]).ContinueWith(t => {if (t.Status == System.Threading.Tasks.TaskStatus.Faulted) throw t.Exception; return (object)t.Result; });
                            default: 
                            throw new NotImplementedException("interfaceId="+interfaceId+",methodId="+methodId);
                        }
                    default:
                        throw new System.InvalidCastException("interfaceId="+interfaceId);
                }
            }
            catch(Exception ex)
            {
                var t = new System.Threading.Tasks.TaskCompletionSource<object>();
                t.SetException(ex);
                return t.Task;
            }
        }
Example #39
0
        global::System.Threading.Tasks.Task<object> global::Orleans.CodeGeneration.IGrainMethodInvoker.Invoke(global::Orleans.Runtime.IAddressable grain, int interfaceId, int methodId, object[] arguments)
        {

            try
            {                    if (grain == null) throw new System.ArgumentNullException("grain");
                switch (interfaceId)
                {
                    case -1804278580:  // IChirperAccount
                        switch (methodId)
                        {
                            case 957692321: 
                                return ((IChirperAccount)grain).SetUserDetails((ChirperUserInfo)arguments[0]).ContinueWith(t => {if (t.Status == System.Threading.Tasks.TaskStatus.Faulted) throw t.Exception; return (object)null; });
                            case 752357790: 
                                return ((IChirperAccount)grain).FollowUserId((Int64)arguments[0]).ContinueWith(t => {if (t.Status == System.Threading.Tasks.TaskStatus.Faulted) throw t.Exception; return (object)null; });
                            case -601623755: 
                                return ((IChirperAccount)grain).UnfollowUserId((Int64)arguments[0]).ContinueWith(t => {if (t.Status == System.Threading.Tasks.TaskStatus.Faulted) throw t.Exception; return (object)null; });
                            case -1960464744: 
                                return ((IChirperAccount)grain).GetFollowingList().ContinueWith(t => {if (t.Status == System.Threading.Tasks.TaskStatus.Faulted) throw t.Exception; return (object)t.Result; });
                            case -491886212: 
                                return ((IChirperAccount)grain).GetFollowersList().ContinueWith(t => {if (t.Status == System.Threading.Tasks.TaskStatus.Faulted) throw t.Exception; return (object)t.Result; });
                            case -68598853: 
                                return ((IChirperAccount)grain).PublishMessage((String)arguments[0]).ContinueWith(t => {if (t.Status == System.Threading.Tasks.TaskStatus.Faulted) throw t.Exception; return (object)null; });
                            case 913298032: 
                                return ((IChirperAccount)grain).GetReceivedMessages((Int32)arguments[0], (Int32)arguments[1]).ContinueWith(t => {if (t.Status == System.Threading.Tasks.TaskStatus.Faulted) throw t.Exception; return (object)t.Result; });
                            case 913319715: 
                                return ((IChirperAccount)grain).ViewerConnect((IChirperViewer)arguments[0]).ContinueWith(t => {if (t.Status == System.Threading.Tasks.TaskStatus.Faulted) throw t.Exception; return (object)null; });
                            case 1708978275: 
                                return ((IChirperAccount)grain).ViewerDisconnect((IChirperViewer)arguments[0]).ContinueWith(t => {if (t.Status == System.Threading.Tasks.TaskStatus.Faulted) throw t.Exception; return (object)null; });
                            case 1973211050: 
                                return ((IChirperAccount)grain).GetUserId().ContinueWith(t => {if (t.Status == System.Threading.Tasks.TaskStatus.Faulted) throw t.Exception; return (object)t.Result; });
                            case 208463624: 
                                return ((IChirperAccount)grain).GetUserAlias().ContinueWith(t => {if (t.Status == System.Threading.Tasks.TaskStatus.Faulted) throw t.Exception; return (object)t.Result; });
                            case 438764651: 
                                return ((IChirperAccount)grain).GetPublishedMessages((Int32)arguments[0], (Int32)arguments[1]).ContinueWith(t => {if (t.Status == System.Threading.Tasks.TaskStatus.Faulted) throw t.Exception; return (object)t.Result; });
                            case 1631913776: 
                                return ((IChirperAccount)grain).AddFollower((String)arguments[0], (Int64)arguments[1], (IChirperSubscriber)arguments[2]).ContinueWith(t => {if (t.Status == System.Threading.Tasks.TaskStatus.Faulted) throw t.Exception; return (object)null; });
                            case -370855882: 
                                return ((IChirperAccount)grain).RemoveFollower((String)arguments[0], (IChirperSubscriber)arguments[1]).ContinueWith(t => {if (t.Status == System.Threading.Tasks.TaskStatus.Faulted) throw t.Exception; return (object)null; });
                            case -1105116289: 
                                return ((IChirperAccount)grain).NewChirp((ChirperMessage)arguments[0]).ContinueWith(t => {if (t.Status == System.Threading.Tasks.TaskStatus.Faulted) throw t.Exception; return (object)null; });
                            default: 
                            throw new NotImplementedException("interfaceId="+interfaceId+",methodId="+methodId);
                        }case 562364977:  // IChirperPublisher
                        switch (methodId)
                        {
                            case 1973211050: 
                                return ((IChirperPublisher)grain).GetUserId().ContinueWith(t => {if (t.Status == System.Threading.Tasks.TaskStatus.Faulted) throw t.Exception; return (object)t.Result; });
                            case 208463624: 
                                return ((IChirperPublisher)grain).GetUserAlias().ContinueWith(t => {if (t.Status == System.Threading.Tasks.TaskStatus.Faulted) throw t.Exception; return (object)t.Result; });
                            case 438764651: 
                                return ((IChirperPublisher)grain).GetPublishedMessages((Int32)arguments[0], (Int32)arguments[1]).ContinueWith(t => {if (t.Status == System.Threading.Tasks.TaskStatus.Faulted) throw t.Exception; return (object)t.Result; });
                            case 1631913776: 
                                return ((IChirperPublisher)grain).AddFollower((String)arguments[0], (Int64)arguments[1], (IChirperSubscriber)arguments[2]).ContinueWith(t => {if (t.Status == System.Threading.Tasks.TaskStatus.Faulted) throw t.Exception; return (object)null; });
                            case -370855882: 
                                return ((IChirperPublisher)grain).RemoveFollower((String)arguments[0], (IChirperSubscriber)arguments[1]).ContinueWith(t => {if (t.Status == System.Threading.Tasks.TaskStatus.Faulted) throw t.Exception; return (object)null; });
                            default: 
                            throw new NotImplementedException("interfaceId="+interfaceId+",methodId="+methodId);
                        }case -930412412:  // IChirperSubscriber
                        switch (methodId)
                        {
                            case -1105116289: 
                                return ((IChirperSubscriber)grain).NewChirp((ChirperMessage)arguments[0]).ContinueWith(t => {if (t.Status == System.Threading.Tasks.TaskStatus.Faulted) throw t.Exception; return (object)null; });
                            default: 
                            throw new NotImplementedException("interfaceId="+interfaceId+",methodId="+methodId);
                        }
                    default:
                        throw new System.InvalidCastException("interfaceId="+interfaceId);
                }
            }
            catch(Exception ex)
            {
                var t = new System.Threading.Tasks.TaskCompletionSource<object>();
                t.SetException(ex);
                return t.Task;
            }
        }
Example #40
0
		/// <summary>
		/// Returns an awaitable task whose result is the current time from the NTP server specified in the constructor.
		/// </summary>
		/// <remarks>
		/// <para>This method may throw exceptions (most likely a <seealso cref="NtpNetworkException"/> if an error occurs trying to connect/bind to the network endpoint. Exception handling in client code is recommended.</para>
		/// </remarks>
		/// <seealso cref="NtpNetworkException"/>
		public System.Threading.Tasks.Task<DateTime> RequestTimeAsync()
		{
			var tcs = new System.Threading.Tasks.TaskCompletionSource<DateTime>();
			var client = new NtpClient(_ServerAddress);

			var timeReceivedHandler = new EventHandler<NtpTimeReceivedEventArgs>(
				(sender, args) => 
				{
					tcs.SetResult(args.CurrentTime);
				}
			);
			var errorOccurredHandler = new EventHandler<NtpNetworkErrorEventArgs>(
				(sender, args) => 
				{
					if (!tcs.Task.IsCanceled && !tcs.Task.IsCompleted)
						tcs.SetException(args.Exception);
				}
			);

			client.TimeReceived += timeReceivedHandler;
			client.ErrorOccurred += errorOccurredHandler;

			var retVal = tcs.Task;
			tcs.Task.ContinueWith(
				(pt) =>
				{
					client.TimeReceived -= timeReceivedHandler;
					client.ErrorOccurred -= errorOccurredHandler;
				}
			);

			client.BeginRequestTime();

			return retVal;
		}
Example #41
0
        global::System.Threading.Tasks.Task<object> global::Orleans.CodeGeneration.IGrainMethodInvoker.Invoke(global::Orleans.Runtime.IAddressable grain, int interfaceId, int methodId, object[] arguments)
        {

            try
            {{                    if (grain == null) throw new System.ArgumentNullException("grain");
                switch (interfaceId)
                {
                    case 1167282281:  // IMessageObserver
                        switch (methodId)
                        {
                            case -679320403: 
                                ((IMessageObserver)grain).Send((Microsoft.AspNet.SignalR.Messaging.Message[])arguments[0]); return System.Threading.Tasks.Task.FromResult((object)true);
                            default: 
                            throw new NotImplementedException("interfaceId="+interfaceId+",methodId="+methodId);
                        }
                    default:
                        throw new System.InvalidCastException("interfaceId="+interfaceId);
                }
            }}
            catch(Exception ex)
            {{
                var t = new System.Threading.Tasks.TaskCompletionSource<object>();
                t.SetException(ex);
                return t.Task;
            }}
        }
Example #42
0
        global::System.Threading.Tasks.Task<object> global::Orleans.CodeGeneration.IGrainMethodInvoker.Invoke(global::Orleans.Runtime.IAddressable grain, int interfaceId, int methodId, object[] arguments)
        {

            try
            {                    if (grain == null) throw new System.ArgumentNullException("grain");
                switch (interfaceId)
                {
                    case -2105953344:  // IDeviceGrain
                        switch (methodId)
                        {
                            case 1567424079: 
                                return ((IDeviceGrain)grain).GetColor().ContinueWith(t => {if (t.Status == System.Threading.Tasks.TaskStatus.Faulted) throw t.Exception; return (object)t.Result; });
                            case -1860597175: 
                                return ((IDeviceGrain)grain).SetColor((String)arguments[0]).ContinueWith(t => {if (t.Status == System.Threading.Tasks.TaskStatus.Faulted) throw t.Exception; return (object)null; });
                            default: 
                            throw new NotImplementedException("interfaceId="+interfaceId+",methodId="+methodId);
                        }case -1277021679:  // IGrainWithStringKey
                        switch (methodId)
                        {
                            default: 
                            throw new NotImplementedException("interfaceId="+interfaceId+",methodId="+methodId);
                        }
                    default:
                        throw new System.InvalidCastException("interfaceId="+interfaceId);
                }
            }
            catch(Exception ex)
            {
                var t = new System.Threading.Tasks.TaskCompletionSource<object>();
                t.SetException(ex);
                return t.Task;
            }
        }
        global::System.Threading.Tasks.Task<object> global::Orleans.CodeGeneration.IGrainMethodInvoker.Invoke(global::Orleans.Runtime.IAddressable grain, int interfaceId, int methodId, object[] arguments)
        {

            try
            {                    if (grain == null) throw new System.ArgumentNullException("grain");
                switch (interfaceId)
                {
                    case 1662910789:  // IDestination
                        switch (methodId)
                        {
                            case 1491328371: 
                                return ((IDestination)grain).Ping((IClient)arguments[0], (Message)arguments[1]).ContinueWith(t => {if (t.Status == System.Threading.Tasks.TaskStatus.Faulted) throw t.Exception; return (object)null; });
                            default: 
                            throw new NotImplementedException("interfaceId="+interfaceId+",methodId="+methodId);
                        }case -1277021679:  // IGrainWithStringKey
                        switch (methodId)
                        {
                            default: 
                            throw new NotImplementedException("interfaceId="+interfaceId+",methodId="+methodId);
                        }
                    default:
                        throw new System.InvalidCastException("interfaceId="+interfaceId);
                }
            }
            catch(Exception ex)
            {
                var t = new System.Threading.Tasks.TaskCompletionSource<object>();
                t.SetException(ex);
                return t.Task;
            }
        }
        global::System.Threading.Tasks.Task<object> global::Orleans.CodeGeneration.IGrainMethodInvoker.Invoke(global::Orleans.Runtime.IAddressable grain, int interfaceId, int methodId, object[] arguments)
        {

            try
            {                    if (grain == null) throw new System.ArgumentNullException("grain");
                switch (interfaceId)
                {
                    case 1126410990:  // IClientObserver
                        switch (methodId)
                        {
                            case -1778340467: 
                                ((IClientObserver)grain).Done((System.Int64)arguments[0], (System.Int64)arguments[1]); return System.Threading.Tasks.Task.FromResult((object)true);
                            default: 
                            throw new NotImplementedException("interfaceId="+interfaceId+",methodId="+methodId);
                        }
                    default:
                        throw new System.InvalidCastException("interfaceId="+interfaceId);
                }
            }
            catch(Exception ex)
            {
                var t = new System.Threading.Tasks.TaskCompletionSource<object>();
                t.SetException(ex);
                return t.Task;
            }
        }
Example #45
0
        global::System.Threading.Tasks.Task<object> global::Orleans.CodeGeneration.IGrainMethodInvoker.Invoke(global::Orleans.Runtime.IAddressable grain, int interfaceId, int methodId, object[] arguments)
        {

            try
            {                    if (grain == null) throw new System.ArgumentNullException("grain");
                switch (interfaceId)
                {
                    case 562364977:  // IChirperPublisher
                        switch (methodId)
                        {
                            case 1973211050: 
                                return ((IChirperPublisher)grain).GetUserId().ContinueWith(t => {if (t.Status == System.Threading.Tasks.TaskStatus.Faulted) throw t.Exception; return (object)t.Result; });
                            case 208463624: 
                                return ((IChirperPublisher)grain).GetUserAlias().ContinueWith(t => {if (t.Status == System.Threading.Tasks.TaskStatus.Faulted) throw t.Exception; return (object)t.Result; });
                            case 438764651: 
                                return ((IChirperPublisher)grain).GetPublishedMessages((Int32)arguments[0], (Int32)arguments[1]).ContinueWith(t => {if (t.Status == System.Threading.Tasks.TaskStatus.Faulted) throw t.Exception; return (object)t.Result; });
                            case 1631913776: 
                                return ((IChirperPublisher)grain).AddFollower((String)arguments[0], (Int64)arguments[1], (IChirperSubscriber)arguments[2]).ContinueWith(t => {if (t.Status == System.Threading.Tasks.TaskStatus.Faulted) throw t.Exception; return (object)null; });
                            case -370855882: 
                                return ((IChirperPublisher)grain).RemoveFollower((String)arguments[0], (IChirperSubscriber)arguments[1]).ContinueWith(t => {if (t.Status == System.Threading.Tasks.TaskStatus.Faulted) throw t.Exception; return (object)null; });
                            default: 
                            throw new NotImplementedException("interfaceId="+interfaceId+",methodId="+methodId);
                        }
                    default:
                        throw new System.InvalidCastException("interfaceId="+interfaceId);
                }
            }
            catch(Exception ex)
            {
                var t = new System.Threading.Tasks.TaskCompletionSource<object>();
                t.SetException(ex);
                return t.Task;
            }
        }
        global::System.Threading.Tasks.Task<object> global::Orleans.CodeGeneration.IGrainMethodInvoker.Invoke(global::Orleans.Runtime.IAddressable grain, int interfaceId, int methodId, object[] arguments)
        {

            try
            {                    if (grain == null) throw new System.ArgumentNullException("grain");
                switch (interfaceId)
                {
                    case 898358989:  // IMethodEntityGrain
                        switch (methodId)
                        {
                            case 331950094: 
                                return ((IMethodEntityGrain)grain).GetDescriptor().ContinueWith(t => {if (t.Status == System.Threading.Tasks.TaskStatus.Faulted) throw t.Exception; return (object)t.Result; });
                            case -550949426: 
                                return ((IMethodEntityGrain)grain).ProcessMessaggeAsync((IEntityDescriptor)arguments[0], (IMessage)arguments[1]).ContinueWith(t => {if (t.Status == System.Threading.Tasks.TaskStatus.Faulted) throw t.Exception; return (object)null; });
                            case -676666698: 
                                return ((IMethodEntityGrain)grain).DoAnalysisAsync().ContinueWith(t => {if (t.Status == System.Threading.Tasks.TaskStatus.Faulted) throw t.Exception; return (object)null; });
                            case 110400473: 
                                return ((IMethodEntityGrain)grain).GetEntityWithProcessorAsync().ContinueWith(t => {if (t.Status == System.Threading.Tasks.TaskStatus.Faulted) throw t.Exception; return (object)t.Result; });
                            case -1831544886: 
                                return ((IMethodEntityGrain)grain).IsInitialized().ContinueWith(t => {if (t.Status == System.Threading.Tasks.TaskStatus.Faulted) throw t.Exception; return (object)t.Result; });
                            case -538316126: 
                                return ((IMethodEntityGrain)grain).GetMethodEntity().ContinueWith(t => {if (t.Status == System.Threading.Tasks.TaskStatus.Faulted) throw t.Exception; return (object)t.Result; });
                            case -1284597035: 
                                return ((IMethodEntityGrain)grain).SetMethodEntity((IEntity)arguments[0], (IEntityDescriptor)arguments[1]).ContinueWith(t => {if (t.Status == System.Threading.Tasks.TaskStatus.Faulted) throw t.Exception; return (object)null; });
                            case -673288645: 
                                return ((IMethodEntityGrain)grain).SetDescriptor((IEntityDescriptor)arguments[0]).ContinueWith(t => {if (t.Status == System.Threading.Tasks.TaskStatus.Faulted) throw t.Exception; return (object)null; });
                            default: 
                            throw new NotImplementedException("interfaceId="+interfaceId+",methodId="+methodId);
                        }case -1277021679:  // IGrainWithStringKey
                        switch (methodId)
                        {
                            default: 
                            throw new NotImplementedException("interfaceId="+interfaceId+",methodId="+methodId);
                        }
                    default:
                        throw new System.InvalidCastException("interfaceId="+interfaceId);
                }
            }
            catch(Exception ex)
            {
                var t = new System.Threading.Tasks.TaskCompletionSource<object>();
                t.SetException(ex);
                return t.Task;
            }
        }
Example #47
0
        global::System.Threading.Tasks.Task<object> global::Orleans.CodeGeneration.IGrainMethodInvoker.Invoke(global::Orleans.Runtime.IAddressable grain, int interfaceId, int methodId, object[] arguments)
        {

            try
            {                    if (grain == null) throw new System.ArgumentNullException("grain");
                switch (interfaceId)
                {
                    case -930412412:  // IChirperSubscriber
                        switch (methodId)
                        {
                            case -1105116289: 
                                return ((IChirperSubscriber)grain).NewChirp((ChirperMessage)arguments[0]).ContinueWith(t => {if (t.Status == System.Threading.Tasks.TaskStatus.Faulted) throw t.Exception; return (object)null; });
                            default: 
                            throw new NotImplementedException("interfaceId="+interfaceId+",methodId="+methodId);
                        }
                    default:
                        throw new System.InvalidCastException("interfaceId="+interfaceId);
                }
            }
            catch(Exception ex)
            {
                var t = new System.Threading.Tasks.TaskCompletionSource<object>();
                t.SetException(ex);
                return t.Task;
            }
        }
        global::System.Threading.Tasks.Task<object> global::Orleans.CodeGeneration.IGrainMethodInvoker.Invoke(global::Orleans.Runtime.IAddressable grain, int interfaceId, int methodId, object[] arguments)
        {

            try
            {                    if (grain == null) throw new System.ArgumentNullException("grain");
                switch (interfaceId)
                {
                    case -627797884:  // IPerson
                        switch (methodId)
                        {
                            case -1544510960: 
                                return ((IPerson)grain).Register((PersonalAttributes)arguments[0]).ContinueWith(t => {if (t.Status == System.Threading.Tasks.TaskStatus.Faulted) throw t.Exception; return (object)null; });
                            case -516276551: 
                                return ((IPerson)grain).Marry((Guid)arguments[0], (String)arguments[1]).ContinueWith(t => {if (t.Status == System.Threading.Tasks.TaskStatus.Faulted) throw t.Exception; return (object)null; });
                            case 513673718: 
                                return ((IPerson)grain).GetFirstName().ContinueWith(t => {if (t.Status == System.Threading.Tasks.TaskStatus.Faulted) throw t.Exception; return (object)t.Result; });
                            case 160660420: 
                                return ((IPerson)grain).GetLastName().ContinueWith(t => {if (t.Status == System.Threading.Tasks.TaskStatus.Faulted) throw t.Exception; return (object)t.Result; });
                            case 1616597481: 
                                return ((IPerson)grain).GetIsMarried().ContinueWith(t => {if (t.Status == System.Threading.Tasks.TaskStatus.Faulted) throw t.Exception; return (object)t.Result; });
                            default: 
                            throw new NotImplementedException("interfaceId="+interfaceId+",methodId="+methodId);
                        }case 1928988877:  // IGrainWithIntegerKey
                        switch (methodId)
                        {
                            default: 
                            throw new NotImplementedException("interfaceId="+interfaceId+",methodId="+methodId);
                        }
                    default:
                        throw new System.InvalidCastException("interfaceId="+interfaceId);
                }
            }
            catch(Exception ex)
            {
                var t = new System.Threading.Tasks.TaskCompletionSource<object>();
                t.SetException(ex);
                return t.Task;
            }
        }
Example #49
0
        global::System.Threading.Tasks.Task<object> global::Orleans.CodeGeneration.IGrainMethodInvoker.Invoke(global::Orleans.Runtime.IAddressable grain, int interfaceId, int methodId, object[] arguments)
        {

            try
            {                    if (grain == null) throw new System.ArgumentNullException("grain");
                switch (interfaceId)
                {
                    case -874440916:  // IChirperViewer
                        switch (methodId)
                        {
                            case -343496927: 
                                ((IChirperViewer)grain).NewChirpArrived((ChirperMessage)arguments[0]); return System.Threading.Tasks.Task.FromResult((object)true);
                            case 489541775: 
                                ((IChirperViewer)grain).SubscriptionAdded((ChirperUserInfo)arguments[0]); return System.Threading.Tasks.Task.FromResult((object)true);
                            case 1797324738: 
                                ((IChirperViewer)grain).SubscriptionRemoved((ChirperUserInfo)arguments[0]); return System.Threading.Tasks.Task.FromResult((object)true);
                            default: 
                            throw new NotImplementedException("interfaceId="+interfaceId+",methodId="+methodId);
                        }
                    default:
                        throw new System.InvalidCastException("interfaceId="+interfaceId);
                }
            }
            catch(Exception ex)
            {
                var t = new System.Threading.Tasks.TaskCompletionSource<object>();
                t.SetException(ex);
                return t.Task;
            }
        }
        global::System.Threading.Tasks.Task<object> global::Orleans.CodeGeneration.IGrainMethodInvoker.Invoke(global::Orleans.Runtime.IAddressable grain, int interfaceId, int methodId, object[] arguments)
        {

            try
            {                    if (grain == null) throw new System.ArgumentNullException("grain");
                switch (interfaceId)
                {
                    case -1646659855:  // ISolutionGrain
                        switch (methodId)
                        {
                            case -472864594: 
                                return ((ISolutionGrain)grain).SetSolutionPath((String)arguments[0]).ContinueWith(t => {if (t.Status == System.Threading.Tasks.TaskStatus.Faulted) throw t.Exception; return (object)null; });
                            case 397961266: 
                                return ((ISolutionGrain)grain).SetSolutionSource((String)arguments[0]).ContinueWith(t => {if (t.Status == System.Threading.Tasks.TaskStatus.Faulted) throw t.Exception; return (object)null; });
                            case 1319809341: 
                                return ((ISolutionGrain)grain).GetCodeProviderAsync((ReachingTypeAnalysis.MethodDescriptor)arguments[0]).ContinueWith(t => {if (t.Status == System.Threading.Tasks.TaskStatus.Faulted) throw t.Exception; return (object)t.Result; });
                            case 1971864790: 
                                return ((ISolutionGrain)grain).GetMethodDescriptors().ContinueWith(t => {if (t.Status == System.Threading.Tasks.TaskStatus.Faulted) throw t.Exception; return (object)t.Result; });
                            default: 
                            throw new NotImplementedException("interfaceId="+interfaceId+",methodId="+methodId);
                        }case -1277021679:  // IGrainWithStringKey
                        switch (methodId)
                        {
                            default: 
                            throw new NotImplementedException("interfaceId="+interfaceId+",methodId="+methodId);
                        }
                    default:
                        throw new System.InvalidCastException("interfaceId="+interfaceId);
                }
            }
            catch(Exception ex)
            {
                var t = new System.Threading.Tasks.TaskCompletionSource<object>();
                t.SetException(ex);
                return t.Task;
            }
        }
Example #51
0
        global::System.Threading.Tasks.Task<object> global::Orleans.CodeGeneration.IGrainMethodInvoker.Invoke(global::Orleans.Runtime.IAddressable grain, int interfaceId, int methodId, object[] arguments)
        {

            try
            {{                    if (grain == null) throw new System.ArgumentNullException("grain");
                switch (interfaceId)
                {
                    case 403532564:  // IPubSubGrain
                        switch (methodId)
                        {
                            case 1418215476: 
                                return ((IPubSubGrain)grain).Publish((Microsoft.AspNet.SignalR.Messaging.Message[])arguments[0]).ContinueWith(t => {if (t.Status == System.Threading.Tasks.TaskStatus.Faulted) throw t.Exception; return (object)null; });
                            case -1032958586: 
                                return ((IPubSubGrain)grain).Subscribe((IMessageObserver)arguments[0]).ContinueWith(t => {if (t.Status == System.Threading.Tasks.TaskStatus.Faulted) throw t.Exception; return (object)null; });
                            case -1026708032: 
                                return ((IPubSubGrain)grain).Unsubscribe((IMessageObserver)arguments[0]).ContinueWith(t => {if (t.Status == System.Threading.Tasks.TaskStatus.Faulted) throw t.Exception; return (object)null; });
                            case 1140013191: 
                                return ((IPubSubGrain)grain).Notify((Microsoft.AspNet.SignalR.Messaging.Message[])arguments[0]).ContinueWith(t => {if (t.Status == System.Threading.Tasks.TaskStatus.Faulted) throw t.Exception; return (object)null; });
                            case -316297706: 
                                return ((IPubSubGrain)grain).TopologyChange((IPubSubGrain[])arguments[0]).ContinueWith(t => {if (t.Status == System.Threading.Tasks.TaskStatus.Faulted) throw t.Exception; return (object)null; });
                            default: 
                            throw new NotImplementedException("interfaceId="+interfaceId+",methodId="+methodId);
                        }
                    default:
                        throw new System.InvalidCastException("interfaceId="+interfaceId);
                }
            }}
            catch(Exception ex)
            {{
                var t = new System.Threading.Tasks.TaskCompletionSource<object>();
                t.SetException(ex);
                return t.Task;
            }}
        }
        global::System.Threading.Tasks.Task<object> global::Orleans.CodeGeneration.IGrainMethodInvoker.Invoke(global::Orleans.Runtime.IAddressable grain, int interfaceId, int methodId, object[] arguments)
        {

            try
            {                    if (grain == null) throw new System.ArgumentNullException("grain");
                switch (interfaceId)
                {
                    case -1152396051:  // IPrefsGrain
                        switch (methodId)
                        {
                            case -562543526: 
                                return ((IPrefsGrain)grain).SetValue((System.Collections.Generic.KeyValuePair<String,String>)arguments[0]).ContinueWith(t => {if (t.Status == System.Threading.Tasks.TaskStatus.Faulted) throw t.Exception; return (object)null; });
                            case -1376685924: 
                                return ((IPrefsGrain)grain).GetValue((String)arguments[0]).ContinueWith(t => {if (t.Status == System.Threading.Tasks.TaskStatus.Faulted) throw t.Exception; return (object)t.Result; });
                            case 852692164: 
                                return ((IPrefsGrain)grain).GetAllEntries().ContinueWith(t => {if (t.Status == System.Threading.Tasks.TaskStatus.Faulted) throw t.Exception; return (object)t.Result; });
                            case -291970914: 
                                return ((IPrefsGrain)grain).ClearValues().ContinueWith(t => {if (t.Status == System.Threading.Tasks.TaskStatus.Faulted) throw t.Exception; return (object)null; });
                            default: 
                            throw new NotImplementedException("interfaceId="+interfaceId+",methodId="+methodId);
                        }case -1277021679:  // IGrainWithStringKey
                        switch (methodId)
                        {
                            default: 
                            throw new NotImplementedException("interfaceId="+interfaceId+",methodId="+methodId);
                        }
                    default:
                        throw new System.InvalidCastException("interfaceId="+interfaceId);
                }
            }
            catch(Exception ex)
            {
                var t = new System.Threading.Tasks.TaskCompletionSource<object>();
                t.SetException(ex);
                return t.Task;
            }
        }
        global::System.Threading.Tasks.Task<object> global::Orleans.CodeGeneration.IGrainMethodInvoker.Invoke(global::Orleans.Runtime.IAddressable grain, int interfaceId, int methodId, object[] arguments)
        {

            try
            {                    if (grain == null) throw new System.ArgumentNullException("grain");
                switch (interfaceId)
                {
                    case 1530413783:  // IManager
                        switch (methodId)
                        {
                            case -1701259070: 
                                return ((IManager)grain).AsEmployee().ContinueWith(t => {if (t.Status == System.Threading.Tasks.TaskStatus.Faulted) throw t.Exception; return (object)t.Result; });
                            case -675836216: 
                                return ((IManager)grain).GetDirectReports().ContinueWith(t => {if (t.Status == System.Threading.Tasks.TaskStatus.Faulted) throw t.Exception; return (object)t.Result; });
                            case -1731443267: 
                                return ((IManager)grain).AddDirectReport((IEmployee)arguments[0]).ContinueWith(t => {if (t.Status == System.Threading.Tasks.TaskStatus.Faulted) throw t.Exception; return (object)null; });
                            case -459995068: 
                                return ((IManager)grain).Order((String)arguments[0]).ContinueWith(t => {if (t.Status == System.Threading.Tasks.TaskStatus.Faulted) throw t.Exception; return (object)null; });
                            default: 
                            throw new NotImplementedException("interfaceId="+interfaceId+",methodId="+methodId);
                        }
                    default:
                        throw new System.InvalidCastException("interfaceId="+interfaceId);
                }
            }
            catch(Exception ex)
            {
                var t = new System.Threading.Tasks.TaskCompletionSource<object>();
                t.SetException(ex);
                return t.Task;
            }
        }
        global::System.Threading.Tasks.Task<object> global::Orleans.CodeGeneration.IGrainMethodInvoker.Invoke(global::Orleans.Runtime.IAddressable grain, int interfaceId, int methodId, object[] arguments)
        {

            try
            {                    if (grain == null) throw new System.ArgumentNullException("grain");
                switch (interfaceId)
                {
                    case -912346303:  // IBankAccount
                        switch (methodId)
                        {
                            case -1993006295: 
                                return ((IBankAccount)grain).Initialize((Guid)arguments[0]).ContinueWith(t => {if (t.Status == System.Threading.Tasks.TaskStatus.Faulted) throw t.Exception; return (object)t.Result; });
                            case 1980500241: 
                                return ((IBankAccount)grain).Validate().ContinueWith(t => {if (t.Status == System.Threading.Tasks.TaskStatus.Faulted) throw t.Exception; return (object)t.Result; });
                            case 1417003246: 
                                return ((IBankAccount)grain).AddTransactionPreparation((Guid)arguments[0], (TransactionType)arguments[1], (PreparationType)arguments[2], (Decimal)arguments[3]).ContinueWith(t => {if (t.Status == System.Threading.Tasks.TaskStatus.Faulted) throw t.Exception; return (object)t.Result; });
                            case -576022763: 
                                return ((IBankAccount)grain).CommitTransactionPreparation((Guid)arguments[0]).ContinueWith(t => {if (t.Status == System.Threading.Tasks.TaskStatus.Faulted) throw t.Exception; return (object)null; });
                            case -1730429136: 
                                return ((IBankAccount)grain).CancelTransactionPreparation((Guid)arguments[0]).ContinueWith(t => {if (t.Status == System.Threading.Tasks.TaskStatus.Faulted) throw t.Exception; return (object)null; });
                            case 698066810: 
                                return ((IBankAccount)grain).GetBalance().ContinueWith(t => {if (t.Status == System.Threading.Tasks.TaskStatus.Faulted) throw t.Exception; return (object)t.Result; });
                            default: 
                            throw new NotImplementedException("interfaceId="+interfaceId+",methodId="+methodId);
                        }case -1097320095:  // IGrainWithGuidKey
                        switch (methodId)
                        {
                            default: 
                            throw new NotImplementedException("interfaceId="+interfaceId+",methodId="+methodId);
                        }
                    default:
                        throw new System.InvalidCastException("interfaceId="+interfaceId);
                }
            }
            catch(Exception ex)
            {
                var t = new System.Threading.Tasks.TaskCompletionSource<object>();
                t.SetException(ex);
                return t.Task;
            }
        }
        global::System.Threading.Tasks.Task<object> global::Orleans.CodeGeneration.IGrainMethodInvoker.Invoke(global::Orleans.Runtime.IAddressable grain, int interfaceId, int methodId, object[] arguments)
        {

            try
            {                    if (grain == null) throw new System.ArgumentNullException("grain");
                switch (interfaceId)
                {
                    case 587671118:  // IEmployee
                        switch (methodId)
                        {
                            case 312402437: 
                                return ((IEmployee)grain).GetLevel().ContinueWith(t => {if (t.Status == System.Threading.Tasks.TaskStatus.Faulted) throw t.Exception; return (object)t.Result; });
                            case -1461035780: 
                                return ((IEmployee)grain).Promote((System.Int32)arguments[0]).ContinueWith(t => {if (t.Status == System.Threading.Tasks.TaskStatus.Faulted) throw t.Exception; return (object)null; });
                            case 940043127: 
                                return ((IEmployee)grain).GetManager().ContinueWith(t => {if (t.Status == System.Threading.Tasks.TaskStatus.Faulted) throw t.Exception; return (object)t.Result; });
                            case -159913581: 
                                return ((IEmployee)grain).SetManager((IManager)arguments[0]).ContinueWith(t => {if (t.Status == System.Threading.Tasks.TaskStatus.Faulted) throw t.Exception; return (object)null; });
                            case -1319124596: 
                                return ((IEmployee)grain).Greeting((IEmployee)arguments[0], (System.String)arguments[1]).ContinueWith(t => {if (t.Status == System.Threading.Tasks.TaskStatus.Faulted) throw t.Exception; return (object)null; });
                            case 1860114687: 
                                return ((IEmployee)grain).Do((System.String)arguments[0]).ContinueWith(t => {if (t.Status == System.Threading.Tasks.TaskStatus.Faulted) throw t.Exception; return (object)null; });
                            default: 
                            throw new NotImplementedException("interfaceId="+interfaceId+",methodId="+methodId);
                        }
                    default:
                        throw new System.InvalidCastException("interfaceId="+interfaceId);
                }
            }
            catch(Exception ex)
            {
                var t = new System.Threading.Tasks.TaskCompletionSource<object>();
                t.SetException(ex);
                return t.Task;
            }
        }
        global::System.Threading.Tasks.Task<object> global::Orleans.CodeGeneration.IGrainMethodInvoker.Invoke(global::Orleans.Runtime.IAddressable grain, int interfaceId, int methodId, object[] arguments)
        {

            try
            {                    if (grain == null) throw new System.ArgumentNullException("grain");
                switch (interfaceId)
                {
                    case 2040282744:  // IBuilding
                        switch (methodId)
                        {
                            case 1047791444: 
                                return ((IBuilding)grain).SetPowerForApartment((Int64)arguments[0], (Int32)arguments[1]).ContinueWith(t => {if (t.Status == System.Threading.Tasks.TaskStatus.Faulted) throw t.Exception; return (object)null; });
                            case -449473587: 
                                return ((IBuilding)grain).GetCurrentPower().ContinueWith(t => {if (t.Status == System.Threading.Tasks.TaskStatus.Faulted) throw t.Exception; return (object)t.Result; });
                            case -1266728070: 
                                return ((IBuilding)grain).GetPowerByApartments().ContinueWith(t => {if (t.Status == System.Threading.Tasks.TaskStatus.Faulted) throw t.Exception; return (object)t.Result; });
                            default: 
                            throw new NotImplementedException("interfaceId="+interfaceId+",methodId="+methodId);
                        }
                    default:
                        throw new System.InvalidCastException("interfaceId="+interfaceId);
                }
            }
            catch(Exception ex)
            {
                var t = new System.Threading.Tasks.TaskCompletionSource<object>();
                t.SetException(ex);
                return t.Task;
            }
        }
Example #57
0
        global::System.Threading.Tasks.Task<object> global::Orleans.CodeGeneration.IGrainMethodInvoker.Invoke(global::Orleans.Runtime.IAddressable grain, int interfaceId, int methodId, object[] arguments)
        {

            try
            {{                    if (grain == null) throw new System.ArgumentNullException("grain");
                switch (interfaceId)
                {
                    case 1150057381:  // IPubSubManager
                        switch (methodId)
                        {
                            case -203526534: 
                                return ((IPubSubManager)grain).Register((IPubSubGrain)arguments[0]).ContinueWith(t => {if (t.Status == System.Threading.Tasks.TaskStatus.Faulted) throw t.Exception; return (object)t.Result; });
                            case -2125469177: 
                                return ((IPubSubManager)grain).Unregister((IPubSubGrain)arguments[0]).ContinueWith(t => {if (t.Status == System.Threading.Tasks.TaskStatus.Faulted) throw t.Exception; return (object)null; });
                            default: 
                            throw new NotImplementedException("interfaceId="+interfaceId+",methodId="+methodId);
                        }
                    default:
                        throw new System.InvalidCastException("interfaceId="+interfaceId);
                }
            }}
            catch(Exception ex)
            {{
                var t = new System.Threading.Tasks.TaskCompletionSource<object>();
                t.SetException(ex);
                return t.Task;
            }}
        }
        global::System.Threading.Tasks.Task<object> global::Orleans.CodeGeneration.IGrainMethodInvoker.Invoke(global::Orleans.Runtime.IAddressable grain, int interfaceId, int methodId, object[] arguments)
        {

            try
            {                    if (grain == null) throw new System.ArgumentNullException("grain");
                switch (interfaceId)
                {
                    case 1895808213:  // ITransferTransaction
                        switch (methodId)
                        {
                            case 518927232: 
                                return ((ITransferTransaction)grain).Initialize((Guid)arguments[0], (Guid)arguments[1], (Decimal)arguments[2]).ContinueWith(t => {if (t.Status == System.Threading.Tasks.TaskStatus.Faulted) throw t.Exception; return (object)null; });
                            case 901321164: 
                                return ((ITransferTransaction)grain).ConfirmAccountValidatePassed().ContinueWith(t => {if (t.Status == System.Threading.Tasks.TaskStatus.Faulted) throw t.Exception; return (object)null; });
                            case 1613436135: 
                                return ((ITransferTransaction)grain).ConfirmTransferOutPreparation().ContinueWith(t => {if (t.Status == System.Threading.Tasks.TaskStatus.Faulted) throw t.Exception; return (object)null; });
                            case 108736162: 
                                return ((ITransferTransaction)grain).ConfirmTransferInPreparation().ContinueWith(t => {if (t.Status == System.Threading.Tasks.TaskStatus.Faulted) throw t.Exception; return (object)null; });
                            case -1176500040: 
                                return ((ITransferTransaction)grain).ConfirmTransferOut().ContinueWith(t => {if (t.Status == System.Threading.Tasks.TaskStatus.Faulted) throw t.Exception; return (object)null; });
                            case 1990501567: 
                                return ((ITransferTransaction)grain).ConfirmTransferIn().ContinueWith(t => {if (t.Status == System.Threading.Tasks.TaskStatus.Faulted) throw t.Exception; return (object)null; });
                            case 751141822: 
                                return ((ITransferTransaction)grain).Cancel((TransactionFaileReason)arguments[0]).ContinueWith(t => {if (t.Status == System.Threading.Tasks.TaskStatus.Faulted) throw t.Exception; return (object)null; });
                            case -1251605435: 
                                return ((ITransferTransaction)grain).GetStatus().ContinueWith(t => {if (t.Status == System.Threading.Tasks.TaskStatus.Faulted) throw t.Exception; return (object)t.Result; });
                            case 1419660080: 
                                return ((ITransferTransaction)grain).GetTransferTransactionInfo().ContinueWith(t => {if (t.Status == System.Threading.Tasks.TaskStatus.Faulted) throw t.Exception; return (object)t.Result; });
                            default: 
                            throw new NotImplementedException("interfaceId="+interfaceId+",methodId="+methodId);
                        }case -1097320095:  // IGrainWithGuidKey
                        switch (methodId)
                        {
                            default: 
                            throw new NotImplementedException("interfaceId="+interfaceId+",methodId="+methodId);
                        }
                    default:
                        throw new System.InvalidCastException("interfaceId="+interfaceId);
                }
            }
            catch(Exception ex)
            {
                var t = new System.Threading.Tasks.TaskCompletionSource<object>();
                t.SetException(ex);
                return t.Task;
            }
        }
        global::System.Threading.Tasks.Task<object> global::Orleans.CodeGeneration.IGrainMethodInvoker.Invoke(global::Orleans.Runtime.IAddressable grain, int interfaceId, int methodId, object[] arguments)
        {

            try
            {                    if (grain == null) throw new System.ArgumentNullException("grain");
                switch (interfaceId)
                {
                    case -1731488188:  // IMyGrainInterface
                        switch (methodId)
                        {
                            default: 
                            throw new NotImplementedException("interfaceId="+interfaceId+",methodId="+methodId);
                        }case -1277021679:  // IGrainWithStringKey
                        switch (methodId)
                        {
                            default: 
                            throw new NotImplementedException("interfaceId="+interfaceId+",methodId="+methodId);
                        }
                    default:
                        throw new System.InvalidCastException("interfaceId="+interfaceId);
                }
            }
            catch(Exception ex)
            {
                var t = new System.Threading.Tasks.TaskCompletionSource<object>();
                t.SetException(ex);
                return t.Task;
            }
        }
        global::System.Threading.Tasks.Task<object> global::Orleans.CodeGeneration.IGrainMethodInvoker.Invoke(global::Orleans.Runtime.IAddressable grain, int interfaceId, int methodId, object[] arguments)
        {

            try
            {                    if (grain == null) throw new System.ArgumentNullException("grain");
                switch (interfaceId)
                {
                    case 306204708:  // IProjectCodeProviderGrain
                        switch (methodId)
                        {
                            case 747974890: 
                                return ((IProjectCodeProviderGrain)grain).IsSubtypeAsync((TypeDescriptor)arguments[0], (TypeDescriptor)arguments[1]).ContinueWith(t => {if (t.Status == System.Threading.Tasks.TaskStatus.Faulted) throw t.Exception; return (object)t.Result; });
                            case -819592028: 
                                return ((IProjectCodeProviderGrain)grain).FindMethodImplementationAsync((MethodDescriptor)arguments[0], (TypeDescriptor)arguments[1]).ContinueWith(t => {if (t.Status == System.Threading.Tasks.TaskStatus.Faulted) throw t.Exception; return (object)t.Result; });
                            case -625742380: 
                                return ((IProjectCodeProviderGrain)grain).CreateMethodEntityAsync((MethodDescriptor)arguments[0]).ContinueWith(t => {if (t.Status == System.Threading.Tasks.TaskStatus.Faulted) throw t.Exception; return (object)t.Result; });
                            case -397931987: 
                                return ((IProjectCodeProviderGrain)grain).SetProjectPath((String)arguments[0]).ContinueWith(t => {if (t.Status == System.Threading.Tasks.TaskStatus.Faulted) throw t.Exception; return (object)null; });
                            case -113155710: 
                                return ((IProjectCodeProviderGrain)grain).SetProjectSourceCode((String)arguments[0]).ContinueWith(t => {if (t.Status == System.Threading.Tasks.TaskStatus.Faulted) throw t.Exception; return (object)null; });
                            default: 
                            throw new NotImplementedException("interfaceId="+interfaceId+",methodId="+methodId);
                        }case -1277021679:  // IGrainWithStringKey
                        switch (methodId)
                        {
                            default: 
                            throw new NotImplementedException("interfaceId="+interfaceId+",methodId="+methodId);
                        }
                    default:
                        throw new System.InvalidCastException("interfaceId="+interfaceId);
                }
            }
            catch(Exception ex)
            {
                var t = new System.Threading.Tasks.TaskCompletionSource<object>();
                t.SetException(ex);
                return t.Task;
            }
        }