public override void CopyFrom(IProperty srcProperty)
        {
            if (base.EntityPropertyDefinition.Setter == null)
            {
                throw new ConversionException("Unable to set data of type " + base.EntityPropertyDefinition.Type.FullName);
            }
            IMultivaluedProperty <string> multivaluedProperty = srcProperty as IMultivaluedProperty <string>;

            if (multivaluedProperty != null)
            {
                List <string> list = new List <string>(multivaluedProperty.Count);
                list.AddRange(multivaluedProperty);
                base.EntityPropertyDefinition.Setter(base.Item, list);
            }
        }
Exemple #2
0
        // Token: 0x06001430 RID: 5168 RVA: 0x000747E0 File Offset: 0x000729E0
        protected override void InternalCopyFromModified(IProperty srcProperty)
        {
            IMultivaluedProperty <string> multivaluedProperty = srcProperty as IMultivaluedProperty <string>;

            if (multivaluedProperty == null)
            {
                throw new UnexpectedTypeException("IMultivaluedProperty<string>", srcProperty);
            }
            string[] array = new string[multivaluedProperty.Count];
            int      num   = 0;

            foreach (string text in multivaluedProperty)
            {
                array[num++] = text;
            }
            base.XsoItem[base.PropertyDef] = array;
        }
        // Token: 0x06000F8E RID: 3982 RVA: 0x00058F9C File Offset: 0x0005719C
        protected override void InternalCopyFrom(IProperty srcProperty)
        {
            IMultivaluedProperty <string> multivaluedProperty = srcProperty as IMultivaluedProperty <string>;

            if (multivaluedProperty == null)
            {
                throw new UnexpectedTypeException("IMultivaluedProperty<string>", srcProperty);
            }
            base.XmlNode = base.XmlParentNode.OwnerDocument.CreateElement(base.AirSyncTagNames[0], base.Namespace);
            foreach (string text in multivaluedProperty)
            {
                if (!string.IsNullOrEmpty(text))
                {
                    XmlNode xmlNode = base.XmlParentNode.OwnerDocument.CreateElement(this.airSyncChildTagName, base.Namespace);
                    xmlNode.InnerText = text;
                    base.XmlNode.AppendChild(xmlNode);
                }
            }
            if (base.XmlNode.HasChildNodes)
            {
                base.XmlParentNode.AppendChild(base.XmlNode);
            }
        }
Exemple #4
0
        protected override void InternalCopyFromModified(IProperty srcProperty)
        {
            base.InternalCopyFromModified(srcProperty);
            IMultivaluedProperty <string> multivaluedProperty = srcProperty as IMultivaluedProperty <string>;

            foreach (string name in multivaluedProperty)
            {
                this.CheckAddCategory(name);
            }
            try
            {
                if (this.needToSaveMCL && this.MasterCategoryList != null)
                {
                    this.MasterCategoryList.Save();
                    this.needToSaveMCL = false;
                }
            }
            catch (LocalizedException arg)
            {
                AirSyncDiagnostics.TraceDebug <LocalizedException>(ExTraceGlobals.XsoTracer, this, "Failed to save MCL, exception: {0}", arg);
                Command.CurrentCommand.ProtocolLogger.SetValue(ProtocolLoggerData.Error, "FailedToSaveMCL");
            }
        }