Ejemplo n.º 1
0
        public bool OnClientMouseOver(MouseInfo mouseInfo, ModifierKeys modifiers, nsIDOMNode target)
        {
#if debug
            OnGeneric("OnClientMouseOver");
            Console.Error.WriteLine("OnClientMouseOver");
#endif
            DOM.DOMObject helper = new DOM.DOMObject(this.owner);
            INode         node   = helper.GetTypedNode(target);
            string        key    = String.Intern(node.GetHashCode() + ":mouseover");
            EventHandler  eh1    = (EventHandler)owner.DomEvents[key];
            if (eh1 != null)
            {
                EventArgs e1 = new EventArgs();
                eh1(node, e1);
            }

            NodeEventHandler eh = (NodeEventHandler)(owner.Events[WebBrowser.MouseEnterEvent]);
            if (eh != null)
            {
                NodeEventArgs e = new NodeEventArgs(node);
                eh(node, e);
                return(true);
            }
            return(false);
        }
Ejemplo n.º 2
0
        private void HandleNodeEvent()
        {
            switch (Event.current.rawType)
            {
            case EventType.MouseUp:
            {
                if (Event.current.button == 0)
                {
                    var ev = new NodeEvent
                    {
                        eventType           = NodeEvent.EventType.Touched,
                        eventSourceNode     = this,
                        globalMousePosition = Event.current.mousePosition + nodeRect.position,
                    };

                    // redirect to manager
                    NodeEventHandler.Invoke(ev);
                }
            }
            break;

            default:
                break;
            }
        }
Ejemplo n.º 3
0
        private void RemovedHandler(object Sender, IqEventArgs e)
        {
            XmlElement     E         = e.Query;
            string         NodeId    = XML.Attribute(E, "id");
            string         SourceId  = XML.Attribute(E, "src");
            string         Partition = XML.Attribute(E, "pt");
            ThingReference Node;

            if (string.IsNullOrEmpty(NodeId) && string.IsNullOrEmpty(SourceId) && string.IsNullOrEmpty(Partition))
            {
                Node = ThingReference.Empty;
            }
            else
            {
                Node = new ThingReference(NodeId, SourceId, Partition);
            }

            NodeEventArgs    e2 = new NodeEventArgs(e, Node);
            NodeEventHandler h  = this.Removed;

            if (h != null)
            {
                try
                {
                    h(this, e2);
                }
                catch (Exception ex)
                {
                    Log.Critical(ex);
                }
            }

            e.IqResult(string.Empty);
        }
Ejemplo n.º 4
0
        public TypeNode(SensorType sensorType) : base()
        {
            this.sensorType = sensorType;

            switch (sensorType)
            {
            case SensorType.Voltage:
                this.Image = Utilities.EmbeddedResources.GetImage("voltage.png");
                this.Text  = "Voltages";
                break;

            case SensorType.Clock:
                this.Image = Utilities.EmbeddedResources.GetImage("clock.png");
                this.Text  = "Clocks";
                break;

            case SensorType.Load:
                this.Image = Utilities.EmbeddedResources.GetImage("load.png");
                this.Text  = "Load";
                break;

            case SensorType.Temperature:
                this.Image = Utilities.EmbeddedResources.GetImage("temperature.png");
                this.Text  = "Temperatures";
                break;

            case SensorType.Fan:
                this.Image = Utilities.EmbeddedResources.GetImage("fan.png");
                this.Text  = "Fans";
                break;

            case SensorType.Flow:
                this.Image = Utilities.EmbeddedResources.GetImage("flow.png");
                this.Text  = "Flows";
                break;

            case SensorType.Control:
                this.Image = Utilities.EmbeddedResources.GetImage("control.png");
                this.Text  = "Controls";
                break;

            case SensorType.Level:
                this.Image = Utilities.EmbeddedResources.GetImage("level.png");
                this.Text  = "Levels";
                break;

            case SensorType.Power:
                this.Image = Utilities.EmbeddedResources.GetImage("power.png");
                this.Text  = "Powers";
                break;

            case SensorType.Data:
                this.Image = Utilities.EmbeddedResources.GetImage("data.png");
                this.Text  = "Data";
                break;
            }

            NodeAdded   += new NodeEventHandler(TypeNode_NodeAdded);
            NodeRemoved += new NodeEventHandler(TypeNode_NodeRemoved);
        }
Ejemplo n.º 5
0
        public TypeNode(SensorType sensorType) : base()
        {
            this.sensorType = sensorType;

            switch (sensorType)
            {
            case SensorType.Voltage:
                this.Text = "voltages";
                break;

            case SensorType.Clock:
                this.Text = "clocks";
                break;

            case SensorType.Load:
                this.Text = "load";
                break;

            case SensorType.Temperature:
                this.Text = "temperatures";
                break;

            case SensorType.Fan:
                this.Text = "fans";
                break;

            case SensorType.Flow:
                this.Text = "flows";
                break;

            case SensorType.Control:
                this.Text = "controls";
                break;

            case SensorType.Level:
                this.Text = "levels";
                break;

            case SensorType.Power:
                this.Text = "powers";
                break;

            case SensorType.Data:
                this.Text = "data";
                break;

            case SensorType.Factor:
                this.Text = "factors";
                break;
            }

            NodeAdded   += new NodeEventHandler(TypeNode_NodeAdded);
            NodeRemoved += new NodeEventHandler(TypeNode_NodeRemoved);
        }
Ejemplo n.º 6
0
        public DxTreeList()
        {
            TreeListColumns = new List <DxTreeListColumn>();

            MouseDown      += new MouseEventHandler(OnMouseDown);
            AfterCheckNode += new NodeEventHandler(OnAfterCheckNode);

            OptionsSelection.EnableAppearanceFocusedCell = false;               // no cell selection.
            OptionsSelection.EnableAppearanceFocusedRow  = true;                // background color is displayed for the full row.
            OptionsSelection.MultiSelect = false;
        }
Ejemplo n.º 7
0
    public TypeNode(SensorType sensorType) : base() {
      this.sensorType = sensorType;

      switch (sensorType) {
        case SensorType.Voltage: 
          this.Image = Utilities.EmbeddedResources.GetImage("voltage.png");
          this.Text = "Voltages";
          break;
        case SensorType.Clock:
          this.Image = Utilities.EmbeddedResources.GetImage("clock.png");
          this.Text = "Clocks";
          break;
        case SensorType.Load:
          this.Image = Utilities.EmbeddedResources.GetImage("load.png");
          this.Text = "Load";
          break;
        case SensorType.Temperature:
          this.Image = Utilities.EmbeddedResources.GetImage("temperature.png");
          this.Text = "Temperatures";
          break;
        case SensorType.Fan:
          this.Image = Utilities.EmbeddedResources.GetImage("fan.png");
          this.Text = "Fans";
          break;
        case SensorType.Flow:
          this.Image = Utilities.EmbeddedResources.GetImage("flow.png");
          this.Text = "Flows";
          break;
        case SensorType.Control:
          this.Image = Utilities.EmbeddedResources.GetImage("control.png");
          this.Text = "Controls";
          break;
        case SensorType.Level:
          this.Image = Utilities.EmbeddedResources.GetImage("level.png");
          this.Text = "Levels";
          break;
        case SensorType.Power:
          this.Image = Utilities.EmbeddedResources.GetImage("power.png");
          this.Text = "Powers";
          break;
        case SensorType.Data:
          this.Image = Utilities.EmbeddedResources.GetImage("data.png");
          this.Text = "Data";
          break;
        case SensorType.Factor:
          this.Image = Utilities.EmbeddedResources.GetImage("factor.png");
          this.Text = "Factors";
          break;
      }

      NodeAdded += new NodeEventHandler(TypeNode_NodeAdded);
      NodeRemoved += new NodeEventHandler(TypeNode_NodeRemoved);
    }
Ejemplo n.º 8
0
        /// <summary>
        /// Loads interfaces and binds them to appropriate delegates
        /// </summary>
        private void LoadInterfaces()
        {
            // Find assembly that contains the needed class
            EventCollection events = CatalogConfiguration.Instance.Events;

            if (events != null)
            {
                foreach (EventDefinition eventDef in events)
                {
                    Type type = Type.GetType(eventDef.ClassName);

                    if (type == null)
                    {
                        // Log Exception here
                        continue;
                    }

                    if (type.IsAbstract)
                    {
                        continue;
                    }

                    foreach (Type intf in type.GetInterfaces())
                    {
                        if (intf == typeof(ICatalogEventListener))
                        {
                            ICatalogEventListener listener = (ICatalogEventListener)Activator.CreateInstance(type);

                            EntryUpdating += new EntryEventHandler(listener.EntryUpdating);
                            EntryUpdated  += new EntryEventHandler(listener.EntryUpdated);

                            NodeUpdating += new NodeEventHandler(listener.NodeUpdating);
                            NodeUpdated  += new NodeEventHandler(listener.NodeUpdated);

                            CatalogUpdating += new CatalogEventHandler(listener.CatalogUpdating);
                            CatalogUpdated  += new CatalogEventHandler(listener.CatalogUpdated);

                            AssociationUpdating += new AssociationEventHandler(listener.AssociationUpdating);
                            AssociationUpdated  += new AssociationEventHandler(listener.AssociationUpdated);

                            RelationUpdating += new RelationEventHandler(listener.RelationUpdating);
                            RelationUpdated  += new RelationEventHandler(listener.RelationUpdated);

                            // Save a handle
                            _Handles.Add(new ObjectHandle(listener));
                        }
                    }
                }
            }
        }
Ejemplo n.º 9
0
        private void DisownedHandler(object Sender, IqEventArgs e)
        {
            XmlElement     E         = e.Query;
            string         NodeId    = XML.Attribute(E, "id");
            string         SourceId  = XML.Attribute(E, "src");
            string         Partition = XML.Attribute(E, "pt");
            ThingReference Node;

            if (string.IsNullOrEmpty(NodeId) && string.IsNullOrEmpty(SourceId) && string.IsNullOrEmpty(Partition))
            {
                Node = ThingReference.Empty;

                if (this.client.TryGetExtension(typeof(ProvisioningClient), out IXmppExtension Extension) &&
                    Extension is ProvisioningClient ProvisioningClient)
                {
                    ProvisioningClient.OwnerJid = string.Empty;
                }
            }
            else
            {
                Node = new ThingReference(NodeId, SourceId, Partition);
            }

            NodeEventArgs    e2 = new NodeEventArgs(e, Node);
            NodeEventHandler h  = this.Disowned;

            if (h != null)
            {
                try
                {
                    h(this, e2);
                }
                catch (Exception ex)
                {
                    Log.Critical(ex);
                }
            }

            e.IqResult(string.Empty);
        }
Ejemplo n.º 10
0
        private void OnDisconnected()
        {
            this.logger.LogTrace("()");

            NodeEventHandler disconnected = Disconnected;

            if (disconnected != null)
            {
                foreach (NodeEventHandler handler in disconnected.GetInvocationList().Cast <NodeEventHandler>())
                {
                    try
                    {
                        handler.DynamicInvoke(this);
                    }
                    catch (TargetInvocationException ex)
                    {
                        this.logger.LogError("Exception occurred: {0}", ex.InnerException.ToString());
                    }
                }
            }

            this.logger.LogTrace("(-)");
        }
Ejemplo n.º 11
0
        public bool OnClientMouseOut(MouseInfo mouseInfo, ModifierKeys modifiers, nsIDOMNode target)
        {
#if debug
            OnGeneric("OnClientMouseOut");
            Console.Error.WriteLine("OnClientMouseOut");
#endif
            INode        node = new Mono.Mozilla.DOM.Node(owner, target);
            string       key  = String.Intern(node.GetHashCode() + ":mouseout");
            EventHandler eh1  = (EventHandler)owner.DomEvents[key];
            if (eh1 != null)
            {
                EventArgs e1 = new EventArgs();
                eh1(node, e1);
            }

            NodeEventHandler eh = (NodeEventHandler)(owner.Events[WebBrowser.MouseLeaveEvent]);
            if (eh != null)
            {
                NodeEventArgs e = new NodeEventArgs(node);
                eh(this, e);
                return(true);
            }
            return(false);
        }
Ejemplo n.º 12
0
        /// <summary>
        /// Processes event add, delete and filter requests.
        /// </summary>
        /// <param name="document">Document that contains the event message.</param>
        private void ProcessEventListener(IProcEventListener document)
        {
            // See if there are any filter events to set.
            IEnumerator e = document.GetFilterEnumerator();

            while (e.MoveNext())
            {
                IProcEventFilter filter = e.Current as IProcEventFilter;
                switch (filter.Type)
                {
                case IProcFilterType.Collection:
                {
                    simiasNodeEventSubscriber.CollectionId = filter.Data;
                    break;
                }

                case IProcFilterType.NodeID:
                {
                    simiasNodeEventSubscriber.NodeIDFilter = filter.Data;
                    break;
                }

                case IProcFilterType.NodeType:
                {
                    simiasNodeEventSubscriber.NodeTypeFilter = filter.Data;
                    break;
                }
                }
            }

            // See if there are any events to add or delete.
            e = document.GetEventEnumerator();
            while (e.MoveNext())
            {
                switch (( IProcEventAction )Enum.Parse(typeof(IProcEventAction), e.Current as string))
                {
                case IProcEventAction.AddNodeChanged:
                {
                    if (nodeChangedHandler == null)
                    {
                        log.Debug("{0} : Added node change event.", port);
                        nodeChangedHandler = new NodeEventHandler(NodeEventCallback);
                        simiasNodeEventSubscriber.NodeChanged += nodeChangedHandler;
                    }
                    break;
                }

                case IProcEventAction.AddNodeCreated:
                {
                    if (nodeCreatedHandler == null)
                    {
                        log.Debug("{0} : Added node create event.", port);
                        nodeCreatedHandler = new NodeEventHandler(NodeEventCallback);
                        simiasNodeEventSubscriber.NodeCreated += nodeCreatedHandler;
                    }
                    break;
                }

                case IProcEventAction.AddNodeDeleted:
                {
                    if (nodeDeletedHandler == null)
                    {
                        log.Debug("{0} : Added node delete event.", port);
                        nodeDeletedHandler = new NodeEventHandler(NodeEventCallback);
                        simiasNodeEventSubscriber.NodeDeleted += nodeDeletedHandler;
                    }
                    break;
                }

                case IProcEventAction.AddCollectionSync:
                {
                    if (collectionSyncHandler == null)
                    {
                        log.Debug("{0} : Added collection sync event.", port);
                        collectionSyncHandler = new CollectionSyncEventHandler(CollectionSyncEventCallback);
                        simiasSyncEventSubscriber.CollectionSync += collectionSyncHandler;
                    }
                    break;
                }

                case IProcEventAction.AddFileSync:
                {
                    if (fileSyncHandler == null)
                    {
                        log.Debug("{0} : Added file sync event.", port);
                        fileSyncHandler = new FileSyncEventHandler(FileSyncEventCallback);
                        simiasSyncEventSubscriber.FileSync += fileSyncHandler;
                    }
                    break;
                }

                case IProcEventAction.AddNotifyMessage:
                {
                    if (notifyHandler == null)
                    {
                        log.Debug("{0} : Added notify event.", port);
                        notifyHandler = new NotifyEventHandler(NotifyEventCallback);
                        simiasNotifyEventSubscriber.NotifyEvent += notifyHandler;
                    }
                    break;
                }

                case IProcEventAction.RemoveNodeChanged:
                {
                    if (nodeChangedHandler != null)
                    {
                        log.Debug("{0} : Removed node change event.", port);
                        simiasNodeEventSubscriber.NodeChanged -= nodeChangedHandler;
                        nodeChangedHandler = null;
                    }
                    break;
                }

                case IProcEventAction.RemoveNodeCreated:
                {
                    if (nodeCreatedHandler != null)
                    {
                        log.Debug("{0} : Removed node created event.", port);
                        simiasNodeEventSubscriber.NodeCreated -= nodeCreatedHandler;
                        nodeCreatedHandler = null;
                    }
                    break;
                }

                case IProcEventAction.RemoveNodeDeleted:
                {
                    if (nodeDeletedHandler != null)
                    {
                        log.Debug("{0} : Removed node deleted event.", port);
                        simiasNodeEventSubscriber.NodeDeleted -= nodeDeletedHandler;
                        nodeDeletedHandler = null;
                    }
                    break;
                }

                case IProcEventAction.RemoveCollectionSync:
                {
                    if (collectionSyncHandler != null)
                    {
                        log.Debug("{0} : Removed collection sync event.", port);
                        simiasSyncEventSubscriber.CollectionSync -= collectionSyncHandler;
                        collectionSyncHandler = null;
                    }
                    break;
                }

                case IProcEventAction.RemoveFileSync:
                {
                    if (fileSyncHandler != null)
                    {
                        log.Debug("{0} : Removed file sync event.", port);
                        simiasSyncEventSubscriber.FileSync -= fileSyncHandler;
                        fileSyncHandler = null;
                    }
                    break;
                }

                case IProcEventAction.RemoveNotifyMessage:
                {
                    if (notifyHandler != null)
                    {
                        log.Debug("{0} : Removed notify event.", port);
                        simiasNotifyEventSubscriber.NotifyEvent -= notifyHandler;
                        notifyHandler = null;
                    }
                    break;
                }
                }
            }
        }
Ejemplo n.º 13
0
		public DxTreeList()
		{
			TreeListColumns = new List<DxTreeListColumn>();

			MouseDown += new MouseEventHandler(OnMouseDown);
			AfterCheckNode += new NodeEventHandler(OnAfterCheckNode);

			OptionsSelection.EnableAppearanceFocusedCell = false;	// no cell selection.
			OptionsSelection.EnableAppearanceFocusedRow = true;		// background color is displayed for the full row.
			OptionsSelection.MultiSelect = false;
		}
Ejemplo n.º 14
0
        public TypeNode(SensorType sensorType) : base()
        {
            this.sensorType = sensorType;

            switch (sensorType)
            {
            case SensorType.Voltage:
                this.Image = Utilities.EmbeddedResources.GetImage("voltage.png");
                this.Text  = "Напряжения";
                break;

            case SensorType.Clock:
                this.Image = Utilities.EmbeddedResources.GetImage("clock.png");
                this.Text  = "Частоты";
                break;

            case SensorType.Load:
                this.Image = Utilities.EmbeddedResources.GetImage("load.png");
                this.Text  = "Нагрузка";
                break;

            case SensorType.Temperature:
                this.Image = Utilities.EmbeddedResources.GetImage("temperature.png");
                this.Text  = "Температуры";
                break;

            case SensorType.Fan:
                this.Image = Utilities.EmbeddedResources.GetImage("fan.png");
                this.Text  = "Вентеляторы";
                break;

            case SensorType.Flow:
                this.Image = Utilities.EmbeddedResources.GetImage("flow.png");
                this.Text  = "Поток";
                break;

            case SensorType.Control:
                this.Image = Utilities.EmbeddedResources.GetImage("control.png");
                this.Text  = "Контроллеры";
                break;

            case SensorType.Level:
                this.Image = Utilities.EmbeddedResources.GetImage("level.png");
                this.Text  = "Уровни";
                break;

            case SensorType.Power:
                this.Image = Utilities.EmbeddedResources.GetImage("power.png");
                this.Text  = "Мощность";
                break;

            case SensorType.Data:
                this.Image = Utilities.EmbeddedResources.GetImage("data.png");
                this.Text  = "Данные";
                break;

            case SensorType.SmallData:
                this.Image = Utilities.EmbeddedResources.GetImage("data.png");
                this.Text  = "Данные";
                break;

            case SensorType.Factor:
                this.Image = Utilities.EmbeddedResources.GetImage("factor.png");
                this.Text  = "Факторы";
                break;
            }

            NodeAdded   += new NodeEventHandler(TypeNode_NodeAdded);
            NodeRemoved += new NodeEventHandler(TypeNode_NodeRemoved);
        }
Ejemplo n.º 15
0
        public TypeNode(SensorType sensorType) : base()
        {
            this.sensorType = sensorType;

            switch (sensorType)
            {
            case SensorType.Voltage:
                this.Image = Utilities.EmbeddedResources.GetImage("voltage.png");
                this.Text  = "电压";
                break;

            case SensorType.Clock:
                this.Image = Utilities.EmbeddedResources.GetImage("clock.png");
                this.Text  = "时钟";
                break;

            case SensorType.Load:
                this.Image = Utilities.EmbeddedResources.GetImage("load.png");
                this.Text  = "负荷";
                break;

            case SensorType.Temperature:
                this.Image = Utilities.EmbeddedResources.GetImage("temperature.png");
                this.Text  = "温度";
                break;

            case SensorType.Fan:
                this.Image = Utilities.EmbeddedResources.GetImage("fan.png");
                this.Text  = "风扇";
                break;

            case SensorType.Flow:
                this.Image = Utilities.EmbeddedResources.GetImage("flow.png");
                this.Text  = "流量";
                break;

            case SensorType.Control:
                this.Image = Utilities.EmbeddedResources.GetImage("control.png");
                this.Text  = "控制";
                break;

            case SensorType.Level:
                this.Image = Utilities.EmbeddedResources.GetImage("level.png");
                this.Text  = "级别";
                break;

            case SensorType.Power:
                this.Image = Utilities.EmbeddedResources.GetImage("power.png");
                this.Text  = "功率";
                break;

            case SensorType.Data:
                this.Image = Utilities.EmbeddedResources.GetImage("data.png");
                this.Text  = "数据";
                break;

            case SensorType.Factor:
                this.Image = Utilities.EmbeddedResources.GetImage("factor.png");
                this.Text  = "因素";
                break;
            }

            NodeAdded   += new NodeEventHandler(TypeNode_NodeAdded);
            NodeRemoved += new NodeEventHandler(TypeNode_NodeRemoved);
        }
Ejemplo n.º 16
0
        public TypeNode(SensorType sensorType, IHardware hardware,
                        PersistentSettings settings) : base()
        {
            this.settings   = settings;
            this.sensorType = sensorType;
            this.hardware   = hardware;

            switch (sensorType)
            {
            case SensorType.Voltage:
                this.Image = Utilities.EmbeddedResources.GetImage("voltage.png");
                this.Text  = "Voltages";
                break;

            case SensorType.Clock:
                this.Image = Utilities.EmbeddedResources.GetImage("clock.png");
                this.Text  = "Clocks";
                break;

            case SensorType.Load:
                this.Image = Utilities.EmbeddedResources.GetImage("load.png");
                this.Text  = "Load";
                break;

            case SensorType.Temperature:
                this.Image = Utilities.EmbeddedResources.GetImage("temperature.png");
                this.Text  = "Temperatures";
                break;

            case SensorType.Fan:
                this.Image = Utilities.EmbeddedResources.GetImage("fan.png");
                this.Text  = "Fans";
                break;

            case SensorType.Flow:
                this.Image = Utilities.EmbeddedResources.GetImage("flow.png");
                this.Text  = "Flows";
                break;

            case SensorType.Control:
                this.Image = Utilities.EmbeddedResources.GetImage("control.png");
                this.Text  = "Controls";
                break;

            case SensorType.Level:
                this.Image = Utilities.EmbeddedResources.GetImage("level.png");
                this.Text  = "Levels";
                break;

            case SensorType.Power:
                this.Image = Utilities.EmbeddedResources.GetImage("power.png");
                this.Text  = "Powers";
                break;

            case SensorType.Data:
                this.Image = Utilities.EmbeddedResources.GetImage("data.png");
                this.Text  = "Data";
                break;

            case SensorType.SmallData:
                this.Image = Utilities.EmbeddedResources.GetImage("data.png");
                this.Text  = "Data";
                break;

            case SensorType.Factor:
                this.Image = Utilities.EmbeddedResources.GetImage("factor.png");
                this.Text  = "Factors";
                break;

            case SensorType.Throughput:
                this.Image = Utilities.EmbeddedResources.GetImage("throughput.png");
                this.Text  = "Throughput";
                break;
            }

            NodeAdded   += new NodeEventHandler(TypeNode_NodeAdded);
            NodeRemoved += new NodeEventHandler(TypeNode_NodeRemoved);

            this.expandedIdentifier = new Identifier(new Identifier(hardware.Identifier,
                                                                    sensorType.ToString().ToLowerInvariant()), "expanded");
            base.IsExpanded =
                settings.GetValue(expandedIdentifier.ToString(), base.IsExpanded);
        }
Ejemplo n.º 17
0
        public TypeNode(SensorType sensorType, Identifier identifier, PersistentSettings settings) : base(identifier, settings)
        {
            this.sensorType = sensorType;

            switch (sensorType)
            {
            case SensorType.Voltage:
                this.Image = Utilities.EmbeddedResources.GetImage("voltage.png");
                this.Text  = "Voltages";
                break;

            case SensorType.Current:
                this.Image = Utilities.EmbeddedResources.GetImage("voltage.png");
                this.Text  = "Current";
                break;

            case SensorType.KWH:
                this.Image = Utilities.EmbeddedResources.GetImage("voltage.png");
                this.Text  = "kWh";
                break;

            case SensorType.Clock:
                this.Image = Utilities.EmbeddedResources.GetImage("clock.png");
                this.Text  = "Clocks";
                break;

            case SensorType.Load:
                this.Image = Utilities.EmbeddedResources.GetImage("load.png");
                this.Text  = "Load";
                break;

            case SensorType.Temperature:
                this.Image = Utilities.EmbeddedResources.GetImage("temperature.png");
                this.Text  = "Temperatures";
                break;

            case SensorType.Fan:
                this.Image = Utilities.EmbeddedResources.GetImage("fan.png");
                this.Text  = "Fans";
                break;

            case SensorType.Flow:
                this.Image = Utilities.EmbeddedResources.GetImage("flow.png");
                this.Text  = "Flows";
                break;

            case SensorType.Control:
                this.Image = Utilities.EmbeddedResources.GetImage("control.png");
                this.Text  = "Controls";
                break;

            case SensorType.Level:
                this.Image = Utilities.EmbeddedResources.GetImage("level.png");
                this.Text  = "Levels";
                break;

            case SensorType.Power:
                this.Image = Utilities.EmbeddedResources.GetImage("power.png");
                this.Text  = "Powers";
                break;

            case SensorType.Data:
            case SensorType.SmallData:
            case SensorType.TinyData:
                this.Image = Utilities.EmbeddedResources.GetImage("data.png");
                this.Text  = "Data";
                break;

            case SensorType.Factor:
                this.Image = Utilities.EmbeddedResources.GetImage("factor.png");
                this.Text  = "Factors";
                break;
            }

            NodeAdded   += new NodeEventHandler(TypeNode_NodeAdded);
            NodeRemoved += new NodeEventHandler(TypeNode_NodeRemoved);
        }