private List<Related> MapRelated(HtmlNode node) { var relatedShows = new List<Related>(); var subNode = node.ChildNodes[1]; foreach (var url in subNode.ChildNodes) { if (url.Name == "a") { var related = new Related { Title = url.InnerText, Url = string.Format(_urlHelper.CleanMalUrl, url.Attributes["href"].Value) }; var parts = related.Url.Split('/'); int id; int.TryParse(parts[4], out id); related.Id = id; relatedShows.Add(related); } } return relatedShows; }
protected async Task AssertRelatedFile(Node node, Related related) { var relNode = await node.GetNode(related.Path); this.AssertNodeFile(relNode); Assert.Equal(related.Name, relNode.Name); }
public static string GetName(Related related, int index) { switch (related) { case Related.REFERENCE: case Related.LOCAL_REFERENCE: return(Enum.GetName(typeof(EntityRelated), index)); case Related.STR: case Related.SUGGESTION: return(Enum.GetName(typeof(StringRelated), index)); case Related.NUM64: case Related.NUM32: return(Enum.GetName(typeof(NumRelated), index)); case Related.DBL: return(Enum.GetName(typeof(DoubleRelated), index)); case Related.BOOL: return(Enum.GetName(typeof(BoolRelated), index)); case Related.GEO: return(Enum.GetName(typeof(GeoRelated), index)); case Related.ENUM: return(Enum.GetName(typeof(EnumRelated), index)); default: return(Enum.GetName(typeof(DateRelated), index)); } }
public Anime get_fav() { Id = 1; Name = "Fairy Tail"; IcoUri = "~/images/Anime/fairy-tail/ico.jpg"; Desc = "Set in an imaginary world, the Earth Land, there exists a Mage Guild called \"Fairy Tail\". Fairy Tail is stationed in the town Magnolia, residing in the Kingdom of Fiore, and is currently governed by Makarov, Guild's master." + "\r\n\r\n" + "Lucy Heartfilia, a 17 - year old girl, wishes to become a full-fledged mage and join one of the most prestigious Mage Guilds in the world, Fairy Tail." + "\r\n\r\n" + "One day, out of pure coincidence, she meets Dragneel Natsu, a boy who is transportation - sick, but very cheerful in nature.However, the thing she does not know is that Natsu is the closest connection to Fairy Tail, as he is a Mage in Fairy Tail."; AirDate = "Aug 23, 2006"; BannerUri = "~/images/Anime/fairy-tail/banner.jpg"; Genres = "Action;Adventure;Comedy;Ecchi;Fantasy"; AuthorName = "Hiro Mashima"; NumEpisodes = 277; Rating = 3.7; Related.Add("Fairy Tail 2014", "~/images/Anime/fairy-tail/fairy-tail-2014.jpg"); Related.Add("Fairy Tail Zero", "~/images/Anime/fairy-tail/fairy-tail-zero.jpg"); Related.Add("Fairy Tail Movie: Phoenix Priestess", "~/images/Anime/fairy-tail/fairy-tail-movie-1.jpg"); Related.Add("Fairy Tail Movie: Dragon Cry", "~/images/Anime/fairy-tail/fairy-tail-movie-2.jpg"); Links.Add("http://kissanime.ru/Anime/Fairy-Tail"); Links.Add("http://www.animeshow.tv/Fairy-Tail/"); return(this); }
public static void Show(Related stream, Video vid) { Console.WriteLine("**********************************************"); Console.WriteLine("=============================================="); Console.WriteLine("Name: " + vid.Name); Console.WriteLine("Categories: "); PrintCriteria(vid.Category); Console.WriteLine("Genre: "); PrintCriteria(vid.Genre); Console.WriteLine("Actors: "); PrintCriteria(vid.Actors); Console.WriteLine("=============================================="); Console.WriteLine("**********************************************"); foreach (var video in stream.RelatedVideosStream) { Console.WriteLine("------------------------------------------"); Console.WriteLine("Name: " + video.Video.Name); Console.WriteLine("Categories: "); PrintCriteria(video.Video.Category); Console.WriteLine("Genre: "); PrintCriteria(video.Video.Genre); Console.WriteLine("Actors: "); PrintCriteria(video.Video.Actors); Console.WriteLine("------------------------------------------"); } }
public static void DirectionOutput(GameObject SourceInstance, ElectricalOIinheritance Thiswire, CableLine RelatedLine = null) { int SourceInstanceID = SourceInstance.GetInstanceID(); if (Thiswire.Data.connections.Count == 0) { Thiswire.FindPossibleConnections(); } if (!(Thiswire.Data.SupplyDependent.ContainsKey(SourceInstanceID))) { Thiswire.Data.SupplyDependent[SourceInstanceID] = new ElectronicSupplyData(); } ElectricalSynchronisation.OutputSupplyingUsingData = Thiswire.Data.SupplyDependent[SourceInstanceID]; foreach (ElectricalOIinheritance Related in Thiswire.Data.connections) { if (!(ElectricalSynchronisation.OutputSupplyingUsingData.Upstream.Contains(Related)) && (!(Thiswire == Related))) { bool pass = true; if (RelatedLine != null) { if (RelatedLine.Covering.Contains(Related)) { pass = false; } } if (!(ElectricalSynchronisation.OutputSupplyingUsingData.Downstream.Contains(Related)) && pass) { ElectricalSynchronisation.OutputSupplyingUsingData.Downstream.Add(Related); Related.DirectionInput(SourceInstance, Thiswire); } } } }
public override int GetHashCode() { int result = 7; result = 7 * result + Related.GetHashCode(); result = 7 * result + RelationshipType.GetHashCode(); return(result); }
public int CreateStream(Video video, VideoStream videoStream) { var related = new Related(videoStream, video); ShowRelatedVideos.Show(related, video); return(related.SizeOfStream()); }
private async Task <List <Artist> > GetRelated() { var RelTask = ApiHandler.GetRelated(CurrentArtist.Id).ConfigureAwait(false); List <JSONArtist> rel = await RelTask; List <Artist> relA = rel.Select(x => JsonToArtist(x)) .Where(x => Related == null ? true : !Related.Contains(x) && x != CurrentArtist).ToList <Artist>(); return(relA.Skip(Random.Next(diff, relA.Count - 1 - diff)).Take(diff).ToList <Artist>()); }
public override string ToString() { if (Related == null) { return(" -> {0}".FormatWith(Color)); } return("{0} {1} -> {2}".FormatWith(Related.GetType().NiceName(), Related.Id, Color)); }
/// <summary> /// Validate the object. /// </summary> /// <exception cref="ValidationException"> /// Thrown if validation fails /// </exception> public virtual void Validate() { if (Name == null) { throw new ValidationException(ValidationRules.CannotBeNull, "Name"); } if (Related != null) { Related.Validate(); } }
public async Task <IActionResult> CreateModel() { var model = new Model(); var related = new Related(); await context.Models.AddAsync(model); await context.Related.AddAsync(related); model.RelatedModels.Add(related); await context.SaveChangesAsync(); return(Ok(model.Id)); }
public NameValueCollection GetParameters() { var values = new NameValueCollection(); if (DateTime != null) { values["VALUE"] = "DATE-TIME"; } if (DateTime == null && Related != Relateds.Start) { values["RELATED"] = Related.ToString().ToUpper(); } return(values); }
} // ScAddSMnote // ****************************************************************************** public void ScAddSMrelated(Related related) // Code History: // 2014-02-12 mws { XmlNode parentXN = XmlDoc.SelectSingleNode("/nar:" + RootElemName + "/nar:schemeMeta", NsMngr); if (parentXN == null) { return; } XmlElement newXElement = XmlDoc.CreateElement("related", G2NsCs); NarProperty2XmlElement(related, newXElement); parentXN.AppendChild(newXElement); } // ScAddSMrelated
public void UpdateConnector() { Source.UpdateLayout(); Related.UpdateLayout(); double leftX = Source.Item.Left + Source.ActualWidth / 2; double rightX = Related.Item.Left; double topY = Source.Item.Top + Source.ActualHeight; double bottomY = Related.Item.Top + Related.ActualHeight / 2; Connector.Points.Clear(); Connector.Points.Add(new Point(leftX, topY)); Connector.Points.Add(new Point(leftX, bottomY)); Connector.Points.Add(new Point(rightX, bottomY)); }
public void lineExplore(CableLine PassOn, GameObject SourceInstance = null) { if (Data.connections.Count <= 0) { FindPossibleConnections(); } if (!(Data.connections.Count > 2)) { RelatedLine = PassOn; if (!(this == PassOn.TheStart)) { if (PassOn.TheEnd != null) { PassOn.Covering.Add(PassOn.TheEnd); PassOn.TheEnd = this; } else { PassOn.TheEnd = this; } } foreach (ElectricalOIinheritance Related in Data.connections) { if (!(RelatedLine.Covering.Contains(Related) || RelatedLine.TheStart == Related)) { bool canpass = true; if (SourceInstance != null) { int SourceInstanceID = SourceInstance.GetInstanceID(); if (Data.SupplyDependent[SourceInstanceID].Upstream.Contains(Related)) { canpass = false; } } if (canpass) { if (Related.GameObject().GetComponent <WireConnect>() != null) { Related.GameObject().GetComponent <WireConnect>().lineExplore(RelatedLine); } } } } } }
} // ScAddCSCbroader // ****************************************************************************** public void ScAddCSCrelated(string conceptElementId, Related related) // Code History: // 2010-12-13 mws { string parentXPath = "/nar:" + RootElemName + "/nar:conceptSet/nar:concept[@id='" + conceptElementId + "']"; XmlNode parentXN = XmlDoc.SelectSingleNode(parentXPath, NsMngr); if (parentXN == null) { AddCSconcept(conceptElementId); } XmlElement newXElement = XmlDoc.CreateElement("related", G2NsCs); NarProperty2XmlElement(related, newXElement); AddPropertyToParent(parentXPath, NameSeqConcept, newXElement); } // ScAddCSCrelated
private void UpdateRelated() { DatabaseCommands.GetDocumentsStartingWithAsync(Key + "/", 0, 15) .ContinueOnSuccess(items => { if (items == null) { return; } var linkModels = items.Select(doc => new LinkModel { Title = doc.Key, HRef = "/Edit?id=" + doc.Key }).ToArray(); Related.Set(linkModels); }); }
/// <summary> /// Returns a hash code for this instance. /// </summary> /// <returns> /// A hash code for this instance, suitable for use in hashing algorithms and data structures like a hash table. /// </returns> public override int GetHashCode( ) { int hash = 13; if (DateTime != null) { hash = (hash * 7) + DateTime.GetHashCode( ); } if (Duration != null) { hash = (hash * 7) + Duration.GetHashCode( ); } hash = (hash * 7) + Related.GetHashCode( ); return(hash); }
public static EntitySearchDisplayInfo ResourceModel(Related related, int index) { var indexName = GetName(related, index); var rm = GetResourceCollection(related); var info = new EntitySearchDisplayInfo { Title = new ResourceManager(rm.Titles).GetString(indexName), Column = rm.Columns == null ? null: new ResourceManager(rm.Columns).GetString(indexName), Description = new ResourceManager(rm.Descriptions).GetString(indexName), ShortName = new ResourceManager(rm.ShortNames).GetString(indexName), }; if (info.Title == null && info.Column == null && info.Description == null || info.ShortName == null) { return(null); } return(info); }
private void UpdateRelated() { if (string.IsNullOrEmpty(Key) || string.IsNullOrEmpty(Seperator)) { return; } var childrenTask = DatabaseCommands.StartsWithAsync(Key + Seperator, 0, 15) .ContinueOnSuccess(items => items == null ? new string[0] : items.Select(i => i.Key)); // find parent Ids var parentids = new List <string>(); var id = Key; var lastindex = id.LastIndexOf(Seperator, StringComparison.Ordinal); while (!string.IsNullOrWhiteSpace(id) && lastindex != -1) { id = id.Remove(lastindex); parentids.Add(id); lastindex = id.LastIndexOf(Seperator, StringComparison.Ordinal); } var parentsTask = ApplicationModel.Current.Server.Value.SelectedDatabase.Value.AsyncDatabaseCommands.GetAsync(parentids.ToArray(), null, metadataOnly: true) .ContinueOnSuccess(results => results.Results.Where(r => r != null).Select(r => r["@metadata"].SelectToken("@id").ToString())); TaskEx.WhenAll(childrenTask, parentsTask).ContinueOnSuccessInTheUIThread(t => { var linkModels = childrenTask.Result .Concat(parentsTask.Result) .OrderBy(key => key.Length) .Select(key => new LinkModel { Title = key, HRef = "/Edit?id=" + key }) .ToArray(); Related.Set(linkModels); }); }
public List <Related> getRelatedContent(List <Extracted.Entities.Entity> entityList) { List <Related> returnList = new List <Related>(); foreach (Extracted.Entities.Entity related in entityList) { if (related.disambiguated != null) { Related newOne = new Related(); newOne.name = related.text; if (related.disambiguated.dbpedia != null) { newOne.websiteName = "External Website Link"; newOne.websiteLink = related.disambiguated.dbpedia; newOne.websiteClass = "icon-share"; newOne.websiteShow = "Display: block;"; } else { newOne.websiteShow = "Display: none;"; } newOne.searchLink = "/templates/Search.aspx?q=" + related.text; if (related.disambiguated.website != null) { newOne.homepageLink = related.disambiguated.website; newOne.homepageClass = "icon-home"; newOne.homepageName = "Homepage"; newOne.homepageShow = "Display: block;"; } else { newOne.homepageShow = "Display: none;"; } returnList.Add(newOne); } } return(returnList); }
public static void DirectionOutput(GameObject SourceInstance, ElectricalOIinheritance Thiswire, CableLine RelatedLine = null) { int SourceInstanceID = SourceInstance.GetInstanceID(); if (!(Thiswire.Data.Upstream.ContainsKey(SourceInstanceID))) { Thiswire.Data.Upstream[SourceInstanceID] = new HashSet <ElectricalOIinheritance>(); } if (!(Thiswire.Data.Downstream.ContainsKey(SourceInstanceID))) { Thiswire.Data.Downstream[SourceInstanceID] = new HashSet <ElectricalOIinheritance>(); } if (Thiswire.Data.connections.Count <= 0) { Thiswire.FindPossibleConnections(); } foreach (ElectricalOIinheritance Related in Thiswire.Data.connections) { if (!(Thiswire.Data.Upstream[SourceInstanceID].Contains(Related)) && (!(Thiswire == Related))) { bool pass = true; if (RelatedLine != null) { if (RelatedLine.Covering.Contains(Related)) { pass = false; } } if (!(Thiswire.Data.Downstream[SourceInstanceID].Contains(Related)) && pass) { Thiswire.Data.Downstream[SourceInstanceID].Add(Related); Related.DirectionInput(SourceInstance, Thiswire); } } } }
public static string ToJson(this Related self) => JsonConvert.SerializeObject(self, Converter.Settings);
private Related GetRelated(Related from, Setting setting) { return(new Related() { Path = from.Path[(setting.TestPath.Share.Length + 1)..],
/// <summary>Returns a string that represents the current object.</summary> /// <returns>A string that represents the current object.</returns> public override string ToString() { return($"{nameof(Token)}: {Token}, {nameof(Related)}: {Related.FirstOrDefault()}"); }
private static Dictionary <int, DefaultDictionary> GetDictionaryFromRelated(IEnumerable <PropertySearchInfo> propSearchInfos, Related related) { var infos = propSearchInfos.Where(s => s.Related == related).ToList(); return(infos.ToDictionary(s => s.Index, g => new DefaultDictionary { Visible = g.Visible, AutoNumeric = g.AutoNumeric, NameProp = char.ToLower(g.Name[0]) + g.Name.Substring(1), isArray = g.IsEnumerable, Info = g.Info, Required = g.IsRequired, Unique = g.IsUnique, HasInput = g.HasInput })); }
// POST: api/RelatedNews public bool Post(Related rdt) { return(dbutility.addRelated(rdt)); }
public override IDeepCopyable CopyTo(IDeepCopyable other) { var dest = other as Observation; if (dest != null) { base.CopyTo(dest); if (Identifier != null) { dest.Identifier = new List <Hl7.Fhir.Model.Identifier>(Identifier.DeepCopy()); } if (StatusElement != null) { dest.StatusElement = (Code <Hl7.Fhir.Model.Observation.ObservationStatus>)StatusElement.DeepCopy(); } if (Category != null) { dest.Category = (Hl7.Fhir.Model.CodeableConcept)Category.DeepCopy(); } if (Code != null) { dest.Code = (Hl7.Fhir.Model.CodeableConcept)Code.DeepCopy(); } if (Subject != null) { dest.Subject = (Hl7.Fhir.Model.ResourceReference)Subject.DeepCopy(); } if (Encounter != null) { dest.Encounter = (Hl7.Fhir.Model.ResourceReference)Encounter.DeepCopy(); } if (Effective != null) { dest.Effective = (Hl7.Fhir.Model.Element)Effective.DeepCopy(); } if (IssuedElement != null) { dest.IssuedElement = (Hl7.Fhir.Model.Instant)IssuedElement.DeepCopy(); } if (Performer != null) { dest.Performer = new List <Hl7.Fhir.Model.ResourceReference>(Performer.DeepCopy()); } if (Value != null) { dest.Value = (Hl7.Fhir.Model.Element)Value.DeepCopy(); } if (DataAbsentReason != null) { dest.DataAbsentReason = (Hl7.Fhir.Model.CodeableConcept)DataAbsentReason.DeepCopy(); } if (Interpretation != null) { dest.Interpretation = (Hl7.Fhir.Model.CodeableConcept)Interpretation.DeepCopy(); } if (CommentsElement != null) { dest.CommentsElement = (Hl7.Fhir.Model.FhirString)CommentsElement.DeepCopy(); } if (BodySite != null) { dest.BodySite = (Hl7.Fhir.Model.CodeableConcept)BodySite.DeepCopy(); } if (Method != null) { dest.Method = (Hl7.Fhir.Model.CodeableConcept)Method.DeepCopy(); } if (Specimen != null) { dest.Specimen = (Hl7.Fhir.Model.ResourceReference)Specimen.DeepCopy(); } if (Device != null) { dest.Device = (Hl7.Fhir.Model.ResourceReference)Device.DeepCopy(); } if (ReferenceRange != null) { dest.ReferenceRange = new List <Hl7.Fhir.Model.Observation.ObservationReferenceRangeComponent>(ReferenceRange.DeepCopy()); } if (Related != null) { dest.Related = new List <Hl7.Fhir.Model.Observation.ObservationRelatedComponent>(Related.DeepCopy()); } if (Component != null) { dest.Component = new List <Hl7.Fhir.Model.Observation.ObservationComponentComponent>(Component.DeepCopy()); } return(dest); } else { throw new ArgumentException("Can only copy to an object of the same type", "other"); } }
public static ResourceModel GetResourceCollection(Related related) { switch (related) { case Related.REFERENCE: case Related.LOCAL_REFERENCE: return(new ResourceModel { Columns = null, Titles = typeof(entity_titles), Descriptions = typeof(entity_descriptions), ShortNames = typeof(entity_snames) }); case Related.STR: case Related.SUGGESTION: return(new ResourceModel { Columns = typeof(string_columns), Titles = typeof(string_titles), Descriptions = typeof(string_descriptions), ShortNames = typeof(string_snames) }); case Related.NUM32: case Related.NUM64: return(new ResourceModel { Columns = typeof(num_columns), Titles = typeof(num_titles), Descriptions = typeof(num_descriptions), ShortNames = typeof(num_snames) }); case Related.DBL: return(new ResourceModel { Columns = typeof(double_columns), Titles = typeof(double_titles), Descriptions = typeof(double_descriptions), ShortNames = typeof(double_snames) }); case Related.BOOL: return(new ResourceModel { Columns = typeof(boolean_columns), Titles = typeof(boolean_titles), Descriptions = typeof(boolean_descriptions), ShortNames = typeof(boolean_snames) }); case Related.GEO: return(new ResourceModel { Columns = typeof(geo_columns), Titles = typeof(geo_titles), Descriptions = typeof(geo_descriptions), ShortNames = typeof(geo_snames) }); case Related.ENUM: return(new ResourceModel { Columns = typeof(enum_columns), Titles = typeof(enum_titles), Descriptions = typeof(enum_descriptions), ShortNames = typeof(enum_snames) }); default: return(new ResourceModel { Columns = typeof(date_columns), Titles = typeof(date_titles), Descriptions = typeof(date_descriptions), ShortNames = typeof(date_snames) }); } }