/// <summary>
        /// Add a new Transmission to the active transmission manager
        /// </summary>
        /// <param name="transmission">transmission which should be added</param>
        /// <returns>true if added</returns>
        public virtual bool AddTransmission(TransmissionController transmission) {
            if (transmission == null) {
                throw new ArgumentNullException();
            }

            lock (this.collectionLock) {
                if (this.activeTransmissions.Contains(transmission)) {
                    return false;
                }

                transmission.PropertyChanged += this.TransmissionFinished;
                this.activeTransmissions.Add(transmission);
            }

            return true;
        }
        /// <summary>
        /// Add a new Transmission to the active transmission manager
        /// </summary>
        /// <param name="transmission">transmission which should be added</param>
        /// <returns>true if added</returns>
        public virtual bool AddTransmission(TransmissionController transmission)
        {
            if (transmission == null)
            {
                throw new ArgumentNullException();
            }

            lock (this.collectionLock) {
                if (this.activeTransmissions.Contains(transmission))
                {
                    return(false);
                }

                transmission.PropertyChanged += this.TransmissionFinished;
                this.activeTransmissions.Add(transmission);
            }

            return(true);
        }
Esempio n. 3
0
    void CheckButton(ActionEnum action, bool pressed)
    {
        if (pressed)
        {
            //GetComponent<PlayerController> ().ActivateButton (action);

            audio.PlayOneShot(sendSound);

            Action a = new Action();
            a.Button       = action;
            a.SourcePlayer = gameObject;

            GameObject             t = Instantiate(Transmission, transform.position, Quaternion.identity);
            TransmissionController transmissionController = t.GetComponent <TransmissionController> ();
            transmissionController.TransmittedAction = a;
            transmissionController.color             = TransmissionColor;

            transmissionManager.AddTransmissionController(transmissionController);
        }
    }
 public TransmissionDataSource(TransmissionController controller) {
     Controller = controller;
     Controller.InsertTransmissionEvent += HandleInsertTransmissionEvent;
     Controller.DeleteTransmissionEvent += HandleDeleteTransmissionEvent;
     Controller.UpdateTransmissionEvent += HandleUpdateTransmissionEvent;
 }
Esempio n. 5
0
 public void AddTransmissionController(TransmissionController tc)
 {
     tc.manager = this;
     TransmissionControllers.Add(tc);
 }
Esempio n. 6
0
 public void RemoveTransmissionController(TransmissionController tc)
 {
     TransmissionControllers.Remove(tc);
 }