public ActionTreeViewItem(SwitcherActionBase action, NetworkTreeViewItem parentNetworkItem)
            : base()
        {
            if (action == null)
                throw new ArgumentNullException("action", "Action cannot be null");

            this.ActionId = action.Id;
            this.Header = action.Name;
            this.ParentNetworkItem = parentNetworkItem;
        }
        public NetworkTreeViewItem(NetworkConfiguration networkConfiguration, SwitcherActionBase[] actions)
            : base()
        {
            this.NetworkConfiguration = networkConfiguration;
            this.Header = CreateHeader();

            if (actions != null)
            {
                foreach (var item in actions)
                {
                    this.Items.Add(new ActionTreeViewItem(item, this));
                }
            }

            if (!this.NetworkConfiguration.Active)
                this.FontStyle = FontStyles.Italic;
        }
 public UnknownNetworkTreeViewItem(NetworkConfiguration networkConfiguration, SwitcherActionBase[] actions)
     : base(networkConfiguration, actions)
 {
     this.Margin = new System.Windows.Thickness(0, 10, 0, 0);
     this.Header = LanguageResources.DeactivateNode_Name;
 }
        public void SetStatusText(SwitcherActionBase ownerAction, string message, bool isError = false)
        {
            if (ownerAction == null)
                return;

            this.Dispatcher.Invoke(new Action(delegate
            {
                labelAboutStatus.Tag = "FROM_ACTION";
                labelAboutStatus.Content = ownerAction.Name + ": " + message;

                if (isError)
                    labelAboutStatus.Foreground = new SolidColorBrush(Colors.Red);
                else
                    labelAboutStatus.Foreground = new SolidColorBrush(Colors.Black);

                labelAboutStatus.Cursor = Cursors.Arrow;
            }));
        }