QIQI.EProjectFile
1.3.0
See the version list below for details.
dotnet add package QIQI.EProjectFile --version 1.3.0
NuGet\Install-Package QIQI.EProjectFile -Version 1.3.0
<PackageReference Include="QIQI.EProjectFile" Version="1.3.0" />
paket add QIQI.EProjectFile --version 1.3.0
#r "nuget: QIQI.EProjectFile, 1.3.0"
// Install QIQI.EProjectFile as a Cake Addin #addin nuget:?package=QIQI.EProjectFile&version=1.3.0 // Install QIQI.EProjectFile as a Cake Tool #tool nuget:?package=QIQI.EProjectFile&version=1.3.0
Only Chinese document is available.
EProjectFile
一个用于编辑易语言项目文件的第三方库(C#)
命名空间:QIQI.EProjectFile
安装
Package Manager Install-Package QIQI.EProjectFile
.NET CLI dotnet add package QIQI.EProjectFile
使用VS的NuGet包管理器(GUI)搜索 QIQI.EProjectFile
支持:.NET Framework 4.0或更高/.NET Core 2.0或更高
声明
- 仅供学习与交流使用
- 本项目属于实验性项目,所有API随时变更
- 本项目随时终止,不做任何可用承诺
- 对于使用本项目造成的一切损失,概不负责
- 本项目可能造成被操作文件的数据丢失,请提前备份
- 禁止用于非法用途,包括但不限于:破解他人软件
- 本项目目前处于起步阶段,基本只提供底层解析/生成支持,功能极不完善
交流
一般bug请用Github的Issues模块反馈
如果您希望对本项目做出贡献,请使用标准GitHub工作流:Fork + Pull request
进一步的快速讨论:请加入QQ群605310933 (注意不要在群中反馈bug,这很可能导致反馈没有被记录。聊天消息较Issues模块比较混乱)
编译
使用NuGet安装缺失包,然后一般编译即可
注意:必须VS2017或更高版本,使用了最新语言特性 (不过运行环境.NET Framework 4.0即可,支持XP)
例程
using QIQI.EProjectFile;
using QIQI.EProjectFile.Expressions;
using QIQI.EProjectFile.Statements;
using System;
using System.Collections.Generic;
using System.Linq;
using System.IO;
private static T[] AddArrayElement<T>(T[] array, T element)
{
var newArray = new T[array.Length + 1];
Array.Copy(array, newArray, array.Length);
newArray[array.Length] = element;
return newArray;
}
// 添加Tag子程序(如果不存在),然后在每个子程序的开头加上:Tag(<子程序名>)
var projectFile = new EProjectFile();
projectFile.Load(File.OpenRead(fileName));
int tagMethod = 0;
try
{
tagMethod = Array.Find(projectFile.Code.Methods, x => x.IsStatic && string.Compare(x.Name, "Tag") == 0).Id;
}
catch (Exception)
{
int tagStaticClass = projectFile.Code.AllocId(EplSystemId.Type_StaticClass);
tagMethod = projectFile.Code.AllocId(EplSystemId.Type_Method);
projectFile.Code.Classes = AddArrayElement(projectFile.Code.Classes, new ClassInfo(tagStaticClass)
{
Name = "TagMoudle",
Method = new int[] { tagMethod }
});
projectFile.Code.Methods = AddArrayElement(projectFile.Code.Methods, new MethodInfo(tagMethod)
{
Name = "Tag",
Class = tagStaticClass,
CodeData = new StatementBlock() { new ExpressionStatement() }.ToCodeData(projectFile.Encoding),
Parameters = new MethodParameterInfo[]
{
new MethodParameterInfo(projectFile.Code.AllocId(EplSystemId.Type_Local))
{
Name = "Name",
DataType = EplSystemId.DataType_String
}
}
});
if (projectFile.EPackageInfo != null)
{
projectFile.EPackageInfo.FileNames = AddArrayElement(projectFile.EPackageInfo.FileNames, null);
}
}
foreach (var method in projectFile.Code.Methods)
{
if (method.Id != tagMethod)
{
StatementBlock block = CodeDataParser.ParseStatementBlock(method.CodeData.ExpressionData, method.CodeData.Encoding);
{
if (block[0] is ExpressionStatement exprStat && exprStat.Expression is CallExpression callExpr)
if (callExpr.LibraryId == -2 && callExpr.MethodId == tagMethod)
block.RemoveAt(0);
}
block.Insert(0, new ExpressionStatement(new CallExpression(-2, tagMethod, new ParamListExpression() { new StringLiteral(method.Name) }), false, "Added from C# Project \"EProjectFile\""));
method.CodeData = block.ToCodeData(projectFile.Encoding);
}
}
projectFile.Save(File.Create(fileName));
Product | Versions 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. |
.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 | net40 is compatible. net403 was computed. net45 was computed. net451 was computed. net452 was computed. net46 was computed. net461 was computed. net462 was computed. 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. |
-
.NETFramework 4.0
- Newtonsoft.Json (>= 12.0.1)
-
.NETStandard 2.0
- Newtonsoft.Json (>= 12.0.1)
NuGet packages (1)
Showing the top 1 NuGet packages that depend on QIQI.EProjectFile:
Package | Downloads |
---|---|
QIQI.EplOnCpp.Core
EplOnCpp Core |
GitHub repositories
This package is not used by any popular GitHub repositories.
Version | Downloads | Last updated |
---|---|---|
1.9.4 | 133 | 8/13/2024 |
1.9.3 | 268 | 11/13/2023 |
1.9.0 | 449 | 10/10/2022 |
1.8.0 | 429 | 8/28/2022 |
1.7.6 | 387 | 8/27/2022 |
1.7.5 | 383 | 8/22/2022 |
1.7.4 | 403 | 8/18/2022 |
1.7.3 | 366 | 8/17/2022 |
1.7.2 | 404 | 8/16/2022 |
1.7.1 | 394 | 8/13/2022 |
1.7.0 | 418 | 8/13/2022 |
1.6.2 | 392 | 8/8/2022 |
1.6.1 | 400 | 8/8/2022 |
1.6.0 | 419 | 8/8/2022 |
1.5.1 | 456 | 7/17/2022 |
1.5.0 | 472 | 7/13/2022 |
1.4.1 | 723 | 7/9/2022 |
1.4.0 | 407 | 7/8/2022 |
1.3.6 | 1,351 | 8/13/2019 |
1.3.5 | 569 | 8/11/2019 |
1.3.4 | 581 | 8/10/2019 |
1.3.3 | 1,041 | 7/12/2019 |
1.3.2 | 673 | 7/12/2019 |
1.3.1 | 664 | 6/6/2019 |
1.3.0 | 814 | 4/5/2019 |
1.2.0 | 808 | 9/16/2018 |
1.1.0 | 853 | 8/25/2018 |
1.0.0 | 879 | 7/30/2018 |
1.0.0-rc | 695 | 7/28/2018 |
1.0.0-beta | 801 | 6/28/2018 |