private Dictionary <string, List <string> > GetInnerTests(string job, AtomEntryCollection worksheetRows) { Dictionary <string, List <string> > JenkinTests = new Dictionary <string, List <string> >(); foreach (ListEntry worksheetRow in worksheetRows) { string jobname = worksheetRow.Elements[2].Value.ToString(); string testname = worksheetRow.Elements[3].Value.ToString(); string result = worksheetRow.Elements[4].Value.ToString(); string jenkinslog = worksheetRow.Elements[6].Value.ToString(); string alm = worksheetRow.Elements[7].Value.ToString(); if (jobname != string.Empty && jobname == job && !JenkinTests.ContainsKey(testname)) { List <string> testDetails = new List <string>(); //testDetails.Add(testname); testDetails.Add(result); testDetails.Add(jenkinslog); testDetails.Add(alm); JenkinTests.Add(testname, testDetails); } } return(JenkinTests); }
public SortableBindingList <IndianCalendarEvent> getEvents(DateTime startDate, DateTime endDate, String searchString) { SortableBindingList <IndianCalendarEvent> events = new SortableBindingList <IndianCalendarEvent>(); Trace.WriteLine("Getting Events"); EventQuery query = new EventQuery("http://www.google.com/calendar/feeds/[email protected]/private/full"); query.SingleEvents = true; query.Query = searchString; query.StartTime = startDate; query.EndTime = endDate; // Tell the service to query: EventFeed calFeed = m_service.Query(query) as EventFeed; m_entries = calFeed.Entries; for (int i = 0; i < calFeed.Entries.Count; ++i) { EventEntry entry = (EventEntry)calFeed.Entries[i]; Trace.WriteLine(entry.Title.Text + " at position " + i); IndianCalendarEvent ice = new IndianCalendarEvent(entry.Times[0].StartTime, entry.Title.Text, entry.Locations[0].ValueString, i); events.Add(ice); } Trace.WriteLine("Found " + calFeed.Entries.Count + " items"); return(events); }
static void ParseForSeasonalAchievementSettings(AtomEntryCollection entries) { foreach (ListEntry row in entries) { var durationText = row.Elements[1].Value; if (string.IsNullOrEmpty(durationText)) { continue; } var dateMatchGroups = Regex.Match(durationText, BibaEditorConstants.REGEX_STARTDATE_ENDDATE).Groups; if (dateMatchGroups.Count == 0) { continue; } for (var i = 2; i < row.Elements.Count; i++) { var cell = row.Elements[i]; ParseListEntryForSeasonalAchievement(row.Title.Text, Regex.Match(cell.LocalName, BibaEditorConstants.REGEX_TIME_PLAYED).Groups[1].Value, cell.Value, dateMatchGroups[BibaEditorConstants.REGEX_GROUP_STARTDATE].Value, dateMatchGroups[BibaEditorConstants.REGEX_GROUP_ENDDATE].Value); } } }
private void AddSelectTableData(AtomEntryCollection colectCollection, MenuItemType sheet) { int counter = 0; for (int i = 4; i < colectCollection.Count; i++) { CellEntry cell = colectCollection[i] as CellEntry; switch (counter) { case 0: _runtimeDbSelect[sheet].Add(new BaseDataForSelectWindow() { Id = int.Parse(cell.Value) }); break; case 1: _runtimeDbSelect[sheet].Last().Name = cell.Value; break; case 2: _runtimeDbSelect[sheet].Last().Price = cell.Value; break; case 3: _runtimeDbSelect[sheet].Last().AvatarSprite = cell.Value; counter = -1; break; } counter++; } }
public static List <string> GetAgendaToLinks() { DateTime dt = new DateTime(); dt = DateTime.Now; string userName = "******"; string password = "******"; string applicationName = "Agenda"; CalendarHelper.Credentials = new GDataCredentials(userName, password); AtomEntryCollection feed = CalendarHelper.GetAllEvents(CalendarHelper.GetService(applicationName), DateTime.Now, DateTime.Now.AddDays(90)); List <string> items = new List <string>(); for (int x = 0; x < feed.Count; x++) { var e = feed[x]; if (!String.IsNullOrEmpty(e.Title.Text)) { CalendarEvent ar = new CalendarEvent(); ar.Title = e.Title.Text; ar.URI = e.AlternateUri.Content; ar.Description = e.Content.Content; ExtensionCollection <When> v = ((EventEntry)(e)).Times; ar.StartTime = v[0].StartTime; ar.EndTime = v[0].EndTime; items.Add(ar.ToString()); } } return(items); }
public ListaHojasHistoricoGoogle(SpreadsheetsService servicio, AtomEntryCollection listaHojas) { InitializeComponent(); SombraEncabezado.Source = ImageSource.FromResource(App.RutaImagenSombraEncabezado); _servicio = servicio; _listaHojas = listaHojas; }
//public static EventEntry GetElementByDaytimerID(string id, CalendarService service, DateTime? startDate = null) //{ // EventQuery oEventQuery = new EventQuery(FeedUrl(service)); // oEventQuery.ExtraParameters = "extq=[" + DaytimerID + ":" + id + "]"; // oEventQuery.NumberToRetrieve = 1;// 000; // if (startDate.HasValue) // oEventQuery.StartDate = startDate.Value; // EventFeed oEventFeed = service.Query(oEventQuery); // AtomEntryCollection entries = oEventFeed.Entries; // if (entries.Count > 0) // return (EventEntry)entries[0]; // return null; //} public static EventEntry GetElementByDaytimerID(string id, CalendarService service, string feedUrl) { EventQuery oEventQuery = new EventQuery(feedUrl); oEventQuery.ExtraParameters = "extq=[" + DaytimerID + ":" + id + "]"; oEventQuery.NumberToRetrieve = 1; EventFeed oEventFeed = service.Query(oEventQuery); AtomEntryCollection entries = oEventFeed.Entries; if (entries.Count > 0) { EventEntry entry = (EventEntry)entries[0]; if (entry.OriginalEvent == null) { return(entry); } else { // Get the base element. return(GetElementByGoogleID(entry.EventId, service, feedUrl)); } } return(null); }
/// <summary> /// Sets the list view on the Worksheets page with the titles of the worksheets, /// and the row and column counts for demonstration of these extension elements /// </summary> /// <param name="feed">The worksheets feed for the spreadsheet selected on the Spreadsheets page</param> void SetWorksheetListView(WorksheetFeed feed) { this.worksheetListView.Items.Clear(); AtomEntryCollection entries = feed.Entries; for (int i = 0; i < entries.Count; i++) { // Get the cells feed URI AtomLink cellsLink = entries[i].Links.FindService(GDataSpreadsheetsNameTable.CellRel, AtomLink.ATOM_TYPE); // Get the list feed URI AtomLink listLink = entries[i].Links.FindService(GDataSpreadsheetsNameTable.ListRel, AtomLink.ATOM_TYPE); // Create an item that will display the title and hide the cells and list feed URIs ListViewItem item = new ListViewItem(new string[3] { entries[i].Title.Text + " (Rows:" + ((WorksheetEntry)entries[i]).RowCount.Count + ", Cols:" + ((WorksheetEntry)entries[i]).ColCount.Count + ")", cellsLink.HRef.Content, listLink.HRef.Content }); this.worksheetListView.Items.Add(item); } }
public OpcionPuntosVenta(SpreadsheetsService servicio, AtomEntryCollection listaHojas) { InitializeComponent(); _servicio = servicio; _listaHojas = listaHojas; SombraEncabezado.Source = ImageSource.FromResource(App.RutaImagenSombraEncabezado); }
private static void ConvertEventsToFreeBusy( ExchangeUser user, AtomEntryCollection entries, DateTimeRange coveredRange, List <string> busyMonthValues, List <string> busyBase64Data, List <string> tentativeMonthValues, List <string> tentativeBase64Data) { List <DateTimeRange> busyTimes = new List <DateTimeRange>(); List <DateTimeRange> tentativeTimes = new List <DateTimeRange>(); foreach (EventEntry googleAppsEvent in entries) { ConvertEventToFreeBusy(user, googleAppsEvent, coveredRange, busyTimes, tentativeTimes); } FreeBusyConverter.CondenseFreeBusyTimes(busyTimes); FreeBusyConverter.CondenseFreeBusyTimes(tentativeTimes); FreeBusyConverter.ConvertDateTimeBlocksToBase64String(coveredRange.Start, coveredRange.End, busyTimes, busyMonthValues, busyBase64Data); FreeBusyConverter.ConvertDateTimeBlocksToBase64String(coveredRange.Start, coveredRange.End, tentativeTimes, tentativeMonthValues, tentativeBase64Data); }
public static EventEntry GetElementByGoogleID(string id, CalendarService service, string feedUrl, string etag = null) { try { EventQuery oEventQuery = new EventQuery(feedUrl); oEventQuery.Uri = new Uri(feedUrl + "/" + id); if (etag != null) { oEventQuery.Etag = etag; } EventFeed oEventFeed = service.Query(oEventQuery); AtomEntryCollection entries = oEventFeed.Entries; if (entries.Count > 0) { return((EventEntry)entries[0]); } } catch (GDataRequestException exc) { if (exc.Response is HttpWebResponse && ((HttpWebResponse)exc.Response).StatusCode == HttpStatusCode.NotFound) { return(null); } else { throw; } } return(null); }
private async Task ObtenerYConfigurarHojas(string linkLibro) { try { IsBusy = true; await Task.Run(async() => { if (CuentaUsuario.ValidarTokenDeGoogle()) { _listaHojas = new ServiciosGoogle().ObtenerListaHojas(linkLibro, _servicio); ConfigurarHojas(); } else { //Si se quedó la pantalla abierta un largo tiempo y se venció el token, se cierra y refresca el token var paginaAuntenticacion = new PaginaAuntenticacion(true); Navigation.InsertPageBefore(paginaAuntenticacion, this); await Navigation.PopAsync(); } }); } finally { IsBusy = false; //Remueve el Indicador de Actividad. } }
public ListaHojasHistoricoGoogle(SpreadsheetsService servicio, AtomEntryCollection listaHojas) { InitializeComponent(); Cabecera.Children.Add(App.Instancia.ObtenerImagen(TipoImagen.EncabezadoProyectos)); SombraEncabezado.Source = ImageSource.FromResource(App.RutaImagenSombraEncabezado); _servicio = servicio; _listaHojas = listaHojas; }
public DateTime Run(string group) { DateTime now = DateTime.Now; AtomEntryCollection users = RetrieveAllGroupMembers(group); DateTime nextSlot = FindNextAvailableTimeSlot(users, now + new System.TimeSpan(30, 0, 0, 0)); CreateEvent("Meeting", nextSlot, users); return(nextSlot); }
/// <summary> /// Sets the list view on the Cells tab /// </summary> /// <param name="feed">The feed providing the data</param> void SetCellListView(CellFeed feed) { // Clear out all the old information this.cellsListView.Items.Clear(); this.cellsListView.Columns.Clear(); this.editUriTable.Clear(); AtomEntryCollection entries = feed.Entries; // Add in the column headers, as many as the column count asks // The number of rows, we only care to go as far as the data goes this.cellsListView.Columns.Add("", 20, HorizontalAlignment.Left); for (int i = 1; i < feed.ColCount.Count; i++) { this.cellsListView.Columns.Add(i.ToString(), 80, HorizontalAlignment.Center); } int currentRow = 1; int currentCol = 1; ListViewItem item = new ListViewItem(); item.Text = 1.ToString(); for (int i = 0; i < entries.Count; i++) { CellEntry entry = entries[i] as CellEntry; if (entry != null) { // Add the current row, since we are starting // a new row in data from the feed while (entry.Cell.Row > currentRow) { this.cellsListView.Items.Add(item); item = new ListViewItem(); item.Text = (currentRow + 1).ToString(); currentRow++; currentCol = 1; } // Add blank entries where there is no data for the column while (entry.Cell.Column > currentCol) { item.SubItems.Add(""); currentCol++; } // Add the current data entry item.SubItems.Add(entry.Cell.Value); this.editUriTable.Add("R" + currentRow + "C" + currentCol, entry); currentCol++; } } }
static void ParseBasicAchievementSttings(AtomEntryCollection entries) { foreach (ListEntry row in entries) { for (var i = 1; i < row.Elements.Count; i++) { var cell = row.Elements[i]; ParseListEntryForBasicAchievement(row.Title.Text, Regex.Match(cell.LocalName, BibaEditorConstants.REGEX_TIME_PLAYED).Groups[1].Value, cell.Value); } } }
private List <DatablockDetectionInfo> ParseSpreadsheet(SpreadsheetEntry spreadsheet) { WorksheetFeed wsFeed = spreadsheet.Worksheets; if (wsFeed.Entries.Count == 0) { return(null); } var worksheet = (WorksheetEntry)wsFeed.Entries[0]; if (worksheet.Rows < 2) { return(null); } // Define the URL to request the list feed of the worksheet. AtomLink listFeedLink = worksheet.Links.FindService(GDataSpreadsheetsNameTable.ListRel, null); // Fetch the list feed of the worksheet. var listQuery = new ListQuery(listFeedLink.HRef.ToString()); ListFeed listFeed = sheetsAPI.Service.Query(listQuery); var headers = new List <string>(); spreadsheetRows = listFeed.Entries; nameColumnIndex = -1; var row = (ListEntry)spreadsheetRows[0]; for (int index = 0; index < row.Elements.Count; index++) { ListEntry.Custom element = row.Elements[index]; if (element.LocalName.Equals("name", StringComparison.OrdinalIgnoreCase)) { nameColumnIndex = index; } headers.Add(element.LocalName); } List <DatablockDetectionInfo> datablockTypes = AutoDetectDatablockType(headers); if (datablockTypes == null) { Debug.Log("Unable to auto detect datablock type"); return(null); } return(datablockTypes); }
public bool AreUsersAvailable(AtomEntryCollection users, DateTime datetime) { foreach (AppsExtendedEntry entry in users) { string user = entry.getPropertyValueByName("memberId"); bool isAvailable = IsUserAvailable(user, datetime); if (!isAvailable) { return(false); } } return(true); }
private void listViewSpreadsheets_SelectedIndexChanged(object sender, EventArgs e) { if (!m_bRequireSheetSelect) { return; } if (listViewSpreadsheets.SelectedItems.Count == 1) { new Thread(() => { Func <ListViewItem> getCurrentSelectedtem = () => listViewSpreadsheets.SelectedItems.Count == 1 ? listViewSpreadsheets.SelectedItems[0] : null; var zLvi = listViewSpreadsheets.InvokeFunc(getCurrentSelectedtem); AtomEntryCollection zSheetAtomCollection = getAtomEntryCollection( () => GoogleSpreadsheet.GetSheetNames(m_zSpreadsheetsService, ((AtomEntry)zLvi.Tag)), () => listViewSheets.InvokeAction(() => listViewSheets.Clear())); if (null == zSheetAtomCollection) { return; } var listNewItems = new List <ListViewItem>(); foreach (var entry in zSheetAtomCollection) { var zNewLvi = new ListViewItem(entry.Title.Text) { Tag = entry }; listNewItems.Add(zNewLvi); } if (listViewSpreadsheets.InvokeFunc(getCurrentSelectedtem) == zLvi) { listViewSheets.InvokeAction(() => { listViewSheets.Items.Clear(); listViewSheets.Items.AddRange(listNewItems.ToArray()); listViewSpreadsheets.Sort(); }); } }).Start(); } else { listViewSheets.Items.Clear(); } }
public void TestConvertEventsToFreeBusy() { ExchangeUser user = new ExchangeUser(); EventEntry googleAppsEvent = new EventEntry("title", "description", "location"); DateTimeRange coveredRange = new DateTimeRange(DateTime.MaxValue, DateTime.MinValue); List <DateTimeRange> busyTimes = new List <DateTimeRange>(); List <DateTimeRange> tentativeTimes = new List <DateTimeRange>(); DateTime startDate = new DateTime(2007, 07, 1, 10, 0, 0, DateTimeKind.Utc); DateTime endDate = new DateTime(2007, 07, 1, 11, 0, 0, DateTimeKind.Utc); When when = new When(startDate, endDate); Uri uri = new Uri("https://www.google.com/calendar/feeds/[email protected]/private/full"); EventFeed googleAppsFeed = new EventFeed(uri, null); AtomEntryCollection entries = new AtomEntryCollection(googleAppsFeed); }
public DateTime FindNextAvailableTimeSlot(AtomEntryCollection users, DateTime limit) { DateTime nextHour = NextHour(); while (nextHour < limit) { if (AreUsersAvailable(users, nextHour)) { return(nextHour); } nextHour += new System.TimeSpan(0, 0, 30, 0); } throw new NoAvailableSlotWithinLimitException(); }
private void FindValidAuctionTypes() { validTypes = new List <string>(); WorksheetQuery wsQuery = new WorksheetQuery(String.Format(@"http://spreadsheets.google.com/feeds/worksheets/{0}/private/full", NotificationAdministrationSheetKey)); AtomEntryCollection worksheetEntries = MySpreadsheetService.Query(wsQuery).Entries; foreach (WorksheetEntry sheet in worksheetEntries) { if (!"Admin,Template".Contains(sheet.Title.Text)) { validTypes.Add(sheet.Title.Text); } } }
private List <string> GetInnerJobs(string server, AtomEntryCollection worksheetRows) { List <string> JobList = new List <string>(); foreach (ListEntry worksheetRow in worksheetRows) { string serverName = worksheetRow.Elements[0].Value.ToString(); string jobName = worksheetRow.Elements[2].Value.ToString(); if (serverName != string.Empty && serverName == server && !JobList.Contains(jobName)) { JobList.Add(jobName); } } return(JobList); }
static void ParseLocaleBasedSceneSettings(AtomEntryCollection entries, ref BibaSpecialSceneSettings settings) { foreach (ListEntry row in entries) { var idText = row.Elements[0].Value; if (string.IsNullOrEmpty(idText)) { continue; } var sceneText = row.Elements[1].Value; if (string.IsNullOrEmpty(sceneText)) { continue; } var centerText = row.Elements[2].Value; if (string.IsNullOrEmpty(centerText)) { continue; } var centerMatchGroups = Regex.Match(centerText, REGEX_VECTOR2).Groups; if (centerMatchGroups.Count == 0) { continue; } var latitude = Convert.ToDouble(centerMatchGroups[REGEX_LATITUDE].Value); var longtitude = Convert.ToDouble(centerMatchGroups[REGEX_LONGTITUDE].Value); var radiusText = row.Elements[3].Value; if (string.IsNullOrEmpty(radiusText)) { continue; } var sceneSetting = new GeoSceneSetting(); sceneSetting.Id = idText; sceneSetting.SceneName = sceneText; sceneSetting.Center = new Vector2((float)latitude, (float)longtitude); sceneSetting.Radius = Convert.ToInt32(radiusText); settings.GeoSceneSettings.Add(sceneSetting); } }
private int ObtainIndexByName(string sName) { CellQuery query = new CellQuery(m_oWorksheet.CellFeedLink.ToString()); CellFeed feed = m_oAccount.Service.Query(query); AtomEntryCollection entries = feed.Entries; for (int i = 0; i < (int)feed.Entries.Count; i++) { CellEntry cell = entries[i] as CellEntry; if (cell.InputValue == sName) { return(i); } } // throw new Exception("Invalid collumn name"); return(-1); }
private void CreateCSVFile(string fileName, string outputDirectory, AtomEntryCollection cells) { if (!outputDirectory.EndsWith("/")) { outputDirectory += "/"; } Directory.CreateDirectory(outputDirectory); using (CSVWriter writer = new CSVWriter(outputDirectory + fileName + ".csv")) { CSVRow line = null; uint row = 0; foreach (CellEntry curCell in cells) { if (line == null) { line = new CSVRow(); line.Add(curCell.Cell.Value); row = curCell.Cell.Row; } else { if (row == curCell.Cell.Row) { line.Add(curCell.Cell.Value); } else { writer.WriteRow(line); line = new CSVRow(); line.Add(curCell.Cell.Value); row = curCell.Cell.Row; } } } if (line != null) { writer.WriteRow(line); } } }
private static void PrintDetails(AtomEntryCollection contacts) { var agencies = contacts.Select(c => ((ContactEntry)c).PrimaryEmail.Address.Split('@')[1].ToUpper()).Distinct().OrderBy(a => a); Console.WriteLine("FOUND {0} AGENCIES\n", agencies.Count()); foreach (string agency in agencies) { Console.WriteLine(agency); foreach (ContactEntry contact in contacts) { var domain = ((ContactEntry)contact).PrimaryEmail.Address.Split('@')[1].ToUpper(); if (domain != agency) { continue; } Console.WriteLine(contact.Name.FullName); Console.WriteLine(contact.Name.GivenName); Console.WriteLine(contact.PrimaryEmail.Address); Console.WriteLine(contact.PrimaryPhonenumber); Console.WriteLine(contact.PrimaryPostalAddress); foreach (var email in contact.Emails) { Console.WriteLine(email.Address); } foreach (var phone in contact.Phonenumbers) { Console.WriteLine(phone); } foreach (var address in contact.PostalAddresses) { Console.WriteLine(address); } Console.WriteLine(); } } Console.WriteLine("FOUND {0} CONTACTS\n", contacts.Count()); }
static void ParseTimedSceneSettings(AtomEntryCollection entries, ref BibaSpecialSceneSettings settings) { foreach (ListEntry row in entries) { var idText = row.Elements[0].Value; if (string.IsNullOrEmpty(idText)) { continue; } var sceneText = row.Elements[1].Value; if (string.IsNullOrEmpty(sceneText)) { continue; } var durationText = row.Elements[2].Value; if (string.IsNullOrEmpty(durationText)) { continue; } var dateMatchGroups = Regex.Match(durationText, BibaEditorConstants.REGEX_STARTDATE_ENDDATE).Groups; if (dateMatchGroups.Count == 0) { continue; } var startDate = DateTime.ParseExact(dateMatchGroups[BibaEditorConstants.REGEX_GROUP_STARTDATE].Value, BibaEditorConstants.DATETIME_PARSE_EXACT_FORMAT, CultureInfo.InvariantCulture); var endDate = DateTime.ParseExact(dateMatchGroups[BibaEditorConstants.REGEX_GROUP_ENDDATE].Value, BibaEditorConstants.DATETIME_PARSE_EXACT_FORMAT, CultureInfo.InvariantCulture); var sceneSetting = new TimedSceneSetting(); sceneSetting.Id = idText; sceneSetting.SceneName = sceneText; sceneSetting.StartDate = startDate; sceneSetting.EndDate = endDate; settings.TimedSceneSettings.Add(sceneSetting); } }
/// <summary> /// Sets the list view on the Spreadsheets page with the titles of the /// spreadsheets in the feed /// </summary> /// <param name="feed">The spreadsheets feed</param> void setSpreadsheetListView(SpreadsheetFeed feed) { // Clear out the old list this.spreadsheetListView.Items.Clear(); AtomEntryCollection entries = feed.Entries; for (int i = 0; i < entries.Count; i++) { // Get the worksheets feed URI AtomLink worksheetsLink = entries[i].Links.FindService(GDataSpreadsheetsNameTable.WorksheetRel, AtomLink.ATOM_TYPE); // Create an item that will display the title and hide the worksheets feed URI ListViewItem item = new ListViewItem(new string[2] { entries[i].Title.Text, worksheetsLink.HRef.Content }); this.spreadsheetListView.Items.Add(item); } }
public EventEntry CreateEvent(string title, DateTime date, AtomEntryCollection users) { EventEntry entry = new EventEntry(); entry.Title.Text = title; entry.Content.Content = title + "Content"; When eventTime = new When(date, date + new System.TimeSpan(0, 0, 30, 0)); entry.Times.Add(eventTime); foreach (AppsExtendedEntry user in users) { string member = user.getPropertyValueByName("memberId"); Who who = new Who(); who.Email = member; who.Rel = Who.RelType.EVENT_ATTENDEE; entry.Participants.Add(who); } Uri postUri = new Uri(string.Format(feedUrl, admin)); return(calendar.Insert(postUri, entry)); }