Inheritance: EditorWindow
 private TextPageScreenViewModel CreateTextPageScreenViewModel(ScreenSettings <TextFormSettingsDescriptor> screenSettings)
 => (TextPageScreenViewModel)Activator.CreateInstance
 (
     typeof(TextPageScreenViewModel),
     screenSettings,
     uiNotificationService
 );
 public TextPageScreenViewModel(ScreenSettings <TextFormSettingsDescriptor> screenSettings, UiNotificationService uiNotificationService)
 {
     FormSettings = screenSettings.Settings;
     this.uiNotificationService = uiNotificationService;
     Buttons = new ObservableCollection <CommandButtonDescriptor>(screenSettings.CommandButtons);
     Title   = this.FormSettings.Title;
 }
示例#3
0
            public ScreenSettings GetWorkspaceSettings()
            {
                var settings = new ScreenSettings
                {
                    PersistenceId = Host.GetPersistenceId(),
                    Type          = Key.Type.AssemblyQualifiedName != null
                        ? string.Join(",", Key.Type.AssemblyQualifiedName.Split(',').Take(2))
                        : Key.Type.FullName,
                    Name    = Key.Name,
                    IsPopup = _isPopup
                };

                if (_popupAttribute != null)
                {
                    settings.TopMost    = _popupAttribute.TopMost;
                    settings.ResizeMode = _popupAttribute.ResizeMode;
                    settings.Icon       = _popupAttribute.Icon;
                }

                if (Host is IPopupScreenHost popup)
                {
                    settings.PositionAndSize = popup.GetPositionAndSize() ?? new RectangleSettings {
                        Height = 300, Width = 300
                    }
                }
                ;

                return(settings);
            }
        private DetailFormEntityViewModelBase CreateDetailFormViewModel(ScreenSettings <DataFormSettingsDescriptor> screenSettings)
        {
            return((DetailFormEntityViewModelBase)Activator.CreateInstance
                   (
                       typeof(DetailFormEntityViewModel <>).MakeGenericType
                       (
                           Type.GetType
                           (
                               screenSettings.Settings.ModelType,
                               AssemblyResolver,
                               TypeResolver
                           )
                       ),
                       new object[]
            {
                screenSettings,
                this.contextProvider
            }
                   ));

            Type TypeResolver(Assembly assembly, string typeName, bool matchCase)
            => assembly.GetType(typeName);

            Assembly AssemblyResolver(AssemblyName assemblyName)
            => typeof(Domain.BaseModelClass).Assembly;
        }
示例#5
0
    void Start()
    {
        isShowed = false;
        SwapCanvas();

        startBtn.onClick.RemoveAllListeners();
        startBtn.onClick.AddListener(() => {
            //StartCoroutines(IMouseCoords());
            StartCoroutines(IChoosingWindowDelay());
            StartCoroutines(FishingController.inst.IFishingCycle());
            //Debug.Log("Запуск основного процесса рыбалки");
        });

        stopBtn.onClick.RemoveAllListeners();
        stopBtn.onClick.AddListener(StopAllLocalCoroutines);

        btnSettingsBear.onClick.RemoveAllListeners();
        btnSettingsBear.onClick.AddListener(() => {
            sS = ScreenSettingsFactory.GetSettings("bear");
            programStateTxt.text = "bearLaptop Screen Settings is active";
        });

        btnSettingsManual.onClick.RemoveAllListeners();
        btnSettingsManual.onClick.AddListener(() => {
            CreateManualSettings();

            SwapCanvas();
        });
    }
        protected override void AddItems()
        {
            MenuItem playersCountMenuItem = new MenuItem(string.Format(k_OnePlayerPlayText, k_One), this.GameScreen);

            playersCountMenuItem.BindActionToKeys(playersCount_Clicked, Keys.PageDown, Keys.PageUp);
            playersCountMenuItem.BindActionToMouseButtons(playersCount_Clicked, eInputButtons.Right);
            playersCountMenuItem.BindActionToMouseWheel(playersCount_Clicked);

            SubMenu  soundSettingsMenu     = new SoundSettingsMenu(this, this.GameScreen);
            MenuItem soundSettingsMenuItem = new MenuItem(k_SoundSettingsMenuItem, this.GameScreen, soundSettingsMenu);

            soundSettingsMenuItem.BindActionToKeys(subMenu_Clicked, Keys.Enter);
            soundSettingsMenuItem.BindActionToMouseButtons(subMenu_Clicked, eInputButtons.Left);

            SubMenu  screenSettings         = new ScreenSettings(this, this.GameScreen);
            MenuItem screenSettingsMenuItem = new MenuItem(k_ScreenSettingsMenuItem, this.GameScreen, screenSettings);

            screenSettingsMenuItem.BindActionToKeys(subMenu_Clicked, Keys.Enter);
            screenSettingsMenuItem.BindActionToMouseButtons(subMenu_Clicked, eInputButtons.Left);

            MenuItem playMenuItem = new MenuItem(k_PlayText, this.GameScreen);

            playMenuItem.BindActionToKeys(PlayClicked, Keys.Enter);
            playMenuItem.BindActionToMouseButtons(PlayClicked, eInputButtons.Left);

            this.AddMenuItem(playersCountMenuItem);
            this.AddMenuItem(screenSettingsMenuItem);
            this.AddMenuItem(soundSettingsMenuItem);
            this.AddMenuItem(playMenuItem);

            base.AddItems();
        }
示例#7
0
 public ListPageCollectionViewModel(ScreenSettings <ListFormSettingsDescriptor> screenSettings, IContextProvider contextProvider) : base(screenSettings)
 {
     itemBindings         = FormSettings.Bindings.Values.ToList();
     this.contextProvider = contextProvider;
     this.httpService     = contextProvider.HttpService;
     GetItems();
 }
示例#8
0
 protected SearchPageCollectionViewModelBase(ScreenSettings <SearchFormSettingsDescriptor> screenSettings)
 {
     FormSettings      = screenSettings.Settings;
     Buttons           = new ObservableCollection <CommandButtonDescriptor>(screenSettings.CommandButtons);
     FilterPlaceholder = this.FormSettings.FilterPlaceholder;
     Title             = this.FormSettings.Title;
 }
示例#9
0
 public Exception(ScreenSettings <ExceptionView> screenSettings, double transitionOffset)
 {
     this.InitializeComponent();
     this.TransitionOffset = transitionOffset;
     ScreenSettings        = screenSettings;
     Message = this.ScreenSettings.Settings.Message;
 }
 public Message(ScreenSettings <MessageTemplateView> screenSettings, UiNotificationService uiNitificationService, double transitionOffset)
 {
     this.InitializeComponent();
     this.TransitionOffset      = transitionOffset;
     this.screenSettings        = screenSettings;
     this.uiNitificationService = uiNitificationService;
 }
        private EditFormEntityViewModelBase CreateEditFormViewModel(ScreenSettings <EditFormSettingsDescriptor> screenSettings)
        {
            return((EditFormEntityViewModelBase)Activator.CreateInstance
                   (
                       typeof(EditFormEntityViewModel <>).MakeGenericType
                       (
                           Type.GetType
                           (
                               screenSettings.Settings.ModelType,
                               AssemblyResolver,
                               TypeResolver
                           )
                       ),
                       new object[]
            {
                screenSettings,
                App.ServiceProvider.GetRequiredService <UiNotificationService>(),
                App.ServiceProvider.GetRequiredService <IMapper>(),
                App.ServiceProvider.GetRequiredService <IHttpService>()
            }
                   ));

            Type TypeResolver(Assembly assembly, string typeName, bool matchCase)
            => assembly.GetType(typeName);

            Assembly AssemblyResolver(AssemblyName assemblyName)
            => typeof(Domain.BaseModelClass).Assembly;
        }
示例#12
0
    static void Init()
    {
        // Get existing open window or if none, make a new one:
        ScreenSettings window = (ScreenSettings)EditorWindow.GetWindow(typeof(ScreenSettings));

        window.Show();
    }
示例#13
0
        public Dictionary <string, TScreen> LoadWorkspace(Stream stream)
        {
            var result = new Dictionary <string, TScreen>();
            var memory = new MemoryStreamNoDispose();
            var count  = memory.ReadInt32(stream);

            for (var i = 0; i < count; i++)
            {
                memory.Fetch(stream);
                var settings = ScreenSettings.Deserialize(memory);

                memory.Fetch(stream);
                var screen = CreateScreenHost(
                    Type.GetType(settings.Type),
                    settings.Name,
                    s => s.DeserializeParameter(memory),
                    settings.IsPopup,
                    settings.ToPopupAttribute());

                if (settings.IsPopup)
                {
                    screen.Show(true);
                }
                else
                {
                    result[settings.PersistenceId] = screen.CreateScreen();
                }
            }

            return(result);
        }
 //Function called on Initialization
 private void Awake()
 {
     //If there isn't already a static reference to this manager, this instance becomes the static reference
     if (screenManagerRef == null)
     {
         screenManagerRef = GetComponent <ScreenSettings>();
     }
 }
 protected EditFormEntityViewModelBase(ScreenSettings <EditFormSettingsDescriptor> screenSettings, UiNotificationService uiNotificationService, IHttpService httpService, IMapper mapper)
 {
     this.UiNotificationService = uiNotificationService;
     FormSettings           = screenSettings.Settings;
     Buttons                = new ObservableCollection <CommandButtonDescriptor>(screenSettings.CommandButtons);
     fieldsCollectionHelper = new FieldsCollectionHelper(this.FormSettings, Properties, this.UiNotificationService, httpService, mapper);
     fieldsCollectionHelper.CreateFieldsCollection();
     propertyChangedSubscription = this.UiNotificationService.ValueChanged.Subscribe(FieldChanged);
 }
示例#16
0
 public FlowComplete(ScreenSettings <FlowCompleteView> screenSettings, UiNotificationService uiNotificationService, double transitionOffset)
 {
     this.InitializeComponent();
     this.screenSettings        = screenSettings;
     this.uiNotificationService = uiNotificationService;
     this.voiceInformation      = Helpers.GetVoice(this.uiNotificationService.SelectedVoice);
     this.uiNotificationService.ExitCalledFromMain.Subscribe(ExitCalled);
     this.TransitionOffset = transitionOffset;
     this.Loaded          += FlowComplete_Loaded;
 }
示例#17
0
    void Start()
    {
        settings  = new ScreenSettings(Screen.width, Screen.height);
        generator = FindObjectOfType <WordGenerator>();
        generator.LoadWords();

        InitUI();
        LoadColors();

        Debug.Log(settings.LeftBorder * settings.PixelToUnitScale);
    }
    void OnSelectionChange()
    {
        var treeAsset = Selection.activeObject as ScreenSettings;

        if (treeAsset != null && treeAsset != settings)
        {
            settings = treeAsset;
            InitTreeView();
            Repaint();
        }
    }
示例#19
0
 public SearchPageCollectionViewModel(ScreenSettings <SearchFormSettingsDescriptor> screenSettings, IContextProvider contextProvider)
     : base(screenSettings)
 {
     itemBindings               = FormSettings.Bindings.Values.ToList();
     this.contextProvider       = contextProvider;
     this.uiNotificationService = contextProvider.UiNotificationService;
     this.getItemFilterBuilder  = contextProvider.GetItemFilterBuilder;
     this.httpService           = contextProvider.HttpService;
     this.searchSelectorBuilder = contextProvider.SearchSelectorBuilder;
     defaultSkip = FormSettings.SortCollection.Skip;
     GetItems();
 }
        private void ReplaceScreenSettingsTextPlaceholders(ScreenSettings settingsValue)
        {
            var placeholders = placeholderReplacingFuncs.Keys;

            foreach (var placeholder in placeholders)
            {
                var replacement = placeholderReplacingFuncs[placeholder]();

                settingsValue.Header      = settingsValue.Header.Replace(placeholder, replacement);
                settingsValue.Description = settingsValue.Description.Replace(placeholder, replacement);
            }
        }
        private void SetSelectedButton(ScreenSettings <MessageTemplateView> screenSettings)
        {
            if (string.IsNullOrEmpty(screenSettings.Settings.Selection))
            {
                return;
            }

            foreach (CommandButtonView button in screenSettings.CommandButtons)
            {
                button.IsSelected = button.ShortString == screenSettings.Settings.Selection;
            }
        }
示例#22
0
 public InputForm(ScreenSettings <InputFormView> screenSettings, UiNotificationService uiNitificationService, double transitionOffset)
 {
     this.InitializeComponent();
     this.TransitionOffset = transitionOffset;
     this.ScreenSettings   = screenSettings;
     Buttons = new ObservableCollection <CommandButtonView>(this.ScreenSettings.CommandButtons);
     this.RecognitionResults    = GetRecognitionResults(this.ScreenSettings.Settings.GetAllQuestions().First());
     this.UiNotificationService = uiNitificationService;
     this.voiceInformation      = Helpers.GetVoice(this.UiNotificationService.SelectedVoice);
     this.UiNotificationService.ExitCalledFromMain.Subscribe(ExitCalled);
     this.Loaded += InputForm_Loaded;
 }
 public SelectButton(ScreenSettings <MessageTemplateView> screenSettings, UiNotificationService uiNitificationService, double transitionOffset, ScrollViewer svDialog)
 {
     this.InitializeComponent();
     this.TransitionOffset = transitionOffset;
     this.svDialog         = svDialog;
     SetSelectedButton(screenSettings);
     this.ScreenSettings        = screenSettings;
     this.Buttons               = new ObservableCollection <CommandButtonView>(this.ScreenSettings.CommandButtons);
     this.RecognitionResults    = this.Buttons.ToDictionary(b => b.LongString);
     this.UiNotificationService = uiNitificationService;
     this.voiceInformation      = Helpers.GetVoice(this.UiNotificationService.SelectedVoice);
     this.UiNotificationService.ExitCalledFromMain.Subscribe(ExitCalled);
     this.Loaded += SelectButton_Loaded;
 }
示例#24
0
        public static void Main(string[] args)
        {
            Console.Write("How many should I make? ");
            FireflyWorld.FireflyCount = int.Parse(Console.ReadLine());

            var settings = new ScreenSettings {
                UseOpenTKLoop = true
            };

            //settings.Fullscreen = true;
            //settings.WindowSize = new System.Drawing.Rectangle(0, 0, 1920, 1080);

            Screen.DisplayScreenAsync(settings);

            wplayer.URL             = "bg.mp3";
            wplayer.settings.volume = 100;
            wplayer.controls.play();
            wplayer.settings.setMode("loop", true);

            var world  = new FireflyWorld();
            var world2 = new FireflyWorld();

            world.Load();
            world2.Load();
            world.Camera.Z = world2.Camera.Z = 200;
            world.Camera.X = world2.Camera.X = -(24 * 16f);
            world.Camera.Y = world2.Camera.Y = 18 * 16f;

            GlobalSettings.EngineSettings.ShowConsole = true;

            world.AmbientBrightness  = 0.1f;
            world2.AmbientBrightness = 0.1f;

            world.Display();

            while (true)
            {
                Thread.Sleep(10000);
                if (world.Displaying)
                {
                    world2.Display();
                }
                else
                {
                    world.Display();
                }
            }
        }
 public EditFormEntityViewModel(ScreenSettings <EditFormSettingsDescriptor> screenSettings, UiNotificationService uiNotificationService, IMapper mapper, IHttpService httpService)
     : base(screenSettings, uiNotificationService, httpService, mapper)
 {
     this.validateIfManager = new ValidateIfManager <TModel>
                              (
         Properties,
         fieldsCollectionHelper.GetConditionalValidationConditions <TModel>
         (
             FormSettings.ConditionalDirectives,
             Properties,
             mapper
         ),
         mapper,
         this.UiNotificationService
                              );
 }
示例#26
0
    public void CreateManualSettings()
    {
        var key  = ManualSettingsController.inst.keyForPlayerPrefs;
        var json = PlayerPrefs.GetString(key, "{}");
        var sS1  = JsonUtility.FromJson <ManualInputScreenSettings>(json);

        if (sS1 != null)
        {
            sS = sS1;
        }
        if (sS == null)
        {
            sS = ScreenSettingsFactory.GetSettings("manual");
        }

        ManualSettingsController.inst.BindingTextAndPrefabs();
    }
示例#27
0
        protected override void _Initialize()
        {
            var resolutions = new List <string>();

            for (int i = 0; i < Screen.resolutions.Length; i++)
            {
                var resString = ScreenSettings.ResolutionToString(Screen.resolutions[i]);
                if (!resolutions.Contains(resString))
                {
                    resolutions.Add(resString);
                }
            }

            _dropdown.ClearOptions();
            _dropdown.AddOptions(resolutions);
            _dropdown.onValueChanged.AddListener(OnValueChanged);
        }
示例#28
0
        public void SaveWorkspace(Stream stream)
        {
            var screens = _screens.Values.ToList();
            var memory  = new MemoryStreamNoDispose();

            stream.Write(screens.Count);
            foreach (var screen in screens)
            {
                var settings = screen.GetWorkspaceSettings();

                ScreenSettings.Serialize(memory, settings);
                memory.Commit(stream);

                screen.SerializeParameter(memory);
                memory.Commit(stream);
            }
        }
        public DetailFormEntityViewModel(ScreenSettings <DataFormSettingsDescriptor> screenSettings, IContextProvider contextProvider)
            : base(screenSettings, contextProvider)
        {
            FormLayout                 = contextProvider.ReadOnlyFieldsCollectionBuilder.CreateFieldsCollection(this.FormSettings, typeof(TModel));
            this.httpService           = contextProvider.HttpService;
            this.propertiesUpdater     = contextProvider.ReadOnlyPropertiesUpdater;
            this.uiNotificationService = contextProvider.UiNotificationService;
            this.getItemFilterBuilder  = contextProvider.GetItemFilterBuilder;

            this.directiveManagers = new ReadOnlyDirectiveManagers <TModel>
                                     (
                FormLayout.Properties,
                FormSettings,
                contextProvider
                                     );

            GetEntity();
        }
        private IEnumerator Start()
        {
            loaded = false;
            while (!TextureManager.instance.isLoaded || !AudioManager.instance.isLoaded)
            {
                yield return(null);
            }
            ScreenSettings[] screenSettingsArray = ApplicationManager.instance.menuSettings.pageSettings;

            _menuBar.Show();
            _pages = new IHideable[screenSettingsArray.Length];
            for (int i = 0; i < screenSettingsArray.Length; i++)
            {
                ScreenSettings screenSettings = screenSettingsArray[i];
                switch (screenSettings.GetScreenType())
                {
                case ScreenSettings.ScreenType.ContentPage:
                    _pages[i] = InitContentPage((ContentPageSettings)screenSettings);
                    break;

                case ScreenSettings.ScreenType.TextOnly:
                    _pages[i] = InitTextOnlyPage((TextOnlyPageSettings)screenSettings);
                    break;

                case ScreenSettings.ScreenType.PlayerMode:
                    _pages[i] = InitChoosePlayerPage((PlayerModeSettings)screenSettings);
                    break;

                case ScreenSettings.ScreenType.CatchScreen:
                    _pages[i] = InitCatchScreenPage((CatchScreenSettings)screenSettings);
                    break;

                case ScreenSettings.ScreenType.Survey:
                    _pages[i] = InitSurveyPage((SurveyPageSettings)screenSettings);
                    break;
                }
            }
            _currentPage = _pages[0];
            _currentPage.Show();
            loaded = true;
        }
示例#31
0
        // *** This subroutine will eventually change screen sizes ***
        public static void OnScreenSizeChanged(Size sz)
        {
            //obj.ClientSize = New System.Drawing.Size(obj.clientarea.cx, obj.clientarea.cy)
            //crashes badly
            //http://www.riemers.net/eng/Tutorials/DirectX/Csharp/ShortTuts/lost_device.php
            ScreenSettings newSettings = new ScreenSettings();

            newSettings.Width = sz.Width;
            newSettings.Height = sz.Height;

            OuterSpace.ClientArea = newSettings;

            // need to change size of window too
        }