Example #1
0
        protected void OnNewChannels (ChannelDetails[] channels)
        {
            if (chann_path != null) {
                return;
            }

            foreach (ChannelDetails c in channels) {

                ObjectPath object_path = c.Channel;
                string channel_type = (string) c.Properties[Constants.CHANNEL_IFACE + ".ChannelType"];
                HandleType handle_type = (HandleType) c.Properties[Constants.CHANNEL_IFACE + ".TargetHandleType"];
                uint target_handle = (uint) c.Properties[Constants.CHANNEL_IFACE + ".TargetHandle"];

                Console.WriteLine ("NewChannel detected: object path {0}, channel_type {1}, handle_type {2}, target_handle {3}",
                                   object_path, channel_type, handle_type.ToString (), target_handle);

                initiator = (uint) DBusUtility.GetProperty (Connection.Bus, Connection.BusName, object_path.ToString (),
                                                                     Constants.CHANNEL_IFACE, "InitiatorHandle");

                if (channel_type.Equals (ChannelType)  &&
                    (target_handle == TargetHandle || initiator == TargetHandle)) {
                        ChannPath = object_path.ToString ();
                        ProcessNewChannel (c);
                        return;
                }

            }
        }
Example #2
0
        public NodeHandle(int nodePanelGuid, string id, HandleType type, Rect rect, CanvasState canvasState)
        {
            this.canvasState   = canvasState;
            transform          = new CanvasTransform(id + " NodeHandle " + type.ToString(), rect, canvasState);
            this.nodePanelGuid = nodePanelGuid;

            this.type    = type;
            _connections = new List <NodeConnection>();

            this.canvasState.AddInputReceiver(this);
        }
        protected void OnNewChannels(ChannelDetails[] channels)
        {
            foreach (ChannelDetails c in channels)
            {
                string     object_path   = c.Channel.ToString();
                string     channel_type  = (string)c.Properties[Constants.CHANNEL_IFACE + ".ChannelType"];
                HandleType handle_type   = (HandleType)c.Properties[Constants.CHANNEL_IFACE + ".TargetHandleType"];
                uint       target_handle = (uint)c.Properties[Constants.CHANNEL_IFACE + ".TargetHandle"];

                if (channel_type.Equals(ChannelType) && CanProcess(c))
                {
                    Console.WriteLine("NewChannel detected: object path {0}, channel_type {1}, handle_type {2}, target_handle {3}",
                                      object_path, channel_type, handle_type.ToString(), target_handle);

                    uint initiator_handle = (uint)DBusUtility.GetProperty(Connection.Bus, Connection.BusName, object_path,
                                                                          Constants.CHANNEL_IFACE, "InitiatorHandle");
                    ProcessNewChannel(object_path, initiator_handle, target_handle, c);
                    return;
                }
            }
        }
Example #4
0
 /// <summary>
 /// ToString override.
 /// </summary>
 /// <returns></returns>
 public override string ToString()
 {
     return(HandleType.ToString() + " " + (Type != null ? Type.Name : ""));
 }
Example #5
0
 void handleIp(HandleType type)
 {
     Debug.Log("========: " + type.ToString());
 }
Example #6
0
        /// <summary>
        /// Telepathy callback when new channels are created
        /// </summary>
        private void OnNewChannel(
						ObjectPath channelPath,
						string channelType,
						HandleType handleType,
						uint handle,
						bool suppressHandler)
        {
            Logger.Debug ("Account::OnNewChannel - called");
            Logger.Debug ("New Channel {0}", channelType);
            Logger.Debug ("Handle Type: {0}", handleType.ToString());
            Logger.Debug ("Handle: {0}", handle);
            Logger.Debug ("Suppress Handler: {0}", suppressHandler);

            if (suppressHandler == false)
                ConversationManager.ProcessNewChannel (
                    this,
                    channelPath,
                    channelType,
                    handleType,
                    handle,
                    suppressHandler);

            return;
        }