Esempio n. 1
0
        internal Type GetBindableControlType()
        {
            switch (BindableControl)
            {
            case ColumnBindableControl.Text:
                return(typeof(TextObject));

            case ColumnBindableControl.Picture:
                return(typeof(PictureObject));

            case ColumnBindableControl.CheckBox:
                return(typeof(CheckBoxObject));

            case ColumnBindableControl.RichText:
                return(typeof(RichObject));

            case ColumnBindableControl.Custom:
                Type controlType = RegisteredObjects.FindType(CustomBindableControl);
                if (controlType == null)
                {
                    return(typeof(TextObject));
                }
                return(controlType);
            }
            return(null);
        }
Esempio n. 2
0
 public override void Deserialize(FRReader reader)
 {
     FPageType = RegisteredObjects.FindType(reader.ReadStr("PageType"));
     while (reader.NextItem())
     {
         Base c = reader.Read() as Base;
         if (c != null)
         {
             FObjects.Add(c);
         }
     }
 }
Esempio n. 3
0
        private Base ReadObject(Base parent, XmlItem item, bool readChildren)
        {
            string objName = item.Name;

            // try to find the object in the dictionary
            Base obj = FPreparedPages.Dictionary.GetObject(objName);

            // object not found, objName is type name
            if (obj == null)
            {
                Type type = RegisteredObjects.FindType(objName);
                if (type == null)
                {
                    return(null);
                }
                obj = Activator.CreateInstance(type) as Base;
            }
            obj.SetRunning(true);

            // read object's properties
            if (!String.IsNullOrEmpty(item.Text))
            {
                using (FRReader reader = new FRReader(null, item))
                {
                    reader.ReadChildren = false;
                    reader.BlobStore    = FPreparedPages.BlobStore;
                    // since the BlobStore is shared resource, lock it to avoid problems with multi-thread access.
                    // this may happen in the html export that uses several threads to export one report.
                    lock (reader.BlobStore)
                    {
                        reader.Read(obj);
                    }
                }
            }

            if (readChildren)
            {
                for (int i = 0; i < item.Count; i++)
                {
                    ReadObject(obj, item[i], true);
                }
            }

            obj.Parent = parent;
            return(obj);
        }