FormAppRunEvent.cs

(开头部分) 41KB

这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。

using AppManager.Config;
using AppManager.Excep;
using AppManager.Icon;
using AppManager.Pojo;
using AppManager.Utils;
using Newtonsoft.Json;
using System;
using System.Collections;
using System.Collections.Generic;
using System.Drawing;
using System.IO;
using System.Text;
using System.Windows.Forms;

namespace AppManager {
    /// <summary>
    /// 当前类是应用运行相关的事件
    /// </summary>
    partial class Form1 {
        private void InitApp() {
            // 应用树和应用运行面板的分隔距离
            var splitDistance = IniUtils.IniReadValue(Configs.SystemIniPath, Configs.IniSectionApp, Configs.IniKeyAppSplitDis);
            if (!string.IsNullOrEmpty(splitDistance)) {
                AppSplitContainer.SplitterDistance = Convert.ToInt32(splitDistance);
            }

            // 项目运行面板TabPage自定义添加关闭按钮
            AppRunTabControl.TabPages.Clear();
            AppRunTabControl.DrawMode = TabDrawMode.OwnerDrawFixed;
            AppRunTabControl.DrawItem += AppRunTabControl_DrawItem;
            AppRunTabControl.MouseDown += AppRunTabControl_MouseDown;
            // 运行面板右键 关闭已停止的窗口
            var rightMenu = new ContextMenuStrip();
            ControlUtils.AddToolStripMenu(rightMenu, "close_tab", "app_run", "关闭所有已停止", null, AppRunTab_AllStopedClose);
            AppRunTabControl.ContextMenuStrip = rightMenu;

            AutoRunAllCheckBox.Checked = true; // 初始化默认为全选,当项目存在非自启动时,会取消全选勾选

            // 项目列表框指定图标并添加右键菜单
            AppTreeView.ImageList = TreeViewImageList;
            AppTreeView.Nodes.Clear();
            AppTreeView.NodeMouseClick += AppTreeView_NodeMouseClick;
            AppTreeView.ItemDrag += AppTreeView_ItemDrag;
            AppTreeView.DragDrop += AppTreeView_DragDrop;
            AppTreeView.DragEnter += AppTreeView_DragEnter;
            InitAppTreeViewRightMenu();
            var sections = IniUtils.ReadSections(Configs.ProjectsIniPath);
            foreach (var t in sections) {
                InitProject(t);
            }

            try {
                if (null != AppSections.GetAllSectionDic()) {
                    foreach (var appSection in AppSections.GetAllSectionDic()) {
                        // 校验应用启动情况,如果有自启动,则执行启动
                        CheckSection(appSection.Value, false, true);
                    }
                }
            } catch (Exception ex) {
                MessageBox.Show(ex.Message);
后面还有 694 行代码,解锁后查看完整代码

24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明

AI 解读 AI

登录后可用,每次 10 算力,解读结果公开显示在下面。

还没有人解读过这个文件。