private void treeViewMerges_AfterCheck(object sender, TreeViewEventArgs e) { if (treeViewFeatures.SelectedNode != null) { IsWiXFeature feature = treeViewFeatures.SelectedNode.Tag as IsWiXFeature; IsWiXMerge merge = e.Node.Tag as IsWiXMerge; IsWiXMergeRefs mergeRefs = feature.MergeRefs; propertyGridFeatureProperties.Refresh(); if (e.Node.Checked) { if (!mergeRefs.Keys.Contains(merge.Id)) { IsWiXMergeRef mergeRef = new IsWiXMergeRef(); mergeRef.Id = merge.Id; mergeRefs.Add(mergeRef.Id, mergeRef); mergeRefs.Save(); } } else { if (feature.MergeRefs.Keys.Contains(merge.Id)) { mergeRefs.Remove(merge.Id); mergeRefs.Save(); } } } }
private void toolStripMenuItemNewFeature_Click(object sender, EventArgs e) { if (treeViewFeatures.SelectedNode == null)//|| treeViewFeatures.SelectedNode.Parent == null) { IsWiXFeatures features = new IsWiXFeatures(); string featureName = IsWiXFeatures.SuggestNextFeatureName(); IsWiXFeature feature = features.Create(featureName); TreeNode node = treeViewFeatures.Nodes.Add(feature.Id); node.Tag = feature; _refresh = true; treeViewFeatures.SelectedNode = node; } else { IsWiXFeatures features = new IsWiXFeatures(); string featureName = IsWiXFeatures.SuggestNextFeatureName(); var iswixFeature = treeViewFeatures.SelectedNode.Tag as IsWiXFeature; IsWiXFeature feature = features.Create(iswixFeature.Id, featureName); TreeNode node = treeViewFeatures.Nodes.Insert(treeViewFeatures.SelectedNode.Index + 1, feature.Id); node.Tag = feature; _refresh = true; treeViewFeatures.SelectedNode = node; } treeViewFeatures.SelectedNode.BeginEdit(); }
private void treeViewFeatures_AfterSelect(object sender, TreeViewEventArgs e) { if (_refresh) { IsWiXFeature iswixFeature = treeViewFeatures.SelectedNode.Tag as IsWiXFeature; feature.Read(iswixFeature); UpdatePropertyGrid(); UpdateMergeModules(); foreach (var mergeRef in iswixFeature.MergeRefs.Values) { var nodes = treeViewMerges.Nodes.Find(mergeRef.Id, true); foreach (var node in nodes) { node.Checked = true; } } toolStripMenuItemNewSubFeature.Enabled = true; toolStripMenuItemRename.Enabled = true; toolStripMenuItemDelete.Enabled = true; UpdateMoveOptions(); propertyGridFeatureProperties.ExpandAllGridItems(); } }
private void toolStripMenuItemDelete_Click(object sender, EventArgs e) { toolStripMenuItemDelete.Enabled = false; toolStripMenuItemRename.Enabled = false; toolStripMenuItemNewSubFeature.Enabled = false; IsWiXFeature feature = treeViewFeatures.SelectedNode.Tag as IsWiXFeature; feature.Delete(); treeViewFeatures.SelectedNode.Remove(); ClearPropertyGrid(); UpdateMergeModules(); }
private void toolStripMenuItemNewSubFeature_Click(object sender, EventArgs e) { IsWiXFeatures features = new IsWiXFeatures(); string featureName = IsWiXFeatures.SuggestNextFeatureName(); var iswixFeature = treeViewFeatures.SelectedNode.Tag as IsWiXFeature; IsWiXFeature feature = features.CreateSubFeature(iswixFeature.Id, featureName); TreeNode node = treeViewFeatures.SelectedNode.Nodes.Add(featureName); node.Tag = feature; _refresh = true; treeViewFeatures.SelectedNode = node; treeViewFeatures.SelectedNode.BeginEdit(); }
public void Clear() { _feature = null; Id = ""; Title = ""; Absent = null; AllowAdvertise = null; ConfigurableDirectory = ""; InstallDefault = null; TypicalDefault = null; Level = null; Description = ""; Display = null; }
public void Read(IsWiXFeature Feature) { _feature = Feature; Id = _feature.Id; Title = _feature.Title; Absent = _feature.Absent; AllowAdvertise = _feature.AllowAdvertise; ConfigurableDirectory = _feature.ConfigurableDirectory; InstallDefault = _feature.InstallDefault; TypicalDefault = _feature.TypicalDefault; Level = _feature.Level; Description = _feature.Description; Display = _feature.Display; }
private void toolStripMenuItemDelete_Click(object sender, EventArgs e) { toolStripMenuItemDelete.Enabled = false; toolStripMenuItemRename.Enabled = false; toolStripMenuItemNewSubFeature.Enabled = false; IsWiXFeature feature = treeViewFeatures.SelectedNode.Tag as IsWiXFeature; feature.Delete(); treeViewFeatures.SelectedNode.Remove(); if (treeViewFeatures.Nodes.Count > 0) { _refresh = true; treeViewFeatures.Select(); treeViewFeatures.SelectedNode = treeViewFeatures.Nodes[0]; treeViewFeatures.ExpandAll(); } }
private void treeViewFeatures_AfterLabelEdit(object sender, NodeLabelEditEventArgs e) { try { if (string.IsNullOrEmpty(e.Label)) { e.CancelEdit = true; } else { IsWiXFeature iswixFeature = treeViewFeatures.SelectedNode.Tag as IsWiXFeature; iswixFeature.Id = e.Label; feature.Id = iswixFeature.Id; } propertyGridFeatureProperties.Refresh(); } catch (Exception ex) { MessageBox.Show(ex.Message); e.CancelEdit = true; } }