Exemple #1
0
        private void UpdatedSelectedNodeText()
        {
            IsWiXFGAppX appx = treeViewAppXs.SelectedNode.Tag as IsWiXFGAppX;

            if (appx != null)
            {
                treeViewAppXs.SelectedNode.Text = appx.Id;
            }
        }
Exemple #2
0
        private void AddAppXNode(IsWiXFGAppX isWiXFGAppX)
        {
            var subTreeNode = treeViewAppXs.Nodes.Add(isWiXFGAppX.Id);

            subTreeNode.ImageIndex         = (int)ImageLibrary.Services;
            subTreeNode.SelectedImageIndex = (int)ImageLibrary.Services;
            subTreeNode.Tag = isWiXFGAppX;
            treeViewAppXs.ExpandAll();
            treeViewAppXs.Select();
            UpdatedSelectedNodeText();
        }
Exemple #3
0
        public void Read(IsWiXFGAppX isWiXFGAppX)
        {
            _isWiXFGAppX = isWiXFGAppX;

            Id        = _isWiXFGAppX.Id;
            Publisher = _isWiXFGAppX.Publisher;
            Target    = _isWiXFGAppX.Target;

            MainPackage  = _isWiXFGAppX.MainPackage;
            Description  = _isWiXFGAppX.Description;
            DisplayName  = _isWiXFGAppX.DisplayName;
            Manufacturer = _isWiXFGAppX.Manufacturer;
            LogoFile     = _isWiXFGAppX.LogoFile;
            Version      = _isWiXFGAppX.Version;
        }
Exemple #4
0
        private void toolStripMenuItemNewFeature_Click(object sender, EventArgs e)
        {
            IsWiXFGAppXs appxs    = new IsWiXFGAppXs(_documentManager.Document);
            string       appxName = IsWiXFGAppXs.SuggestNextAppXName(_documentManager.Document);
            IsWiXFGAppX  appx     = appxs.Create(appxName, "CN=YourCompanyName", TargetType.desktop);
            TreeNode     node     = treeViewAppXs.Nodes.Add(appx.Id);

            node.SelectedImageIndex = (int)ImageLibrary.Services;
            node.ImageIndex         = (int)ImageLibrary.Services;
            node.Tag = appx;
            treeViewAppXs.SelectedNode = node;
            contextMenuStripAppX.Items["toolStripMenuItemRename"].Enabled = true;
            contextMenuStripAppX.Items["toolStripMenuItemDelete"].Enabled = true;

            _isWiXFGAppXs.SortXML();
        }
Exemple #5
0
 private void treeViewAppXs_AfterLabelEdit(object sender, NodeLabelEditEventArgs e)
 {
     try
     {
         if (string.IsNullOrEmpty(e.Label))
         {
             e.CancelEdit = true;
         }
         else
         {
             IsWiXFGAppX isWiXFGAppX = treeViewAppXs.SelectedNode.Tag as IsWiXFGAppX;
             isWiXFGAppX.Id = e.Label;
             appX1.Id       = isWiXFGAppX.Id;
         }
         propertyGrid1.Refresh();
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message);
         e.CancelEdit = true;
     }
 }
Exemple #6
0
        private void toolStripMenuItemDelete_Click(object sender, EventArgs e)
        {
            IsWiXFGAppX isWiXFGAppX = treeViewAppXs.SelectedNode.Tag as IsWiXFGAppX;

            isWiXFGAppX.Delete();
            treeViewAppXs.SelectedNode.Remove();
            if (treeViewAppXs.Nodes.Count > 0)
            {
                treeViewAppXs.SelectedNode = treeViewAppXs.Nodes[0];
            }
            else
            {
                propertyGrid1.Enabled = false;
                appX1 = new AppX();
                propertyGrid1.SelectedObject = appX1;
            }

            if (treeViewAppXs.Nodes.Count == 0)
            {
                contextMenuStripAppX.Items["toolStripMenuItemRename"].Enabled = false;
                contextMenuStripAppX.Items["toolStripMenuItemDelete"].Enabled = false;
            }
            _isWiXFGAppXs.SortXML();
        }