예제 #1
0
        public static void StartAndroidActivity(
            string package,
            string intent   = null,
            string dataType = null,
            string dataUri  = null
            )
        {
            List <string> arguments = new List <string> {
                package
            };

            if (intent != null)
            {
                arguments.Add(intent);
            }
            if (dataType != null)
            {
                arguments.Add(dataType);
            }
            if (dataType != null)
            {
                arguments.Add(dataType);
            }

            PythonInterop.CallBuiltin("StartAndroidActivity", arguments);
        }
예제 #2
0
        /// <summary>
        /// Runs the python script.
        /// You must specify the full path to the script.
        /// As of 2007/02/24, all extra parameters are passed to the script as arguments and can be accessed by python using sys.argv
        /// </summary>
        /// <param name="script"> the URL to the python script. </param>
        /// <param name="args"></param>
        public static void RunScript(string script, params object[] args)
        {
            object[] builtinArgs = new object[args.Length + 1];
            builtinArgs[0] = script;
            Array.Copy(args, 0, builtinArgs, 1, args.Length);

            PythonInterop.CallBuiltin("RunScript", script, args);
        }
예제 #3
0
        /// <summary>
        /// Executes the specified script given its addon-id
        /// </summary>
        /// <param name="addonId">the addon-ID to the script add-on</param>
        /// <param name="args"></param>
        public static void RunScript(int addonId, params object[] args)
        {
            object[] builtinArgs = new object[args.Length + 1];
            builtinArgs[0] = addonId;
            Array.Copy(args, 0, builtinArgs, 1, args.Length);

            PythonInterop.CallBuiltin("RunScript", addonId, args);
        }
예제 #4
0
 public static void StartAndroidActivity(
     string package,
     string intent   = null,
     string dataType = null,
     string dataUri  = null
     )
 {
     PythonInterop.CallBuiltin("StartAndroidActivity", package, intent, dataType, dataUri);
 }
예제 #5
0
파일: Skin.cs 프로젝트: mediabuff/KodiSharp
        /// <summary>
        /// Pops up a keyboard dialog and allows the user to input a string which can be used in a label control elsewhere in the skin
        /// via the info tag Skin.String(string)
        /// </summary>
        /// <param name="value">If specified the keyboard dialog does not pop up and the string is set directly.</param>
        public static void SetString(string setting, object value = null)
        {
            List <object> arguments = new List <object> {
                setting
            };

            if (value != null)
            {
                arguments.Add(value);
            }
            PythonInterop.CallBuiltin("Skin.SetString", arguments);
        }
예제 #6
0
파일: Skin.cs 프로젝트: mediabuff/KodiSharp
        /// <summary>
        ///	Pops up a keyboard dialog and allows the user to input a numerical.
        /// </summary>
        /// <param name="value">If specified the keyboard dialog does not pop up and the numeric value is set directly.</param>
        public static void SetNumeric(object number, object value)
        {
            List <object> arguments = new List <object> {
                number
            };

            if (value != null)
            {
                arguments.Add(value);
            }
            PythonInterop.CallBuiltin("Skin.SetNumeric", arguments);
        }
예제 #7
0
파일: Skin.cs 프로젝트: mediabuff/KodiSharp
        /// <summary>
        /// Pops up a folder browser and allows the user to select a folder of images to be used in a multi image control else where in the skin
        /// via the info tag Skin.String(string).
        /// </summary>
        /// <param name="folderpath">If specified the file browser will start in that folder</param>
        public static void SetPath(string setting, string folderpath = null)
        {
            List <string> arguments = new List <string> {
                setting
            };

            if (folderpath != null)
            {
                arguments.Add(folderpath);
            }

            PythonInterop.CallBuiltin("Skin.SetPath", arguments);
        }
예제 #8
0
        /// <summary>
        /// Takes a Screenshot. Only .png files are supported
        /// </summary>
        /// <param name="filenameAndPath">filename (including the path)</param>
        /// <param name="sync">whether to run synchronously</param>
        public static void TakeScreenshot(string filenameAndPath = null, bool?sync = null)
        {
            List <object> arguments = new List <object>();

            if (filenameAndPath != null)
            {
                arguments.Add(filenameAndPath);
            }
            if (sync != null)
            {
                arguments.Add(sync);
            }

            PythonInterop.CallBuiltin("TakeScreenshot", arguments);
        }
예제 #9
0
파일: Skin.cs 프로젝트: mediabuff/KodiSharp
        /// <summary>
        /// Pops up a file browser and allows the user to select an image file to be used in an image control elsewhere in the skin
        /// via the info tag Skin.String(string).
        /// </summary>
        /// <param name="value">If specified the keyboard dialog does not pop up and the image path is set directly.</param>
        /// <param name="folderpath">If specified the file browser will start in that folder</param>
        public static void SetImage(string setting, object value = null, string folderpath = null)
        {
            List <object> arguments = new List <object> {
                setting
            };

            if (value != null)
            {
                arguments.Add(value);
            }
            if (folderpath != null)
            {
                arguments.Add(folderpath);
            }

            PythonInterop.CallBuiltin("Skin.SetImage", arguments);
        }
예제 #10
0
        /// <summary>
        /// Will display a notification dialog with the specified header and message
        /// </summary>
        /// <param name="header"></param>
        /// <param name="message"></param>
        /// <param name="duration">length of time in milliseconds</param>
        /// <param name="iconPath">icon image</param>
        public static void Notification(string header = "", string message = "", TimeSpan?duration = null, string iconPath = null)
        {
            List <string> arguments = new List <string> {
                header, message
            };

            if (duration != null)
            {
                arguments.Add(duration.Value.TotalMilliseconds.ToString());
            }
            if (iconPath != null)
            {
                arguments.Add(iconPath);
            }

            PythonInterop.CallBuiltin("Notification", arguments);
        }
예제 #11
0
 /// <summary>
 /// Send a page down event to the pagecontrol with given id.
 /// </summary>
 public static void PageDown()
 {
     PythonInterop.CallBuiltin("PageDown");
 }
예제 #12
0
 /// <summary>
 /// Minimizes Kodi
 /// </summary>
 public static void Minimize()
 {
     PythonInterop.CallBuiltin("Minimize");
 }
예제 #13
0
 /// <summary>
 /// Triggers a scan of local add-on directories.
 /// </summary>
 public static void UpdateLocalAddons()
 {
     PythonInterop.CallBuiltin("UpdateLocalAddons");
 }
예제 #14
0
 /// <summary>
 /// Runs the specified plugin/script
 /// </summary>
 /// <param name="id"></param>
 public static void RunAddon(int id)
 {
     PythonInterop.CallBuiltin("RunAddon", new List <object> {
         id
     });
 }
예제 #15
0
 /// <summary>
 /// Force weather data refresh
 /// </summary>
 public static void Refresh()
 {
     PythonInterop.CallBuiltin("Weather.Refresh");
 }
예제 #16
0
 /// <summary>
 /// Switch to previous weather location
 /// </summary>
 public static void LocationPrevious()
 {
     PythonInterop.CallBuiltin("Weather.LocationPrevious");
 }
예제 #17
0
 /// <summary>
 /// Reload RSS feeds from RSSFeeds.xml
 /// </summary>
 public static void RefreshRSS()
 {
     PythonInterop.CallBuiltin("RefreshRSS");
 }
예제 #18
0
 /// <summary>
 ///	Send a page up event to the pagecontrol with given id.
 /// </summary>
 public static void PageUp()
 {
     PythonInterop.CallBuiltin("PageUp");
 }
예제 #19
0
 /// <summary>
 /// Will play the inserted CD or DVD media from the DVD-ROM drive.
 /// </summary>
 public static void PlayDVD()
 {
     PythonInterop.CallBuiltin("PlayDVD");
 }
예제 #20
0
 /// <summary>
 /// Sets the volume to the percentage specified. Optionally, show the Volume Dialog in Kodi when setting the volume.
 /// </summary>
 /// <param name="percent">Volume level</param>
 /// <param name="showVolumeBar">Show the volume bar</param>
 public static void SetVolume(int percent, bool showVolumeBar = false)
 {
     PythonInterop.CallBuiltin("SetVolume", percent, (showVolumeBar) ? "showVolumeBar" : null);
 }
예제 #21
0
 public static void Seek(TimeSpan position)
 {
     PythonInterop.CallBuiltin("Seek", position.TotalSeconds);
 }
예제 #22
0
 /// <summary>
 /// Toggle DPMS mode manually
 /// </summary>
 public static void ToggleDPMS()
 {
     PythonInterop.CallBuiltin("ToggleDPMS");
 }
예제 #23
0
 /// <summary>
 /// Switch to given weather location
 /// </summary>
 /// <param name="locationIndex">A number between 1 and 3</param>
 public static void LocationSet(int locationIndex)
 {
     PythonInterop.CallBuiltin("Weather.LocationSet", locationIndex);
 }
예제 #24
0
 public static void Seek(TimeSpan position)
 {
     PythonInterop.CallBuiltin("Seek", new List <object> {
         position.TotalSeconds
     });
 }
예제 #25
0
 /// <summary>
 /// Switch to next weather location
 /// </summary>
 public static void LocationNext()
 {
     PythonInterop.CallBuiltin("Weather.LocationNext");
 }
예제 #26
0
 /// <summary>
 /// Restarts Kodi (only implemented under Windows and Linux)
 /// </summary>
 public static void RestartApp()
 {
     PythonInterop.CallBuiltin("RestartApp");
 }
예제 #27
0
 /// <summary>
 /// Open a settings dialog for the addon of the given id
 /// </summary>
 /// <param name="id"></param>
 public static void OpenSettings(int id)
 {
     PythonInterop.CallBuiltin("Addon.OpenSettings", new List <object> {
         id
     });
 }
예제 #28
0
 /// <summary>
 /// Quits Kodi
 /// </summary>
 public static void Quit()
 {
     PythonInterop.CallBuiltin("Quit");
 }
예제 #29
0
 /// <summary>
 /// Triggers a forced update of enabled add-on repositories.
 /// </summary>
 public static void UpdateAddonRepos()
 {
     PythonInterop.CallBuiltin("UpdateAddonRepos");
 }
예제 #30
0
 /// <summary>
 ///	Mutes (or unmutes) the volume.
 /// </summary>
 public static void Mute()
 {
     PythonInterop.CallBuiltin("Mute");
 }