using System; using System.Collections.Generic; using System.Linq; using System.Text; using ICSharpCode.NRefactory.CSharp; using System.IO; using System.Text.RegularExpressions; using ICSharpCode.NRefactory.TypeSystem; using ICSharpCode.NRefactory.CSharp.TypeSystem; using ICSharpCode.NRefactory.CSharp.Resolver; using ICSharpCode.NRefactory.Semantics; namespace HDLibrary.UnitsOfMeasure.Validator { class SharedElementScope { private Dictionary<object, SharedElement> sharedElements = new Dictionary<object, SharedElement>(); public ISharedElement GetSharedElement(ResolveResult resolveResult, out bool isNew) { object key = null; MemberResolveResult mrr = resolveResult as MemberResolveResult; if (mrr != null) key = mrr.Member; else { LocalResolveResult lrr = resolveResult as LocalResolveResult; if (lrr != null) key = lrr.Variable; } isNew = false; if (key == null) return null; SharedElement result; if (!sharedElements.TryGetValue(key, out result)) { result = new SharedElement(); sharedElements.Add(key, result); isNew = true; } return result; } private class SharedElement : ISharedElement { public IUnitDescription UnitDescription { get; set; } //public Unit Unit { get; set; } //public Unit[] Parameters { get; set; } } } }
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.
This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)