public int OpenOutputGroup(string szCanonicalName, out IVsOutputGroup ppIVsOutputGroup)
        {
            IVsProjectCfg2 projCfg = _pythonCfg as IVsProjectCfg2;

            if (projCfg != null)
            {
                return(projCfg.OpenOutputGroup(szCanonicalName, out ppIVsOutputGroup));
            }
            ppIVsOutputGroup = null;
            return(VSConstants.E_NOTIMPL);
        }
Beispiel #2
0
 public virtual int OpenOutputGroup(string szCanonicalName, out IVsOutputGroup ppIVsOutputGroup)
 {
     ppIVsOutputGroup = null;
     // Search through our list of groups to find the one they are looking forgroupName
     foreach (var group in this.OutputGroups)
     {
         group.get_CanonicalName(out var groupName);
         if (StringComparer.OrdinalIgnoreCase.Equals(groupName, szCanonicalName))
         {
             ppIVsOutputGroup = group;
             break;
         }
     }
     return((ppIVsOutputGroup != null) ? VSConstants.S_OK : VSConstants.E_FAIL);
 }
Beispiel #3
0
 public virtual int OpenOutputGroup(string szCanonicalName, out IVsOutputGroup ppIVsOutputGroup)
 {
     ppIVsOutputGroup = null;
     // Search through our list of groups to find the one they are looking forgroupName
     foreach (OutputGroup group in OutputGroups)
     {
         string groupName;
         group.get_CanonicalName(out groupName);
         if (String.Compare(groupName, szCanonicalName, StringComparison.OrdinalIgnoreCase) == 0)
         {
             ppIVsOutputGroup = group;
             break;
         }
     }
     return((ppIVsOutputGroup != null) ? VSConstants.S_OK : VSConstants.E_FAIL);
 }
Beispiel #4
0
        public virtual int get_OutputGroups(uint celt, IVsOutputGroup[] rgpcfg, uint[] pcActual)
        {
            // Are they only asking for the number of groups?
            if (celt == 0)
            {
                if ((null == pcActual) || (0 == pcActual.Length))
                {
                    throw new ArgumentNullException("pcActual");
                }
                pcActual[0] = (uint)OutputGroups.Count;
                return VSConstants.S_OK;
            }

            // Check that the array of output groups is not null
            if ((null == rgpcfg) || (rgpcfg.Length == 0))
            {
                throw new ArgumentNullException("rgpcfg");
            }

            // Fill the array with our output groups
            uint count = 0;
            foreach (OutputGroup group in OutputGroups)
            {
                if (rgpcfg.Length > count && celt > count && group != null)
                {
                    rgpcfg[count] = group;
                    ++count;
                }
            }

            if (pcActual != null && pcActual.Length > 0)
                pcActual[0] = count;

            // If the number asked for does not match the number returned, return S_FALSE
            return (count == celt) ? VSConstants.S_OK : VSConstants.S_FALSE;
        }
Beispiel #5
0
 public virtual int OpenOutputGroup(string szCanonicalName, out IVsOutputGroup ppIVsOutputGroup)
 {
     ppIVsOutputGroup = null;
     // Search through our list of groups to find the one they are looking for groupName
     foreach (OutputGroup group in OutputGroups)
     {
         string groupName;
         group.get_CanonicalName(out groupName);
         if (String.Compare(groupName, szCanonicalName, StringComparison.OrdinalIgnoreCase) == 0)
         {
             ppIVsOutputGroup = group;
             break;
         }
     }
     return (ppIVsOutputGroup != null) ? VSConstants.S_OK : VSConstants.E_FAIL;
 }
 public int OpenOutputGroup(string szCanonicalName, out IVsOutputGroup ppIVsOutputGroup)
 {
     IVsProjectCfg2 projCfg = _baseCfg as IVsProjectCfg2;
     if (projCfg != null)
     {
         return projCfg.OpenOutputGroup(szCanonicalName, out ppIVsOutputGroup);
     }
     ppIVsOutputGroup = null;
     return VSConstants.E_NOTIMPL;
 }
 public int get_OutputGroups(uint celt, IVsOutputGroup[] rgpcfg, uint[] pcActual = null)
 {
     IVsProjectCfg2 projCfg = _baseCfg as IVsProjectCfg2;
     if (projCfg != null)
     {
         return projCfg.get_OutputGroups(celt, rgpcfg, pcActual);
     }
     return VSConstants.E_NOTIMPL;
 }
Beispiel #8
0
        private static IEnumerable <string> EnumerateOutputs(IVsProjectCfg2 config, string canonicalName)
        {
            var actual = new uint[1];

            ErrorHandler.ThrowOnFailure(config.get_OutputGroups(0, null, actual));
            var groups = new IVsOutputGroup[actual[0]];

            ErrorHandler.ThrowOnFailure(config.get_OutputGroups((uint)groups.Length, groups, actual));

            var group = groups.FirstOrDefault(g =>
            {
                string name;
                ErrorHandler.ThrowOnFailure(g.get_CanonicalName(out name));
                return(canonicalName.Equals(name, StringComparison.OrdinalIgnoreCase));
            });

            if (group == null)
            {
                return(Enumerable.Empty <string>());
            }

            string keyName;

            if (!ErrorHandler.Succeeded(group.get_KeyOutput(out keyName)))
            {
                keyName = null;
            }

            try
            {
                ErrorHandler.ThrowOnFailure(group.get_Outputs(0, null, actual));
            }
            catch (NotImplementedException)
            {
                if (CommonUtils.IsValidPath(keyName))
                {
                    return(Enumerable.Repeat(keyName, 1));
                }
                throw;
            }
            var outputs = new IVsOutput2[actual[0]];

            ErrorHandler.ThrowOnFailure(group.get_Outputs((uint)outputs.Length, outputs, actual));

            string keyResult = null;
            var    results   = new List <string>();

            foreach (var o in outputs)
            {
                string name;
                if (keyName != null &&
                    ErrorHandler.Succeeded(o.get_CanonicalName(out name)) &&
                    keyName.Equals(name, StringComparison.OrdinalIgnoreCase)
                    )
                {
                    keyResult = GetFilenameFromOutput(o);
                }
                else
                {
                    results.Add(GetFilenameFromOutput(o));
                }
            }

            if (keyResult != null)
            {
                results.Insert(0, keyResult);
            }
            return(results);
        }
Beispiel #9
0
        private static IEnumerable<string> EnumerateOutputs(IVsProjectCfg2 config, string canonicalName) {
            var actual = new uint[1];
            ErrorHandler.ThrowOnFailure(config.get_OutputGroups(0, null, actual));
            var groups = new IVsOutputGroup[actual[0]];
            ErrorHandler.ThrowOnFailure(config.get_OutputGroups((uint)groups.Length, groups, actual));

            var group = groups.FirstOrDefault(g => {
                string name;
                ErrorHandler.ThrowOnFailure(g.get_CanonicalName(out name));
                return canonicalName.Equals(name, StringComparison.OrdinalIgnoreCase);
            });
            if (group == null) {
                return Enumerable.Empty<string>();
            }

            string keyName;
            if (!ErrorHandler.Succeeded(group.get_KeyOutput(out keyName))) {
                keyName = null;
            }

            try {
                ErrorHandler.ThrowOnFailure(group.get_Outputs(0, null, actual));
            } catch (NotImplementedException) {
                if (CommonUtils.IsValidPath(keyName)) {
                    return Enumerable.Repeat(keyName, 1);
                }
                throw;
            }
            var outputs = new IVsOutput2[actual[0]];
            ErrorHandler.ThrowOnFailure(group.get_Outputs((uint)outputs.Length, outputs, actual));

            string keyResult = null;
            var results = new List<string>();

            foreach (var o in outputs) {
                string name;
                if (keyName != null &&
                    ErrorHandler.Succeeded(o.get_CanonicalName(out name)) &&
                    keyName.Equals(name, StringComparison.OrdinalIgnoreCase)
                ) {
                    keyResult = GetFilenameFromOutput(o);
                } else {
                    results.Add(GetFilenameFromOutput(o));
                }
            }

            if (keyResult != null) {
                results.Insert(0, keyResult);
            }
            return results;
        }