Пример #1
0
        /// <summary>
        /// </summary>
        private void onSymbolFilter(object sender, EventArgs e)
        {
            DTE dte = (DTE)GetService(typeof(DTE));

            VCDocumentInfo info = new VCDocumentInfo(dte);

            if (info.IsValid())
            {
                alcSymbolFilterForBinary(info.ObjPath);
            }
            else
            {
                // todo: show error message
            }
        }
Пример #2
0
        /// <summary>
        /// </summary>
        private void onSymbolFilter(object sender, EventArgs e)
        {
            DTE dte = (DTE)GetService(typeof(DTE));

            VCDocumentInfo info = new VCDocumentInfo(dte);
            if (info.IsValid())
            {
                alcSymbolFilterForBinary(info.ObjPath);
            }
            else
            {
                // todo: show error message
            }
        }
Пример #3
0
        /// <summary>
        /// </summary>
        private void onApplyChange(object sender, EventArgs e)
        {
            DTE dte = (DTE)GetService(typeof(DTE));
            VCDocumentInfo vcdoc = new VCDocumentInfo(dte);
            if (!vcdoc.IsValid()) { return; }

            dte.ActiveDocument.Save();

            List<String> cur_func = ProjectUtil.GetFunctionsInCurrentPosition(dte);
            VCFileW vcfile = vcdoc.VCFile;
            VCConfigurationW vcconf = vcdoc.VCConfiguration;

            Dictionary<String, String> properties = new Dictionary<String, String >();
            properties.Add("Configuration", vcconf.Evaluate("$(Configuration)"));
            properties.Add("Platform", vcconf.Evaluate("$(Platform)"));
            properties.Add("SelectedFiles", vcdoc.FileRelpath);
            properties.Add("BuildProjectReferences", "false");
            properties.Add("SolutionDir", vcconf.Evaluate("$(SolutionDir)"));
            properties.Add("SolutionExt", vcconf.Evaluate("$(SolutionExt)"));
            properties.Add("SolutionName", vcconf.Evaluate("$(SolutionName)"));
            properties.Add("SolutionFileName", vcconf.Evaluate("$(SolutionFileName)"));
            properties.Add("SolutionPath", vcconf.Evaluate("$(SolutionPath)"));

            RunBuild(vcdoc.ProjPath, vcfile.ItemType, properties, (BuildLogger logger) =>
            {
                if (vcfile.ItemType == "ClCompile")
                {
                    List<alcSymbolFilterColumn> filter = SymbolFilterUtil.GetDefaultFilter(vcdoc.ObjPath, true);
                    {
                        List<alcSymbolFilterColumn> loaded_filter = SymbolFilterUtil.LoadFromConfigFile(vcdoc.ObjFilterPath);
                        if (loaded_filter != null)
                        {
                            filter = SymbolFilterUtil.MergeFilter(filter, loaded_filter);
                        }
                    }

                    if (filter != null && cur_func.Count > 0)
                    {
                        bool changed = false;
                        foreach (alcSymbolFilterColumn c in filter)
                        {
                            foreach (String f in cur_func)
                            {
                                if (c.Name == f)
                                {
                                    c.FlagUpdate = true;
                                    changed = true;
                                }
                            }
                        }
                        if (changed)
                        {
                            SymbolFilterUtil.SaveConfig(vcdoc.ObjFilterPath, filter);
                        }
                    }
                    else
                    {
                        logger.Write(String.Format("Alcantarea warning: could not get cursor's current position function\n"));
                    }
                    AlcantareaHelper.RequestSetSymbolFilter(vcdoc.ObjPath, filter);
                    SendCommand("dpLoadBinary\n" + vcdoc.ObjPath + "\n\n");
                }
            });
        }
Пример #4
0
        /// <summary>
        /// </summary>
        private void onApplyChange(object sender, EventArgs e)
        {
            DTE            dte   = (DTE)GetService(typeof(DTE));
            VCDocumentInfo vcdoc = new VCDocumentInfo(dte);

            if (!vcdoc.IsValid())
            {
                return;
            }

            dte.ActiveDocument.Save();

            List <String>    cur_func = ProjectUtil.GetFunctionsInCurrentPosition(dte);
            VCFileW          vcfile   = vcdoc.VCFile;
            VCConfigurationW vcconf   = vcdoc.VCConfiguration;

            Dictionary <String, String> properties = new Dictionary <String, String>();

            properties.Add("Configuration", vcconf.Evaluate("$(Configuration)"));
            properties.Add("Platform", vcconf.Evaluate("$(Platform)"));
            properties.Add("SelectedFiles", vcdoc.FileRelpath);
            properties.Add("BuildProjectReferences", "false");
            properties.Add("SolutionDir", vcconf.Evaluate("$(SolutionDir)"));
            properties.Add("SolutionExt", vcconf.Evaluate("$(SolutionExt)"));
            properties.Add("SolutionName", vcconf.Evaluate("$(SolutionName)"));
            properties.Add("SolutionFileName", vcconf.Evaluate("$(SolutionFileName)"));
            properties.Add("SolutionPath", vcconf.Evaluate("$(SolutionPath)"));

            RunBuild(vcdoc.ProjPath, vcfile.ItemType, properties, (BuildLogger logger) =>
            {
                if (vcfile.ItemType == "ClCompile")
                {
                    List <alcSymbolFilterColumn> filter = SymbolFilterUtil.GetDefaultFilter(vcdoc.ObjPath, true);
                    {
                        List <alcSymbolFilterColumn> loaded_filter = SymbolFilterUtil.LoadFromConfigFile(vcdoc.ObjFilterPath);
                        if (loaded_filter != null)
                        {
                            filter = SymbolFilterUtil.MergeFilter(filter, loaded_filter);
                        }
                    }

                    if (filter != null && cur_func.Count > 0)
                    {
                        bool changed = false;
                        foreach (alcSymbolFilterColumn c in filter)
                        {
                            foreach (String f in cur_func)
                            {
                                if (c.Name == f)
                                {
                                    c.FlagUpdate = true;
                                    changed      = true;
                                }
                            }
                        }
                        if (changed)
                        {
                            SymbolFilterUtil.SaveConfig(vcdoc.ObjFilterPath, filter);
                        }
                    }
                    else
                    {
                        logger.Write(String.Format("Alcantarea warning: could not get cursor's current position function\n"));
                    }
                    AlcantareaHelper.RequestSetSymbolFilter(vcdoc.ObjPath, filter);
                    SendCommand("dpLoadBinary\n" + vcdoc.ObjPath + "\n\n");
                }
            });
        }