public void AddTab(string title, Android.Support.V4.App.Fragment frag, TabType tp) { Titles.Add(title); fragments.Add(frag); TabTypes.Add(tp); NotifyDataSetChanged(); }
/// <summary> /// Deletes any details currently stored in the Smart Poster /// and re-initializes them by parsing the contents of the payload. /// </summary> private void ParsePayloadToData(byte[] payload) { InitializeData(); if (payload == null || payload.Length == 0) { return; } var message = NdefMessage.FromByteArray(payload); foreach (NdefRecord record in message) { var specializedType = record.CheckSpecializedType(false); if (specializedType == null) { continue; } if (specializedType == typeof(NdefUriRecord)) { // URI RecordUri = new NdefUriRecord(record); } else if (specializedType == typeof(NdefTextRecord)) { // Title var textRecord = new NdefTextRecord(record); if (Titles == null) { Titles = new List <NdefTextRecord>(); } Titles.Add(textRecord); } else if (specializedType == typeof(NdefSpActRecord)) { // Action _recordAction = new NdefSpActRecord(record); } else if (specializedType == typeof(NdefSpSizeRecord)) { // Size _recordSize = new NdefSpSizeRecord(record); } else if (specializedType == typeof(NdefSpMimeTypeRecord)) { // Mime Type _recordMimeType = new NdefSpMimeTypeRecord(record); } else if (specializedType == typeof(NdefMimeImageRecordBase)) { // Image _recordImage = new NdefMimeImageRecordBase(record); } else { Debug.WriteLine("Sp: Don't know how to handle this record: " + BitConverter.ToString(record.Type)); } } }
//Parse private void ParseRSS() { try { XmlDocument rssXmlDoc = new XmlDocument(); // Load the RSS file from the RSS URL rssXmlDoc.Load(URL); //Store initial values - title and link XmlNode TL = rssXmlDoc.SelectSingleNode("rss/channel"); this.Title = TL.SelectSingleNode("title").InnerText.Trim(); this.Link = TL.SelectSingleNode("link").InnerText.Trim(); this.Language = TL.SelectSingleNode("language").InnerText.Trim(); this.PublishedDate = TL.SelectSingleNode("pubDate").InnerText.Trim(); this.LastBuildDate = TL.SelectSingleNode("lastBuildDate").InnerText.Trim(); // Parse the Items in the RSS file XmlNodeList rssNodes = rssXmlDoc.SelectNodes("rss/channel/item"); foreach (XmlNode rssNode in rssNodes) { //Title XmlNode rssSubNode = rssNode.SelectSingleNode("title"); string title = rssSubNode != null ? rssSubNode.InnerText : ""; //Link/Url rssSubNode = rssNode.SelectSingleNode("link"); string link = rssSubNode != null ? rssSubNode.InnerText : ""; link = ParseLink(link); Titles.Add(title); URLs.Add(link); TitlesURLs.Add(title + " - " + link); } } catch (Exception e) { throw e; } }
private async Task DownloadTitles(List <Uri> AllTitlesUrls) { var urlsForTitles = AllTitlesUrls.Take(TAKE_COUNT); int skipTitles = TAKE_COUNT; var downloadTasks = urlsForTitles.Select(link => WebPageDownloader.Download(link)).ToList(); while (downloadTasks.Any()) { Task <WebPage> _task = null; try { _task = await Task.WhenAny(downloadTasks); } catch (Exception ex) { Console.WriteLine($"{DateTime.Now} ||Error Message:: {ex.Message}"); await Task.Delay(DELAY_IF_EXCEPTION); _task.Start(); } finally { Titles.Add(TitleBuilder.Get(_task.Result.Html, _task.Result.Url)); Console.WriteLine($"{DateTime.Now} ||Добавлен новый тайтл. ВСЕГО:{Titles.Count}"); downloadTasks.Remove(_task); await Task.Delay(DELAY); var newTask = AllTitlesUrls.Skip(skipTitles).Take(1).Select(link => WebPageDownloader.Download(link)); skipTitles += 1; downloadTasks.AddRange(newTask); } } }
/// <summary> /// Method <c>loadData</c> performs the reading of /// the csv file containing the library extract data. /// It populates all data collection contained within /// this Library. /// It is called from the Library constructor, but /// can also be called from a Public method Load() /// </summary> private async void loadData() { // Locate the csv file. var dataFile = await Helpers.DataFileHelper.GetDataFile(); if (dataFile != null) { // Set up the streamreader to access the file, Read only mode using (StreamReader reader = new StreamReader(await dataFile.OpenStreamForReadAsync())) { while (!reader.EndOfStream) { string data = reader.ReadLine(); // split the data into a Book record and add to the Books collection. var book = Helpers.DeserialiseData.ToBook(data, _libraryBookFactory); Books.Add(book); // Add to other model classes Authors.Add(book.Author); Titles.Add(book.Title); Isbns.Add(book.ISBN); // Split the keywords and add them if they don't exist. foreach (string kw in book.KeyWords) { Keywords.Add(kw); } Keywords.Sort(); } } } }
public void GetTitles(ApiInfo liveAPI) { var corp = ((CorporationKey)EveXml.CreateApiKey(Convert.ToInt32(Properties.Settings.Default.CorpAPI), Properties.Settings.Default.VCode).Init().GetActualKey()).Corporation; var titles = corp.GetMemberTracking().Result.Members.Where(member => member.CharacterName == UserName).FirstOrDefault().Title.Split(new string[] { ", " }, StringSplitOptions.RemoveEmptyEntries); var titleList = new List <Title>(); foreach (var title in titles) { titleList.Add(new Title() { UserId = Id, TitleName = title }); } Titles = titleList; if ((GetToonId(IDType.Corporation, liveAPI.ApiKey, liveAPI.VerificationCode) == GetToonId(IDType.Corporation, Convert.ToInt32(Properties.Settings.Default.CorpAPI), Properties.Settings.Default.VCode)) && (!this.Titles.Any(title => title.TitleName == "CEO")) ) { Titles.Add(new Title() { UserId = this.Id, TitleName = "CEO" }); } }
private void Parser_OnNewData(object arg1, string[] arg2) { foreach (var a in arg2) { Titles.Add(a); } }
public ZoneDataAreaChart(Func <TrainingEntry[]> getEntries) : base(() => getEntries().Cast <Entry>().ToArray(), true) { Titles.Add("Zone Data Area"); GetGroupingChanged += AddEntries; }
} //end parseResponse public void Add(Movie movie) { if (!Titles.Contains(movie)) { Titles.Add(movie); } }//end add
public void Add(Title title) { if (title != null) { Titles.Add(title); } }
private void InitialicePERCENTILES( int width, int height, List <Ar_ChartingResult> members) { Series[] series = BuildSeries(1); for (int i = 0; i < members.Count; i++) { series[0].Points.Add(members[i].ToDataPoints(i, 0)); } var t = new Title("PUNTUACIONES T") { Font = new Font("Microsoft Sans Serif", 11F, FontStyle.Bold, GraphicsUnit.Point, 0) }; Series.Add(series[0]); Titles.Add(t); BorderColor = Color.LightGray; BorderWidth = 1; ChartAreas.Add(BuildChartArea(true)); Width = width; // new Unit( width, UnitType.Pixel ); Height = height; // new Unit( height, UnitType.Pixel ); }
//Parse private void ParseRSS() { try { var feed = SyndicationFeed.Load(XmlReader.Create(URL)); this.Updated = feed.LastUpdatedTime.ToString(); this.Title = feed.Title.ToString(); this.Link = feed.Links.First(l => l.RelationshipType.Trim().ToLower() == "alternate").Uri.ToString(); this.Category = new Entry._Category(feed.Categories.FirstOrDefault(c => c.Name != "").Name, feed.Categories.FirstOrDefault(c => c.Name != "").Label); this.ID = feed.Id; //Items foreach (var item in feed.Items) { //Authors List <Entry._Author> authors = new List <Entry._Author>(); foreach (SyndicationPerson author in item.Authors) { authors.Add(new Entry._Author(author.Name, author.Uri)); } //Categories List <Entry._Category> categories = new List <Entry._Category>(); foreach (SyndicationCategory category in item.Categories) { categories.Add(new Entry._Category(category.Name, category.Label)); } //Links List <string> Links = new List <string>(); foreach (SyndicationLink link in item.Links) { Links.Add(link.Uri.ToString()); } //ID IDs.Add(item.Id.ToString()); //Updated Updateds.Add(item.LastUpdatedTime.ToString()); //Content Contents.Add(item.Content.ToString()); //Titles Titles.Add(item.Title.Text.ToString()); //Titles & Links if (!TitlesLinks.ContainsKey(item.Title.ToString().Trim())) { TitlesLinks.Add(item.Title.Text.ToString().Trim(), Links); } //Add entry Entries.Add(new Entry(authors, categories, item.Content.ToString(), item.Id.ToString(), Links, item.LastUpdatedTime.ToString(), item.Title.ToString())); } } catch (Exception e) { throw e; } }
} //end createMovieList public void Add(Movie movie) { if (!Titles.Contains(movie)) { movie.Poster = ""; Titles.Add(movie); } }//end add
/// <summary> /// /// </summary> /// <param name="title"></param> public void AddTitle(string title) { if (Mode == FileMode.ReadOnly) { throw new FileLibException("File is Read-Only cannot AddTitle"); } Titles.Add(title); }
public void Add() { var nMovie = new MovieViewModel(); nMovie.PropertyChanged += Movie_OnNotifyPropertyChanged; Titles.Add(nMovie); myMovie.Add(nMovie); SelectedIndex = Titles.IndexOf(nMovie); }
public void AddNewTitle() { TitleViewModel entity = new TitleViewModel(); entity.Title = String.Format(CultureInfo.InvariantCulture, "{0}{1}", "New Title", GetMaxIndex() + 1); entity.PropertyChanged += (sender, e) => { ChangePreview(); }; Titles.Add(entity); SelectedTitle = Titles[Titles.Count - 1]; }
public ResultsList(List <WikipediaNet.Objects.Search> searches) { SetReference(); for (int i = 0; i < searches.Count; i++) { Titles.Add(searches[i].Title); Snippets.Add(searches[i].Snippet); } }
private void Gestion_titre() { //Titre this.titre.Name = "titre"; this.titre.Text = "Mesures en cours"; this.titre.Font = new Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.titre.ForeColor = Color.Red; Titles.Add(titre);//rajout du titre sur le graphique }
public override void InitializeTitles() { Titles.Add(new Tuple <TextDefinition, Type>(new TextDefinition(1156691), typeof(DefenderOfEodonTitleDeed))); // Defender of Eodon Titles.Add(new Tuple <TextDefinition, Type>(new TextDefinition(1156692), typeof(DefenderOfTheMyrmidexTitleDeed))); // Defender of the Myrmidex Titles.Add(new Tuple <TextDefinition, Type>(new TextDefinition(1156693), typeof(FlameOfTheJukariTitleDeed))); // Flame of the Jukari Titles.Add(new Tuple <TextDefinition, Type>(new TextDefinition(1156694), typeof(AmbusherOfTheKurakTitleDeed))); // Ambusher of the Kurak Titles.Add(new Tuple <TextDefinition, Type>(new TextDefinition(1156695), typeof(TrooperOfTheBarakoTitleDeed))); // Trooper of the Barako Titles.Add(new Tuple <TextDefinition, Type>(new TextDefinition(1156696), typeof(ThunderOfTheUraliTitleDeed))); // Thunder of the Urali Titles.Add(new Tuple <TextDefinition, Type>(new TextDefinition(1156697), typeof(HerderOfTheSakkhraTitleDeed))); // Herder of the Sakkhra Titles.Add(new Tuple <TextDefinition, Type>(new TextDefinition(1156698), typeof(ColonizerOfTheBarrabTitleDeed))); // Colonizer of the Barrab }
public async Task Refresh() { //notify view foreach (var myMovie in myMovie.Titles) { var np = new MovieViewModel(myMovie); np.PropertyChanged += Movie_OnNotifyPropertyChanged; Titles.Clear(); Titles.Add(np); } }//end refresh
public SportOverviewChart(Func <TrainingEntry[]> getEntries, Common.Sport sport) : base(() => getEntries().Cast <Entry>().ToArray()) { _sport = sport; Titles.Add(_sport + " Overview"); // can't do that in Initialize() because _sport isn't yet set var trainingTypeColors = Common.GetTrainingTypeColors(_sport); for (var i = 0; i < Common.GetTrainingTypes(_sport).Length; i++) { Series.Add( new Series("Training Type " + Common.GetTrainingTypes(_sport)[i].ToString()) { XValueType = ChartValueType.Date, YValueType = ChartValueType.Int32, ChartType = SeriesChartType.StackedColumn, Color = trainingTypeColors[i], ChartArea = "Monthly Training Types" }); } // must add entries manually for the same reason AddEntries(); // detect whether chartarea is clicked MouseClick += (s, e) => { if (_maximizedChartArea != 0) { _maximizedChartArea = 0; AlignChartAreas(); return; } for (var i = 0; i < ChartAreas.Count; i++) { var minX = (int)ChartAreas[i].Position.X * Width / 100; var maxX = (int)((ChartAreas[i].Position.X + ChartAreas[i].Position.Width) * Width / 100); var minY = (int)ChartAreas[i].Position.Y * Height / 100; var maxY = (int)((ChartAreas[i].Position.Y + ChartAreas[i].Position.Height) * Height / 100); if (e.X < minX || e.X > maxX || e.Y < minY || e.Y > maxY) { continue; } //The mouse is inside the given area _maximizedChartArea = i + 1; AlignChartAreas(); return; } }; }
private void SetObservableCollections() { foreach (ILinguisticVariable linguistic in linguistics) { Titles.Add(linguistic.Title); } foreach (FactorFuzzyValue term in termSets) { FuzzyValues.Add(term); } }
private void addTitle_Click(object sender, EventArgs e) { using (TitleWindow window = new TitleWindow(TitleWindow.Operation.Add)) { var result = window.ShowDialog(); if (result == DialogResult.OK) { string[] row = window.Values; Titles.Add(row); } } }
/// <summary> /// Initializes a new instance of the /// <see cref="ChartPanel" /> /// class. /// </summary> /// <param name="chartdata">The chartdata.</param> /// <param name="title">The title.</param> public ChartPanel(ISeriesModel chartdata, ITitleInfo title) : this() { ChartData = chartdata; Configuration = ChartData.GetSeriesConfiguration(); SourceModel = ChartData.GetSourceModel(); TitleInfo = title; DataMetric = ChartData.GetSeriesMetric(); DataSeries = new DataSeries(ChartData); Series.Add(DataSeries); Titles.Add(TitleInfo.GetChartMainTitle()); }
/// <summary> /// Initializes a new instance of the /// <see cref="ChartPanel" /> /// class. /// </summary> /// <param name="model">The model.</param> /// <param name="title">The title.</param> public ChartPanel(ISourceModel model, ITitleInfo title) : this() { SourceModel = model; Configuration = SourceModel.GetSeriesConfiguration(); TitleInfo = title; DataMetric = SourceModel.GetMetric(); ChartData = new SeriesModel(SourceModel.GetSourceBinding()); DataSeries = new DataSeries(ChartData); Series.Add(DataSeries); Titles.Add(TitleInfo.GetChartMainTitle()); }
/// <summary> /// Initializes a new instance of the <see cref="ChartPanel" /> class. /// </summary> /// <param name="data">The data.</param> /// <param name="seriesconfig">The seriesconfig.</param> public ChartPanel(IEnumerable <DataRow> data, ISeriesConfig seriesconfig) : this() { SourceModel = new SourceModel(data, seriesconfig); Configuration = SourceModel.GetSeriesConfiguration(); ChartData = new SeriesModel(data, seriesconfig); DataMetric = SourceModel.GetMetric(); TitleInfo = new TitleInfo(DataMetric.Data?.CopyToDataTable()?.TableName); DataSeries = new DataSeries(ChartData); Series.Add(DataSeries); Titles.Add(TitleInfo.GetChartMainTitle()); }
/// <summary> /// Initializes a new instance of the /// <see cref="ChartPanel" /> /// class. /// </summary> /// <param name="sourcebinding">The sourcebinding.</param> public ChartPanel(IChartBinding sourcebinding) : this() { SourceModel = new SourceModel(sourcebinding); Configuration = SourceModel.GetSeriesConfiguration(); ChartData = new SeriesModel(sourcebinding); DataMetric = SourceModel.GetMetric(); TitleInfo = new TitleInfo(DataMetric.Data?.CopyToDataTable()?.TableName); DataSeries = new DataSeries(ChartData); Series.Add(DataSeries); Titles.Add(TitleInfo.GetChartMainTitle()); }
protected override void addTitle() { Titles.Add( new Title(Title, Docking.Top) { Position = new ElementPosition(0, 0, 100, 14), Alignment = ContentAlignment.TopLeft, Font = Font.Regular, Text = Title } ); }
public async override Task GetEntitiesFromServer() { List <Task> tasks = new List <Task>(); Task <List <TeamModel> > entitiesTask = interactor.GetEntities("api/floorball/teams", "Error during getting teams"); tasks.Add(entitiesTask); Task <List <LeagueModel> > leaguesTask = interactor.GetEntities <LeagueModel>("api/floorball/leagues", "Error during getting leagues"); tasks.Add(leaguesTask); /*dTask<List<TeamModel>> teamsTask = interactor.GetEntities<TeamModel>("api/floorball/teams", "Error during getting teams"); * tasks.Add(teamsTask);*/ //Task<Dictionary<int, List<int>>> playersAndTeamsTask = interactor.GetEntityMappings("api/floorball/players/teams", "Error during getting teams for player"); await Task.WhenAll(tasks); var entities = entitiesTask.Result; var leagues = leaguesTask.Result; //var teams = teamsTask.Result; TeamModel prevEntity = null; List <SearchCell> searchList = new List <SearchCell>(); foreach (var entity in entities.OrderByDescending(e => e.LeagueId).ThenBy(e => e.Name)) { if (prevEntity == null || entity.Name != prevEntity.Name) { SearchModel.Add(new List <SearchCell>()); var league = leagues.Single(l => l.Id == entity.LeagueId); Titles.Add(new SearchTitle { MainTitle = league.Name, Subtitle = AppDelegate.SharedAppDelegate.TextManager.GetText(league.Gender) }); } SearchModel.Last().Add(new SearchCell { Id = entity.Id, Title = entity.Name, Subtitle = entity.Coach, RightDetail = entity.Year.Year.ToString() }); prevEntity = entity; } FilteredSearchModel = new List <List <SearchCell> >(SearchModel); FilteredTitles = new List <SearchTitle>(Titles); }
private void UpdateTitles() { var outputs = workout.Output; for (int i = 0; i < 5; i++) { if (Titles.Count <= i) { Titles.Add(new StringItem()); } Titles[i].Text = outputs[i]; } Progress = workout.Progress; var holds = new string[] { "\uf060", "\uf667", "\uf048" }; var holdTimes = outputs[2]; if (Text == null) { Text = new ObservableCollection <StringItem>(new StringItem[] { new StringItem { Text = "" }, new StringItem { Text = "" }, new StringItem { Text = "" } }); Picture = new ObservableCollection <StringItem>(new StringItem[] { new StringItem { Text = "" }, new StringItem { Text = "" }, new StringItem { Text = "" } }); } if (holdTimes != string.Empty) { var strings = holdTimes.Split(':').Select(t => holds[(int.Parse(t) / 10) - 1]).ToArray(); var timeStr = holdTimes.Split(':').Select(t => t[1] + "s").ToArray(); for (int i = 0; i < 3; i++) { Picture[i].Text = strings[i]; Text[i].Text = timeStr[i]; } } else { for (int i = 0; i < 3; i++) { Text[i].Text = ""; Picture[i].Text = ""; } } }