Click here to Skip to main content
12,349,355 members (68,616 online)
Click here to Skip to main content

Stats

44.1K views
1.4K downloads
108 bookmarked
Posted

Plug-in Framework

, 14 Sep 2010 CPOL
Basic framework for building desktop plug-in applications.
PluginFramework
Demo
bin
Debug
Plugins
Release
Plugins
Forms
Properties
DemoFormPlugin
Properties
DemoUserControlPlugin
Properties
MBG.Extensions
Collections
Controls
Core
Data
Math
Properties
Xml
MBG.IO
Properties
PluginFramework.Attributes
Properties
PluginFramework.Controls
Properties
Resources
Icons
SettingsIcon.ico
TreeIcon.ico
Images
SettingsImage.png
TreeImage.png
PluginFramework.Interface
Properties
PluginFramework.Utilities
Properties
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace MBG.Extensions.Core
{
    public static class RandomExtensions
    {
        public static bool NextBoolean(this Random random)
        {
            return random.Next(byte.MinValue, byte.MaxValue) > (byte.MaxValue / 2);
        }
        public static DateTime NextDateTime(this Random random)
        {
            return NextDateTime(random, DateTime.MinValue.Year, DateTime.MaxValue.Year);
        }
        public static DateTime NextDateTime(this Random random, int minYear, int maxYear)
        {
            int year = random.Next(minYear, maxYear);
            int month = random.Next(1, 12);
            int day = random.Next(1, 28);
            int hour = random.Next(0, 23);
            int minute = random.Next(0, 59);
            int second = random.Next(0, 59);

            return new DateTime(year, month, day, hour, minute, second);
        }
    }
}

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

Share

About the Author

vnmatt
Software Developer (Senior) Freelancer
Vietnam Vietnam
No Biography provided

You may also be interested in...

| Advertise | Privacy | Terms of Use | Mobile
Web01 | 2.8.160621.1 | Last Updated 14 Sep 2010
Article Copyright 2010 by vnmatt
Everything else Copyright © CodeProject, 1999-2016
Layout: fixed | fluid