View Sidebar

A Million Little Pieces Of My Mind

Organica: OrganicaLib

By: Paul S. Cilwa Viewed: 7/22/2024
Posted: 1/21/2022
Page Views: 863
Topics: #Organica #VisualBasic #VB.NET #ClassLibrary
Creating Organica's general toolkit.

Before one can start in earnest on a project as ambitious as Organica, one needs to have a robust operating system with high-level functions, such as pre-programmed libraries for playing and manipulating music files, showing and manipulating video files, as well as support for more basic text-based files. Windows plus Net 5.0 provides all this, and Visual Studio allows Visual Basic programmers access.

However, inevitably, it turns out that assorted classes in the understructure may just be missing a method that would make your coding so much simpler and clearer. Take, for example, the Fileinfo class. An object of that class can give you its FullName (pathname), its Name (the base name plus the Extension) and just the Extension. But for some odd reason, they omitted a BaseName property. Now, sure, you can derive the base name from the existing methods plus existing String methods. But if your code is going to need the base name a lot, you're soon gonna wish for an easier way to get it.

And that's where Class Extensions come in.

Now, because such basic tools are so, well, basic, it follows that they could be useful in many contexts other than Organic. So, by putting them in an independent DLL (Dynamic Link Library), we can make them available to any project we create.

Creating the Project

Start up Visual Studio. In the opening page, select Create a New Project and click Next.

You then must choose the project type. If you've never created one of these before, you'll have to locate Windows Forms Class Library on the right. If you have, you'll also find it on the left as, sinply, Class Library. Click Next

On the Configure Your New Project page, type in the name, "OrganicaLib", and, if neccessary, the folder in which you want your project to be stored. Click Next.

On the aAddition Information page, be sure that .NET 5.0 (or better) is select, then click Next.

That will create the project and open it for you. By default, its one component is Class1.vb and the default class name is, likewise, Class1.

We'll be changing that, and adding additional classes and modules, as we proceed with the elements listed below.In the pages listed below, you will find the various extensions and other helpful classes we can place in OrganicaLib for use in Organica, plus in any other project where you find them useful.

The OrganicaLib Test Bed

By: Paul S. Cilwa Posted: 1/30/2022
Page Views: 766
Topics: #Organica #VisualBasic #VB.NET #ClassLibrary #OrganicaLib
It's good to include a way of testing its routines with any library.

So, in today's project, we're going to create a test bed for OrganicaLib. For now, it won't have anything to test; but we'll add to it as we create additional modules and classes for OrganicaLib.

Read more…

OrganicaLib: SuperStrings

By: Paul S. Cilwa Posted: 1/21/2022
Updated: 2/2/2022
Page Views: 1256
Topics: #Organica #VisualBasic #VB.NET #ClassLibrary #OrganicaLib #SuperStrings
Creating extension methods to the String object type.

The low-level classes provided by .NET 5.0 are nevertheless very powerful. However, they inexplicably omit some also basic, and very useful properties and methods. While the effect of these missing elements can be performed by another combination of elements, doing so doesn't usually make for more readable code. And that's where extension methods and properties come in.

Read more…


By: Paul S. Cilwa Occurred: 9/20/2023
Page Views: 529
Topics: #Programming #ShadowLabel #CustomControls
A label control that casts its own shadow.

I've always sought to create tools that enhance the user experience and bring my applications to life. That's why I've designed a derivative of a Label control that casts a shadow behind the text, specifically for Desktop applications. This control adds depth and visual interest to the text, making it pop against various backgrounds. It's an excellent choice for headers, or any content that needs to stand out. With this new control, I've found that I can effortlessly add a touch of sophistication to my applications, improving user engagement and overall aesthetics. Why settle for the ordinary when you can elevate your application with this shadow-casting Label control? I've made it part of OrganicaLib, but it's a pair of standalone .vb files so you have the option of simply plugging it into your program.

Read more…

OrganicaLib: Settings

By: Paul S. Cilwa Posted: 1/26/2022
Page Views: 878
Topics: #Organica #VisualBasic #VB.NET #ClassLibrary #OrganicaLib
Whether you call then .INI files, PrivateProfiles, or Settings, they're everywhere and you've still gotta use 'em..

In the early days of Windows, there was a file in the Windows directory called Win.ini, and another called System.ini. Internally, it was called a "profile", and there were (are) Windows API calls to manage it. Later and current versions of Windows now support .INI files anywhere; these are called private profiles. It was a simple format, in usefulness severely limited compared to today's XML files. But simple isn't always bad, especially when the data being stored is, itself, simple. .INI files can be written in Notepad; the syntax is readily understandable; and, in any case, these files are everywhere.

Read more…

OrganicaLib: SystemRegistry

By: Paul S. Cilwa Posted: 2/24/2022
Page Views: 821
Topics: #Organica #VisualBasic #VB.NET #ClassLibrary #OrganicaLib
Easily store information in the System Registry.

In Windows, the System Registry holds setting information for Windows itself, as well as for any number of applications. Visual Basic used to provide a simple means of reading to and writing from the System Registry, but then they split .NET into several branches, in an effort to promote programming for any generic platform, not just Windows. So now, applications that are .NET CORE-based and have code using those methods is broken. So I've replaced them and put them in a new class, SystemRegistry, added to OrganicaLib.

Read more…

OrganicaLib: FileCrawler Class

By: Paul S. Cilwa Posted: 1/22/2022
Updated: 1/23/2022
Page Views: 1253
Topics: #Organica #VisualBasic #VB.NET #ClassLibrary #OrganicaLib
A class for listing all files in the current folder and subfolders.

How many times have you written code to navigate through a series of folders and subfolders in order to list, or process in some way, every file they contain? Well, settle back as we solve that programming problem once and for all with the FileCrawler class!

Read more…

Referencing OrganicaLib In Your Project

By: Paul S. Cilwa Posted: 1/21/2022
Page Views: 763
Topics: #Organica #VisualBasic #VB.NET #ClassLibrary #OrganicaLib
Step-by-step instructions.

After you've built (or simply downloaded) the marvelous-as-it-is-useful OrganicaLib, you'll want to find out how to plug it into your own app so you can reference it.

Read more…