Ejemplo n.º 1
0
    public void onClick(BaseEventData evt)
    {
        PointerEventData ptrEvt = evt as PointerEventData;

        if (ptrEvt != null)
        {
            SessionCell cell = ptrEvt.pointerPress.GetComponent <SessionCell> ();
            if ((cell != null) && (tableClickController != null))
            {
                tableClickController.handleClick(ptrEvt, cell);
            }
        }
    }
			public override UITableViewCell GetCell (UITableView tableView, NSIndexPath indexPath)
			{
				var cell = (SessionCell) tableView.DequeueReusableCell (sessionCellId);

				var sessionGroup = Data.Instance.SessionsGrouped [indexPath.Section];
				var session = sessionGroup.ElementAt (indexPath.Row);

				if (cell == null)
					cell = new SessionCell (sessionCellId);	

				cell.Session = session;
			
				return cell;
			}
Ejemplo n.º 3
0
    /// <summary>
    /// Create a cell for a certain row in a table view.
    /// Callers should use tableView.GetReusableCell to cache objects
    /// </summary>
    public Tacticsoft.TableViewCell GetCellForRowInTableView(Tacticsoft.TableView tableView, int row)
    {
        SessionCell cell = tableView.GetReusableCell(m_cellPrefab.reuseIdentifier) as SessionCell;

        if (cell == null)
        {
            cell      = (SessionCell)GameObject.Instantiate(m_cellPrefab);
            cell.name = "VisibleCounterCellInstance_" + (++m_numInstancesCreated).ToString();
        }
        cell.tableClickController = this;
        cell.rowNumber            = row;
        cell.sessionInfo          = sessionList [row];
        return(cell);
    }
            public override UITableViewCell GetCell(UITableView tableView, NSIndexPath indexPath)
            {
                var cell = (SessionCell)tableView.DequeueReusableCell(sessionCellId);

                var sessionGroup = Data.Instance.SessionsGrouped [indexPath.Section];
                var session      = sessionGroup.ElementAt(indexPath.Row);

                if (cell == null)
                {
                    cell = new SessionCell(sessionCellId);
                }

                cell.Session = session;

                return(cell);
            }
Ejemplo n.º 5
0
    public void handleClick(PointerEventData evt, SessionCell cell)
    {
        if ((evt.button == PointerEventData.InputButton.Left) && (evt.clickCount == 2))
        {
            print(cell.sessionInfo);
            canvas.gameObject.SetActive(false);
            //loader.startPlayback ();
            NMSConnectionFactory cf          = new NMSConnectionFactory("activemq:" + cell.sessionInfo.activemqUrl);
            IConnection          connection  = cf.CreateConnection();
            ISession             amqSession  = connection.CreateSession(AcknowledgementMode.AutoAcknowledge);
            ITopic           controlTopic    = amqSession.GetTopic(cell.sessionInfo.controlStreamName);
            IMessageConsumer controlConsumer = amqSession.CreateConsumer(controlTopic);
            controlConsumer.Listener += onControlMessage;

            ITopic           dataTopic    = amqSession.GetTopic(cell.sessionInfo.dataStreamName);
            IMessageConsumer dataConsumer = amqSession.CreateConsumer(dataTopic);
            //dataConsumer.Listener += onDataMessage;
            dataConsumer.Listener += loader.onDataMessage;

            connection.Start();
        }
    }
        public SettingsSessionPopup(Session session)
        {
            InitializeComponent();

            var icon = SessionCell.IconForSession(session);

            IconBackground.Background = new SolidColorBrush(icon.Backgroud);

            if (icon.Animation != null)
            {
                Icon.ColorReplacements = new Dictionary <int, int> {
                    { 0x000000, icon.Backgroud.ToValue() }
                };
                Icon.FrameSize       = new Size(50, 50);
                Icon.DecodeFrameType = DecodePixelType.Logical;
                Icon.Source          = new Uri($"ms-appx:///Assets/Animations/Device{icon.Animation}.json");
            }
            else
            {
            }

            Title.Text    = session.DeviceModel;
            Subtitle.Text = Converter.DateExtended(session.LastActiveDate);

            Application.Badge = string.Format("{0} {1}", session.ApplicationName, session.ApplicationVersion);
            Location.Badge    = session.Country;
            Address.Badge     = session.Ip;

            AcceptCalls.IsChecked = session.CanAcceptCalls;

            AcceptSecretChats.IsChecked       = session.CanAcceptSecretChats;
            AcceptSecretChatsPanel.Visibility = session.ApiId == 2040 || session.ApiId == 2496
                ? Visibility.Collapsed
                : Visibility.Visible;

            PrimaryButtonText   = Strings.Resources.Terminate;
            SecondaryButtonText = Strings.Resources.Done;
        }