Exemplo n.º 1
0
        public async Task <bool> ShowPublishPromptAsync()
        {
            var xProjectProperties = await ProjectProperties.GetConfigurationGeneralPropertiesAsync().ConfigureAwait(false);

            var xOutputType = await xProjectProperties.OutputType.GetEvaluatedValueAtEndAsync().ConfigureAwait(false);

            if (String.Equals(xOutputType, OutputTypeValues.Bootable, StringComparison.OrdinalIgnoreCase))
            {
                await ProjectThreadingService.SwitchToUIThread();

                var xBinOutputPath = await xProjectProperties.BinOutputPath.GetEvaluatedValueAtEndAsync().ConfigureAwait(false);

                var xDefaultIsoPublishPath = ConfiguredProject.UnconfiguredProject.MakeRooted(
                    Path.Combine(xBinOutputPath, Path.ChangeExtension(Path.GetFileName(ConfiguredProject.UnconfiguredProject.FullPath), "iso")));

                var xDefaultPublishProperties = new DefaultPublishProperties(xDefaultIsoPublishPath);

                var xPublishWindow = new PublishWindow(xDefaultPublishProperties);
                mPublishSettings = xPublishWindow.ShowModal();

                return(mPublishSettings != null);
            }
            else
            {
                return(true);
            }
        }
Exemplo n.º 2
0
        public PublishWindowViewModel(PublishWindow aPublishWindow, DefaultPublishProperties aDefaultProperties)
        {
            mPublishWindow = aPublishWindow;

            mIsoPublishPath = aDefaultProperties.IsoPublishPath;

            mBrowseIsoPublishPathCommand = new BrowseIsoPublishPathCommand(this, IsoPublishPath);

            mReturnPublishSettingsCommand = new ReturnPublishSettingsCommand(this);

            WqlEventQuery xDeviceInsertedQuery   = new WqlEventQuery("SELECT * FROM __InstanceCreationEvent WITHIN 2 WHERE TargetInstance ISA 'Win32_USBHub'");
            var           xDeviceInsertedWatcher = new ManagementEventWatcher(xDeviceInsertedQuery);

            xDeviceInsertedWatcher.EventArrived += DrivesChanged;
            xDeviceInsertedWatcher.Start();

            WqlEventQuery xDeviceRemovedQuery   = new WqlEventQuery("SELECT * FROM __InstanceDeletionEvent WITHIN 2 WHERE TargetInstance ISA 'Win32_USBHub'");
            var           xDeviceRemovedWatcher = new ManagementEventWatcher(xDeviceRemovedQuery);

            xDeviceRemovedWatcher.EventArrived += DrivesChanged;
            xDeviceRemovedWatcher.Start();
        }
Exemplo n.º 3
0
 public PublishWindow(DefaultPublishProperties aDefaultProperties, string aHelpTopic) : base(aHelpTopic)
 {
     InitializeComponent();
     Initialize(aDefaultProperties);
 }
Exemplo n.º 4
0
 private void Initialize(DefaultPublishProperties aDefaultProperties)
 {
     mViewModel  = new PublishWindowViewModel(this, aDefaultProperties);
     DataContext = mViewModel;
 }
Exemplo n.º 5
0
 public PublishWindow(DefaultPublishProperties aDefaultProperties)
 {
     InitializeComponent();
     Initialize(aDefaultProperties);
 }