コード例 #1
0
 public GnosisGalleryItemController(
     GnosisGalleryItem galleryItem,
     //  IGnosisGalleryItemImplementation galleryItemImplementation,
     GnosisInstanceController instanceController,
     GnosisGalleryItemController parent)
     : base(galleryItem, instanceController, parent)
 {
     childControllers = new List <GnosisGalleryItemController>();
 }
コード例 #2
0
 public GnosisGalleryDatasetItemController(
     GnosisGalleryDatasetItem _galleryDatasetItem,
     GnosisInstanceController _instanceController,
     GnosisGalleryItemController _parent)
 {
     galleryDatasetItem = _galleryDatasetItem;
     instanceController = _instanceController;
     parent             = _parent;
 }
コード例 #3
0
 public GnosisGalleryDocumentItemController(
     GnosisGalleryDocumentItem searchItem,
     //   IGnosisGalleryItemImplementation searchItemImplementation,
     GnosisInstanceController instanceController,
     GnosisGalleryItemController parent,
     int _index)
     : base(searchItem, instanceController, parent)
 {
     index = _index;
 }
コード例 #4
0
        public void LoadData(GnosisInstance instance, bool expanded)
        {
            //Get the data rows from the instance
            IEnumerable <XElement> dataRows = instanceController.GetDataRows(galleryDatasetItem.Dataset);

            //Find the attribute to use for the caption
            GnosisGallerySearchAttribute captionGalleryAttribute = galleryDatasetItem.GalleryAttributes.Where(a => a.GalleryRole.Equals("Caption")).First();
            string captionAttributeName = instanceController.GetTargetAttributeName(captionGalleryAttribute.Dataset, captionGalleryAttribute.DatasetItem);
            int    order = 1;
            int    index = 0;

            foreach (var row in dataRows)
            {
                GnosisGalleryItem galleryItem = GnosisControlCreator.CreateGnosisGalleryItem(order++, expanded);
                // IGnosisGalleryItemImplementation galleryItemImplementation = GlobalData.Singleton.ImplementationCreator.GetGnosisGalleryItemImplementation();
                GnosisGalleryItemController itemController = new GnosisGalleryItemController(galleryItem, instanceController, parent);
                itemController.Setup();

                galleryItem.Caption = row.Attribute(captionAttributeName).Value;

                foreach (GnosisGallerySearchItem searchItem in galleryDatasetItem.GallerySearchItems)
                {
                    GnosisGallerySearchItem searchItemClone = GnosisControlCreator.CreateGnosisGallerySearchItem(searchItem);
                    // IGnosisGalleryItemImplementation childImplementation = GlobalData.Singleton.ImplementationCreator.GetGnosisGalleryItemImplementation();
                    GnosisGallerySearchItemController childController = new GnosisGallerySearchItemController(searchItemClone, instanceController, itemController, index);
                    childController.Setup();

                    itemController.AddGalleryItemController(childController);
                    // galleryItem.GnosisAddChild(searchItemClone);
                    //galleryItemImplementation.AddGalleryItem(childImplementation);
                }

                foreach (GnosisGalleryDocumentItem docItem in galleryDatasetItem.GalleryDocumentItems)
                {
                    // IGnosisGalleryItemImplementation childImplementation = GlobalData.Singleton.ImplementationCreator.GetGnosisGalleryItemImplementation();
                    GnosisGalleryDocumentItem           docItemClone    = GnosisControlCreator.CreateGnosisGalleryDocumentItem(docItem);
                    GnosisGalleryDocumentItemController childController = new GnosisGalleryDocumentItemController(docItemClone, instanceController, itemController, index);
                    childController.Setup();

                    itemController.AddGalleryItemController(childController);
                    //  galleryItem.GnosisAddChild(docItemClone);
                }

                // itemController.LoadGalleryItems();

                index++;
                parent.AddGalleryItemController(itemController);
                //  ((GnosisGalleryItem)parent.ControlImplementation).GnosisAddChild(itemController.ControlImplementation);
                //   ((IGnosisGalleryImplementation)parent.ControlImplementation).AddGalleryItem(galleryItemImplementation);
            }

            // parent.LoadGalleryItems();
        }
コード例 #5
0
 internal void AddGalleryItemController(GnosisGalleryItemController galleryItemController)
 {
     childControllers.Add(galleryItemController);
     ControlImplementation.GnosisAddChild(galleryItemController.ControlImplementation);
 }