Esempio n. 1
0
        public SolutionPackagerControl(Type pluginType)
        {
            this.pluginType = pluginType;
            InitializeComponent();
            IMyToolFactory myToolFactory = MyToolFactory.GetMyToolFactory(this);

            toolViewModel = myToolFactory.NewToolViewModel();
            /* backgroundWorkHandler = */
            myToolFactory.BackgroundWorkHandler();
            coreToolsDownloader    = myToolFactory.NewCoreToolsDownloader();
            crmSolutionImporter    = myToolFactory.NewCrmSolutionImporter();
            solutionPackagerCaller = myToolFactory.NewSolutionPackagerCaller(txtOutput, crmSolutionImporter);
            crmSolutionManager     = myToolFactory.NewCrmSolutionDownloader(solutionPackagerCaller, cmbCrmSolutions);

            localOrCrm.Bind(_ => _.Enabled, toolViewModel, _ => _.HasConnection);
            btnRefreshSolutions.Bind(_ => _.Enabled, toolViewModel, _ => _.LocalOrCrm);
            chkImportSolution.Bind(_ => _.Enabled, toolViewModel, _ => _.HasConnection);
            tabsExtractOrPack.Bind(_ => _.Enabled, toolViewModel, _ => _.AllowRequests);
            txtCoreTools.Bind(_ => _.Text, toolViewModel, _ => _.SolutionPackagerVersion);
            toolViewModel.PropertyChanged += PluginViewModel_PropertyChanged;

            cmbLanguage.Items.AddRange(new object[] { CultureInfo.GetCultureInfo("en"), CultureInfo.GetCultureInfo("it") });
            cmbLanguage.SelectedIndex            = 0;
            cmbPackageTypeExtract.SelectedIndex  = 0;
            cmbSourceLocaleExtract.SelectedIndex = 0;
            cmbErrorLevelExtract.SelectedIndex   = 0;
            cmbPackageTypePack.SelectedIndex     = 0;
            cmbErrorLevelPack.SelectedIndex      = 0;
        }
 public SolutionPackagerCaller(SolutionPackagerControl solutionPackagerControl, AlBackgroundWorkHandler backgroundWorkHandler, RichTextBox txtOutput, CrmSolutionImporter crmSolutionImporter)
 {
     this.solutionPackagerControl = solutionPackagerControl ?? throw new ArgumentNullException(nameof(solutionPackagerControl));
     this.backgroundWorkHandler   = backgroundWorkHandler ?? throw new ArgumentNullException(nameof(backgroundWorkHandler));
     this.txtOutput           = txtOutput ?? throw new ArgumentNullException(nameof(txtOutput));
     this.crmSolutionImporter = crmSolutionImporter ?? throw new ArgumentNullException(nameof(crmSolutionImporter));
 }
Esempio n. 3
0
 public SolutionPackagerCaller NewSolutionPackagerCaller(RichTextBox txtOutput, CrmSolutionImporter crmSolutionImporter)
 {
     return(new SolutionPackagerCaller(solutionPackagerControl, backgroundWorkHandler, txtOutput, crmSolutionImporter));
 }