public void GetColorableItem(int iIndex, out IVsColorableItem ppItem) { if (!_colors.TryGetValue((SparkTokenType)iIndex, out ppItem)) { throw new IndexOutOfRangeException(); } }
public override int GetColorableItem(int index, out IVsColorableItem item) { SpecSharpTokenColor xtc = (SpecSharpTokenColor)index; string description = xtc.ToString(); item = new ColorableItem(description, VsLanguageService.colors[index], COLORINDEX.CI_USERTEXT_BK, FONTFLAGS.FF_DEFAULT); return(0); }
public void GetColorableItem(int iIndex, out IVsColorableItem ppItem) { if (iIndex < 1 || iIndex > 3) { throw new IndexOutOfRangeException(); } ppItem = new StubContainedColorableItem(iIndex); }
public override int GetColorableItem(int index, out IVsColorableItem item) { if (index < 1) { throw new ArgumentOutOfRangeException("index"); } item = colorableItems[index - 1]; return(Microsoft.VisualStudio.VSConstants.S_OK); }
public override int GetColorableItem(int index, out IVsColorableItem item) { if (index < 1) { throw new ArgumentOutOfRangeException("index"); } item = colorableItems[index - 1]; return Microsoft.VisualStudio.VSConstants.S_OK; }
public override int GetColorableItem(int index, out IVsColorableItem item) { if (index <= Configuration.ColorableItems.Count) { item = Configuration.ColorableItems[index - 1]; return VSConstants.S_OK; } throw new ArgumentNullException("index"); }
public override int GetColorableItem(int index, out IVsColorableItem item) { if (index < 1) { throw new ArgumentOutOfRangeException("index"); } item = m_colorableItems[index]; return(VSConstants.S_OK); }
public override int GetColorableItem(int index, out IVsColorableItem item) { if (index <= 0 || index > colorItems.Length) { item = null; return VSConstants.S_FALSE; } item = colorItems[index]; return VSConstants.S_OK; }
public override int GetColorableItem(int index, out IVsColorableItem item) { if (index < 1) { throw new ArgumentOutOfRangeException("index"); } item = m_colorableItems[index]; return VSConstants.S_OK; }
/// <summary> /// Gets the colorable item. /// </summary> /// <param name="index">The index.</param> /// <param name="item">The item.</param> /// <returns></returns> public override int GetColorableItem(int index, out IVsColorableItem item) { if (index <= Configuration.ColorableItems.Count) { item = Configuration.ColorableItems[index - 1]; return(VSConstants.S_OK); } throw new ArgumentNullException("index"); }
public override int GetColorableItem(int index, out IVsColorableItem item) { if (index < 1 || index > m_colorableItems.Length) { throw new ArgumentOutOfRangeException(nameof(index)); } item = m_colorableItems[index - 1]; return(VSConstants.S_OK); }
} // func GetItemCount public override int GetColorableItem(int index, out IVsColorableItem item) { if (index <= 0 || index > colorItems.Length) { item = null; return(VSConstants.S_FALSE); } item = colorItems[index]; return(VSConstants.S_OK); } // func GetColorableItem
public override int GetColorableItem(int index, out IVsColorableItem item) { if (index < 1 || index > _colorableItems.Length) { item = null; return(VSConstants.S_FALSE); } item = _colorableItems[index - 1]; return(VSConstants.S_OK); }
public override int GetColorableItem(int index, out IVsColorableItem item) { if (Enum.IsDefined(typeof(PuppetTokenColor), index) && ColorableItems.ContainsKey(index)) { item = ColorableItems[index]; return(Microsoft.VisualStudio.VSConstants.S_OK); } return(base.GetColorableItem(index, out item)); }
public override int GetColorableItem(int index, out IVsColorableItem item) { if (index <= Configuration.ColorableItems.Count) { item = Configuration.ColorableItems[index - 1]; return Microsoft.VisualStudio.VSConstants.S_OK; } else { throw new ArgumentNullException("index"); } }
public override int GetColorableItem(int index, out IVsColorableItem item) { if (index >= 0 && index < SoalLanguageConfig.Instance.ColorableItems.Count) { item = SoalLanguageConfig.Instance.ColorableItems[index]; return(Microsoft.VisualStudio.VSConstants.S_OK); } else { item = SoalLanguageConfig.Instance.ColorableItems[0]; return(Microsoft.VisualStudio.VSConstants.S_OK); } }
public override int GetColorableItem(int index, out IVsColorableItem item) { this.logger.Log(EventLogEntryType.Information, "Entering: GetColorableItem()"); if (index <= OsloCodeGeneratorConfiguration.ColorableItems.Count) { item = OsloCodeGeneratorConfiguration.ColorableItems[index - 1]; return Microsoft.VisualStudio.VSConstants.S_OK; } else { throw new ArgumentNullException("index"); } }
public override int GetColorableItem(int index, out IVsColorableItem item) { if (0 <= index && index < _colorableItems.Length) { item = _colorableItems[index]; return(VSConstants.S_OK); } else { item = null; return(VSConstants.E_FAIL); } }
public override int GetColorableItem(int iIndex, out IVsColorableItem ppItem) { int retval = VSConstants.E_INVALIDARG; ppItem = null; if (this.colorableItemsList != null && iIndex >= 0 && iIndex < this.colorableItemsList.Count) { //ppItem = this.colorableItemsList[iIndex] as IVsColorableItem; ppItem = (MyColorableItem)this.colorableItemsList[iIndex]; retval = VSConstants.S_OK; } return(retval); }
public void CorrectNumberOfColorsReturn() { var colorableItems = (IVsProvideColorableItems)new LanguageSupervisor(); int iCount; colorableItems.GetItemCount(out iCount); Assert.AreEqual(EnumColorCount(), iCount); var items = new IVsColorableItem[iCount]; for (var index = 0; index != iCount; ++index) { // color indexes are one based, 0 is reserved for default plain text colorableItems.GetColorableItem(index + 1, out items[index]); } }
public void CorrectNumberOfColorsReturn() { var colorableItems = (IVsProvideColorableItems) new LanguageSupervisor(); int iCount; colorableItems.GetItemCount(out iCount); Assert.AreEqual(EnumColorCount(), iCount); var items = new IVsColorableItem[iCount]; for (var index = 0; index != iCount; ++index) { // color indexes are one based, 0 is reserved for default plain text colorableItems.GetColorableItem(index + 1, out items[index]); } }
public void PackageReturnsContainedLanguageAndSparkColorsTogether() { var sparkPackage = (IVsPackage) new PackageClass(); sparkPackage.SetSite(_packageSite); var colorableItems = _packageSite.QueryService <IVsProvideColorableItems, SparkLanguageService>(); int iCount; colorableItems.GetItemCount(out iCount); Assert.AreEqual(13, iCount); var items = new IVsColorableItem[iCount + 1]; for (var index = 1; index != iCount + 1; ++index) { // color indexes are one based, 0 is reserved for default plain text colorableItems.GetColorableItem(index, out items[index]); } string name; items[1].GetDisplayName(out name); Assert.AreEqual("Stub 1", name); items[2].GetDisplayName(out name); Assert.AreEqual("Stub 2", name); items[3].GetDisplayName(out name); Assert.AreEqual("Stub 3", name); Assert.AreEqual(1, (int)SparkTokenType.HtmlTagDelimiter); items[4].GetDisplayName(out name); Assert.AreEqual("HTML Tag Delimiter", name); Assert.AreEqual(10, (int)SparkTokenType.SparkDelimiter); items[13].GetDisplayName(out name); Assert.AreEqual("Spark Code Delimiter", name); }
public void PackageReturnsContainedLanguageAndSparkColorsTogether() { var sparkPackage = (IVsPackage)new PackageClass(); sparkPackage.SetSite(_packageSite); var colorableItems = _packageSite.QueryService<IVsProvideColorableItems, SparkLanguageService>(); int iCount; colorableItems.GetItemCount(out iCount); Assert.AreEqual(13, iCount); var items = new IVsColorableItem[iCount + 1]; for (var index = 1; index != iCount + 1; ++index) { // color indexes are one based, 0 is reserved for default plain text colorableItems.GetColorableItem(index, out items[index]); } string name; items[1].GetDisplayName(out name); Assert.AreEqual("Stub 1", name); items[2].GetDisplayName(out name); Assert.AreEqual("Stub 2", name); items[3].GetDisplayName(out name); Assert.AreEqual("Stub 3", name); Assert.AreEqual(1, (int)SparkTokenType.HtmlTagDelimiter); items[4].GetDisplayName(out name); Assert.AreEqual("HTML Tag Delimiter", name); Assert.AreEqual(10, (int)SparkTokenType.SparkDelimiter); items[13].GetDisplayName(out name); Assert.AreEqual("Spark Code Delimiter", name); }
/// <summary> /// Implements IVsProvideColorableItems.GetColorableItem /// </summary> private static new int GetColorableItem(int iIndex, out IVsColorableItem ppItem) { Debug.Assert(iIndex > 0); // Appears to make all calls 1-based ppItem = new ColorableItemImpl(myDefaultColorSettings[iIndex - 1]); return(VSConstants.S_OK); }
int IVsProvideColorableItems.GetColorableItem(int iIndex, out IVsColorableItem ppItem) { return(GetColorableItem(iIndex, out ppItem)); }
public override int GetColorableItem(int index, out IVsColorableItem item) { if (index < 1 || index > m_colorableItems.Length) throw new ArgumentOutOfRangeException(nameof(index)); item = m_colorableItems[index-1]; return VSConstants.S_OK; }
public virtual int GetColorableItem(int index, out IVsColorableItem item);
public override int GetColorableItem(int index, out IVsColorableItem item) { item = colorableItems[index - 1]; return(VSConstants.S_OK); }
public override int GetColorableItem(int index, out IVsColorableItem item) { item = Formats.ColorableItems[index]; return VSConstants.S_OK; }
/// <include file='doc\LanguageService.uex' path='docs/doc[@for="LanguageService.GetColorableItem"]/*' /> public virtual int GetColorableItem(int index, out IVsColorableItem item) { item = null; return NativeMethods.E_NOTIMPL; }
int IVsProvideColorableItems.GetColorableItem(int iIndex, out IVsColorableItem ppItem) { return GetColorableItem(iIndex, out ppItem); }
/// <summary> /// Implements IVsProvideColorableItems.GetColorableItem /// </summary> private static new int GetColorableItem(int iIndex, out IVsColorableItem ppItem) { Debug.Assert(iIndex > 0); // Appears to make all calls 1-based ppItem = new ColorableItemImpl(myDefaultColorSettings[iIndex - 1]); return VSConstants.S_OK; }
public override int GetColorableItem(int index, out IVsColorableItem item){ SpecSharpTokenColor xtc = (SpecSharpTokenColor)index; string description = xtc.ToString(); item = new ColorableItem(description, VsLanguageService.colors[index], COLORINDEX.CI_USERTEXT_BK, FONTFLAGS.FF_DEFAULT); return 0; }
public override int GetColorableItem(int index, out IVsColorableItem item) { if (index >= 1 && index <= MetaModelLanguageConfig.Instance.ColorableItems.Count) { item = MetaModelLanguageConfig.Instance.ColorableItems[index - 1]; return Microsoft.VisualStudio.VSConstants.S_OK; } else { item = MetaModelLanguageConfig.Instance.ColorableItems[0]; return Microsoft.VisualStudio.VSConstants.S_OK; } }
public virtual int GetColorableItem(int index, out IVsColorableItem item){ item = null; return (int)HResult.E_NOTIMPL; }
public override int GetColorableItem(int iIndex, out IVsColorableItem ppItem) { ppItem = null; return(VSConstants.E_INVALIDARG); }
public void GetColorableItem(int iIndex, out IVsColorableItem ppItem) { if (iIndex < 1 || iIndex > 3) throw new IndexOutOfRangeException(); ppItem = new StubContainedColorableItem(iIndex); }