Beispiel #1
0
        private void BuildPropertyCollection(string propertyKey, IEnumerable <VCardProperty?> serializables)
        {
            Debug.Assert(serializables != null);

            VCardProperty[] arr = serializables.Where(x => x != null).OrderBy(x => x !.Parameters.Preference).ToArray() !;

            for (int i = 0; i < arr.Length; i++)
            {
                VCardProperty prop = arr[i];
                BuildProperty(propertyKey, prop, i == 0 && prop.Parameters.Preference < 100);
            }
        }
    public void DateTimeOffsetPropertyTest1()
    {
        var prop = new DateTimeOffsetProperty(DateTimeOffset.UtcNow, GROUP);

        Assert.IsNotNull(prop);
        Assert.IsNotNull(prop.Value);
        Assert.AreEqual(GROUP, prop.Group);
        Assert.AreNotEqual(DateTimeOffset.MinValue, prop.Value);

        DateTimeOffset dto = prop.Value !.Value;

        VCardProperty vcProp = prop;

        Assert.AreEqual(vcProp.Value, dto);
    }
Beispiel #3
0
    public void ProfilePropertyTest1()
    {
        var prop = new ProfileProperty(GROUP);

        Assert.IsNotNull(prop);
        Assert.IsNotNull(prop.Value);
        Assert.AreEqual(GROUP, prop.Group);
        Assert.AreEqual("VCARD", prop.Value);

        string s = prop.Value;

        VCardProperty vcProp = prop;

        Assert.AreEqual(vcProp.Value, s);

        TextProperty textProp = prop;

        Assert.AreEqual(textProp.Value, s);
    }
Beispiel #4
0
 /// <summary>
 /// Kopierkonstruktor.
 /// </summary>
 /// <param name="prop">Das zu klonende <see cref="VCardProperty"/>-Objekt.</param>
 protected VCardProperty(VCardProperty prop)
 {
     Parameters = (ParameterSection)prop.Parameters.Clone();
     Group      = prop.Group;
 }