private void CompareItemButton_Click(object sender, RoutedEventArgs e) { if (PoliciesListView.SelectedItems.Count == 1) { PolicySelect PolSelect = new PolicySelect(); PolicySet CopyPolset = new PolicySet(); foreach (Policy item in polSet.Policies) { CopyPolset.Policies.Add(item); } PolSelect.PoliciesListView.ItemsSource = CopyPolset.Policies; PolSelect.Owner = this; PolSelect.ShowDialog(); if (PolSelect.SelectionInput == PolicySelect.INPUT_OK) { Policy SourcePolicy = (Policy)PoliciesListView.SelectedItem; Policy ComparePolicy = (Policy)PolSelect.PoliciesListView.SelectedItem; CompareViewEx cv = new CompareViewEx(); List <DiffPolicyInfo> Items1 = new List <DiffPolicyInfo>(); Items1.Add(SourcePolicy.Compare(ComparePolicy)); cv.CompareTreeView.ItemsSource = Items1; cv.Owner = this; cv.ShowDialog(); } } }
private void CompareFolderButton_Click(object sender, RoutedEventArgs e) { SelectFolder setfolder = new SelectFolder(); setfolder.Owner = this; setfolder.ShowDialog(); if (setfolder.DialogResult.HasValue && setfolder.DialogResult.Value) { Policy ComparePolicy = new Policy(setfolder.FolderText.Text, "Opened For Folder", setfolder.FolderText.Text, new DateTime(), 1); CompareViewEx cv = new CompareViewEx(); //List<BaseDiffViewItem> Items = new List<BaseDiffViewItem>(); Policy SourcePolicy = (Policy)PoliciesListView.SelectedItem; //Items.Add(SourcePolicy.Compare(ComparePolicy).GetViewItems(null)); //cv.CompareTreeView.ItemsSource = Items; List <DiffPolicyInfo> Items1 = new List <DiffPolicyInfo>(); Items1.Add(SourcePolicy.Compare(ComparePolicy)); cv.DataContext = Items1; cv.Owner = this; cv.ShowDialog(); } }
public void CompareFinished(List <DiffPolicyInfo> PolInfo) { StopProgressDialog(); CompareViewEx cv = new CompareViewEx(); cv.CompareTreeView.ItemsSource = PolInfo; cv.Owner = this; cv.ShowDialog(); }
private void Menu_File_Open_Compare_Click(object sender, RoutedEventArgs e) { System.Windows.Forms.OpenFileDialog fbDialog = new System.Windows.Forms.OpenFileDialog(); fbDialog.Filter = "Compare Policy Files|*.Cpf"; if (fbDialog.ShowDialog() == System.Windows.Forms.DialogResult.OK) { CompareViewEx cv = new CompareViewEx(); Stream stream = File.Open(fbDialog.FileName, FileMode.Open); BinaryFormatter bformatter = new BinaryFormatter(); List <DiffPolicyInfo> PolInfo = (List <DiffPolicyInfo>)bformatter.Deserialize(stream); cv.CompareTreeView.ItemsSource = PolInfo; stream.Close(); cv.Owner = this; cv.ShowDialog(); } }