コード例 #1
0
ファイル: Window1.xaml.cs プロジェクト: Jonesb/PolReader
        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();
                }
            }
        }
コード例 #2
0
ファイル: Window1.xaml.cs プロジェクト: Jonesb/PolReader
        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();
            }
        }
コード例 #3
0
ファイル: Window1.xaml.cs プロジェクト: Jonesb/PolReader
        public void CompareFinished(List <DiffPolicyInfo> PolInfo)
        {
            StopProgressDialog();

            CompareViewEx cv = new CompareViewEx();

            cv.CompareTreeView.ItemsSource = PolInfo;


            cv.Owner = this;
            cv.ShowDialog();
        }
コード例 #4
0
ファイル: Window1.xaml.cs プロジェクト: Jonesb/PolReader
        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();
            }
        }