public APIVariable(APIPage InParent, XmlNode InNode) : base(InParent, InNode.SelectSingleNode("name").InnerText) { Node = InNode; Protection = ParseProtection(Node); AddRefLink(Node.Attributes["id"].InnerText, this); }
public void ThenIValidateStatus(int status) { APIPage apiPageObject = new APIPage(); JObject response = (JObject)ScenarioContext.Current["response"]; apiPageObject.VerifyApiStatus(status, response); }
public void ThenIVerifyResponsePropertiesForValidRequest() { APIPage apiPageObject = new APIPage(); JObject apiResponse = (JObject)ScenarioContext.Current["response"]; Assert.IsNotNull(apiResponse["promotions"].ToString()); Console.WriteLine(apiResponse["promotions"].ToString()); Assert.IsNotNull(apiResponse["promotions"][0]["promotionId"]); var typeOfPromoId = apiResponse["promotions"][0]["promotionId"].Value <string>().GetType(); Assert.AreEqual(typeof(string), typeOfPromoId); Assert.IsNotNull(apiResponse["promotions"][0]["orderId"]); Console.WriteLine(apiResponse["promotions"][0]["orderId"]); Assert.IsNotNull(apiResponse["promotions"][0]["promoArea"]); Assert.IsNotNull(apiResponse["promotions"][0]["promoType"]); var typeOfShowPrice = apiResponse["promotions"][0]["showPrice"].Value <bool>().GetType(); Assert.AreEqual(typeof(bool), typeOfShowPrice); var typeOfShowText = apiResponse["promotions"][0]["showText"].Value <bool>().GetType(); Assert.AreEqual(typeof(bool), typeOfShowText); Assert.IsNotNull(apiResponse["promotions"][0]["localizedTexts"]); Assert.IsNotNull(apiResponse["promotions"][0]["localizedTexts"]["ar"]); Assert.IsNotNull(apiResponse["promotions"][0]["localizedTexts"]["en"]); string[] programType = { "EPISODE", "MOVIE", "SERIES", "SEASON" }; Assert.IsTrue(programType.Contains(apiResponse["promotions"][0]["properties"][0]["programType"].ToString().ToUpper())); }
public void GivenICallPromotionAPIWithKey(string APIKey) { APIPage apiPageObject = new APIPage(); JObject response = apiPageObject.CallAPIs(APIKey); ScenarioContext.Current["response"] = response; }
public APIRecord(APIPage InParent, DoxygenEntity InEntity) : base(InParent, GetNameFromNode(InEntity.Node)) { // Set all the readonly vars Entity = InEntity; Node = InEntity.Node; RefId = Node.Attributes["id"].InnerText; Protection = ParseProtection(Node); // Set the record type switch (Node.Attributes["kind"].Value) { case "class": RecordType = Name.StartsWith("I")? APIRecordType.Interface : APIRecordType.Class; break; case "struct": RecordType = APIRecordType.Struct; break; case "union": RecordType = APIRecordType.Union; break; } // Register the record for incoming links AddRefLink(RefId, this); // Add it to the template list if(Node.SelectSingleNode("templateparamlist") != null) { bIsTemplate = true; bIsTemplateSpecialization = Name.Contains('<'); if(!bIsTemplateSpecialization && !TemplateRecords.ContainsKey(FullName)) TemplateRecords.Add(FullName, this); } }
public static APIHierarchy Build(APIPage Parent, IEnumerable<APIRecord> Records) { // Create a root node APIHierarchyNode RootNode = new APIHierarchyNode(); // Build a set of all the records to include in the hierarchy HashSet<APIRecord> KnownRecords = new HashSet<APIRecord>(); foreach (APIRecord Record in Records) { KnownRecords.Add(Record); } // Filter out all the records which don't have another record in the hierarchy foreach (APIRecord Record in Records) { if (!Record.bIsTemplateSpecialization) { if (Record.BaseRecords == null || !Record.BaseRecords.Exists(y => KnownRecords.Contains(y.Value))) { APIHierarchyNode NewNode = new APIHierarchyNode(Record.FullName, Record.LinkPath, true); NewNode.AddChildren(Record); RootNode.Children.Add(NewNode); } } } // Return the new page return new APIHierarchy(Parent, "Class Hierarchy", "Class Hierarchy", RootNode); }
public APIFunctionIndex(APIPage InParent, IEnumerable<APIFunction> Functions) : base(InParent, "Functions", "Alphabetical list of all functions") { // Create the operators category Category OperatorsCategory = new Category("Operators"); Categories.Add(OperatorsCategory); // Separate out all the functions by their unique names Dictionary<APIFunctionKey, List<APIFunction>> KeyedFunctions = new Dictionary<APIFunctionKey, List<APIFunction>>(); foreach(APIFunction Function in Functions) { APIFunctionKey Key = new APIFunctionKey(Function.FullName, Function.FunctionType); Utility.AddToDictionaryList(Key, Function, KeyedFunctions); } // Build a list of all the members, creating function groups where necessary List<KeyValuePair<APIFunctionKey, APIMember>> KeyedMembers = new List<KeyValuePair<APIFunctionKey, APIMember>>(); foreach (KeyValuePair<APIFunctionKey, List<APIFunction>> KeyedFunction in KeyedFunctions) { if (KeyedFunction.Value.Count == 1) { KeyedMembers.Add(new KeyValuePair<APIFunctionKey,APIMember>(KeyedFunction.Key, KeyedFunction.Value[0])); } else { // Check if all the members have the same function group APIFunctionGroup FunctionGroup = KeyedFunction.Value[0].Parent as APIFunctionGroup; for(int Idx = 1; Idx < KeyedFunction.Value.Count; Idx++) { if(KeyedFunction.Value[Idx].Parent != FunctionGroup) { FunctionGroup = null; break; } } // If there was no common function group, create a new one if (FunctionGroup == null) { FunctionGroup = new APIFunctionGroup(this, KeyedFunction.Key, KeyedFunction.Value); FunctionGroups.Add(FunctionGroup); } // Add the function group to the member list KeyedMembers.Add(new KeyValuePair<APIFunctionKey, APIMember>(KeyedFunction.Key, FunctionGroup)); } } // Separate all the functions into different categories foreach (KeyValuePair<APIFunctionKey, APIMember> KeyedMember in KeyedMembers) { if (KeyedMember.Key.Type == APIFunctionType.UnaryOperator || KeyedMember.Key.Type == APIFunctionType.BinaryOperator) { OperatorsCategory.Entries.Add(new Entry(KeyedMember.Value)); } else { AddToDefaultCategory(new Entry(KeyedMember.Value)); } } }
public static APIFunctionKey FromEntity(APIPage Parent, DoxygenEntity Entity) { string Name = Entity.Name; if (Parent != null && Parent is APIRecord) { if (Name == Parent.Name && (Parent is APIRecord) && Entity.Node.Attributes["static"].Value != "yes") { return new APIFunctionKey(Name, APIFunctionType.Constructor); } else if (Name == "~" + Parent.Name) { return new APIFunctionKey(Name, APIFunctionType.Destructor); } } if (Name.StartsWith("operator") && Name.Length > 8 && !Char.IsLetterOrDigit(Name[8]) && Name[8] != '_') { int NumParams = 0; using (XmlNodeList ParamNodeList = Entity.Node.SelectNodes("param")) { foreach (XmlNode ParamNode in ParamNodeList) { NumParams++; } } if ((Parent is APIRecord) && Entity.Node.Attributes["static"].Value != "yes") { NumParams++; } return new APIFunctionKey(Name, (NumParams == 1) ? APIFunctionType.UnaryOperator : APIFunctionType.BinaryOperator); } return new APIFunctionKey(Name, APIFunctionType.Normal); }
public APIEventParameters(APIPage InParent, APIMember InAttachedTo, DoxygenEntity InEntity) : base(InParent, InEntity.Name) { AttachedTo = InAttachedTo; Entity = InEntity; AddRefLink(Entity.Id, this); }
public APITypeDef(APIPage InParent, XmlNode InNode) : base(InParent, InNode.SelectSingleNode("name").InnerText) { Node = InNode; Id = Node.Attributes["id"].Value; AddRefLink(Id, this); }
public void GivenICheckPostsData(Table table) { string response = new APIPage().ReadResponse(); dynamic data = table.CreateDynamicInstance(); VerifyTextExists(data.title.ToString(), response.ToString()); }
public APIConstantIndex(APIPage InParent, IEnumerable<APIMember> Members) : base(InParent, "Constants", "Alphabetical list of all constants") { foreach (APIMember Member in Members) { if (Member.FullName == Member.Name) { if (Member is APIConstant) { // Add the constant as-is AddToDefaultCategory(new Entry(Member)); } else if (Member is APIEnum) { // Get the enum APIEnum Enum = (APIEnum)Member; // Get the scope prefix for all enum members string EnumPrefix = Enum.FullName; int LastScope = EnumPrefix.LastIndexOf("::"); EnumPrefix = (LastScope == -1) ? "" : EnumPrefix.Substring(0, LastScope + 2); // Add all the values foreach (APIEnumValue EnumValue in Enum.Values) { AddToDefaultCategory(new Entry(EnumPrefix + EnumValue.Name, Enum.LinkPath)); } } } } }
public APICategory(APIPage InParent, string InName, bool bInIsRootCategory = false) : base(InParent, InName) { SubCategories = new Dictionary<string, APICategory>(); Actions = new List<APIAction>(); bIsRootCategory = bInIsRootCategory; }
public APITypeDef(APIPage InParent, DoxygenEntity InEntity) : base(InParent, InEntity.Node.SelectSingleNode("name").InnerText) { Entity = InEntity; Node = Entity.Node; Id = Node.Attributes["id"].Value; AddRefLink(Id, this); }
public void ThenIVerifyResponsePropertiesForinValidRequest() { APIPage apiPageObject = new APIPage(); JObject apiResponse = (JObject)ScenarioContext.Current["response"]; Assert.IsNotNull(apiResponse["error"]["requestId"].ToString()); Assert.AreEqual((string)apiResponse["error"]["code"], "8001"); Assert.AreEqual((string)apiResponse["error"]["message"], "invalid api key"); }
public APIMemberIndex(APIPage InParent, string InName, string InDescription) : base(InParent, InName) { Description = InDescription; for (int Idx = 0; Idx < CharacterCategories.Length; Idx++) { Categories.Add(new Category(CharacterCategories.Substring(Idx, 1))); } }
public static IEnumerable<APIConstant> Read(APIPage Parent, DoxygenEntity Entity) { XmlNode EnumNode = Entity.Node; using (XmlNodeList ValueNodeList = EnumNode.SelectNodes("enumvalue")) { foreach (XmlNode ValueNode in ValueNodeList) { string Name = ValueNode.SelectSingleNode("name").InnerText; APIConstant Constant = new APIConstantEnum(Parent, Entity, ValueNode, Name); yield return Constant; } } }
public APIEnumIndex(APIPage InParent, IEnumerable<APIMember> Members) : base(InParent, "Enums", "All enums") { foreach (APIMember Member in Members) { if (Member is APIEnum) { Entry NewEntry = new Entry(Member); if (NewEntry.SortName.Length >= 2 && IgnorePrefixLetters.Contains(NewEntry.SortName[0]) && Char.IsUpper(NewEntry.SortName[1])) { NewEntry.SortName = NewEntry.SortName.Substring(1); } AddToDefaultCategory(NewEntry); } } }
public void VerifyProtocolsList() { #region Variables Logger1 newLog1 = new Logger1(); newLog1.CreateStory(driver, MethodBase.GetCurrentMethod().Name, GetTestDescription(MethodBase.GetCurrentMethod().CustomAttributes)); List <string> listOfProtocols = new List <string> { "WebDriver Protocol", "Appium", "Mobile JSON Wire Protocol", "Chromium", "Sauce Labs", "Selenium Standalone", "JSON Wire Protocol" }; #endregion #region Navigate to Home Page and Click "Protocol" section in the left navigation bar HomePage homePage = new HomePage(driver); homePage.Navigate(); APIPage аpiPage = homePage.GoToAPIPage(); аpiPage.ExpandProtocols(); #endregion #region Get Number of Protocols and Their Names from the menu Thread.Sleep(TimeSpan.FromSeconds(10)); var protocols = аpiPage.Protocols; var protocolList = new List <string>(); for (int i = 0; i < protocols.Count; i++) { protocolList.Add(protocols[i].Text); } #endregion #region Verify Protocol Names in Exact Order newLog1.Step("Protocols", driver); Assert.IsTrue(listOfProtocols.SequenceEqual(protocolList)); newLog1.SaveStory(); #endregion }
public APITypeIndex(APIPage InParent, IEnumerable<APIMember> Members) : base(InParent, "Types", "Alphabetical index of all types") { foreach (APIMember Member in Members) { if ((Member is APIRecord && (!((APIRecord)Member).bIsTemplateSpecialization)) || (Member is APITypeDef) || (Member is APIEnum) || (Member is APIEventParameters)) { Entry NewEntry = new Entry(Member); if (NewEntry.SortName.Length >= 2 && IgnorePrefixLetters.Contains(NewEntry.SortName[0]) && Char.IsUpper(NewEntry.SortName[1])) { NewEntry.SortName = NewEntry.SortName.Substring(1); } AddToDefaultCategory(NewEntry); } } }
public APIFunctionGroup(APIPage InParent, APIFunctionKey InKey, IEnumerable<DoxygenEntity> InEntities) : base(InParent, InKey.Name, Utility.MakeLinkPath(InParent.LinkPath, InKey.GetLinkName())) { FunctionType = InKey.Type; // Build a list of prototypes for each function node, to be used for sorting List<DoxygenEntity> Entities = new List<DoxygenEntity>(InEntities.OrderBy(x => x.Node.SelectNodes("param").Count)); // Create the functions int LinkIndex = 1; foreach(DoxygenEntity Entity in Entities) { string NewLinkPath = Utility.MakeLinkPath(LinkPath, String.Format("{0}", LinkIndex)); APIFunction Function = new APIFunction(this, Entity, InKey, NewLinkPath); Children.Add(Function); LinkIndex++; } }
public APIAction(APIPage InParent, string InName, Dictionary<string, object> ActionProperties) : base(InParent, InName) { object Value; if (ActionProperties.TryGetValue("Tooltip", out Value)) { Tooltip = String.Concat(((string)Value).Split('\n').Select(Line => Line.Trim() + '\n')); } else { Tooltip = ""; } if (ActionProperties.TryGetValue("CompactTitle", out Value)) { CompactName = (string)Value; } if (ActionProperties.TryGetValue("NodeType", out Value)) { NodeType = (string)Value; } else { NodeType = "function"; } if (ActionProperties.TryGetValue("Pins", out Value)) { Pins = new List<APIActionPin>(); foreach (var Pin in (Dictionary<string, object>)Value) { Pins.Add(new APIActionPin(this, APIActionPin.GetPinName((Dictionary<string, object>)Pin.Value), (Dictionary<string, object>)Pin.Value)); } } if (ActionProperties.TryGetValue("ShowAddPin", out Value)) { bShowAddPin = Convert.ToBoolean((string)Value); } }
public APIEnum(APIPage InParent, XmlNode InNode, string InName) : base(InParent, InName) { // Set the defaults Node = InNode; Protection = ParseProtection(Node); // Read the values using(XmlNodeList ValueNodeList = Node.SelectNodes("enumvalue")) { foreach(XmlNode ValueNode in ValueNodeList) { APIEnumValue Value = new APIEnumValue(ValueNode); AddRefLink(Value.Id, this); Values.Add(Value); } } // Add it as a link target AddRefLink(Node.Attributes["id"].InnerText, this); }
public void Add(string Name, APIPage Page) { APIPage ExistingPage; if(Entries.TryGetValue(Name, out ExistingPage)) { if (ExistingPage != Page) { List<APIPage> ConflictPages; if (!ConflictEntries.TryGetValue(Name, out ConflictPages)) { ConflictPages = new List<APIPage>{ ExistingPage }; ConflictEntries.Add(Name, ConflictPages); } if (!ConflictPages.Contains(Page)) { ConflictPages.Add(Page); } } } else { Entries.Add(Name, Page); } }
public APIAction(APIPage InParent, string InName, Dictionary<string, object> ActionProperties) : base(InParent, InName) { object Value; TooltipNormalText = ""; TooltipLine.LineType CurrentLineType = TooltipLine.LineType.Count; //Invalid if (ActionProperties.TryGetValue("Tooltip", out Value)) { //Create an interleaved list of normal text and note regions. Also, store all normal text as a single block (i.e. notes stripped out) in a separate place. foreach (string Line in ((string)Value).Split('\n')) { string TrimmedLine = Line.Trim(); if (TrimmedLine.StartsWith("@note")) { if (TrimmedLine.Length > 6) { if (CurrentLineType != TooltipLine.LineType.Note) { CurrentLineType = TooltipLine.LineType.Note; TooltipData.Add(new TooltipLine(CurrentLineType)); } TooltipData[TooltipData.Count - 1].Text += (TrimmedLine.Substring(6) + '\n'); } } else { if (CurrentLineType != TooltipLine.LineType.Normal) { CurrentLineType = TooltipLine.LineType.Normal; TooltipData.Add(new TooltipLine(CurrentLineType)); } TooltipData[TooltipData.Count - 1].Text += (TrimmedLine + '\n'); TooltipNormalText += (TrimmedLine + '\n'); } } } if (ActionProperties.TryGetValue("CompactTitle", out Value)) { CompactName = (string)Value; } if (ActionProperties.TryGetValue("NodeType", out Value)) { NodeType = (string)Value; } else { NodeType = "function"; } if (ActionProperties.TryGetValue("Pins", out Value)) { Pins = new List<APIActionPin>(); foreach (var Pin in (Dictionary<string, object>)Value) { Pins.Add(new APIActionPin(this, APIActionPin.GetPinName((Dictionary<string, object>)Pin.Value), (Dictionary<string, object>)Pin.Value)); } } if (ActionProperties.TryGetValue("ShowAddPin", out Value)) { bShowAddPin = Convert.ToBoolean((string)Value); } }
public void GivenIHaveConnectedWithPostsAPI() { APIPage apiPage = new APIPage(); }
public static APIModule Build(APIPage InParent, DoxygenModule InModule) { // Find the description and category string ModuleSettingsPath = "Module." + InModule.Name; string Description = Program.Settings.FindValueOrDefault(ModuleSettingsPath + ".Description", ""); // Get the filter settings IniSection FilterSection = Program.Settings.FindSection(ModuleSettingsPath + ".Filter"); IniSection WithholdSection = Program.Settings.FindSection(ModuleSettingsPath + ".Withhold"); // Build a module from all the members APIModule Module = new APIModule(InParent, InModule.Name, Description); // Normalize the base directory string NormalizedBaseSrcDir = Path.GetFullPath(InModule.BaseSrcDir).ToLowerInvariant(); if (!NormalizedBaseSrcDir.EndsWith("\\")) NormalizedBaseSrcDir += "\\"; // Separate the members into categories, based on their path underneath the module source directory Dictionary<APIFilter, List<DoxygenEntity>> MembersByFilter = new Dictionary<APIFilter,List<DoxygenEntity>>(); foreach (DoxygenEntity Entity in InModule.Entities) { string FilterPath = null; // Try to get the filter path from the ini section if (FilterSection != null) { FilterPath = FilterSection.Find(Entity.Name); } // If we didn't have one set explicitly, generate one from the subdirectory if(FilterPath == null) { string EntityFile = String.IsNullOrEmpty(Entity.File)? "" : Path.GetFullPath(Entity.File); if(EntityFile.ToLowerInvariant().StartsWith(NormalizedBaseSrcDir)) { int MinIndex = EntityFile.IndexOf('\\', NormalizedBaseSrcDir.Length); if(MinIndex == -1) { FilterPath = ""; } else if (IsVisibleFolder(EntityFile.Substring(NormalizedBaseSrcDir.Length, MinIndex - NormalizedBaseSrcDir.Length))) { int MaxIndex = EntityFile.LastIndexOf('\\'); FilterPath = EntityFile.Substring(MinIndex + 1, Math.Max(MaxIndex - MinIndex - 1, 0)); } } } // Add this entity to the right filters if(FilterPath != null) { // Create all the categories for this entry APIFilter ParentFilter = Module; if (FilterPath.Length > 0) { string[] Folders = FilterPath.Split('\\'); for (int Idx = 0; Idx < Folders.Length; Idx++) { APIFilter NextFilter = ParentFilter.Filters.FirstOrDefault(x => String.Compare(x.Name, Folders[Idx], true) == 0); if (NextFilter == null) { NextFilter = new APIFilter(ParentFilter, Folders[Idx]); ParentFilter.Filters.Add(NextFilter); } ParentFilter = NextFilter; } } // Add this entity to the pending list for this filter Utility.AddToDictionaryList(ParentFilter, Entity, MembersByFilter); } } // Try to fixup all of the filters foreach (KeyValuePair<APIFilter, List<DoxygenEntity>> Members in MembersByFilter) { APIFilter Filter = Members.Key; Filter.Members.AddRange(APIMember.CreateChildren(Filter, Members.Value)); } return Module; }
public APIModule(APIPage InParent, string InName, string InDescription) : base(InParent, InName) { Description = InDescription; }
public APIFunctionGroup(APIPage InParent, APIFunctionKey InKey, IEnumerable<APIFunction> InFunctions) : base(InParent, InKey.Name, Utility.MakeLinkPath(InParent.LinkPath, InKey.GetLinkName())) { FunctionType = InKey.Type; Children.AddRange(InFunctions); }
public APIMember(APIPage InParent, string InName) : base(InParent, InName) { }
public APIFunction(APIPage InParent, DoxygenEntity InEntity, APIFunctionKey InKey, string InLinkPath) : base(InParent, InEntity.Name, InLinkPath) { Entity = InEntity; Node = Entity.Node; Protection = ParseProtection(Node); FunctionType = InKey.Type; AddRefLink(Entity.Node.Attributes["id"].Value, this); bIsTemplateSpecialization = Name.Contains('<'); if (Node.SelectSingleNode("templateparamlist") != null && !bIsTemplateSpecialization && !TemplateFunctions.ContainsKey(FullName)) { TemplateFunctions.Add(FullName, this); } }
public APIFunction(APIPage InParent, DoxygenEntity InEntity, APIFunctionKey InKey) : this(InParent, InEntity, InKey, Utility.MakeLinkPath(InParent.LinkPath, InKey.GetLinkName())) { }
public APIGettingStarted(APIPage InParent) : base(InParent, "QuickStart") { }
public static List<APIMember> CreateChildren(APIPage Parent, IEnumerable<DoxygenEntity> Entities) { List<APIMember> Children = new List<APIMember>(); Dictionary<APIFunctionKey, List<DoxygenEntity>> PendingFunctionGroups = new Dictionary<APIFunctionKey, List<DoxygenEntity>>(); // List of autogenerated structs List<DoxygenEntity> GeneratedEntities = new List<DoxygenEntity>(); // Parse the entities foreach (DoxygenEntity Entity in Entities) { if (Entity.Kind == "class" || Entity.Kind == "struct" || Entity.Kind == "union") { if (Entity.Kind == "struct" && Entity.Name.Contains("_event") && Entity.Name.EndsWith("_Parms")) { GeneratedEntities.Add(Entity); } else { APIRecord Record = new APIRecord(Parent, Entity); Record.Children.AddRange(CreateChildren(Record, Entity.Members)); Children.Add(Record); } } else if (Entity.Kind == "function") { APIFunctionKey FunctionKey = APIFunctionKey.FromEntity(Parent, Entity); if (!Program.IgnoredFunctionMacros.Contains(FunctionKey.Name)) { List<DoxygenEntity> EntityList; if (!PendingFunctionGroups.TryGetValue(FunctionKey, out EntityList)) { EntityList = new List<DoxygenEntity>(); PendingFunctionGroups.Add(FunctionKey, EntityList); } EntityList.Add(Entity); } } else if (Entity.Kind == "variable") { if (IsConstantVariable(Entity)) { Children.Add(new APIConstantVariable(Parent, Entity)); } else { Children.Add(new APIVariable(Parent, Entity.Node)); } } else if (Entity.Kind == "typedef") { Children.Add(new APITypeDef(Parent, Entity.Node)); } else if (Entity.Kind == "enum") { if (Entity.Name != null && Entity.Name.StartsWith("@")) { // It's an enum constant Children.AddRange(APIConstantEnum.Read(Parent, Entity)); } else { // It's an enum Children.Add(new APIEnum(Parent, Entity, Entity.Name)); } } } // Fixup the functions foreach (KeyValuePair<APIFunctionKey, List<DoxygenEntity>> PendingFunctionGroup in PendingFunctionGroups) { if (PendingFunctionGroup.Value.Count == 1) { APIFunction Function = new APIFunction(Parent, PendingFunctionGroup.Value[0], PendingFunctionGroup.Key); Children.Add(Function); } else { APIFunctionGroup FunctionGroup = new APIFunctionGroup(Parent, PendingFunctionGroup.Key, PendingFunctionGroup.Value); Children.Add(FunctionGroup); } } // Attach all the autogenerated structures to their parent functions foreach(DoxygenEntity Entity in GeneratedEntities) { if(!CreateParametersStruct(Parent, Children, Entity)) { APIRecord Record = new APIRecord(Parent, Entity); Record.Children.AddRange(CreateChildren(Record, Entity.Members)); Children.Add(Record); } } // Sort the children by name Children.Sort((x, y) => String.Compare(x.Name, y.Name)); return Children; }
public APIMember(APIPage InParent, string InName, string InLinkPath) : base(InParent, InName, InLinkPath) { }
public UdnManifest(APIPage Page) { Page.AddToManifest(this); }
public static bool CreateParametersStruct(APIPage Parent, List<APIMember> Children, DoxygenEntity Entity) { string Name = Entity.Name; int ClassMaxIdx = Name.IndexOf("_event"); if (ClassMaxIdx == -1) return false; string ClassName = Name.Substring(0, ClassMaxIdx); APIRecord ClassRecord = Children.OfType<APIRecord>().FirstOrDefault(x => x.Name.EndsWith(ClassName) && x.Name.Length == ClassName.Length + 1); if (ClassRecord == null) return false; if (!Name.EndsWith("_Parms")) return false; int MemberMinIdx = ClassMaxIdx + 6; int MemberMaxIdx = Name.Length - 6; string MemberName = Name.Substring(MemberMinIdx, MemberMaxIdx - MemberMinIdx); APIRecord Delegate = Children.OfType<APIRecord>().FirstOrDefault(x => x.Name == "F" + MemberName); if(Delegate != null) { Delegate.DelegateEventParameters = new APIEventParameters(Parent, Delegate, Entity); Children.Add(Delegate.DelegateEventParameters); return true; } APIFunction Function = ClassRecord.Children.OfType<APIFunction>().FirstOrDefault(x => x.Name == MemberName); if (Function != null) { Function.EventParameters = new APIEventParameters(Parent, Function, Entity); Children.Add(Function.EventParameters); return true; } return false; }