protected void UpdateChannelStatusGUI(IPAddress addr, int port) { if (mChannelA == null || mChannelB == null) { return; } ChannelStatusEnum status_a = mChannelA.ChannelStatus; ChannelStatusEnum status_b = mChannelB.ChannelStatus; ////caanale A if (status_a == ChannelStatusEnum.Idle) { channelStatusA.Text = "NC"; channelStatusA.Background = new SolidColorBrush(Colors.Red); remoteEndpointAText.Text = "Non Connesso"; } else if (status_a == ChannelStatusEnum.Listening) { channelStatusA.Text = "LIST"; channelStatusA.Background = new SolidColorBrush(Colors.Yellow); remoteEndpointAText.Text = "Non Connesso"; } else if (status_a == ChannelStatusEnum.Active) { channelStatusA.Text = "ON"; channelStatusA.Background = new SolidColorBrush(Colors.Green); if (addr != null) { remoteEndpointAText.Text = addr.ToString() + ":" + port; } } ////canale B if (status_b == ChannelStatusEnum.Idle) { channelStatusB.Text = "NC"; channelStatusB.Background = new SolidColorBrush(Colors.Red); remoteEndpointBText.Text = "Non Connesso"; } else if (status_b == ChannelStatusEnum.Listening) { channelStatusB.Text = "LIST"; channelStatusB.Background = new SolidColorBrush(Colors.Yellow); remoteEndpointBText.Text = "Non Connesso"; } else if (status_b == ChannelStatusEnum.Active) { channelStatusB.Text = "ON"; channelStatusB.Background = new SolidColorBrush(Colors.Green); if (addr != null) { remoteEndpointBText.Text = addr.ToString() + ":" + port; } } }
public EndPointTranceiver(IEndPointEventReceiver recv) { mOutputQueue = null; mInputQueue = null; //thread di rx mChannelThread = null; mConfigured = false; mEventReceiver = recv; mChannelLock = new object(); mChannelStatus = ChannelStatusEnum.Idle; }
/// <summary> /// Set up simple channel /// </summary> /// <param name="channelId">Id of the channel, default 1</param> /// <param name="distributorId">Id of the distributor, default 1</param> /// <param name="channelType">The channel type, default Channel</param> /// <param name="name">The name of the channel, default "Expedia Gold"</param> /// <param name="shortName">The short name of the channel, default "exp-gold"</param> /// <param name="commission">The amount of commission, default 15.00</param> /// <param name="allowProviderOptOut">True if provider can opt out, default true</param> /// <param name="displaySequence">The display order of channels, default 1</param> /// <param name="requiresMembership">True is channel requires membership, default false</param> /// <param name="channelStatus">The status of the channel, default Active</param> /// <returns>A new channel object</returns> public static Channel BuildChannel(int channelId = 1, long distributorId = 1, ChannelTypeEnum channelType = ChannelTypeEnum.Channel, string name = "Expedia Gold", string shortName = "exp-gold", decimal commission = 15, bool allowProviderOptOut = true, int displaySequence = 1, bool requiresMembership = false, ChannelStatusEnum channelStatus = ChannelStatusEnum.Active) { return new Channel { Id = channelId, DistributorId = distributorId, EcomBusinessAccountId = Guid.NewGuid(), AllowProviderOptOut = allowProviderOptOut, Name = name, ShortName = shortName, Commission = commission, DisplaySequence = displaySequence, RequiresMembership = requiresMembership, ChannelType = channelType, ChannelStatus = channelStatus }; }