示例#1
0
        public ShellPresenter(IBackingStore backingStore, IWorkspacePresenter workspacePresenter)
        {
            _backingStore = backingStore;

            Screens.Add(workspacePresenter);
            Workspace = workspacePresenter;
        }
示例#2
0
        private void NewScreen()
        {
            var newScreen = new Screen();

            newScreen.Id = 1;
            if (Screens.Any())
            {
                newScreen.Id = Screens.Max(x => x.Id) + 1;
            }

            Screens.Add(newScreen);
            _currentScreen = newScreen;
            var newScreenListItem = new ListBoxItem
            {
                Tag     = newScreen.Id,
                Content = newScreen.Id + " - Screen"
            };

            listScreens.Items.Add(newScreenListItem);
            foreach (ListBoxItem item in listScreens.Items)
            {
                var tag = (int)item.Tag;
                if (tag == newScreen.Id)
                {
                    listScreens.SelectedItem = item;
                }
            }

            LoadSelectedScreen();
            NewOption();
        }
示例#3
0
        public Screen AddScreen(string name, bool useAdvanced, Geometry geometry)
        {
            var screen = new Screen(this, name, useAdvanced, geometry);

            Screens.Add(screen);
            return(screen);
        }
示例#4
0
        private void PopulateElementSavesFromReferences(string projectRootDirectory, out string errors)
        {
            errors = "";

            Screens.Clear();
            Components.Clear();
            StandardElements.Clear();

            foreach (ElementReference reference in ScreenReferences)
            {
                ScreenSave toAdd = null;
                try
                {
                    toAdd = reference.ToElementSave <ScreenSave>(projectRootDirectory, ScreenExtension, ref errors);
                }
                catch (Exception e)
                {
                    errors += "\nError loading " + reference.Name + ":\n" + e.Message;
                }
                if (toAdd != null)
                {
                    Screens.Add(toAdd);
                }
            }

            foreach (ElementReference reference in ComponentReferences)
            {
                ComponentSave toAdd = null;

                try
                {
                    toAdd = reference.ToElementSave <ComponentSave>(projectRootDirectory, ComponentExtension, ref errors);
                }
                catch (Exception e)
                {
                    errors += "\nError loading " + reference.Name + ":\n" + e.Message;
                }
                if (toAdd != null)
                {
                    Components.Add(toAdd);
                }
            }

            foreach (ElementReference reference in StandardElementReferences)
            {
                StandardElementSave toAdd = null;
                try
                {
                    toAdd = reference.ToElementSave <StandardElementSave>(projectRootDirectory, StandardExtension, ref errors);
                }
                catch (Exception e)
                {
                    errors += "\nError loading " + reference.Name + ":\n" + e.Message;
                }
                if (toAdd != null)
                {
                    StandardElements.Add(toAdd);
                }
            }
        }
示例#5
0
        public override void FillEntries()
        {
            var opening = TagType.Opening;

            for (var i = 0; i < Markdown.Length; i++)
            {
                if (Markdown[i] != '`')
                {
                    continue;
                }
                //check for screened quotes
                if (i >= 1 && Markdown[i - 1] == '\\')
                {
                    Screens.Add(i - 1);
                    continue;
                }
                Entries.Add(i, opening);
                opening = opening.Invert();
            }
            if (Entries.Count % 2 != 0)
            {
                Entries.Remove(Entries.Keys.Max());
            }
            if (!insideTagsScreened)
            {
                ScreenInsideTags();
            }
        }
示例#6
0
        public override void FillEntries()
        {
            var opening = TagType.Opening;

            for (var i = 0; i < Markdown.Length; i += 1)
            {
                if (i + 2 < Markdown.Length &&
                    Markdown[i] == '\\' &&
                    Markdown[i + 1] == '_' &&
                    Markdown[i + 2] == '_')
                {
                    Screens.Add(i);
                    i += 2;
                    continue;
                }
                if (i + 1 >= Markdown.Length || Markdown[i] != '_' || Markdown[i + 1] != '_')
                {
                    continue;
                }
                if (Entries.Count != 0 && Entries.Keys.Max() + 2 == i)
                {
                    Entries.Add(i, opening.Invert());
                    i += 1;
                    continue;
                }
                Entries.Add(i, opening);
                opening = opening.Invert();
                i      += 1;
            }
            if (Entries.Count % 2 != 0)
            {
                Entries.Remove(Entries.Keys.Max());
            }
            CheckForDoubleUnderscoresInsideSingle();
        }
示例#7
0
        public override void Update(GameTime gameTime)
        {
            base.Update(gameTime);

            MusicManager.Update();

            GameMouse.Update(gameTime);
            Camera.Update(gameTime);

            foreach (BaseScreen screen in ScreensToAdd)
            {
                Screens.Add(screen);
            }

            ScreensToAdd.Clear();

            foreach (BaseScreen screen in Screens)
            {
                // Update before handling input - otherwise if we select something the WhileSelected method will be called straightaway, which is usually undesired
                if (screen.Active)
                {
                    screen.Update(gameTime);
                }
            }

            foreach (BaseScreen screen in ScreensToRemove)
            {
                Screens.Remove(screen);
            }

            ScreensToRemove.Clear();
        }
        protected override void setup()
        {
            _locator = MockRepository.GenerateMock <IScreenLocator>();

            // Let's say we have a ScreenCollection with open screens
            otherActiveScreen1 = MockRepository.GenerateMock <IScreen>();
            otherActiveScreen2 = MockRepository.GenerateMock <IScreen>();
            theActiveScreen    = MockRepository.GenerateMock <IScreen>();

            Screens.Active = theActiveScreen;
            Screens.Add(otherActiveScreen1);
            Screens.Add(otherActiveScreen2);
            Screens.Add(theActiveScreen);

            // and the requested ScreenSubject does not match any of the screens
            _locator.Expect(x => x.Matches(otherActiveScreen1)).Return(false);
            _locator.Expect(x => x.Matches(otherActiveScreen2)).Return(false);
            _locator.Expect(x => x.Matches(theActiveScreen)).Return(false);

            factory = MockFor <IScreenFactory>();

            newScreen = MockRepository.GenerateMock <IScreen>();
            _locator.Expect(x => x.CreateScreen(factory)).Return(newScreen);


            TheScreenConductor.OpenScreen(_locator);
        }
示例#9
0
        public LD35Game()
            : base("Space Junk", 960, 640, Styles.Titlebar | Styles.Close)
        {
            View view = RenderWindow.GetView();

            view.Center = new Vector2f(RenderWindow.Size.X * 0.5f / scale, RenderWindow.Size.Y * 0.5f / scale);
            view.Size   = new Vector2f(RenderWindow.Size.X / scale, RenderWindow.Size.Y / scale);
            RenderWindow.SetView(view);

            renderTexture = new RenderTexture((uint)(Window.Size.X / scale), (uint)(Window.Size.Y / scale));

            Buttons.Add("force_exit", new KeyboardButton(Keyboard.Key.Escape));
            Buttons.Add("1", new KeyboardButton(Keyboard.Key.Num1));
            Buttons.Add("2", new KeyboardButton(Keyboard.Key.Num2));
            Buttons.Add("3", new KeyboardButton(Keyboard.Key.Num3));
            Buttons.Add("4", new KeyboardButton(Keyboard.Key.Num4));
            Buttons.Add("pause", new KeyboardButton(Keyboard.Key.LShift));
            Buttons.Add("left_click", new MouseButton(Mouse.Button.Left));
            Buttons.Add("confirm", new KeyboardButton(Keyboard.Key.Return));
            Buttons.Add("restart", new KeyboardButton(Keyboard.Key.Space));

            Screens.Add(new MenuScreen(this));

            background       = new Sprite(Textures.Load("Data/Textures/palette.png"), new IntRect(0, 0, 1, 1));
            background.Scale = new Vector2f(RenderTarget.Size.X, RenderTarget.Size.Y);
        }
示例#10
0
 public ScreenViewModel AddScreen()
 {
   Screen sc = new Screen(_well.Intakes.First());
   sc.Number = _well.Intakes.Max(var1 => var1.Screens.Max(var => var.Number)) + 1;
   ScreenViewModel svm = new ScreenViewModel(sc, CVM);
   Screens.Add(svm);
   return svm;
 }
        /// <summary>
        /// Добавляет новый экран в эксперимент и выделяет его
        /// </summary>
        public static void AddScreen()
        {
            var screen = new Screen();

            Screens.Add(screen);
            _chosenScreen = screen;
            DrawField();
        }
示例#12
0
文件: Game1.cs 项目: ARLM-Attic/neat
        public override void AddScreens()
        {
            base.AddScreens();
            Screens["mainmenu"] = new StartScreen(this);
#if DEBUG
            Screens.Add("cr", new CollisionResolution(this));
#endif
        }
示例#13
0
        public static void AddScreen(string key, Screen screen)
        {
            Screens.Add(key, screen);

            if (Screens.Count == 1)
            {
                CurrentScreen = screen;
            }
        }
示例#14
0
 void ScreensAdded(Direction direction, VirtualScreen screen)
 {
     if (!Screens.TryGetValue(screen.Client, out Model.DeviceScreens deviceScreens))
     {
         deviceScreens = new Model.DeviceScreens(screen.Client);
         Screens.Add(screen.Client, deviceScreens);
     }
     deviceScreens.AddScreen(screen);
 }
示例#15
0
        public void Begin()
        {
            foreach (BaseScreen baseScreen in ScreensToAdd)
            {
                Screens.Add(baseScreen);
            }

            ScreensToAdd.Clear();
        }
示例#16
0
 /// <summary>
 /// Adds a screen to the game
 /// </summary>
 public void AddScreen(GameScreen screen)
 {
     if (screen != null)
     {
         screen.ScreenManager = this;
         screen.LoadContent();
         Screens.Add(screen);
     }
 }
示例#17
0
文件: Files.cs 项目: ARLM-Attic/neat
        public virtual void AddScreens()
        {
            Screens.Add("mainmenu", new EasyMenus.MainMenu(this));
            Screens.Add("quitconfirm", new EasyMenus.QuitConfirmationMenu(this));
            Screens.Add("optionsmenu", new EasyMenus.OptionsMenu(this));
            Screens.Add("ingamemenu", new EasyMenus.InGameMenu(this));

#if KINECT
            Screens["kinect"] = new CalibrateScreen(this);
#endif
        }
示例#18
0
        public void AddScreen(GameScreen screen)
        {
            screen.TankWars  = this;
            screen.IsExiting = false;

            if (IsInitialized)
            {
                screen.LoadContent();
            }

            Screens.Add(screen);
        }
示例#19
0
        public override void InitializeScreens()
        {
            this.ParentScreen.LeftPanelContainer.Hide();
            DMCC100 DMCC100 = new DMCC100();

            DMCC100.ScreenCode = "DMCC100";
            DMCC100.Module     = this;
            DMCC100.Height    -= 100;
            DMCC100.InitGridControl();
            Screens.Add(DMCC100);
            DMCC100.AddControlsToParentScreen();
        }
示例#20
0
        public void AddScreen(Screen screen)
        {
            screen.ScreenManager = this;
            screen.IsExiting     = false;
            bool isInitialized = Initialized;

            if (isInitialized)
            {
                screen.LoadContent();
            }
            Screens.Add(screen);
        }
示例#21
0
 public void AddScreen(string key, Screen screen)
 {
     if (Screens.ContainsKey(key))
     {
         if (Screens.TryGetValue(key, out var val))
         {
             val.Dispose();
         }
         Screens.Remove(key);
     }
     Screens.Add(key, screen);
 }
示例#22
0
        public List <Job> GetJobsWithScreens(int taskId)
        {
            List <Job> jobs    = new List <Job>();
            SqlCommand command = new SqlCommand("select j.id, StartDate, duration, Job_Description, s.ID, s.Screen from PrTa_Jobs j" +
                                                " left join Screenshots s on j.ID = s.Job_ID where Task_ID = " + taskId + " order by j.id", conn);

            using (SqlDataReader reader = command.ExecuteReader())
            {
                List <Screenshot> Screens = new List <Screenshot>();
                while (reader.Read())
                {
                    var          JobId       = reader.GetInt32(0);
                    var          StartDate   = reader.GetDateTime(1);
                    var          Duration    = reader.GetInt32(2);
                    var          Description = reader.IsDBNull(3) ? "" : reader.GetString(3);
                    int          ScrId       = reader.IsDBNull(4) ? 0 : reader.GetInt32(4);
                    BitmapSource bmpSource   = null;
                    Bitmap       image;
                    //var ScrId = reader.IsDBNull(4) ? 0 : reader.GetInt32(4);
                    byte[] outbyte = new byte[100];
                    if (reader.IsDBNull(5))
                    {
                        //Console.WriteLine("empty screen");
                    }
                    else
                    {
                        outbyte = (byte[])reader[5];
                        using (MemoryStream ms = new MemoryStream(outbyte))
                        {
                            image     = new Bitmap(ms);
                            bmpSource = ToWpfBitmap(image);
                        }
                    }

                    var job = jobs.Where(j => j.Id == JobId).FirstOrDefault();
                    if (job == null)
                    {
                        Screens = new List <Screenshot>();
                        if (ScrId != 0)
                        {
                            Screens.Add(new Screenshot(ScrId, bmpSource));
                        }
                        job = new Job(JobId, StartDate, Duration, Description, Screens);
                        jobs.Add(job);
                    }
                    else
                    {
                        Screens.Add(new Screenshot(ScrId, bmpSource));
                    }
                }
            }
            return(jobs);
        }
示例#23
0
        public static void RestartGame()
        {
            Screen screen;

            if (Screens.TryGetValue("Gameplay", out screen))
            {
                Screens.Remove("Gameplay");
            }
            screen                 = new GameplayScreen(true, Game);
            screen.Active          = true;
            Screens["Menu"].Active = false;
            Screens.Add("Gameplay", screen);
        }
示例#24
0
        public Screen CreateScreen(string name, int rows, int seatsPerRow)
        {
            if (string.IsNullOrEmpty(name))
            {
                throw new ArgumentNullException(nameof(name));
            }

            var screen = new Screen(this, name, rows, seatsPerRow);

            Screens.Add(screen);

            return(screen);
        }
示例#25
0
        public override void FillEntries()
        {
            var opening = TagType.Opening;

            for (var i = 0; i < Markdown.Length; i++)
            {
                if (Markdown[i] != '_')
                {
                    continue;
                }
                // check for double underscores
                if (i + 1 < Markdown.Length && Markdown[i + 1] == '_')
                {
                    i += 1;
                    continue;
                }
                // check for screened underscores
                if (i >= 1 && Markdown[i - 1] == '\\')
                {
                    Screens.Add(i - 1);
                    continue;
                }
                // check for space before closing underscore
                if (opening == TagType.Closing && Markdown[i - 1] == ' ')
                {
                    Entries.Remove(Entries.Keys.Max());
                    opening = TagType.Opening;
                }
                // check for space after opening underscore
                if (opening == TagType.Opening && i + 1 < Markdown.Length && Markdown[i + 1] == ' ')
                {
                    continue;
                }
                // check for numbers inside
                if (opening == TagType.Closing)
                {
                    var lastElement = Entries.Keys.Max();
                    if (Markdown.Substring(lastElement, i - lastElement).Any(char.IsDigit))
                    {
                        Entries.Remove(lastElement);
                        opening = TagType.Opening;
                    }
                }
                Entries.Add(i, opening);
                opening = opening.Invert();
            }
            if (Entries.Count % 2 != 0)
            {
                Entries.Remove(Entries.Keys.Max());
            }
        }
示例#26
0
        public static void Init()
        {
            var menuScreen  = new MenuSceen(true, Game);
            var debugScreen = new DebugScreen(true, Game);

            menuScreen.StartSinglePlayerGame += (sender, args) => StartSinglePlayerGame();
            menuScreen.EndGame += (sender, args) => QuitGame();
            var pauseScreen = new PauseScreen(false, Game);

            pauseScreen.MenuClick   += (sender, args) => MainMenu();
            pauseScreen.ResumeClick += (sender, args) => ResumeGame();
            Screens.Add("Menu", menuScreen);
            Screens.Add("Pause", pauseScreen);
            Screens.Add("Debug", debugScreen);
            //Screens.Add("Gameplay", gameplayScreen);
        }
示例#27
0
        public void ReloadElement(ElementSave element)
        {
            string projectRootDirectory = FileManager.GetDirectory(this.FullFileName);

            var gumLoadResult = new GumLoadResult();

            if (element is ScreenSave)
            {
                var matchingReference = ScreenReferences.FirstOrDefault(item => item.Name == element.Name);

                ScreenSave newScreen = matchingReference?.ToElementSave <ScreenSave>(
                    projectRootDirectory, GumProjectSave.ScreenExtension, gumLoadResult);

                if (newScreen != null)
                {
                    Screens.Remove(element as ScreenSave);
                    Screens.Add(newScreen);
                }
            }
            else if (element is ComponentSave)
            {
                var matchingReference = ComponentReferences.FirstOrDefault(item => item.Name == element.Name);

                ComponentSave newComonent = matchingReference?.ToElementSave <ComponentSave>(
                    projectRootDirectory, GumProjectSave.ComponentExtension, gumLoadResult);

                if (newComonent != null)
                {
                    Components.Remove(element as ComponentSave);
                    Components.Add(newComonent);
                }
            }
            else if (element is StandardElementSave)
            {
                var matchingReference = StandardElementReferences.FirstOrDefault(item => item.Name == element.Name);

                StandardElementSave newStandardElement = matchingReference?.ToElementSave <StandardElementSave>(
                    projectRootDirectory, GumProjectSave.ComponentExtension, gumLoadResult);

                if (newStandardElement != null)
                {
                    StandardElements.Remove(element as StandardElementSave);
                    StandardElements.Add(newStandardElement);
                }
            }
        }
示例#28
0
        private bool LoadScreens()
        {
            try
            {
                Screens.Clear();

                var screenFiles = packageFiles
                                  .Where(pf => pf.Name.IsMatch($"^{ScreenPackageFile.Path}/.+"));

                foreach (PackageFile file in screenFiles)
                {
                    string name   = Path.GetFileNameWithoutExtension(file.Name);
                    var    reader = new ObjectXmlReader(file.Stream);

                    object model = reader.ReadObject();

                    if (model is PContentPage page)
                    {
                        if (string.IsNullOrEmpty(name))
                        {
                            name = LayoutExtension.CreatePageName(page, "Screen");
                        }

                        // Name Setting
                        LayoutExtension.SetPageName(page, name);

                        Screens.Add(page);

                        CachingBinder(page.Binder);

                        foreach (var node in ObjectContentTreeHelper.FindContentChildrens <PVisual, PVisual>(page))
                        {
                            CachingBinder(node.Child.Binder);
                        }
                    }
                }

                return(true);
            }
            catch
            {
            }

            return(false);
        }
示例#29
0
        public bool ScreensAddOrDel(string img)
        {
            if (Screens == null)
            {
                Screens = new List <string>();
            }

            if (Screens.Contains(img))
            {
                Screens.Remove(img);
                return(false);
            }
            else
            {
                Screens.Add(img);
                return(true);
            }
        }
示例#30
0
        public T OpenScreen <T>() where T : ScreenBase
        {
            foreach (var _screen in Screens)
            {
                if (_screen.GetType() == typeof(T))
                {
                    ActiveScreen = _screen;
                    _screen.Opened();
                    return((T)_screen);
                }
            }

            var _outScreen = (T)Activator.CreateInstance(typeof(T));

            Screens.Add(_outScreen);
            ActiveScreen = _outScreen;
            _outScreen.Opened();

            return(_outScreen);
        }