Ejemplo n.º 1
0
        private mediaCarrier createCarrier(Media m)
        {
            mediaCarrier carrier = new mediaCarrier();

            carrier.Id   = m.Id;
            carrier.Text = m.Text;

            carrier.TypeAlias = m.ContentType.Alias;
            carrier.TypeId    = m.ContentType.Id;

            carrier.CreateDateTime = m.CreateDateTime;
            carrier.HasChildren    = m.HasChildren;
            carrier.Level          = m.Level;

            carrier.Path      = m.Path;
            carrier.SortOrder = m.sortOrder;

            try
            {
                carrier.ParentId = m.Parent.Id;
            }
            catch
            {
                carrier.ParentId = -1;
            }

            foreach (Property p in m.getProperties)
            {
                mediaProperty carrierprop = new mediaProperty();

                if (p.Value == System.DBNull.Value)
                {
                    carrierprop.PropertyValue = "";
                }
                else
                {
                    carrierprop.PropertyValue = p.Value;
                }

                carrierprop.Key = p.PropertyType.Alias;
                carrier.MediaProperties.Add(carrierprop);
            }

            return(carrier);
        }
Ejemplo n.º 2
0
        private mediaCarrier createCarrier(Media m)
        {
            var carrier = new mediaCarrier
            {
                Id             = m.Id,
                Text           = m.Text,
                TypeAlias      = m.ContentType.Alias,
                TypeId         = m.ContentType.Id,
                CreateDateTime = m.CreateDateTime,
                HasChildren    = m.HasChildren,
                Level          = m.Level,
                Path           = m.Path,
                SortOrder      = m.sortOrder
            };

            try
            {
                carrier.ParentId = m.Parent.Id;
            }
            catch
            {
                carrier.ParentId = -1;
            }

            foreach (Property p in m.GenericProperties)
            {
                var carrierprop = new mediaProperty();

                if (p.Value == DBNull.Value)
                {
                    carrierprop.PropertyValue = "";
                }
                else
                {
                    carrierprop.PropertyValue = p.Value;
                }

                carrierprop.Key = p.PropertyType.Alias;
                carrier.MediaProperties.Add(carrierprop);
            }

            return(carrier);
        }
Ejemplo n.º 3
0
        private mediaCarrier createCarrier(Media m)
        {
            var carrier = new mediaCarrier
                              {
                                  Id = m.Id,
                                  Text = m.Text,
                                  TypeAlias = m.ContentType.Alias,
                                  TypeId = m.ContentType.Id,
                                  CreateDateTime = m.CreateDateTime,
                                  HasChildren = m.HasChildren,
                                  Level = m.Level,
                                  Path = m.Path,
                                  SortOrder = m.sortOrder
                              };

            try
            {
                carrier.ParentId = m.Parent.Id;
            }
            catch
            {
                carrier.ParentId = -1;
            }

            foreach (Property p in m.GenericProperties)
            {
                var carrierprop = new mediaProperty();

                if (p.Value == DBNull.Value)
                {
                    carrierprop.PropertyValue = "";
                }
                else
                {
                    carrierprop.PropertyValue = p.Value;
                }

                carrierprop.Key = p.PropertyType.Alias;
                carrier.MediaProperties.Add(carrierprop);

            }

            return carrier;
        }
Ejemplo n.º 4
0
        private mediaCarrier createCarrier(Media m)
        {
            mediaCarrier carrier = new mediaCarrier();
            carrier.Id = m.Id;
            carrier.Text = m.Text;

            carrier.TypeAlias = m.ContentType.Alias;
            carrier.TypeId = m.ContentType.Id;

            carrier.CreateDateTime = m.CreateDateTime;
            carrier.HasChildren = m.HasChildren;
            carrier.Level = m.Level;

            carrier.Path = m.Path;
            carrier.SortOrder = m.sortOrder;

            try
            {
                carrier.ParentId = m.Parent.Id;
            }
            catch
            {
                carrier.ParentId = -1;
            }

            foreach (Property p in m.getProperties)
            {

                mediaProperty carrierprop = new mediaProperty();

                if (p.Value == System.DBNull.Value)
                {
                    carrierprop.PropertyValue = "";
                }
                else
                {
                    carrierprop.PropertyValue = p.Value;
                }

                carrierprop.Key = p.PropertyType.Alias;
                carrier.MediaProperties.Add(carrierprop);

            }

            return carrier;
        }