Skip to content

Commit

Permalink
重构了开放框架
Browse files Browse the repository at this point in the history
Former-commit-id: e4a76466dd11efe216faad0d7f8818909c9f52a6
  • Loading branch information
zsh2401 committed Feb 24, 2018
1 parent 122d246 commit a14da94
Show file tree
Hide file tree
Showing 54 changed files with 527 additions and 1,172 deletions.
2 changes: 0 additions & 2 deletions .bat

This file was deleted.

11 changes: 0 additions & 11 deletions AutumnBox.Basic.EFM/AutumnBox.Basic.EFM.projitems

This file was deleted.

13 changes: 0 additions & 13 deletions AutumnBox.Basic.EFM/AutumnBox.Basic.EFM.shproj

This file was deleted.

8 changes: 8 additions & 0 deletions AutumnBox.ConsoleTester/App.config
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,12 @@
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6.1" />
</startup>
<system.diagnostics>
<trace autoflush="false">
<listeners>
<clear/>
<add name="LogTraceListener" type="AutumnBox.ConsoleTester.LogWriterTraceListener" initializeData="gui.log"></add>
</listeners>
</trace>
</system.diagnostics>
</configuration>
5 changes: 1 addition & 4 deletions AutumnBox.ConsoleTester/AutumnBox.ConsoleTester.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="LogWriterTraceListener.cs" />
<Compile Include="Program.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
Expand All @@ -73,10 +74,6 @@
<Project>{6516890C-86B6-40A0-8FD0-14FFDD62E1FE}</Project>
<Name>AutumnBox.OpenFramework</Name>
</ProjectReference>
<ProjectReference Include="..\AutumnBox.Support\AutumnBox.Support.csproj">
<Project>{851B2EB0-0503-428D-BD87-063555B19451}</Project>
<Name>AutumnBox.Support</Name>
</ProjectReference>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project>
50 changes: 50 additions & 0 deletions AutumnBox.ConsoleTester/LogWriterTraceListener.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
/*************************************************
** auth: [email protected]
** date: 2018/2/24 20:25:13 (UTC +8:00)
** desc: ...
*************************************************/
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace AutumnBox.ConsoleTester
{
public class LogWriterTraceListener : TraceListener
{

private readonly StreamWriter logWriter;

public LogWriterTraceListener(string fileName)
{
//logWriter = new StreamWriter(fileName, true)
//{
// AutoFlush = true
//};
}

public override void Write(string message)
{
//logWriter.Write(message);
Debugger.Log(0, "fucker", message);
}

public override void WriteLine(string message)
{
//logWriter.WriteLine(message);
Debugger.Log(0, "fucker", message);
}

private static string MakeText(string categroy, string prefix, string message)
{
StringBuilder sb = new StringBuilder();
sb.Append($"[{DateTime.Now.ToString("yyyy-MM-dd")}]");
sb.Append($"[{categroy}/{prefix}]");
sb.Append($": {message}");
return sb.ToString();
}
}
}
22 changes: 4 additions & 18 deletions AutumnBox.ConsoleTester/Program.cs
Original file line number Diff line number Diff line change
@@ -1,19 +1,6 @@
using AutumnBox.Basic.ACP;
using AutumnBox.Basic.Adb;
using AutumnBox.Basic.Device;
using AutumnBox.Basic.Device.PackageManage;
using AutumnBox.Basic.Executer;
using AutumnBox.Basic.MultipleDevices;
using AutumnBox.Basic.Util;
using AutumnBox.GUI.Mods;
using AutumnBox.OpenFramework;
using AutumnBox.Support.Log;
using AutumnBox.Basic.Device;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Threading;
using System.Diagnostics;

namespace AutumnBox.ConsoleTester
{
Expand All @@ -36,9 +23,8 @@ class Program
};
unsafe static int Main(string[] cmdargs)
{
var states = DeviceState.Recovery;
var statess = DeviceState.Recovery | DeviceState.Poweron;
Console.WriteLine(statess.HasFlag(states));
Trace.WriteLine("do you like this?");
Console.ReadKey();
return 0;
}
}
Expand Down
5 changes: 1 addition & 4 deletions AutumnBox.ConsoleTester/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
using AutumnBox.Support.CstmDebug;
using AutumnBox.Support.Log;
using System.Reflection;
using System.Reflection;
using System.Runtime.InteropServices;

// 有关程序集的一般信息由以下
Expand All @@ -14,7 +12,6 @@
[assembly: AssemblyCopyright("Copyright © 2017")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
[assembly: LogFileProperty("consoletester.log")]
//#if DEBUG
//[assembly: LogSettings(FileName = "console.log", IsInDebugMode = true)]
//#else
Expand Down
8 changes: 8 additions & 0 deletions AutumnBox.GUI/App.config
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,12 @@
<probing privatePath="dll"/>
</assemblyBinding>
</runtime>-->
<!--<system.diagnostics>
<trace autoflush="true">
<listeners>
<clear/>
<add name="LogTraceListener" type="AutumnBox.Support.Log.LogWriterTraceListener" initializeData="gui.log"></add>
</listeners>
</trace>
</system.diagnostics>-->
</configuration>
10 changes: 5 additions & 5 deletions AutumnBox.GUI/App.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,22 +11,21 @@
* Company: I am free man
*
\* =============================================================================*/
using AutumnBox.Basic;
using AutumnBox.Basic.Adb;
using AutumnBox.Basic.MultipleDevices;
using AutumnBox.GUI.Cfg;
using AutumnBox.GUI.Helper;
using AutumnBox.GUI.I18N;
using AutumnBox.GUI.Mods;
using AutumnBox.GUI.Util;
using AutumnBox.GUI.Windows;
using AutumnBox.Support.CstmDebug;
using System;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Threading;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Navigation;

namespace AutumnBox.GUI
{
Expand All @@ -37,6 +36,7 @@ namespace AutumnBox.GUI
/// </summary>
public partial class App : Application
{
private const string TAG = "App";
public const int HAVE_OTHER_PROCESS = 25364;
public static new App Current { get; private set; }
public MainWindow MainWindowAsMainWindow
Expand Down Expand Up @@ -68,10 +68,10 @@ protected override void OnStartup(StartupEventArgs e)
LanguageHelper.LoadLanguageByFileName(Config.Lang);
}
}
private static readonly string msgAdbStartsFailed;

internal async void Load(IAppLoadingWindow loadingWindowApi)
{
Debug.WriteLine("Loading...",TAG);
loadingWindowApi.SetProgress(10);
loadingWindowApi.SetTip("启动ADB服务中....");
await Task.Run(() =>
Expand Down Expand Up @@ -105,7 +105,7 @@ await Task.Run(() =>
App.Current.MainWindow = new MainWindow();
DevicesMonitor.Begin();
loadingWindowApi.SetProgress(80);
ModManager.InitAll();
ExtendModuleManager.Load();
App.Current.MainWindow.Show();
loadingWindowApi.SetProgress(100);
loadingWindowApi.Finish();
Expand Down
8 changes: 7 additions & 1 deletion AutumnBox.GUI/AutumnBox.GUI.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@
<Reference Include="Newtonsoft.Json, Version=10.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
<HintPath>..\packages\Newtonsoft.Json.10.0.3\lib\net45\Newtonsoft.Json.dll</HintPath>
</Reference>
<Reference Include="PresentationFramework.Aero2" />
<Reference Include="System" />
<Reference Include="System.Data" />
<Reference Include="System.Drawing" />
Expand Down Expand Up @@ -138,7 +139,6 @@
<Compile Include="Helper\TextHelper.cs" />
<Compile Include="Helper\UIHelper.cs" />
<Compile Include="I18N\Language.cs" />
<Compile Include="Mods\ModManager.cs" />
<Compile Include="NetUtil\PotdGetter.cs" />
<Compile Include="NetUtil\Urls.cs" />
<Compile Include="NetUtil\MOTDGetter.cs" />
Expand All @@ -148,6 +148,8 @@
<Compile Include="UI\FuncPanels\ThridPartyFunctionPanel.xaml.cs">
<DependentUpon>ThridPartyFunctionPanel.xaml</DependentUpon>
</Compile>
<Compile Include="Util\ExtendModuleManager.cs" />
<Compile Include="Util\LoggerTraceListener.cs" />
<Compile Include="Windows\IAppLoadingWindow.cs" />
<Compile Include="Windows\UserManagerWindow.xaml.cs">
<DependentUpon>UserManagerWindow.xaml</DependentUpon>
Expand Down Expand Up @@ -317,6 +319,10 @@
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
<Page Include="Resources\Themes\BasicTheme_files\ListViewStyle.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="Resources\Themes\BasicTheme_files\TabItemStyle.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
Expand Down
4 changes: 2 additions & 2 deletions AutumnBox.GUI/MainWindow.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
xmlns:cpnel="clr-namespace:AutumnBox.GUI.UI.FuncPanels"
x:Name="_MainWindow" x:Class="AutumnBox.GUI.MainWindow"
mc:Ignorable="d"
Background="{DynamicResource BackBrush}" Title="AutumnBox" Height="682.667" Width="1155" Foreground="#FF1B1919" ResizeMode="NoResize" Loaded="MainWindow_Loaded" WindowStyle="None" WindowStartupLocation="CenterScreen" ShowInTaskbar="False" >
Background="{DynamicResource BackBrush}" Title="AutumnBox" Height="682.667" Width="1155" Foreground="#FF1B1919" ResizeMode="NoResize" Loaded="MainWindow_Loaded" WindowStyle="None" WindowStartupLocation="CenterScreen">
<Grid>
<Grid Name="GridBase" Margin="3,0,3,3">
<WebBrowser x:Name="WTF" Width="1" Height="0" Margin="963,271,185,408"/>
Expand Down Expand Up @@ -39,7 +39,7 @@
<TabItem TabIndex="3" Header="{DynamicResource tbiOnFastboot}" Margin="23,-2,-26,0" Foreground="{DynamicResource ForgBrush}" FontSize="16">
<cpnel:FastbootFuncPanel x:Name="FastbootFuncs"></cpnel:FastbootFuncPanel>
</TabItem>
<TabItem TabIndex="4" Header="{DynamicResource tbiThridPartyFunction}" Margin="23,-2,-26,0" Foreground="{DynamicResource ForgBrush}" FontSize="16">
<TabItem TabIndex="4" Header="{DynamicResource tbiThridPartyFunction}" Margin="26,-2,-29,0" Foreground="{DynamicResource ForgBrush}" FontSize="16">
<cpnel:ThridPartyFunctionPanel x:Name="ThridPartyFuncs"></cpnel:ThridPartyFunctionPanel>
</TabItem>
</TabControl>
Expand Down
108 changes: 0 additions & 108 deletions AutumnBox.GUI/Mods/ModManager.cs

This file was deleted.

Loading

0 comments on commit a14da94

Please sign in to comment.