UPPERIOC 2.0.4.62

dotnet add package UPPERIOC --version 2.0.4.62
                    
NuGet\Install-Package UPPERIOC -Version 2.0.4.62
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="UPPERIOC" Version="2.0.4.62" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="UPPERIOC" Version="2.0.4.62" />
                    
Directory.Packages.props
<PackageReference Include="UPPERIOC" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add UPPERIOC --version 2.0.4.62
                    
#r "nuget: UPPERIOC, 2.0.4.62"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package UPPERIOC@2.0.4.62
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=UPPERIOC&version=2.0.4.62
                    
Install as a Cake Addin
#tool nuget:?package=UPPERIOC&version=2.0.4.62
                    
Install as a Cake Tool

<div align="center">

logo

</div>

<h1 align="center">UPPERIOC</h1>

<p align="center"> <a href="https://github.com/mrwangshipei/UPPERIOC"> <img src="https://badgen.net/badge/Github/mrwangshipei/21D789?icon=github"> </a> <img src="https://img.shields.io/badge/NetStandard-2.0-blue"> <a href="https://github.com/mrwangshipei/UPPERIOC/blob/master/LICENSE"> <img alt="GitHub" src="https://img.shields.io/github/license/mrwangshipei/UPPERIOC?style=flat-square"> </a> <img alt="GitHub last commit" src="https://img.shields.io/github/last-commit/mrwangshipei/UPPERIOC?style=flat-square"> <img alt="GitHub Repo stars" src="https://img.shields.io/github/stars/mrwangshipei/UPPERIOC?style=social"> </p>


💬 联系我

交流群: 816781059

qq: 3644005356


📦 包管理

MyGet Pre-release feed: https://www.nuget.org/packages/UPPERIOC/

Package NuGet Stable NuGet Pre-release Downloads MyGet
UPPERIOC NuGet Stable NuGet Pre NuGet Downloads MyGet

🔰 项目说明

UPPERIOC 是一个为 WinForm 应用设计的 IOC 容器和插件集合框架,旨在帮助开发者快速搭建标准化、模块化的单体应用程序。项目完全开源并长期维护。

适合个人学习、小型项目、原型系统等快速开发场景。

⚠️ 注意:未针对高性能或大规模项目优化,使用即代表理解并接受可能的风险。


✨ 功能概览

  • IOC 容器 + 注解式注入
  • 日志系统(默认实现文件日志)
  • 消息通信模块(Sendor)
  • 文件配置模型系统(Model)
  • 工具集(Util)
  • 应用加锁(MLock)
  • 权限系统(SimplePremission)
  • 翻译模块(Translate)

🚀 快速入门

static void main() {
    UPPERIOCApplication.RunInstance(md =>
    {
        md.UPPERFileModelMoudle(new FileModle());
        md.UPPERMLockMoudle(new MLock());
        md.UPPERLogFileMoudle(new FIleLogConfig());
    });
    Application.Run(new Form1());
}

🧩 模块详解

Sendor

SendorCenter.Register<object>(x => {
    LogCenter.Log(x.ToString());
});

SendorCenter.Publish<object>("HelloWorld");

Log

config.AddMoudle<UPPERLogFileMoudle>();

internal class FCTUFileConfiguation : IFileLogConfiguation {
    public string DirectoryName => "FCTlog";
    public string DefaultExt => ".log";
    public List<LogType> WhichTypePrint => new() { LogType.Debug, LogType.Warn, LogType.Info, LogType.Error };
    public string FileNameTimeFormat => "日志yyyyMMdd";
    public int HowManyHourSave => 48;
    public bool PrintMs => true;
}
UPPERIOCApplication.RunInstance(md =>
{
    md.UPPERLogFileMoudle(new FCTUFileConfiguation());
});
LogCenter.Log("Hello");

Model

config.AddMoudle<UPPERFileModelMoudle>();

internal class UFileModelConfigration : IUFileModelConfiguation {
    public string SaveModelPath => "conf";
}

UPPERIOCApplication.RunInstance(md =>
{
    md.UPPERFileModelMoudle(new UFileModelConfigration());
});
F.I.SaveModel(new T());
var t = F.I.GetModel(new T());

IOCObject 注入

[IOCObject]
public class VerContent {
    public string Up;
    public string Ver;
    public string Content;
}
UPPERIOCApplication.RunInstance(md =>
{
   // 不需要模块
   // md.UPPERLogFileMoudle(new FCTUFileConfiguation());
});
U.C.GetInstance<VerContent>();

MLock

public class MLockConfiguation {
    public virtual string Solt { get; set; }
    public virtual string Listenaddr { get; set; }
    public virtual string LockName { get; set; }
    public virtual void Noregister() {
        Console.Write("没有注册");
        Environment.Exit(0);
    }
}

UPPERIOCApplication.RunInstance(md =>
{
    md.UPPERMLockMoudle(new MLockConfiguation());
});
config._containerProvider.Rigister<ILockConfiguation>();

Translate

public interface ITranslateConfig {
    string APPKey { get; }
    string APPSeret { get; }
    string FromLanguage { get; }
    string ToLanguage { get; }
}
UPPERIOCApplication...//...添加模块
TranslateCenter.Instance.SetRootWindows(this);

🏗️ 架构概览

  • UPPERIOC.UPPERApplication:核心入口
  • *.Moudle:可插拔模块集合
  • *.Center:使用者调用接口
  • *.IConfigration:配置接口
  • *.IModel:数据模型接口

🧯 常见问题

IOCObject 失效

错误提示:CSC warning CS9057 编译器版本不兼容

解决方法:更新 Microsoft.CodeAnalysis.CSharp4.10.0+

Configuation 找不到

手动注入或开启默认容器 Provider

WinForm 设计器类无法显示

提示:文件中的类不能进行设计,请确保已生成所有项目

解决方法:生成项目解决


如果你觉得这个项目对你有帮助,欢迎 Star 🌟 一下!

Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 was computed.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
.NET Core netcoreapp2.0 was computed.  netcoreapp2.1 was computed.  netcoreapp2.2 was computed.  netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.0 is compatible.  netstandard2.1 was computed. 
.NET Framework net461 was computed.  net462 is compatible.  net463 was computed.  net47 was computed.  net471 was computed.  net472 was computed.  net48 was computed.  net481 was computed. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen40 was computed.  tizen60 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

初始版本