Here are the examples of the csharp api System.Windows.Window.Close() taken from open source projects. By voting up you can indicate which examples are most useful and appropriate.
1699 Examples
19
View Source File : EditMacroItemWindow.xaml.cs
License : MIT License
Project Creator : 3RD-Dimension
License : MIT License
Project Creator : 3RD-Dimension
private void ButtonOk_Click(object sender, RoutedEventArgs e)
{
if (MacroName.Contains(':') || MacroName.Contains(';') || Commands.Contains(':') || Commands.Contains(';'))
{
MessageBox.Show("Name and Commands can't include ':' or ';'");
return;
}
Ok = true;
Close();
}
19
View Source File : EditMacroItemWindow.xaml.cs
License : MIT License
Project Creator : 3RD-Dimension
License : MIT License
Project Creator : 3RD-Dimension
private void ButtonCancel_Click(object sender, RoutedEventArgs e)
{
Close();
}
19
View Source File : EnterNumberWindow.xaml.cs
License : MIT License
Project Creator : 3RD-Dimension
License : MIT License
Project Creator : 3RD-Dimension
private void buttonCancel_Click(object sender, RoutedEventArgs e)
{
Close();
}
19
View Source File : EnterNumberWindow.xaml.cs
License : MIT License
Project Creator : 3RD-Dimension
License : MIT License
Project Creator : 3RD-Dimension
private void buttonOk_Click(object sender, RoutedEventArgs e)
{
Ok = true;
if (User_Ok != null)
User_Ok.Invoke(Value);
Close();
}
19
View Source File : WarningWindow.xaml.cs
License : MIT License
Project Creator : 3RD-Dimension
License : MIT License
Project Creator : 3RD-Dimension
private void Button_Click(object sender, RoutedEventArgs e)
{
Close();
}
19
View Source File : MainWindow.xaml.cs
License : MIT License
Project Creator : ab4d
License : MIT License
Project Creator : ab4d
private void InitializeOvrAndDirectX()
{
if (UseOculusRift)
{
// Initializing Oculus VR is very simple when using OculusWrapVirtualRealityProvider
// First we create an instance of OculusWrapVirtualRealityProvider
_oculusRiftVirtualRealityProvider = new OculusWrapVirtualRealityProvider(_ovr, multisamplingCount: 4);
try
{
// Then we initialize Oculus OVR and create a new DXDevice that uses the same adapter (graphic card) as Oculus Rift
_dxDevice = _oculusRiftVirtualRealityProvider.InitializeOvrAndDXDevice(requestedOculusSdkMinorVersion: 17);
}
catch (Exception ex)
{
MessageBox.Show("Failed to initialize the Oculus runtime library.\r\nError: " + ex.Message, "Oculus error", MessageBoxButton.OK, MessageBoxImage.Error);
return;
}
string ovrVersionString = _ovr.GetVersionString();
_originalWindowreplacedle = string.Format("DXEngine OculusWrap Sample (OVR v{0})", ovrVersionString);
this.replacedle = _originalWindowreplacedle;
// Reset tracking origin at startup
_ovr.RecenterTrackingOrigin(_oculusRiftVirtualRealityProvider.SessionPtr);
}
else
{
// Create DXDevice that will be used to create DXViewportView
var dxDeviceConfiguration = new DXDeviceConfiguration();
dxDeviceConfiguration.DriverType = DriverType.Hardware;
dxDeviceConfiguration.SupportedFeatureLevels = new FeatureLevel[] { FeatureLevel.Level_11_0 }; // Oculus requires at least feature level 11.0
_dxDevice = new DXDevice(dxDeviceConfiguration);
_dxDevice.InitializeDevice();
_originalWindowreplacedle = this.replacedle;
}
// Create WPF's Viewport3D
_viewport3D = new Viewport3D();
// Create DXViewportView - a control that will enable DirectX 11 rendering of standard WPF 3D content defined in Viewport3D.
// We use a specified DXDevice that was created by the _oculusRiftVirtualRealityProvider.InitializeOvrAndDXDevice (this way the same adapter is used by Oculus and DXEngine).
_dxViewportView = new DXViewportView(_dxDevice, _viewport3D);
_dxViewportView.BackgroundColor = Colors.Aqua;
// Currently DXEngine support showing Oculus mirror texture only with DirectXOverlay presentation type (not with DirectXImage)
_dxViewportView.PresentationType = DXView.PresentationTypes.DirectXOverlay;
if (UseOculusRift)
{
// The _dxViewportView will show Oculus mirrow window.
// The mirror window can be any size, for this sample we use 1/2 the HMD resolution.
_dxViewportView.Width = _oculusRiftVirtualRealityProvider.HmdDescription.Resolution.Width / 2.0;
_dxViewportView.Height = _oculusRiftVirtualRealityProvider.HmdDescription.Resolution.Height / 2.0;
}
// When the DXViewportView is initialized, we set the _oculusRiftVirtualRealityProvider to the DXScene object
_dxViewportView.DXSceneInitialized += delegate (object sender, EventArgs args)
{
if (_dxViewportView.UsedGraphicsProfile.DriverType != GraphicsProfile.DriverTypes.Wpf3D &&
_dxViewportView.DXScene != null &&
_oculusRiftVirtualRealityProvider != null)
{
// Initialize Virtual reality rendering
_dxViewportView.DXScene.InitializeVirtualRealityRendering(_oculusRiftVirtualRealityProvider);
// Initialized shadow rendering (see Ab3d.DXEngine.Wpf.Samples project - DXEngine/ShadowRenderingSample for more info
_varianceShadowRenderingProvider = new VarianceShadowRenderingProvider()
{
ShadowMapSize = 1024,
ShadowDepthBluringSize = 2,
ShadowThreshold = 0.2f
};
_dxViewportView.DXScene.InitializeShadowRendering(_varianceShadowRenderingProvider);
}
};
// Enable collecting rendering statistics (see _dxViewportView.DXScene.Statistics clreplaced)
DXDiagnostics.IsCollectingStatistics = true;
// Subscribe to SceneRendered to collect FPS statistics
_dxViewportView.SceneRendered += DXViewportViewOnSceneRendered;
// Add _dxViewportView to the RootGrid
// Before that we resize the window to be big enough to show the mirrored texture
this.Width = _dxViewportView.Width + 30;
this.Height = _dxViewportView.Height + 50;
RootGrid.Children.Add(_dxViewportView);
// Create FirstPersonCamera
_camera = new FirstPersonCamera()
{
TargetViewport3D = _viewport3D,
Position = new Point3D(0, 1, 4),
Heading = 0,
Atreplacedude = 0,
ShowCameraLight = ShowCameraLightType.Never
};
RootGrid.Children.Add(_camera);
// Initialize XBOX controller that will control the FirstPersonCamera
_xInputCameraController = new XInputCameraController()
{
TargetCamera = _camera,
RotationSpeed = 120, // rotation: 120 degrees per second
MovementSpeed = 2, // movement: 2 meters per second
RotateOnlyHorizontally = true, // do not rotate up and down (changing atreplacedude) with controller - this is done only HMD
MoveVerticallyWithDPadButtons = true,
};
_xInputCameraController.StartCheckingController();
// Now we can create our sample 3D scene
CreateSceneObjects();
// Add lights
var lightsVisual3D = new ModelVisual3D();
var lightsGroup = new Model3DGroup();
var directionalLight = new DirectionalLight(Colors.White, new Vector3D(0.5, -0.3, -0.3));
directionalLight.SetDXAttribute(DXAttributeType.IsCastingShadow, true); // Set this light to cast shadow
lightsGroup.Children.Add(directionalLight);
var ambientLight = new AmbientLight(System.Windows.Media.Color.FromRgb(30, 30, 30));
lightsGroup.Children.Add(ambientLight);
lightsVisual3D.Content = lightsGroup;
_viewport3D.Children.Add(lightsVisual3D);
// Start rendering
if (RenderAt90Fps)
{
// WPF do not support rendering at more the 60 FPS.
// But with a trick where a rendering loop is created in a background thread, it is possible to achieve more than 60 FPS.
// In case of submitting frames to Oculus Rift at higher FPS, the ovr.SubmitFrame method will limit rendering to 90 FPS.
//
// NOTE:
// When using DXEngine, it is also possible to render the scene in a background thread.
// This requires that the 3D scene is also created in the background thread and that the events and other messages are
// preplaceded between UI and background thread in a thread safe way. This is too complicated for this simple sample project.
// To see one possible implementation of background rendering, see the BackgroundRenderingSample in the Ab3d.DXEngine.Wpf.Samples project.
var backgroundWorker = new BackgroundWorker();
backgroundWorker.DoWork += (object sender, DoWorkEventArgs args) =>
{
// Create an action that will be called by Dispatcher
var refreshDXEngineAction = new Action(() =>
{
UpdateScene();
// Render DXEngine's 3D scene again
if (_dxViewportView != null)
_dxViewportView.Refresh();
});
while (_dxViewportView != null && !_dxViewportView.IsDisposed) // Render until window is closed
{
if (_oculusRiftVirtualRealityProvider != null && _oculusRiftVirtualRealityProvider.LastSessionStatus.ShouldQuit) // Stop rendering - this will call RunWorkerCompleted where we can quit the application
break;
// Sleep for 1 ms to allow WPF tasks to complete (for example handling XBOX controller events)
System.Threading.Thread.Sleep(1);
// Call Refresh to render the DXEngine's scene
// This is a synchronous call and will wait until the scene is rendered.
// Because Oculus is limited to 90 fps, the call to ovr.SubmitFrame will limit rendering to 90 FPS.
Dispatcher.Invoke(refreshDXEngineAction);
}
};
backgroundWorker.RunWorkerCompleted += delegate(object sender, RunWorkerCompletedEventArgs args)
{
if (_oculusRiftVirtualRealityProvider != null && _oculusRiftVirtualRealityProvider.LastSessionStatus.ShouldQuit)
this.Close(); // Exit the application
};
backgroundWorker.RunWorkerAsync();
}
else
{
// Subscribe to WPF rendering event (called approximately 60 times per second)
CompositionTarget.Rendering += CompositionTargetOnRendering;
}
}
19
View Source File : MainWindow.xaml.cs
License : MIT License
Project Creator : ab4d
License : MIT License
Project Creator : ab4d
private void CompositionTargetOnRendering(object sender, EventArgs eventArgs)
{
// It's possible for Rendering to call back twice in the same frame.
// So only render when we haven't already rendered in this frame.
var renderingEventArgs = eventArgs as System.Windows.Media.RenderingEventArgs;
if (renderingEventArgs != null)
{
if (renderingEventArgs.RenderingTime == _lastRenderTime)
return;
_lastRenderTime = renderingEventArgs.RenderingTime;
}
if (_dxViewportView == null || _dxViewportView.IsDisposed)
return; // Window closed
if (_oculusRiftVirtualRealityProvider != null && _oculusRiftVirtualRealityProvider.LastSessionStatus.ShouldQuit)
this.Close(); // Exit the application
if (_oculusRiftVirtualRealityProvider == null)
return;
UpdateScene();
// Render the scene again
_dxViewportView.Refresh();
}
19
View Source File : Finder.xaml.cs
License : GNU General Public License v3.0
Project Creator : ACEmulator
License : GNU General Public License v3.0
Project Creator : ACEmulator
private void OK_Click(object sender, RoutedEventArgs e)
{
var didStr = DID.Text;
if (didStr.StartsWith("0x", StringComparison.OrdinalIgnoreCase))
didStr = didStr.Substring(2);
if (!uint.TryParse(didStr, NumberStyles.HexNumber, CultureInfo.InvariantCulture, out var did))
{
// input invalid -- throw error?
Close();
Console.WriteLine($"Invalid DID format: {did:X8}");
return;
}
uint filetype = 0;
var datType = DatType.Undef;
if (DatManager.PortalDat == null)
{
Console.WriteLine($"Please load the DATs before using finder");
Close();
return;
}
// try lookup in portal.dat
if (DatManager.PortalDat.AllFiles.TryGetValue(did, out var portalFile))
{
datType = DatType.Portal;
Console.WriteLine($"Found {did:X8} in portal");
filetype = did >> 24;
if (filetype == 0xE)
filetype = did;
}
// try lookup in cell.dat
else if (DatManager.CellDat.AllFiles.TryGetValue(did, out var cellFile))
{
datType = DatType.Cell;
Console.WriteLine($"Found {did:X8} in cell");
if ((ushort)did == 0xFFFF)
filetype = 0xFFFF;
else if ((ushort)did == 0xFFFE)
filetype = 0xFFFE;
}
// try lookup in language.dat
else if (DatManager.LanguageDat.AllFiles.TryGetValue(did, out var languageFile))
{
datType = DatType.Language;
Console.WriteLine($"Found {did:X8} in language");
filetype = did >> 24;
}
else if (DatManager.HighResDat.AllFiles.TryGetValue(did, out var highResFile))
{
datType = DatType.HighRes;
Console.WriteLine($"Found {did:X8} in highres");
filetype = did >> 24;
}
else
{
Console.WriteLine($"Couldn't find {did:X8} in DATs");
Close();
return;
}
var fileTypeSelect = FileExplorer.FileTypes.FirstOrDefault(i => i.ID == filetype);
if (fileTypeSelect == null)
{
Console.WriteLine($"Unknown filetype {did:X8} found in {datType} Dat");
Close();
return;
}
var items = FileExplorer.Instance.FileType.Items;
var found = false;
foreach (var item in items)
{
if (item is Enreplacedy.FileType enreplacedyFileType && enreplacedyFileType.ID == filetype)
{
FileExplorer.Instance.FileType.SelectedItem = item;
didStr = did.ToString("X8");
foreach (var file in FileExplorer.Instance.Files.Items)
{
if (file.ToString().Equals(didStr))
{
found = true;
FileExplorer.Instance.Files.SelectedItem = file;
FileExplorer.Instance.Files.ScrollIntoView(file);
break;
}
}
break;
}
}
if (!found)
Console.WriteLine($"Error selecting file");
Close();
}
19
View Source File : About.xaml.cs
License : GNU General Public License v3.0
Project Creator : ACEmulator
License : GNU General Public License v3.0
Project Creator : ACEmulator
private void OK_Click(object sender, RoutedEventArgs e)
{
Close();
}
19
View Source File : OptionsWindow.xaml.cs
License : MIT License
Project Creator : Actipro
License : MIT License
Project Creator : Actipro
private void OnOKButtonClick(object sender, RoutedEventArgs e) {
// Save changes to QAT customization
customizeQat.Save();
this.DialogResult = true;
this.Close();
}
19
View Source File : MainWindow.xaml.cs
License : MIT License
Project Creator : Actipro
License : MIT License
Project Creator : Actipro
private void applicationExitCommand_Execute(object sender, ExecutedRoutedEventArgs e) {
if (BrowserInteropHelper.IsBrowserHosted) {
Page currentPage = (Page)VisualTreeHelperExtended.GetAncestor(this, typeof(Page));
if ((currentPage != null) && (currentPage.NavigationService.CanGoBack))
currentPage.NavigationService.Navigate(Application.Current.StartupUri);
else
MessageBox.Show("Exit the application here.");
}
else {
Window window = (Window)ActiproSoftware.Windows.Media.VisualTreeHelperExtended.GetAncestor(ribbon, typeof(Window));
if (window != null)
window.Close();
}
}
19
View Source File : MainWindow.xaml.cs
License : MIT License
Project Creator : Actipro
License : MIT License
Project Creator : Actipro
private void OnExitMenuItemClick(object sender, RoutedEventArgs e) {
this.Close();
}
19
View Source File : MainWindow.xaml.cs
License : GNU General Public License v3.0
Project Creator : AdamMYoung
License : GNU General Public License v3.0
Project Creator : AdamMYoung
protected override void OnDeactivated(EventArgs e)
{
base.OnDeactivated(e);
if (ViewModel.CanClose)
Close();
}
19
View Source File : WindowHeader.xaml.cs
License : MIT License
Project Creator : adrianmteo
License : MIT License
Project Creator : adrianmteo
private void ButtonClose_Click(object sender, RoutedEventArgs e)
{
if (_window != null)
{
_window.Close();
}
}
19
View Source File : AboutWindow.xaml.cs
License : MIT License
Project Creator : adrianmteo
License : MIT License
Project Creator : adrianmteo
private void ButtonCheck_Click(object sender, RoutedEventArgs e)
{
Close();
_ = _autoUpdater.CheckForUpdates(true);
Window window = new UpdateWindow(_autoUpdater) { Owner = Owner };
window.ShowDialog();
}
19
View Source File : Windows.xaml.cs
License : MIT License
Project Creator : AFei19911012
License : MIT License
Project Creator : AFei19911012
private void ButtonCustomContent_OnClick(object sender, System.Windows.RoutedEventArgs e)
{
var picker = SingleOpenHelper.CreateControl<HandyControl.Controls.ColorPicker>();
var window = new PopupWindow
{
PopupElement = picker,
WindowStartupLocation = WindowStartupLocation.CenterScreen,
AllowsTransparency = true,
WindowStyle = WindowStyle.None,
MinWidth = 0,
MinHeight = 0,
replacedle = "ColorPicker"
};
picker.SelectedColorChanged += delegate { window.Close(); };
picker.Canceled += delegate { window.Close(); };
window.Show();
}
19
View Source File : Windows.xaml.cs
License : MIT License
Project Creator : AFei19911012
License : MIT License
Project Creator : AFei19911012
private void ButtonMouseFollow_OnClick(object sender, System.Windows.RoutedEventArgs e)
{
var picker = SingleOpenHelper.CreateControl<HandyControl.Controls.ColorPicker>();
var window = new PopupWindow
{
PopupElement = picker
};
picker.SelectedColorChanged += delegate { window.Close(); };
picker.Canceled += delegate { window.Close(); };
window.Show(ButtonMouseFollow, false);
}
19
View Source File : SpecificationWindow.xaml.cs
License : MIT License
Project Creator : AgileoAutomation
License : MIT License
Project Creator : AgileoAutomation
private void OK_Click(object sender, RoutedEventArgs e)
{
OKClicked = true;
if (excludeDefaultCSLibreplacedemblies.IsChecked == true)
ExcludeDefaultCSLibreplacedemblies = true;
if (excludeDefaultCSGraphicLibreplacedemblies.IsChecked == true)
ExcludeDefaultCSGraphicLibreplacedemblies = true;
if (!string.IsNullOrEmpty(SpecFilePath))
{
FileInfo file = new FileInfo(SpecFilePath);
if (!file.Exists || (file.Extension != ".json" && file.Extension != ".xlsx"))
{
System.Windows.MessageBox.Show("Invalid Specification File");
SpecFilePath = "";
textBox.Text = "";
}
else
{
Close();
}
}
else
{
Close();
}
}
19
View Source File : SpecificationWindow.xaml.cs
License : MIT License
Project Creator : AgileoAutomation
License : MIT License
Project Creator : AgileoAutomation
private void Cancel_Click(object sender, RoutedEventArgs e)
{
OKClicked = false;
Close();
}
19
View Source File : VariablesList.cs
License : MIT License
Project Creator : alaabenfatma
License : MIT License
Project Creator : alaabenfatma
private void VariableHoster_PreviewMouseUp(object sender, MouseButtonEventArgs e)
{
_positioner.Stop();
PlantTheVariable();
Close();
e.Handled = true;
}
19
View Source File : DialogViewModelBase.cs
License : MIT License
Project Creator : AlexanderPro
License : MIT License
Project Creator : AlexanderPro
protected void Close(bool? result = true)
{
OnClose(result);
if (Dialog != null)
{
Dialog.DialogResult = result;
Dialog.Close();
}
}
19
View Source File : MainViewModel.cs
License : GNU General Public License v3.0
Project Creator : alexdillon
License : GNU General Public License v3.0
Project Creator : alexdillon
private void CanShutdownChanged(bool canShutdown)
{
if (canShutdown)
{
// safe to shutdown now.
Application.Current.Dispatcher.Invoke(() =>
{
Application.Current.MainWindow.Close();
});
}
}
19
View Source File : ErrorWindow.xaml.cs
License : MIT License
Project Creator : alexleen
License : MIT License
Project Creator : alexleen
private void CloseOnClick(object sender, RoutedEventArgs e)
{
Close();
}
19
View Source File : PivotPointsUi.xaml.cs
License : Apache License 2.0
Project Creator : AlexWan
License : Apache License 2.0
Project Creator : AlexWan
private void ButtonAccept_Click(object sender, RoutedEventArgs e)
{
_pivotPoints.ColorR1 = HostR1.Child.BackColor;
_pivotPoints.ColorR2 = HostR2.Child.BackColor;
_pivotPoints.ColorR3 = HostR3.Child.BackColor;
_pivotPoints.ColorS1 = HostS1.Child.BackColor;
_pivotPoints.ColorS2 = HostS2.Child.BackColor;
_pivotPoints.ColorS3 = HostS3.Child.BackColor;
_pivotPoints.PaintOn = CheckBoxPaintOnOff.IsChecked.Value;
_pivotPoints.Save();
IsChange = true;
Close();
}
19
View Source File : StochRsiUi.xaml.cs
License : Apache License 2.0
Project Creator : AlexWan
License : Apache License 2.0
Project Creator : AlexWan
private void ButtonAccept_Click(object sender, RoutedEventArgs e)
{
try
{
if (Convert.ToInt32(TextBoxLenght.Text) <= 0 ||
Convert.ToInt32(TextBoxStochasticLength.Text) <= 0 ||
Convert.ToInt32(TextBoxK.Text) <= 0 ||
Convert.ToInt32(TextBoxD.Text) <= 0)
{
throw new Exception("error");
}
}
catch (Exception)
{
MessageBox.Show("Процесс сохранения прерван. В одном из полей недопустимые значения");
return;
}
_rsi.ColorK = HostColor.Child.BackColor;
_rsi.ColorD = HostColorD.Child.BackColor;
_rsi.RsiLenght = Convert.ToInt32(TextBoxLenght.Text);
_rsi.StochasticLength = Convert.ToInt32(TextBoxStochasticLength.Text);
_rsi.K = Convert.ToInt32(TextBoxK.Text);
_rsi.D = Convert.ToInt32(TextBoxD.Text);
_rsi.Save();
IsChange = true;
Close();
}
19
View Source File : UltimateOscillatorUi.xaml.cs
License : Apache License 2.0
Project Creator : AlexWan
License : Apache License 2.0
Project Creator : AlexWan
private void ButtonAccept_Click(object sender, RoutedEventArgs e)
{
try
{
if (Convert.ToInt32(TextBoxLenght.Text) <= 0 ||
Convert.ToInt32(TextBoxLenght2.Text) <= 0 ||
Convert.ToInt32(TextBoxLenght3.Text) <= 0)
{
throw new Exception("error");
}
}
catch (Exception)
{
MessageBox.Show("Процесс сохранения прерван. В одном из полей недопустимые значения");
return;
}
_indicator.Period2 = Convert.ToInt32(TextBoxLenght2.Text);
_indicator.Period3 = Convert.ToInt32(TextBoxLenght3.Text);
_indicator.ColorBase = HostColorBase.Child.BackColor;
_indicator.Period1 = Convert.ToInt32(TextBoxLenght.Text);
_indicator.PaintOn = CheckBoxPaintOnOff.IsChecked.Value;
_indicator.Save();
IsChange = true;
Close();
}
19
View Source File : VwapUi.xaml.cs
License : Apache License 2.0
Project Creator : AlexWan
License : Apache License 2.0
Project Creator : AlexWan
private void ButtonAccept_Click(object sender, RoutedEventArgs e)
{
if (UseDate.IsChecked.HasValue)
{
_indicator.UseDate = UseDate.IsChecked.Value;
_indicator.DatePickerStart = ((DateTimePicker)DatePickerStart.Child).Value;
_indicator.TimePickerStart = ((DateTimePicker)TimePickerStart.Child).Value;
if (ToEndTicks.IsChecked.HasValue)
{
_indicator.ToEndTicks = ToEndTicks.IsChecked.Value;
}
_indicator.DatePickerEnd = ((DateTimePicker)DatePickerEnd.Child).Value;
_indicator.TimePickerEnd = ((DateTimePicker)TimePickerEnd.Child).Value;
if (Deviations2.IsChecked != null) _indicator.DateDev2 = Deviations2.IsChecked.Value;
if (Deviations3.IsChecked != null) _indicator.DateDev3 = Deviations3.IsChecked.Value;
if (Deviations4.IsChecked != null) _indicator.DateDev4 = Deviations4.IsChecked.Value;
}
if (UseDay.IsChecked.HasValue)
{
_indicator.UseDay = UseDay.IsChecked.Value;
if (DayDeviations2.IsChecked != null) _indicator.DayDev2 = DayDeviations2.IsChecked.Value;
if (DayDeviations3.IsChecked != null) _indicator.DayDev3 = DayDeviations3.IsChecked.Value;
if (DayDeviations4.IsChecked != null) _indicator.DayDev4 = DayDeviations4.IsChecked.Value;
}
if (UseWeekly.IsChecked.HasValue)
{
_indicator.UseWeekly = UseWeekly.IsChecked.Value;
if (WeekDeviations2.IsChecked != null) _indicator.WeekDev2 = WeekDeviations2.IsChecked.Value;
if (WeekDeviations3.IsChecked != null) _indicator.WeekDev3 = WeekDeviations3.IsChecked.Value;
if (WeekDeviations4.IsChecked != null) _indicator.WeekDev4 = WeekDeviations4.IsChecked.Value;
}
_indicator.PaintOn = true;
_indicator.ColorDate = HostColorUp.Child.BackColor;
_indicator.ColorDateDev = HostColorDown.Child.BackColor;
_indicator.ColorDay = HostColorDayUp.Child.BackColor;
_indicator.ColorDayDev = HostColorDayDown.Child.BackColor;
_indicator.ColorWeek = HostColorWeekUp.Child.BackColor;
_indicator.ColorWeekDev = HostColorWeekDown.Child.BackColor;
_indicator.Save();
IsChange = true;
Close();
}
19
View Source File : AIndicatorUi.xaml.cs
License : Apache License 2.0
Project Creator : AlexWan
License : Apache License 2.0
Project Creator : AlexWan
private void ButtonAccept_Click(object sender, RoutedEventArgs e)
{
SaveParam();
SaveVisual();
IsAccepted = true;
Close();
}
19
View Source File : PatternsCreateUi.xaml.cs
License : Apache License 2.0
Project Creator : AlexWan
License : Apache License 2.0
Project Creator : AlexWan
private void ButtonAccept_Click(object sender, RoutedEventArgs e)
{
IsAccepted = true;
NamePattern = TextBoxPatternName.Text;
Close();
}
19
View Source File : PivotPointsRobotUi.xaml.cs
License : Apache License 2.0
Project Creator : AlexWan
License : Apache License 2.0
Project Creator : AlexWan
private void Button_Click(object sender, RoutedEventArgs e)
{
try
{
if (Convert.ToDecimal(TextBoxVolumeOne.Text) <= 0 ||
Convert.ToDecimal(TextBoxSlipage.Text) < 0 ||
Convert.ToDecimal(TextBoxStop.Text) <=0)
{
throw new Exception("");
}
}
catch (Exception)
{
MessageBox.Show(OsLocalization.Trader.Label13);
return;
}
_strategy.VolumeFix = Convert.ToDecimal(TextBoxVolumeOne.Text);
_strategy.Slipage = Convert.ToDecimal(TextBoxSlipage.Text);
_strategy.Stop = Convert.ToDecimal(TextBoxStop.Text);
Enum.TryParse(ComboBoxRegime.Text, true, out _strategy.Regime);
_strategy.Save();
Close();
}
19
View Source File : AddClientDialogUi.xaml.cs
License : Apache License 2.0
Project Creator : AlexWan
License : Apache License 2.0
Project Creator : AlexWan
private void ButtonAccept_Click(object sender, RoutedEventArgs e)
{
var name = ClientName.Text;
if (_allClientsName == null || _allClientsName.Find(c => c.Name == name) == null)
{
CreatedName = ClientName.Text;
Close();
return;
}
var message = OsLocalization.MainWindow.NewClientErrorName;
TbText.Text = message;
Task.Run(() =>
{
Thread.Sleep(5000);
Dispatcher.Invoke(() => TbText.Text = null);
});
}
19
View Source File : AddEngineForm.xaml.cs
License : Apache License 2.0
Project Creator : AlexWan
License : Apache License 2.0
Project Creator : AlexWan
private void Button_Click(object sender, RoutedEventArgs e)
{
if (!Validate())
{
return;
}
DialogResult = true;
Close();
}
19
View Source File : InputBox.xaml.cs
License : Apache License 2.0
Project Creator : AlexWan
License : Apache License 2.0
Project Creator : AlexWan
private void ButtonBase_OnClick(object sender, RoutedEventArgs e)
{
Code = TbCode.Text;
Close();
}
19
View Source File : ChangeTransaqPassword.xaml.cs
License : Apache License 2.0
Project Creator : AlexWan
License : Apache License 2.0
Project Creator : AlexWan
private void ButtonAccept_Click(object sender, RoutedEventArgs e)
{
if (string.IsNullOrWhiteSpace(NewPreplacedword.Text) || NewPreplacedword.Text.Length > 19)
{
MessageBox.Show(OsLocalization.Market.Message96);
}
else
{
_server.ChangePreplacedword(OldPreplacedword.Text, NewPreplacedword.Text);
Close();
}
}
19
View Source File : Settings.xaml.cs
License : MIT License
Project Creator : Alkl58
License : MIT License
Project Creator : Alkl58
private void SendSettingsToSave(bool enableLog, bool shutDown, bool batch, bool settings, bool delete, bool tempFolderChunks, bool aomencDir, bool ffmpegDir, bool ffprobeDir, string temp, string aomenc, string ffmpeg, string ffprobe)
{
{
MainWindow.SaveSettings(enableLog, shutDown, batch, settings, delete, tempFolderChunks, aomencDir, ffmpegDir, ffprobeDir, temp, aomenc, ffmpeg, ffprobe);
//Closes the Window after Settings have been send to main window
this.Close();
}
}
19
View Source File : OpenVideoWindow.xaml.cs
License : MIT License
Project Creator : Alkl58
License : MIT License
Project Creator : Alkl58
private void ButtonOpenSingleSource_Click(object sender, RoutedEventArgs e)
{
// OpenFileDialog for a Single Video File
OpenFileDialog openVideoFileDialog = new OpenFileDialog();
openVideoFileDialog.Filter = "Video Files|*.mp4;*.mkv;*.webm;*.flv;*.avi;*.mov;*.wmv;|All Files|*.*";
// Avoid NULL being returned resulting in crash
Nullable<bool> result = openVideoFileDialog.ShowDialog();
if (result == true)
{
// Sets the Video Path which the main window gets
// with the function at the beginning
VideoPath = openVideoFileDialog.FileName;
ProjectFile = false;
BatchFolder = false;
QuitCorrectly = true;
// Closes the Window
this.Close();
}
}
19
View Source File : OpenVideoWindow.xaml.cs
License : MIT License
Project Creator : Alkl58
License : MIT License
Project Creator : Alkl58
private void ButtonBatchFile_Click(object sender, RoutedEventArgs e)
{
//Sets the Batch Encoding Source Folder
System.Windows.Forms.FolderBrowserDialog browseSourceFolder = new System.Windows.Forms.FolderBrowserDialog();
if (browseSourceFolder.ShowDialog() == System.Windows.Forms.DialogResult.OK)
{
// Sets the Video Path which the main window gets
VideoPath = browseSourceFolder.SelectedPath;
ProjectFile = false;
QuitCorrectly = true;
BatchFolder = true;
// Closes the Window
this.Close();
}
}
19
View Source File : OpenVideoWindow.xaml.cs
License : MIT License
Project Creator : Alkl58
License : MIT License
Project Creator : Alkl58
private void ButtonProjectFile_Click(object sender, RoutedEventArgs e)
{
// OpenFileDialog for a Project File
OpenFileDialog openVideoFileDialog = new OpenFileDialog();
openVideoFileDialog.Filter = "Project File|*.xml;";
openVideoFileDialog.InitialDirectory = Path.Combine(Directory.GetCurrentDirectory(), "Jobs");
// Avoid NULL being returned resulting in crash
Nullable<bool> result = openVideoFileDialog.ShowDialog();
if (result == true)
{
// Sets the Video Path which the main window gets
// with the function at the beginning
VideoPath = openVideoFileDialog.FileName;
ProjectFile = true;
BatchFolder = false;
QuitCorrectly = true;
// Closes the Window
this.Close();
}
}
19
View Source File : PopupWindow.xaml.cs
License : MIT License
Project Creator : Alkl58
License : MIT License
Project Creator : Alkl58
private void Button_Click(object sender, System.Windows.RoutedEventArgs e)
{
// Closes this window
Close();
}
19
View Source File : SavePreset.xaml.cs
License : MIT License
Project Creator : Alkl58
License : MIT License
Project Creator : Alkl58
private void ButtonCloseWindow_Click(object sender, RoutedEventArgs e)
{
Cancel = true;
// Closes the Window
Close();
}
19
View Source File : SavePreset.xaml.cs
License : MIT License
Project Creator : Alkl58
License : MIT License
Project Creator : Alkl58
private void ButtonSavePreset_Click(object sender, RoutedEventArgs e)
{
// Saves the Preset
SaveName = TextBoxPresetName.Text;
AudioCodec = ComboBoxAudioCodec.Text;
AudioBitrate = TextBoxBitrate.Text;
Cancel = false;
// Closes the Window
Close();
}
19
View Source File : Settings.xaml.cs
License : MIT License
Project Creator : Alkl58
License : MIT License
Project Creator : Alkl58
private void Button_Click(object sender, RoutedEventArgs e)
{
SaveSettingsTab();
MainWindow.BatchWithDifferentPresets = CheckBoxBatchWithDifferentPresets.IsChecked == true;
MainWindow.BatchPresets = ComboBoxBatchSettings.Items;
Close();
}
19
View Source File : AudioSettings.xaml.cs
License : MIT License
Project Creator : Alkl58
License : MIT License
Project Creator : Alkl58
private void SaveSettings()
{
MainWindow.SaveAudioSettings(ComboBoxAudioCodec.Text, TextBoxAudioBitrate.Text, trackone, tracktwo, trackthree, trackfour);
this.Close();
}
19
View Source File : ConnectWizard.xaml.cs
License : GNU General Public License v3.0
Project Creator : Amebis
License : GNU General Public License v3.0
Project Creator : Amebis
private void Exit_Click(object sender, EventArgs e)
{
DoClose = true;
Close();
}
19
View Source File : CustomWindow.cs
License : GNU General Public License v3.0
Project Creator : AndreiFedarets
License : GNU General Public License v3.0
Project Creator : AndreiFedarets
private void OnCloseButtonClick(object sender, RoutedEventArgs routedEventArgs)
{
Close();
}
19
View Source File : DummyWindow.cs
License : GNU General Public License v3.0
Project Creator : Angelinsky7
License : GNU General Public License v3.0
Project Creator : Angelinsky7
public void Dispose() {
s_Window.Close();
s_Window = null;
}
19
View Source File : ClipboardWindow.xaml.cs
License : MIT License
Project Creator : AngryCarrot789
License : MIT License
Project Creator : AngryCarrot789
private void Window_KeyDown(object sender, KeyEventArgs e)
{
switch (e.Key)
{
case Key.Enter:
case Key.Escape:
this.Close();
break;
}
}
19
View Source File : ItemSearchResultsWindow.xaml.cs
License : MIT License
Project Creator : AngryCarrot789
License : MIT License
Project Creator : AngryCarrot789
private void ItemSearchResultsWindow_KeyDown(object sender, System.Windows.Input.KeyEventArgs e)
{
switch (e.Key)
{
case Key.Escape:
case Key.Enter:
this.Close();
break;
}
}
19
View Source File : ItemSearchResultsWindow.xaml.cs
License : MIT License
Project Creator : AngryCarrot789
License : MIT License
Project Creator : AngryCarrot789
public void ForceClose()
{
PreviewKeyDown -= ItemSearchResultsWindow_KeyDown;
Closing -= ItemSearchResultsWindow_Closing;
Close();
}
19
View Source File : ColourfulDarkTheme.xaml.cs
License : MIT License
Project Creator : AngryCarrot789
License : MIT License
Project Creator : AngryCarrot789
public void CloseWind(Window window) => window.Close();
See More Examples