Exemplo n.º 1
0
        // Select Theme
        private void SelectTheme(Theme theme)
        {
            SharedClasses.Instance().AppClass.ChangeColours(theme.ThemeIndex);
            SharedClasses.Instance().AppClass.SavePref <int>("ThemeIndex", theme.ThemeIndex);

            _prevoiusTheme = theme;
        }
Exemplo n.º 2
0
 /// <summary> Share a class with other clients to use for remote code execution </summary>
 /// <param name="ClassType">The Class object to share with others</param>
 /// <param name="RemoteInitialize">False: The class will be initialized locally using the "ClassArgs" objects,
 ///                                True: The remote client will give the ClassArgs to use for initializing the object and will ignore the local argument objects</param>
 /// <param name="ClassArgs">The objects to initialize the class with</param>
 /// <param name="MaxInitializations">The maximum count that the class can be shared </param>
 public void ShareClass(Type ClassType, bool RemoteInitialize = false, int MaxInitializations = 100, params object[] ClassArgs)
 {
     lock (SharedClasses)
     {
         if (SharedClasses.ContainsKey(ClassType.Name))
         {
             throw new Exception("A class with this name is already shared");
         }
         SharedClasses.Add(ClassType.Name, new SharedClass(ClassType.Name, ClassType, this, RemoteInitialize, MaxInitializations, ClassArgs));
     }
 }
Exemplo n.º 3
0
        public SettingsView()
        {
            AppClass = SharedClasses.Instance().AppClass;

            InitializeComponent();

            NavigationPage.SetHasNavigationBar(this, false);

            ThemeGrid.Children.Add(GenerateThemeList(ReturnThemeColours()), 1, 0);

            _themeList.ScrollTo(ReturnThemeColours()[PlayerPreferences.Instance().ThemeIndex], ScrollToPosition.Start, false);
        }
Exemplo n.º 4
0
        public App()
        {
            InitializeComponent();

            var gameController = new MainController();

            SharedClasses.Instance().AppClass = this;

            // Set up Colours
            PlayerPreferences.Instance().Load();
            Colours.Instance().CompileThemeList();
            Colours.Instance().SetThemeColours(PlayerPreferences.Instance().ThemeIndex);
            ChangeColours(PlayerPreferences.Instance().ThemeIndex);

            //MainPage = new CrosswordView();
            //MainPage = new SettingsView();
            MainPage = new NavigationPage(new HomeView());
        }
        private string GetCommandUri(List<SharedClasses.AutomationContext> context, string location, string service, SharedClasses.PowerCommand command)
        {
           // var thislocation = context.Find(n => n.Location.Name.ToLower() == location.ToLower());

            var test = context.FirstOrDefault(n => n.Name.ToLower() == service && n.Location.ToLower() == location && n.control.powercommand == command);
            if (test != null)
            {
                return test.control.commandURI;
            }
            else
                return string.Empty;
        }