Пример #1
0
        public void Init(SVsServiceProvider service_provider, IVsEditorAdaptersFactoryService adapters_factory)
        {
            if (m_init)
            {
                return;
            }
            m_init             = true;
            m_service_provider = service_provider;
            m_adapters_factory = adapters_factory;
            m_open_document    = m_service_provider.GetService(typeof(SVsUIShellOpenDocument)) as IVsUIShellOpenDocument;

            MainThreadInit();

            // 创建解决方案
            if (m_solution == null)
            {
                m_solution = new UISolutionInfo();
                m_solution.InitProjectInfos(service_provider, this);
            }
        }
Пример #2
0
        public UIProjectInfo(UISolutionInfo solution, IVsHierarchy project, string path, string dot_ext, Icon file_icon)
        {
            // 保存基本信息
            m_solution  = solution;
            m_project   = project;
            m_path      = path;
            m_dot_ext   = dot_ext;
            m_file_icon = file_icon;

            // 加载节点信息
            LoadNodes(m_project, VSConstants.VSITEMID_ROOT, m_dot_ext);
            // 加载完成
            var server = m_solution.GetServer();

            if (server != null)
            {
                server.AddTask(() => server.LoadCompleted(m_path));
            }

            // 监听文件夹变化
            m_project.AdviseHierarchyEvents(this, out m_cookie);
        }