Ejemplo n.º 1
0
        public static void Main(string[] args)
        {
            try
            {
                var resolveUrOptions = ConsoleArgsResolveUR.Resolve(args);

                resolveUrOptions.MsBuilderPath = MsBuildResolveUR.FindMsBuildPath(resolveUrOptions.Platform);

                _resolveur = ResolveURFactory.GetResolver(
                    resolveUrOptions,
                    resolveur_HasBuildErrorsEvent,
                    resolveur_ProjectResolveCompleteEvent);

                _resolveur.Resolve();
            }
            catch (ArgumentException ae)
            {
                Console.WriteLine(ae.Message);
            }
            catch (FileNotFoundException fnfe)
            {
                Console.WriteLine(fnfe.Message);
            }
            catch (InvalidDataException ide)
            {
                Console.WriteLine(ide.Message);
            }
            catch (NotSupportedException nse)
            {
                Console.WriteLine(nse.Message);
            }
        }
Ejemplo n.º 2
0
        void HandleCallBack(Func <string> activeFileNameGetter)
        {
            CreateOutputWindow();
            CreateProgressDialog();
            CreateUiShell();

            try
            {
                var options = new ResolveUROptions
                {
                    MsBuilderPath         = MsBuildResolveUR.FindMsBuildPath(),
                    FilePath              = activeFileNameGetter(),
                    ShouldResolvePackages = packageOption()
                };

                if (string.IsNullOrEmpty(options.FilePath))
                {
                    return;
                }

                _resolveur = ResolveURFactory.GetResolver(
                    options,
                    resolveur_HasBuildErrorsEvent,
                    resolveur_ProjectResolveCompleteEvent);

                _helper.ResolveurCanceled += helper_ResolveurCanceled;

                _resolveur.Resolve();
            }
            catch (FileNotFoundException fnfe)
            {
                _helper.ShowMessageBox("File Not Found", fnfe.Message);
            }
            catch (InvalidDataException ide)
            {
                _helper.ShowMessageBox("Invalid Data", ide.Message);
            }
            catch (NotSupportedException nse)
            {
                _helper.ShowMessageBox("Selected file type invalid for resolution", nse.Message);
            }
            finally
            {
                _helper.EndWaitDialog();
            }
        }