Exemplo n.º 1
0
        /// <summary>
        /// Launches an appropriate explorer for a.
        /// </summary>
        /// <param name="a">The object to launch the explorer for.</param>
        public static void LaunchExplorerFor(Area a)
        {
            Explorer explorer;
            Estate   f = (a as Estate);
            Place    l = (a as Place);

            if (f != null)
            {
                explorer = new EstateExplorer(f, MainForm.mainForm.ExplorerContainer);
                explorer.Show();
            }
            else
            if (l != null)
            {
                explorer = new PlaceExplorer(l, MainForm.mainForm.Db, MainForm.mainForm.ExplorerContainer);
                explorer.Show();
            }
            else
            {
                MessageBox.Show(
                    "Ya ha alcanzado el tope de la jerarquía, "
                    + "o no ha seleccionado un nodo",
                    "Gestor de Fincas",
                    MessageBoxButtons.OK,
                    MessageBoxIcon.Asterisk
                    );
            }

            return;
        }
Exemplo n.º 2
0
        void OnLinkLabel3Clicked(object sender, LinkLabelLinkClickedEventArgs e)
        {
            PlaceExplorer uil = new PlaceExplorer(
                this.RealEstate.Parent,
                MainForm.mainForm.Db,
                this.Owner
                );

            uil.Show();
        }
Exemplo n.º 3
0
        /// <summary>
        /// Crea un explorador de lugar asociado a un componente treeView
        /// </summary>
        /// <param name="ui">Si está asociado a un treeView en UILugar,
        /// indicarlo (puede ser null)
        /// </param>
        /// <param name="b">La base de datos.</param>
        /// <param name="tr">El treeView</param>
        /// <param name="l">El nodo del lugar donde empezar a mostrar. Si es
        /// null, se toma el nodo raiz.
        /// </param>
        /// <param name="isLauncher">Si es un lanzador permite abrir interfaces para
        /// las fincas y lugares</param>
        public PlaceExplorerEngine(
            PlaceExplorer ui,
            Database b,
            TreeView tr,
            Place l,
            bool isLauncher)
        {
            // Explorer id
            id = numExplorers++;

            // Prepare the interface
            uiPlace = ui;
            bd      = b;
            tree    = tr;

            // Observing data
            keepUpdating  = true;
            selectedArea  = areaFrom = l;
            observedAreas = new ArrayList();

            // Show the root?
            if (areaFrom == null)
            {
                selectedArea = areaFrom = bd.Root;
            }

            // Prepare the tree
            if (isLauncher)
            {
                tree.DoubleClick += (o, args) => this.OnTreeViewItemDoubleClick();
            }
            tree.ImageList          = MainForm.mainForm.ImageList;
            tree.SelectedImageIndex = tree.ImageIndex = 0;

            // Show
            this.Update(DateTime.Now, Observable.NotificationType.Update);
        }