Exemple #1
0
        /// <summary>
        /// Shows the dialog window
        /// </summary>
        public void Show(string infoMessage)
        {
            if (window != null && window.IsActive)
            {
                window.Close();
            }

            window             = new DialogWindow();
            window.Owner       = Application.Current.MainWindow;
            window.DataContext = this;
            InfoMessage        = infoMessage;
            window.Show();
        }
        private void                    AppointMethod()
        {
            if ((DataContext as DialogWithOrderInfoViewModel).CompanyCars.FirstOrDefault(c => c.SelectColor == "8a8a8a") != null &&
                (DataContext as DialogWithOrderInfoViewModel).CompanyCars.FirstOrDefault(c => c.SelectColor == "8a8a8a").CarStatus == "Free")
            {
                _dialogWindow.Close();
                var car   = (DataContext as DialogWithOrderInfoViewModel).CompanyCars.FirstOrDefault(c => c.SelectColor == "8a8a8a").Car;
                var route = IoC.Application_Work.All_Routes.First(r => r.Product.Id == (DataContext as DialogWithOrderInfoViewModel).Product.Id);

                WorkWithDB.Update_Car_Async(car, route);
                WorkWithDB.Update_Product_Async((DataContext as DialogWithOrderInfoViewModel).Product, StatusOfProduct.HoldDriverAccept);
                (DataContext as DialogWithOrderInfoViewModel).Product.Status = StatusOfProduct.HoldDriverAccept;
                IoC.DispatcherView.Reload_Orders();
            }
        }
Exemple #3
0
        public void CloseDialog()
        {
            m_StatusDialogWindow.Close();
            if (m_StatusDialogCloseCoroutine != null)
            {
                StopCoroutine(m_StatusDialogCloseCoroutine);
                m_StatusDialogCloseCoroutine = null;
            }

            m_StatusWarningDialogWindow.Close();
            if (m_StatusWarningDialogCloseCoroutine != null)
            {
                StopCoroutine(m_StatusWarningDialogCloseCoroutine);
                m_StatusWarningDialogCloseCoroutine = null;
            }
        }
        void Awake()
        {
#if !DEBUG
            // Disable development tool on production
            if (m_ToggleTools)
            {
                m_ToggleTools.gameObject.SetActive(false);
            }
            gameObject.SetActive(false);
            return;
#endif
            if (m_SyncStoreManager == null)
            {
                m_SyncStoreManager = FindObjectOfType <MarkerSyncStoreManager>();
            }

            // There needs to be a syncstoremanager active and enabled for this script to be useful.
            Debug.Assert(m_SyncStoreManager, "MarkerSyncStoreManager needs to be available to test it's functionality.");
            Debug.Assert(m_SyncStoreManager.enabled, "MarkerSyncStoreManager needs to be enabled to test it's functionality.");
            m_ActiveMarkerInfoOutput.text = m_MarkerController.ActiveMarker.ToString();

            m_MarkerController.OnMarkerUpdated += HandleOnMarkerUpdated;
            m_SyncNewMarkerButton.onClick.AddListener(SyncNewMarker);
            m_UpdateActiveMarkerButton.onClick.AddListener(UpdateActiveMarker);
            m_ToggleTools.onClick.AddListener(TogglePanel);
            m_DialogWindow = GetComponent <DialogWindow>();
            m_DialogWindow.Close();
        }
        public static void ShowView <TView>(ViewModelBase viewModel, Size windowSize) where TView : FrameworkElement, new()
        {
            var window = new DialogWindow();

            if (windowSize != Size.Empty)
            {
                window.SizeToContent = SizeToContent.Manual;
                window.Width         = windowSize.Width;
                window.Height        = windowSize.Height;
            }
            else
            {
                window.SizeToContent = SizeToContent.WidthAndHeight;
            }

            var view = Activator.CreateInstance <TView>() as TView;
            var vm   = viewModel as IWindowContoller;

            if (vm != null)
            {
                vm.CmdCloseWindow = new DelegateCommand(() => window.Close());
                window.Title      = vm.Title;
            }
            view.DataContext = vm;
            window.Content   = view;

            window.WindowStyle           = WindowStyle.ToolWindow;
            window.ShowInTaskbar         = true;
            window.WindowStartupLocation = WindowStartupLocation.CenterScreen;

            window.ShowDialog();
        }
Exemple #6
0
        void OnActiveToolBarChanged(SetActiveToolBarAction.ToolbarType newData)
        {
            m_FlySidebar.SetActive(false);
            m_WalkSidebar.SetActive(false);
            m_ARSidebar.SetActive(false);
            m_ARModelAlignViewSidebar.SetActive(false);
            m_ARInstructionSidebar.SetActive(false);
            m_ARScaleRadial.Close();

            switch (newData)
            {
            case SetActiveToolBarAction.ToolbarType.FlySidebar:
                m_FlySidebar.SetActive(true);
                break;

            case SetActiveToolBarAction.ToolbarType.WalkSidebar:
                m_WalkSidebar.SetActive(true);
                break;

            case SetActiveToolBarAction.ToolbarType.ARSidebar:
                m_ARSidebar.SetActive(true);
                break;

            case SetActiveToolBarAction.ToolbarType.ARModelAlignSidebar:
                m_ARModelAlignViewSidebar.SetActive(true);
                break;

            case SetActiveToolBarAction.ToolbarType.ARInstructionSidebar:
                m_ARInstructionSidebar.SetActive(true);
                break;

            case SetActiveToolBarAction.ToolbarType.ARScaleDial:
                m_ARScaleRadial.Open();
                break;

            case SetActiveToolBarAction.ToolbarType.TopSidebar:
                m_TopSidebar.SetActive(true);
                break;

            case SetActiveToolBarAction.ToolbarType.NavigationSidebar:
                m_NavigationSidebar.SetActive(true);
                break;

            case SetActiveToolBarAction.ToolbarType.NoSidebar:
                m_LeftSidebar.SetActive(false);
                m_NavigationSidebar.SetActive(false);
                m_TopSidebar.SetActive(false);
                break;

            case SetActiveToolBarAction.ToolbarType.LandingScreen:
                m_TopSidebar.SetActive(true);
                break;

            default:
                m_LeftSidebar.SetActive(true);
                m_NavigationSidebar.SetActive(true);
                m_TopSidebar.SetActive(true);
                break;
            }
        }
        private void Save(DialogWindow window)
        {
            var panelGuid = new Guid("A8E3D03E-28C9-4900-BD48-CEEDEC35E7E6");

            try
            {
                string customError = string.Empty;
                List <ValidationResult> results = new List <ValidationResult>();
                var validation = Validator.TryValidateObject(Configuration, new ValidationContext(Configuration), results);

                if (!validation)
                {
                    results.ForEach((error) => m_service.LogMessage($"[ERROR] => {error.ErrorMessage}", panelGuid));
                    m_service.LogMessage($"[ERROR] => {customError}", panelGuid);
                    return;
                }

                var xmlDump  = XmlObjectsHelper.Serialize(Configuration);
                var fullPath = $"{m_service.PropertiesDirectory}\\AvanadeToolkit.publishSettings";
                File.WriteAllText(fullPath, xmlDump);
                FilePath = fullPath;

                window.Close();
            }
            catch (Exception ex)
            {
                m_service.LogMessage($"[ERROR] => {ex.Message}", panelGuid);
                m_telemetry.TrackExceptionWithCustomMetrics(ex);
            }
        }
Exemple #8
0
        public void ShowDialog(string title, Dialog content)
        {
            if (content == null)
            {
                throw new ArgumentNullException(nameof(content));
            }

            //var uri = new Uri(@"pack://application:,,,/GitLab.UI;component/Resources/Images/logo.png");
            //var icon = new BitmapImage(uri);
            var win = new DialogWindow
            {
                Content               = content,
                ResizeMode            = ResizeMode.NoResize,
                SizeToContent         = SizeToContent.WidthAndHeight,
                WindowStartupLocation = WindowStartupLocation.CenterOwner,
                Title = title,
            };

            content.Closed += () =>
            {
                win.Close();
            };

            win.ShowModal();
        }
 private void OnCommit(DialogWindow w)
 {
     if (w != null)
     {
         w.DialogResult = true;
         w.Close();
     }
 }
 private void OnCancel(DialogWindow w)
 {
     if (w != null)
     {
         w.DialogResult = false;
         w.Close();
     }
 }
Exemple #11
0
        void OnStateDataChanged(UIStateData stateData)
        {
            if (m_currentActiveToolbar == stateData.activeToolbar)
            {
                return;
            }

            m_OrbitSidebar.SetActive(false);
            m_FlySidebar.SetActive(false);
            m_WalkSidebar.SetActive(false);
            m_ARSidebar.SetActive(false);
            m_ARModelAlignViewSidebar.SetActive(false);
            m_ARInstructionSidebar.SetActive(false);
            m_TimeOfDayYearRadial.Close();
            m_AltitudeAzimuthRadial.Close();
            m_ARScaleRadial.Close();

            switch (stateData.activeToolbar)
            {
            case ToolbarType.FlySidebar:
                m_FlySidebar.SetActive(true);
                break;

            case ToolbarType.WalkSidebar:
                m_WalkSidebar.SetActive(true);
                break;

            case ToolbarType.ARSidebar:
                m_ARSidebar.SetActive(true);
                break;

            case ToolbarType.ARModelAlignSidebar:
                m_ARModelAlignViewSidebar.SetActive(true);
                break;

            case ToolbarType.ARInstructionSidebar:
                m_ARInstructionSidebar.SetActive(true);
                break;

            case ToolbarType.TimeOfDayYearDial:
                m_TimeOfDayYearRadial.Open();
                break;

            case ToolbarType.AltitudeAzimuthDial:
                m_AltitudeAzimuthRadial.Open();
                break;

            case ToolbarType.ARScaleDial:
                m_ARScaleRadial.Open();
                break;

            default:
                m_OrbitSidebar.SetActive(true);
                break;
            }

            m_currentActiveToolbar = stateData.activeToolbar;
        }
Exemple #12
0
        void OnActiveDialogChanged(OpenDialogAction.DialogType newData)
        {
            if (newData != OpenDialogAction.DialogType.None &&
                m_ActiveSubDialogGetter.GetValue() == OpenDialogAction.DialogType.LeftSidebarMore)
            {
                m_DialogButton.selected = false;
                m_DialogWindow.Close();

                IEnumerator WaitAFrame()
                {
                    yield return(null);

                    Dispatcher.Dispatch(OpenSubDialogAction.From(OpenDialogAction.DialogType.None));
                }

                StartCoroutine(WaitAFrame());
            }
        }
Exemple #13
0
        public BaseDialogUserControl()
        {
            if (!DesignerProperties.GetIsInDesignMode(this))
            {
                _dialogWindow           = new DialogWindow();
                _dialogWindow.ViewModel = new DialogWindowViewModel(_dialogWindow);

                CloseCommand = new RelayCommand(() => _dialogWindow.Close());
            }
        }
        void OnStateDataChanged(UIStateData stateData)
        {
            if (stateData.activeDialog != DialogType.None)
            {
                if (m_DialogWindow.open)
                {
                    m_Active = true;
                }

                m_DialogWindow.Close();
            }
            else
            {
                if (m_Active)
                {
                    m_DialogWindow.Open();
                }
            }
        }
Exemple #15
0
        void OnActiveDialogChanged(OpenDialogAction.DialogType data)
        {
            if (data != OpenDialogAction.DialogType.None)
            {
                if (m_DialogWindow.open)
                {
                    m_Active = true;
                }

                m_DialogWindow.Close();
            }
            else
            {
                if (m_Active)
                {
                    m_DialogWindow.Open();
                }
            }
        }
Exemple #16
0
        void Awake()
        {
            m_StatusDialogWindow        = m_StatusDialog.GetComponent <DialogWindow>();
            m_StatusWarningDialogWindow = m_StatusWarningDialog.GetComponent <DialogWindow>();
            m_WaitDelay = new WaitForSeconds(m_WaitingDelayToCloseDialog);


            m_StatusDialogWindow.Close();
            m_StatusWarningDialogWindow.Close();
        }
 void OnEnableStatsInfoChanged(bool on)
 {
     if (on)
     {
         m_DialogWindow.Open();
     }
     else
     {
         m_DialogWindow.Close();
     }
 }
 void OnProgressStateChanged(SetProgressStateAction.ProgressState newData)
 {
     if (newData == SetProgressStateAction.ProgressState.NoPendingRequest)
     {
         m_ProgressIndicatorDialog.Close(true);
     }
     else
     {
         m_ProgressIndicatorDialog.Open(true);
     }
 }
 void TogglePanel()
 {
     if (m_DialogWindow.open)
     {
         m_DialogWindow.Close();
     }
     else
     {
         m_DialogWindow.Open();
     }
 }
Exemple #20
0
 void OnEnableDebugOptionChanged(bool on)
 {
     if (on)
     {
         m_DialogWindow.Open();
     }
     else
     {
         m_DialogWindow.Close();
     }
 }
        /// <summary>
        /// Default constructor
        /// </summary>
        public BaseDialogUserControl()
        {
            if (!DesignerProperties.GetIsInDesignMode(this))
            {
                // Create a new dialog window
                DialogWindow           = new DialogWindow();
                DialogWindow.ViewModel = new DialogWindowViewModel(DialogWindow);

                // Create close command
                CloseCommand = new RelayCommand(x => DialogWindow.Close());
            }
        }
        public BaseDialogUserControl()
        {
            if (!DesignerProperties.GetIsInDesignMode(this))
            {
                _dialogWindow           = new DialogWindow();
                _dialogWindow.ViewModel = new DialogWindowViewModel(_dialogWindow);

                CloseCommand   = new RelayCommand(() => _dialogWindow.Close());
                SendCommand    = new RelayCommand(SendMethod);
                RefuseCommand  = new RelayCommand(RefuseMethod);
                AcceptCommand  = new RelayCommand(AcceptMethod);
                AppointCommand = new RelayCommand(AppointMethod);
            }
        }
Exemple #23
0
        public virtual bool?ShowDialog <T>(T dataContext) where T : DialogViewModel
        {
            var dialog = new DialogWindow();

            dialog.Owner = this.Owner;

            dataContext.RequestClose += delegate { dialog.Close(); };

            dataContext.NegativeButtonClicked += delegate
            {
                dialog.DialogResult = false;
                dialog.Close();
            };

            dataContext.PositiveButtonClicked += delegate
            {
                dialog.DialogResult = true;
                dialog.Close();
            };

            dialog.DataContext = dataContext;
            return(dialog.ShowDialog());
        }
Exemple #24
0
        public PrinterProfileHistoryPage(PrinterConfig printer)
        {
            this.WindowTitle = "Restore Settings".Localize();
            this.HeaderText  = "Restore Settings".Localize();
            this.printer     = printer;

            scrollWindow = new ScrollableWidget()
            {
                AutoScroll = true,
                HAnchor    = HAnchor.Stretch,
                VAnchor    = VAnchor.Stretch,
            };
            scrollWindow.ScrollArea.HAnchor = HAnchor.Stretch;
            contentRow.FlowDirection        = FlowDirection.TopToBottom;
            contentRow.AddChild(scrollWindow);

            var revertButton = theme.CreateDialogButton("Restore".Localize());

            revertButton.Click += async(s, e) =>
            {
                int index = radioButtonList.IndexOf(radioButtonList.Where(r => r.Checked).FirstOrDefault());

                if (index != -1)
                {
                    string profileToken = printerProfileData[orderedProfiles[index]];

                    var profile = ProfileManager.Instance[printer.Settings.ID];

                    // Download the specified json profile
                    PrinterSettings printerSettings = null;
                    if (Application.EnableNetworkTraffic)
                    {
                        await ApplicationController.GetPrinterProfileAsync(profile, profileToken);
                    }
                    if (printerSettings != null)
                    {
                        // Persist downloaded profile
                        printerSettings.Save(userDrivenChange: false);

                        // Update/switch printer instance to new settings
                        printer.SwapToSettings(printerSettings);
                    }

                    DialogWindow.Close();
                }
            };
            this.AddPageAction(revertButton);

            LoadHistoryItems();
        }
        void OnActiveSubDialogChanged(OpenDialogAction.DialogType newData)
        {
            m_AccountDialog.Close();
            m_LinkSharingDialog.Close();
            m_NavigationGizmoModeFanOut.Close();
            m_SceneOptionsDialog.Close();
            m_NavigationModeFlyOut.Close();

            if (m_DialogModeSelector.GetValue() == SetDialogModeAction.DialogMode.Help)
            {
                m_HelpDialogController.Display(newData);
                return;
            }

            m_LeftSidebarMoreDialog.Close();

            switch (newData)
            {
            case OpenDialogAction.DialogType.None:
                break;

            case OpenDialogAction.DialogType.Account:
                m_AccountDialog.Open();
                break;

            case OpenDialogAction.DialogType.LinkSharing:
                m_LinkSharingDialog.Open();
                break;

            case OpenDialogAction.DialogType.GizmoMode:
                m_NavigationGizmoModeFanOut.Open();
                break;

            case OpenDialogAction.DialogType.SceneOptions:
                m_SceneOptionsDialog.Open();
                break;

            case OpenDialogAction.DialogType.NavigationMode:
                m_NavigationModeFlyOut.Open();
                break;

            case OpenDialogAction.DialogType.LeftSidebarMore:
                m_LeftSidebarMoreDialog.Open();
                break;

            default:
                throw new ArgumentOutOfRangeException();
            }
        }
Exemple #26
0
        public async Task Interact(string key, string title, object vm,
                                   ICollection <DialogButton> buttons)
        {
            var dialogWindow = new DialogWindow();
            var options      = buttons;

            var content         = Locate(key);
            var dialogViewModel = new DialogViewModel(title, content, options.ToList(), dialogWindow);

            dialogWindow.DataContext = dialogViewModel;

            content.DataContext = vm;

            await dialogWindow.ShowDialogAsync();

            dialogWindow.Close();
        }
        void OnStateDataChanged(OpenDialogAction.DialogType data)
        {
            if (m_MarkerDialogWindow != null)
            {
                bool open = data == OpenDialogAction.DialogType.Marker;
                m_DialogButton.selected = open;

                if (!open)
                {
                    SetEditPanel(false);
                }
                else if (open && m_MarkerController.ReadOnly)
                {
                    m_MarkerDialogWindow.Close();
                }
            }
        }
        void Start()
        {
            m_MarkerDialogWindow = GetComponent <DialogWindow>();
            // Initialize buttons
            m_DialogButton.buttonClicked += HandleDialogButton;

            // Close edit panel & dialog
            m_EditPanel.SetActive(false);
            m_MarkerDialogWindow.Close();

            // Open edit panel on a selected marker.
            m_MarkerController.OnMarkerUpdated      += HandleMarkerSelected;
            m_MarkerController.OnServiceUnsupported += SetUnsupported;
            m_MarkerController.OnServiceInitialized += HandleServiceInitialized;

            m_DialogButton.button.interactable = true;
        }
Exemple #29
0
        public async Task <DialogResult> Show(string key, object context)
        {
            var dialogWindow = new DialogWindow();
            var options      = new List <Option>
            {
                new Option("OK", OptionValue.OK),
                new Option("Cancel", OptionValue.Cancel)
            };

            var dialogViewModel = new DialogViewModel("Deployment options", context, options, dialogWindow);

            dialogWindow.DataContext = dialogViewModel;

            var confirmed = (await dialogWindow.ShowDialogAsync()).HasValue && dialogViewModel.SelectedOption?.OptionValue == OptionValue.OK;

            dialogWindow.Close();

            return(confirmed ? DialogResult.Yes : DialogResult.No);
        }
        public void Reset()
        {
            if (runningMacro)
            {
                runningMacro = false;
                for (int i = 0; i < startingExtruderTemps.Count; i++)
                {
                    printer.Connection.SetTargetHotendTemperature(i, startingExtruderTemps[i]);
                }

                if (printer.Settings.GetValue <bool>(SettingsKey.has_heated_bed))
                {
                    printer.Connection.TargetBedTemperature = startingBedTemp;
                }
            }
            WaitingForUserInput = false;
            timeHaveBeenWaiting.Reset();
            maxTimeToWaitForOk = 0;
            UiThread.RunOnIdle(() => DialogWindow.Close(typeof(RunningMacroPage)));
        }