Esempio n. 1
0
 /// <summary>
 /// constructor for sc:group with name and attributes
 /// </summary>
 /// <param name="name">The group's name.</param>
 /// <param name="customAttributes">The list of attributes for the group.</param>
 public CustomGroup(string name, ExtensionCollection<CustomAttribute> customAttributes)
     : base(ContentForShoppingNameTable.Group,
        ContentForShoppingNameTable.scDataPrefix,
        ContentForShoppingNameTable.BaseNamespace)
 {
     this.Name = name;
     this.customAttributes = customAttributes;
 }
 public static string GetBestUrl(ExtensionCollection<MediaThumbnail> th)
 {
     if (th.Count > 0)
       {
     return th[th.Count - 1].Url;
       }
       else
       {
     return string.Empty;
       }
 }
 public void Init()
 {
     labels = new ExtensionCollection<LabelElement>(new AtomEntry());
 }
Esempio n. 4
0
 private string findLargestThumbnail(ExtensionCollection<MediaThumbnail> collection)
 {
     MediaThumbnail largest = null;
     int width = 0; 
     foreach (MediaThumbnail thumb in collection) 
     {
         int iWidth = int.Parse(thumb.Attributes["width"] as string);
         if (iWidth > width) 
         {
             largest = thumb;
         }
     }
     return largest.Attributes["url"] as string;
 }
Esempio n. 5
0
        private static PhoneNumber FindPhone(string number, ExtensionCollection<PhoneNumber> phones)
        {
            if (string.IsNullOrEmpty(number))
                return null;

            if (phones == null)
                return null;

            foreach (PhoneNumber phone in phones)
            {
                if (phone != null && number.Equals(phone.Value, StringComparison.InvariantCultureIgnoreCase))
                {
                    return phone;
                }
            }

            return null;
        }
Esempio n. 6
0
        private static EMail FindEmail(string address, ExtensionCollection<EMail> emails)
        {
            if (string.IsNullOrEmpty(address))
                return null;

            foreach (EMail email in emails)
            {
                if (address.Equals(email.Address, StringComparison.InvariantCultureIgnoreCase))
                {
                    return email;
                }
            }

            return null;
        }
 public void Init()
 {
     mailItemProperties = new ExtensionCollection<MailItemPropertyElement>(new AtomEntry());
 }
Esempio n. 8
0
		String FillPersonen (DataRow IwTRow, Google.GData.Extensions.ExtensionCollection<Who> WhoList )
			{
			String EventIDString = IwTRow ["ID"].ToString ();
			DataTable FullPersonenZuTermine = WordUpWCFAccess.GetCommonDataSet
				("Select * from FullPersonenZuTermine where TermineID = '" + EventIDString + "'").Tables ["FullPersonenZuTermine"];
			if (FullPersonenZuTermine.Rows.Count == 0)
				{
				WhoList.Clear ();
				return String.Empty;
				}

			bool SomethingChanged = false;
			ExtensionCollection<Who> DeleteList = new ExtensionCollection<Who> ();
			foreach (Who Participant in WhoList)
				{
				String Rel = Participant.Rel;
				if (Rel == "http://schemas.google.com/g/2005#event.organizer")
					continue;
				String eMail = Participant.Email;
				DataRow [] ParticipantBase = FullPersonenZuTermine.Select ("eMail = '" + eMail + "'");
				if (ParticipantBase.Length == 1)
					continue;
				DeleteList.Add (Participant);
				}

			foreach (Who ParticipantsToDelete in DeleteList)
				{
				WhoList.Remove (ParticipantsToDelete);
				SomethingChanged = true;
				}

			foreach (DataRow PersonenRow in FullPersonenZuTermine.Rows)
				{
				String eMail = PersonenRow ["eMail"].ToString ();
				String NameID = String.Empty;
				if (String.IsNullOrEmpty (PersonenRow ["PersonalPresentationLink"].ToString ()))
					NameID = PersonenRow ["VorName"].ToString ();
				else
					NameID = "<a href=\"" + PersonenRow ["PersonalPresentationLink"].ToString () + "\" target=\"_blank\">"
						+ PersonenRow ["VorName"].ToString () + "</a>";
				bool IsAvailable = false;
				foreach (Who Participant in WhoList)
					{
					String Rel = Participant.Rel;
					if (Rel == "http://schemas.google.com/g/2005#event.organizer")
						continue;
					String WhoeMail = Participant.Email;
					if (String.Compare(WhoeMail, eMail, StringComparison.CurrentCultureIgnoreCase) == 0)
						{
						Participant.ValueString = NameID;
						IsAvailable = true;
						break;
						}
					}
				if (IsAvailable == false)
					{
					Who NewParticipant = new Who ();
					NewParticipant.Email = eMail;
					NewParticipant.ValueString = NameID;
					NewParticipant.Rel = "http://schemas.google.com/g/2005#event.attendee";
					WhoList.Add (NewParticipant);
					SomethingChanged = true;
					}
				}
			List<String> PersonenInvolved = new List<string> ();
			int LineBreakCounter = 0;
			foreach (Who Participant in WhoList)
				{
				String Rel = Participant.Rel;
				if (Rel == "http://schemas.google.com/g/2005#event.organizer")
					continue;
				String WhoeMail = Participant.Email;
				String WhoNameID = Participant.ValueString;
				if ((++LineBreakCounter % 5) == 0)
					PersonenInvolved.Add ("<br/>" + WhoNameID);
				else
					PersonenInvolved.Add (WhoNameID);
				}
			return "<h4>Teilnehmer</h4>" + String.Join (", ", PersonenInvolved) + "<Br/>";
			}