private bool TryGetScope(IVsWindowFrame vsWindowFrame, __VSFPROPID propId, out string scope)
        {
            scope = default(string);
            Guid guid;

            return(ErrorHandler.Succeeded(vsWindowFrame.GetGuidProperty((int)propId, out guid)) &&
                   this.scopeDefinitions.TryGetValue(guid, out scope));
        }
示例#2
0
        private void SetGuid(__VSFPROPID propId, Guid value)
        {
            if (_frame == null)
            {
                throw new InvalidOperationException();
            }

            Marshal.ThrowExceptionForHR((_frame.SetGuidProperty((int)propId, ref value)));
        }
示例#3
0
        public static bool GetIUnknownProperty(this IVsWindowFrame windowFrame, __VSFPROPID propid, out object result)
        {
            result = null;

            if (windowFrame != null)
            {
                windowFrame.GetProperty((int)propid, out result);
            }

            return(result != null);
        }
        private Guid GetGuid(__VSFPROPID id)
        {
            Guid gResult;

            if (VSErr.Succeeded(Frame.GetGuidProperty((int)id, out gResult)))
            {
                return(gResult);
            }
            else
            {
                return(Guid.Empty);
            }
        }
示例#5
0
        private Guid GetGuid(__VSFPROPID __VSFPROPID)
        {
            if (_frame == null)
            {
                throw new InvalidOperationException();
            }

            Guid value;

            Marshal.ThrowExceptionForHR((_frame.GetGuidProperty((int)__VSFPROPID, out value)));

            return(value);
        }
示例#6
0
        private Guid GetGuid(__VSFPROPID id)
        {
            ThreadHelper.ThrowIfNotOnUIThread();

            Guid gResult;

            if (VSErr.Succeeded(Frame.GetGuidProperty((int)id, out gResult)))
            {
                return(gResult);
            }
            else
            {
                return(Guid.Empty);
            }
        }
示例#7
0
        /// <summary>
        /// Gets a window frame property.
        /// </summary>
        /// <param name="provider">A service provider.</param>
        /// <param name="propertyId">A property id.</param>
        /// <returns>A window frame property.</returns>
        private static ModelingDocView GetWindowFrameProperty(IServiceProvider provider, __VSFPROPID propertyId)
        {
            IVsMonitorSelection selection = (IVsMonitorSelection)provider.GetService(typeof(IVsMonitorSelection));
            if (selection != null) {
                object frameObject;
                selection.GetCurrentElementValue(2, out frameObject);

                IVsWindowFrame windowFrame = frameObject as IVsWindowFrame;
                if (windowFrame != null) {
                    object propertyValue;
                    windowFrame.GetProperty((int)propertyId, out propertyValue);
                    return propertyValue as ModelingDocView;
                }
            }

            return null;
        }
示例#8
0
        private void SetGuid(__VSFPROPID propId, Guid value)
        {
            if (_frame == null)
                throw new InvalidOperationException();

            Marshal.ThrowExceptionForHR((_frame.SetGuidProperty((int)propId, ref value)));
        }
示例#9
0
        private Guid GetGuid(__VSFPROPID __VSFPROPID)
        {
            if (_frame == null)
                throw new InvalidOperationException();

            Guid value;
            Marshal.ThrowExceptionForHR((_frame.GetGuidProperty((int)__VSFPROPID, out value)));

            return value;
        }
 private void SetGuid(__VSFPROPID id, Guid value)
 {
     Marshal.ThrowExceptionForHR(Frame.SetGuidProperty((int)id, ref value));
 }
示例#11
0
        private static ModelingDocView GetWindowFrameProperty(IServiceProvider provider, __VSFPROPID propertyId)
        {
            IVsMonitorSelection selection = (IVsMonitorSelection)provider.GetService(typeof(IVsMonitorSelection));

            if (selection != null)
            {
                object frameObject;
                selection.GetCurrentElementValue(2, out frameObject);

                IVsWindowFrame windowFrame = frameObject as IVsWindowFrame;
                if (windowFrame != null)
                {
                    object propertyValue;
                    windowFrame.GetProperty((int)propertyId, out propertyValue);
                    return(propertyValue as ModelingDocView);
                }
            }

            return(null);
        }
示例#12
0
        private void SetGuid(__VSFPROPID id, Guid value)
        {
            ThreadHelper.ThrowIfNotOnUIThread();

            Marshal.ThrowExceptionForHR(Frame.SetGuidProperty((int)id, ref value));
        }