Giter Site home page Giter Site logo

How do you use this wrapper? about wget.net HOT 4 CLOSED

maaa101 avatar maaa101 commented on May 27, 2024
How do you use this wrapper?

from wget.net.

Comments (4)

maaa101 avatar maaa101 commented on May 27, 2024 1

Thank you!

from wget.net.

basicx-StrgV avatar basicx-StrgV commented on May 27, 2024

Yes sorry, I haven't created proper documentation yet.


The namespace you need is WGetNET (using WGetNET;).
In this namespace you will find the three classes you can use to perform actions or get information with winget.

WinGetInfo:
The WinGetInfo class can be used to get information about winget itself.
If you want to check if winget is installed and what version is installed, this is the class you should use.

Checking if winget is installed could look like this:

WinGetInfo wingetInfo = new WinGetInfo();
if (wingetInfo.WinGetInstalled)
{
     Console.WriteLine("WinGet is installed.");
}
else
{
     Console.WriteLine("WinGet is NOT installed.");
}

WinGetPackageManager:
The WinGetPackageManager class is used for everything that has to do with packages.
If you want to install a package for example, you would use this class.

Ther code for installing a package could look like this:

WinGetPackageManager packageManager = new WinGetPackageManager();
packageManager.InstallPackage("Git.Git");

WinGetSourceManager:
The ‘WinGetPackageManager’ class is used for everything that has to do with sources.
If you want to add a source for example, you would use this class.

The code for adding a source could look like this:

WinGetSourceManager sourceManager = new WinGetSourceManager();
sourceManager.AddSource("msstore", "https://storeedgefd.dsx.mp.microsoft.com/v9.0", "Microsoft.Rest");

I hope this will help you getting started.
If you need any help with specific functions or if you have any other questions, I am happy to help.


I will try to add samples and documentation soon.

from wget.net.

maaa101 avatar maaa101 commented on May 27, 2024

Thanks for the quick reply, how do i search using this wrapper?

from wget.net.

basicx-StrgV avatar basicx-StrgV commented on May 27, 2024

Searching for packages can be done like this:

WinGetPackageManager packageManager = new WinGetPackageManager();
List<WinGetPackage> packages = packageManager.SearchPackage("Git");

from wget.net.

Related Issues (12)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.