public override void DidLoseInstance(HYP hype, HYPInstance instance, NSError error)
 {
     FoundInstances.Remove(instance.StringIdentifier);
     //Add the instance to the table view source.
     //((InstancesViewSource)view.loungesView.Source)?.RemoveItem(instance.StringIdentifier);
     Console.WriteLine(string.Format("Lost Instance : {0}. {1}", instance.StringIdentifier, error.DebugDescription));
     //HandleNSError(error, alertView);
 }
 public override void ViewDidLoad()
 {
     base.ViewDidLoad();
     hype            = HYP.Instance();
     networkObserver = new NetworkObserver(this);
     stateObserver   = new StateObserver(this);
     messageObserver = new MessageObserver(this);
     FoundInstances  = new Dictionary <string, HYPInstance>();
     FoundLounges    = new Dictionary <string, Lounge>();
     RequestHypeToStart();
 }
            public override void DidFindInstance(HYP hype, HYPInstance instance)
            {
                FoundInstances.Add(instance.StringIdentifier, instance);
                if (view.FoundLounges.Count > 0)
                {
                    view.SendToInstance(view.FoundLounges.Values.ToList(), instance, LoungeMessageType.LoungeDiscovery);
                }
                //Add the instance to the table view source.
                //((InstancesViewSource)view.loungesView.Source)?.AddItem(instance);

                //var newData = NSData.FromString("You have a new message from : " + hype.DomesticInstance.StringIdentifier, NSStringEncoding.UTF8);
                //HYPMessage newMessage = hype.SendData(newData, instance);
                //Console.WriteLine(newMessage);
                Console.WriteLine("Found Instance : " + instance.StringIdentifier);
                alertView.Message = "Found Instance : " + instance.StringIdentifier;
                alertView.Show();
            }
Example #4
0
 public override void DidLoseInstance(HYP hype, HYPInstance instance, NSError error)
 {
     Console.WriteLine(error.DebugDescription);
 }
Example #5
0
 public override void DidFindInstance(HYP hype, HYPInstance instance)
 {
     Console.WriteLine(instance.StringIdentifier);
 }
 public override void DidReceiveMessage(HYP hype, HYPMessage message, HYPInstance instance)
 {
     view.DecodeReceivedMessage(message);
     alertView.Message = "message Received";
     alertView.Show();
 }
 public override void DidFailSending(HYP hype, HYPMessage message, HYPInstance instance, NSError error)
 {
     alertView.Message = "Falied to Send Message - " + error.DebugDescription;
 }
 public override void HypeDidStop(HYP hype, NSError error)
 {
     HandleNSError(error, alertView);
 }
 public override void HypeDidStart(HYP hype)
 {
     Console.WriteLine("HYPE STARTED !!!!!!!!!!!!!!!");
     //alertView.Message = "Hype Started!";
     //alertView.Show();
 }
 public override void HypeDidFailStarting(HYP hype, NSError error)
 {
     HandleNSError(error, alertView);
 }
 public override void HypeDidBecomeReady(HYP hype)
 {
     Console.WriteLine("HYPE DID BECOME READY!!!");
     Console.WriteLine("Restarting Hype");
     hype.StartWithOptions(HypeOptions);
 }
Example #12
0
 public MainViewController(IntPtr handle) : base(handle)
 {
     hype            = new HYP();
     networkObserver = new HypeNetworkDelegate();
 }