Beispiel #1
0
 public DropdownOptionViewModel(string text, Func <bool> isSelected, Func <bool> isEnabled, TSelection selection)
 {
     Text       = GUIUtil.CreateContent(text);
     IsSelected = isSelected;
     IsEnabled  = isEnabled;
     Selection  = selection;
 }
 public ToggleViewModel(string text, string enabledTooltip, string disabledTooltip, Action onToggled, Func <bool> isToggled, bool enabled = true)
 {
     _enabled  = GUIUtil.CreateContent(text, enabledTooltip);
     _disabled = GUIUtil.CreateContent(text, disabledTooltip);
     OnToggled = onToggled;
     IsToggled = isToggled;
     Enabled   = enabled;
 }
        public DropdownGUI(float x, float y, float width, DropdownViewModel <TDropdownOptionViewModel, TSelection> viewModel)
        {
            _x           = x;
            _y           = y;
            _width       = width;
            _noSelection = GUIUtil.CreateContent(viewModel.NoSelection, viewModel.NoSelectionTooltip);
            _unselect    = GUIUtil.CreateContent(viewModel.Unselect, viewModel.UnselectTooltip);

            _viewModel = viewModel;
        }
Beispiel #4
0
 public TranslatorDropdownOptionViewModel(bool fallback, Func <bool> isSelected, TranslationEndpointManager selection) : base(selection.Endpoint.FriendlyName, isSelected, () => selection.Error == null, selection)
 {
     if (fallback)
     {
         _selected = GUIUtil.CreateContent(selection.Endpoint.FriendlyName, $"<b>CURRENT FALLBACK TRANSLATOR</b>\n{selection.Endpoint.FriendlyName} is the currently selected fallback translator that will be used to perform translations when the primary translator fails.");
         _disabled = GUIUtil.CreateContent(selection.Endpoint.FriendlyName, $"<b>CANNOT SELECT FALLBACK TRANSLATOR</b>\n{selection.Endpoint.FriendlyName} cannot be selected because the initialization failed. {selection.Error?.Message}");
         _normal   = GUIUtil.CreateContent(selection.Endpoint.FriendlyName, $"<b>SELECT FALLBACK TRANSLATOR</b>\n{selection.Endpoint.FriendlyName} will be selected as fallback translator.");
     }
     else
     {
         _selected = GUIUtil.CreateContent(selection.Endpoint.FriendlyName, $"<b>CURRENT TRANSLATOR</b>\n{selection.Endpoint.FriendlyName} is the currently selected translator that will be used to perform translations.");
         _disabled = GUIUtil.CreateContent(selection.Endpoint.FriendlyName, $"<b>CANNOT SELECT TRANSLATOR</b>\n{selection.Endpoint.FriendlyName} cannot be selected because the initialization failed. {selection.Error?.Message}");
         _normal   = GUIUtil.CreateContent(selection.Endpoint.FriendlyName, $"<b>SELECT TRANSLATOR</b>\n{selection.Endpoint.FriendlyName} will be selected as translator.");
     }
 }
 public ButtonViewModel(string text, string tooltip, Action onClicked, Func <bool> canClick)
 {
     Text      = GUIUtil.CreateContent(text, tooltip);
     OnClicked = onClicked;
     CanClick  = canClick;
 }