private void Contractor_ExtensionAction(object sender, ExtensionActionEventArgs e)
        {
            ListViewItem item = null;
            if (_itemByHash.ContainsKey(e.Extension.Hash))
                item = _itemByHash[e.Extension.Hash];

            switch (e.Action)
            {
                case ExtensionActionType.Installed:
                {
                    item = FocusAdd(e.Extension.Identifier, e.Extension.Creator,
                        e.Extension.Description, e.Extension.Version, "Closed");

                    _itemByHash[e.Extension.Hash] = item;
                    _extensionByItem[item] = e.Extension;
                    break;
                }
                case ExtensionActionType.Reinstalled:
                {
                    e.Extension.BringToFront();
                    item.Selected = true;
                    break;
                }
                case ExtensionActionType.Uninstalled:
                {
                    _itemByHash.Remove(e.Extension.Hash);
                    _extensionByItem.Remove(item);
                    RemoveItem(item);
                    break;
                }
                case ExtensionActionType.Opened:
                case ExtensionActionType.Closed:
                {
                    item.SubItems[4].Text = e.Action.ToString();
                    break;
                }
            }
        }
Beispiel #2
0
 protected virtual void OnExtensionAction(ExtensionActionEventArgs e)
 {
     ExtensionAction?.Invoke(this, e);
 }
Beispiel #3
0
        private void ExtensionManager_ExtensionAction(object sender, ExtensionActionEventArgs e)
        {
            int runningCount = Extensions.Count(ext => ext.IsRunning);

            MainUI.ExtensionsActiveTxt.Text =
                $"Extensions Active: {runningCount}/{Extensions.Count}";
        }
Beispiel #4
0
 protected virtual void OnExtensionAction(ExtensionActionEventArgs e)
 {
     ExtensionAction?.Invoke(this, e);
 }