예제 #1
0
        public MainWindowViewModel()
        {
            // Read the settings file to get the available profiles
            List <Profile> profiles = ProfileSettings.getProfiles();

            _profilesView = new ProfilesViewModel(profiles);

            _comparisonView = new DbComparisonViewModel();
            _comparisonView.OnComparisonComplete += new EventHandler <DatabaseComparisonEventArgs>((sender, args) => {
                StatusText = "";
                foreach (TableComparison tableComp in args.Tables)
                {
                    if (tableComp.LeftTable != null && tableComp.RightTable == null && tableComp.LeftTable.CreateStatement != null)
                    {
                        StatusText = StatusText + tableComp.LeftTable.CreateStatement + _sqlStatementDivider;
                    }
                    else if (tableComp.LeftTable != null)
                    {
                        StatusText = StatusText + tableComp.LeftTable.ToString() + _sqlStatementDivider;
                    }
                }
            });

            CopySqlToClipboardCommand = new AppCommand((sender) => CopySqlToClipboard(sender), (sender) => CanCopySqlToClipboard(sender));
        }
예제 #2
0
        public MainWindowViewModel()
        {
            // Read the settings file to get the available profiles
            List<Profile> profiles = ProfileSettings.getProfiles();
            _profilesView = new ProfilesViewModel(profiles);

            _comparisonView = new DbComparisonViewModel();
            _comparisonView.OnComparisonComplete += new EventHandler<DatabaseComparisonEventArgs>((sender, args) => {
                StatusText = "";
                foreach (TableComparison tableComp in args.Tables)
                {
                    if (tableComp.LeftTable != null && tableComp.RightTable == null && tableComp.LeftTable.CreateStatement != null)
                    {
                        StatusText = StatusText + tableComp.LeftTable.CreateStatement + _sqlStatementDivider;
                    }
                    else if (tableComp.LeftTable != null)
                    {
                        StatusText = StatusText + tableComp.LeftTable.ToString() + _sqlStatementDivider;
                    }
                }
            });

            CopySqlToClipboardCommand = new AppCommand((sender) => CopySqlToClipboard(sender), (sender) => CanCopySqlToClipboard(sender));
        }