示例#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);
            }
        }
示例#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();
        }
示例#3
0
 public PublishWindow(DefaultPublishProperties aDefaultProperties, string aHelpTopic) : base(aHelpTopic)
 {
     InitializeComponent();
     Initialize(aDefaultProperties);
 }
示例#4
0
 private void Initialize(DefaultPublishProperties aDefaultProperties)
 {
     mViewModel  = new PublishWindowViewModel(this, aDefaultProperties);
     DataContext = mViewModel;
 }
示例#5
0
 public PublishWindow(DefaultPublishProperties aDefaultProperties)
 {
     InitializeComponent();
     Initialize(aDefaultProperties);
 }