Пример #1
0
        /*
         * private void SourceSelectButton_Click(object sender, RoutedEventArgs e)
         * {
         *  SelectEntityForm selectEntityForm = new SelectEntityForm();
         *  selectEntityForm.Initialize(new Type[] { typeof(SPList) });
         *  if (selectEntityForm.ShowDialog(this.ParentWindow, "Select an object to sync from") == true)
         *  {
         *      SourceFolder = selectEntityForm.SelectedObject;
         *  }
         * }
         */

        private void DestinationSelectButton_Click(object sender, RoutedEventArgs e)
        {
            SelectEntityForm selectEntityForm = new SelectEntityForm();

            selectEntityForm.Initialize(new Type[] { typeof(SPList), typeof(SQLTable) });
            if (selectEntityForm.ShowDialog(this.ParentWindow, "Select an object to sync to") == true)
            {
                DestinationFolder = selectEntityForm.SelectedObject;
                DestinationSelectButton.Content = DestinationFolder.GetPath();
                PopulateDestinationDetails();
            }
        }
Пример #2
0
        void compareMenuItem_Click(object sender, RoutedEventArgs e)
        {
            MenuItem menuItem = e.OriginalSource as MenuItem;
            Folder sourceObject = ((TreeViewItem)menuItem.Tag).Tag as Folder;

            SelectEntityForm selectEntityForm = new SelectEntityForm();
            selectEntityForm.Initialize(new Type[] { typeof(SPWeb), typeof(SQLDB), typeof(CRMWeb) });
            if (selectEntityForm.ShowDialog(this.ParentWindow, "Select an object to compare with") == true)
            {
                Folder objectToCompareWith = selectEntityForm.SelectedObject;
                CompareWizardForm compareWizardForm = new CompareWizardForm();
                compareWizardForm.Initialize(sourceObject, objectToCompareWith);
                compareWizardForm.ShowDialog(this.ParentWindow, "Compare Wizard");
            }
        }
        private void SourceSelectButton_Click(object sender, RoutedEventArgs e)
        {
            //SyncTask s = new SyncTask();
            //s.SourceQueryResultMapping.Mappings[0].QueryResult.
            SelectEntityForm selectEntityForm = new SelectEntityForm();

            selectEntityForm.Initialize(new Type[] { typeof(SPList), typeof(CRMEntity), typeof(SQLTable) });
            //HostControl hc = ((HostControl)this.Parent);

            if (selectEntityForm.ShowDialog(null, "Select an object to sync from") == true)
            {
                SourceFolder                              = selectEntityForm.SelectedObject;
                QueryResult.SiteSetting                   = (SiteSetting)ApplicationContext.Current.GetSiteSetting(SourceFolder.SiteSettingID);
                QueryResult.FolderPath                    = SourceFolder.GetPath();
                QueryResult.PrimaryIdFieldName            = SourceFolder.PrimaryIdFieldName;
                QueryResult.PrimaryNameFieldName          = SourceFolder.PrimaryNameFieldName;
                QueryResult.PrimaryFileReferenceFieldName = SourceFolder.PrimaryFileReferenceFieldName;
                QueryResult.ModifiedByFieldName           = SourceFolder.ModifiedByFieldName;
                QueryResult.ModifiedOnFieldName           = SourceFolder.ModifiedOnFieldName;
                QueryResult.VersioningEnabled             = (SourceFolder is SPBaseFolder);
                Populate();
            }
        }