public void GenerateMap_WhenAssemblyHasTypesWithoutNamespace_TypesAreContainedInNoneNamespaceContainer() { const string TypeName = "Issue45_TypeWithNoNamespace"; const string NoneNamespaceName = "NoneNamespaces"; List <DocumentedAssembly> assemblies = new List <DocumentedAssembly>(); DocumentedAssembly documentedAssembly = new DocumentedAssembly { FileName = DocumentationFile }; EntryCreator creator = new EntryCreator(); assemblies.Add(documentedAssembly); GroupedNamespaceDocumentMapper mapper = new GroupedNamespaceDocumentMapper(assemblies, false, creator); DocumentMap result = mapper.GenerateMap(); AssemblyDef assembly = documentedAssembly.LoadedAssembly; TypeDef type = assembly.FindType(string.Empty, TypeName); Entry entry = result.FindById(type.GetGloballyUniqueId()); Assert.AreSame(type, entry.Item); // the type has been mapped Assert.AreEqual(NoneNamespaceName, entry.Parent.Parent.SubKey); // is part of the nonenamespace container }
protected virtual void OneTimeSetUp() { Reader = new EntryReader(DatabaseName, CollectionName); Creator = new EntryCreator(Reader, DatabaseName, CollectionName); Updater = new EntryUpdater(DatabaseName, CollectionName); Deleter = new EntryDeleter(DatabaseName, CollectionName); Broker = new EntryBroker(Creator, Reader, Updater, Deleter); Broker.Initialize(DatabaseName); }
private Document InitialiseDocumentForExport(List <DocumentedAssembly> files, export.ExportSettings settings) { EntryCreator entryCreator = new EntryCreator(); Document document = new Document(files, Mappers.GroupedNamespaceFirst, false, entryCreator); document.Settings = settings.Settings; document.UpdateDocumentMap(); _log.LogInformation($" {Path.GetFileName(_configuration.Document)} contains {entryCreator.Created} members and types.\n"); return(document); }
public void AssemblyFirstDocumentMapper_WhenCreatedWithNoAssemblies_MapIsEmpty() { List <DocumentedAssembly> assemblies = new List <DocumentedAssembly>(); EntryCreator entryCreator = new EntryCreator(); bool useObservableCollection = false; AssemblyFirstDocumentMapper mapper = new AssemblyFirstDocumentMapper(assemblies, useObservableCollection, entryCreator); DocumentMap map = mapper.GenerateMap(); Assert.AreEqual(0, entryCreator.Created); Assert.AreEqual(0, map.Count); }
protected override void OneTimeSetUp() { base.OneTimeSetUp(); RabbitCreator = new EntryCreator( new MessagePublisher(HostName, ExchangeName, CreatorQueueName)); RabbitReader = new EntryReader( new MessageConsumer(HostName, ApiQueueName), new MessagePublisher(HostName, ExchangeName, ReaderQueueName)); RabbitUpdater = new EntryUpdater( new MessagePublisher(HostName, ExchangeName, UpdaterQueueName)); RabbitDeleter = new EntryDeleter( new MessagePublisher(HostName, ExchangeName, DeleterQueueName)); RabbitBroker = new EntryBroker(Creator, Reader, Updater, Deleter); AutoResetEvent = new AutoResetEvent(false); }
public void AssemblyFirstDocumentMapper_When_Should() { List <DocumentedAssembly> assemblies = new List <DocumentedAssembly>(); EntryCreator entryCreator = new EntryCreator(); bool useObservableCollection = false; DocumentedAssembly documented = new DocumentedAssembly(); documented.FileName = "test.dll"; assemblies.Add(documented); AssemblyFirstDocumentMapper mapper = new AssemblyFirstDocumentMapper(assemblies, useObservableCollection, entryCreator); DocumentMap map = mapper.GenerateMap(); Assert.AreEqual(0, entryCreator.Created); }
public IEnumerable <dynamic> GetEntries(string collectionName) { var size = SizeOf("Contacts"); var properties = new Dictionary <string, string> { { "Badge", "//*[@resource-id='io.appium.android.apis:id/badge']" }, { "FirstName", "//*[@resource-id='io.appium.android.apis:id/name']" } }; var creator = new EntryCreator(this, "Contacts", properties); for (int i = 1; i <= size; i++) { yield return(creator.GetNextEntry(i)); } }
private void EntryEdititm_Click(object sender, EventArgs e) { UI.EntryCreator ec = new EntryCreator(_TheBook); ec.EditEntry(_TheEntry); ec.ShowDialog(); }
internal static void Initialise() { string forDocument = @"C:\Users\Barry\Documents\Development\Projects\Developer Suite\The Box Software Developer Suite.sln"; List <DocumentedAssembly> files = new List <DocumentedAssembly>(); Project project = null; ExportSettings settings = new ExportSettings(); settings.Settings = new DocumentSettings(); if (!File.Exists(forDocument)) { throw new InvalidOperationException(string.Format("The file {0} does not exist.", forDocument)); } // initialise the assemblies, ldproj file will detail all assemblies, we are only working // with ldproj, vs projects/solutions and dll files if (Path.GetExtension(forDocument) == ".ldproj") { project = Project.Deserialize(forDocument); foreach (string file in project.Files) { files.Add(new DocumentedAssembly(file)); } settings.Settings.VisibilityFilters = project.VisibilityFilters; } else if (Path.GetExtension(forDocument) == ".dll") { files.Add(new DocumentedAssembly(forDocument)); } else { try { files.AddRange( InputFileReader.Read( forDocument, "Release" )); } catch (ArgumentException) { throw new Exception( string.Format("The provided file [{0}] and extension is not supported", forDocument) ); } } settings.Settings.VisibilityFilters = new List <Visibility>() { Visibility.Public }; // we will always default to public System.Console.Write("Loading documentation ... "); // initialise the document EntryCreator entryCreator = new EntryCreator(); docs = new Document(files, Mappers.NamespaceFirst, false, entryCreator); docs.Settings = settings.Settings; docs.UpdateDocumentMap(); System.Console.Write("[done]\n"); }
/// <summary> /// Initialises the state of the documentation class and prepares it so <see cref="Documentation" /> can be accessed. /// </summary> /// <include file='Documentation\documentation.xml' path='members/member[@name="Load"]/*'/> // sets default settings for the documentation and loads it to memory, this is generally // a slow step. public void Load() { List <DocumentedAssembly> files = new List <DocumentedAssembly>(); Project project = null; ExportSettings settings = new ExportSettings(); settings.Settings = new DocumentSettings(); if (!File.Exists(this._forDocument)) { throw new InvalidOperationException(string.Format("The file {0} does not exist.", this._forDocument)); } // initialise the assemblies, ldproj file will detail all assemblies, we are only working // with ldproj, vs projects/solutions and dll files if (Path.GetExtension(_forDocument) == ".ldproj") { project = Project.Deserialize(_forDocument); foreach (string file in project.Files) { files.Add(new DocumentedAssembly(file)); } settings.Settings.VisibilityFilters = project.VisibilityFilters; } else if (Path.GetExtension(_forDocument) == ".dll") { files.Add(new DocumentedAssembly(_forDocument)); } else { try { files.AddRange( new InputFileReader().Read( _forDocument, "Release" )); } catch (ArgumentException) { throw new DocumentationException( string.Format("The provided file [{0}] and extension is not supported", this._forDocument) ); } } settings.Settings.VisibilityFilters = new List <Visibility>() { Visibility.Public, Visibility.Protected }; // we will always default to public/protected // initialise the document EntryCreator entryCreator = new EntryCreator(); Document d = new Document(files, Mappers.NamespaceFirst, false, entryCreator); d.Settings = settings.Settings; d.UpdateDocumentMap(); _baseDocument = d; // store it for future references _isLoaded = true; // if we are here we have loaded successfully }
protected virtual void Start() { _button.onClick.AddListener(createEntry); _label.text = _type.GetName(); _entryCreator = FindObjectOfType <EntryCreator>(); }