/
spruttechnology
/
cam-api-examples
Обзор
Документация
Войти
/
spruttechnology
/
cam-api-examples
Код
Запросы
3
Задачи
Пакеты
0
Релизы
1
Аналитика
v19/develop
UI/ExtensionManageViewNet/project/main/ViewControlWindow.xaml.cs
51 строка
1 KB
renal
Stabilization with fresh update of CAM
10 апр 2026, 15:28
10 апр 2026, 15:28
ff452f8
Код
Авторство
О чём код?
using System.Windows; using System.Windows.Controls; using CAMAPI.DotnetHelper; using CAMAPI.ViewCube; using CAMAPI.ViewPort; namespace ExtensionManageViewNet; /// <summary> /// Interaction logic for ViewControlWindow.xaml /// </summary> public partial class ViewControlWindow : Window, IDisposable { private readonly ComWrapper<ICamApiViewPort> _viewPortCom; /// <summary> /// Interaction logic for ViewControlWindow.xaml /// </summary> public ViewControlWindow(ComWrapper<ICamApiViewPort> viewPortCom) { _viewPortCom = viewPortCom; InitializeComponent(); } private void Face_Click(object sender, RoutedEventArgs e) { if (sender is not Button { Tag: string tagStr }) return; if (!Enum.TryParse<TViewCubeRotateMode>(tagStr, out var mode)) return; try { _viewPortCom.ZoomAll(true); using var cubeCom = _viewPortCom.GetCube(); cubeCom.Rotate(mode); } catch (Exception ex) { MessageBox.Show(ex.Message, "Error", MessageBoxButton.OK, MessageBoxImage.Error); } } /// <summary> /// Dispose of COM wrappers /// </summary> public void Dispose() { _viewPortCom.Dispose(); } }