Exemplo n.º 1
0
        /// <summary>
        /// Initialize this instance.
        /// </summary>
        public void Initialize()
        {
            // Configure the source list
            ConnectionList.Initialize();

            // Add connections
            Connections = new SourceListItem("Connection Points");
            ConnectionList.AddItem(Connections);

            // Display side list
            ConnectionList.ReloadData();
            ConnectionList.ExpandItem(null, true);
        }
Exemplo n.º 2
0
        /// <summary>
        /// Updates the connection list.
        /// </summary>
        /// <param name="refreshList">If set to <c>true</c> refresh list.</param>
        private void UpdateConnectionList(bool refreshList)
        {
            // Clear
            Connections.Clear();

            // Anything to process?
            if (PropertyConsumer == null)
            {
                return;
            }

            // Repopulate
            foreach (KimonoPropertyConnectionPoint point in PropertyConsumer.ConnectionPoints)
            {
                // Handle the connection being selected
                Connections.AddItem($"{point}", (FindConnection(point) == null) ? "IconDisconnected" : "IconConnected", () =>
                {
                    // Update the UI
                    selectedPoint = point;
                    UpdateAvailableProperties(point);
                });
            }

            // Empty list?
            if (Connections.Count == 0)
            {
                Connections.AddItem("(empty)", "IconDocFolder");
            }

            // Refresh source list?
            if (refreshList)
            {
                ConnectionList.ReloadData();
                ConnectionList.ExpandItem(null, true);
            }
        }