Example #1
0
        public bool LoadFilter(String path_to_bin)
        {
            TargetFilePath = path_to_bin;

            List <alcSymbolFilterColumn> default_filter = SymbolFilterUtil.GetDefaultFilter(TargetFilePath);
            List <alcSymbolFilterColumn> loaded_filter  = SymbolFilterUtil.LoadFromConfigFile(ConfigFilePath);
            List <alcSymbolFilterColumn> filter         = null;

            if (loaded_filter != null)
            {
                NeedsSave = true;
                filter    = SymbolFilterUtil.MergeFilter(default_filter, loaded_filter);
            }
            else
            {
                NeedsSave = false;
                filter    = default_filter;
            }
            if (filter != null)
            {
                filter.Sort(SymbolFilterUtil.CompareDataTypeOrName);
                FilterData = new BindingList <alcSymbolFilterColumn>(filter);
                return(true);
            }
            return(false);
        }
Example #2
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");
                }
            });
        }