void txt_MouseDown(object sender, MouseButtonEventArgs e)
        {
            if (e.ClickCount == 2)
            {
                //Se vecchio nodo presente nello stesso bilancio
                if (IDTree == "4")
                {
                    WindowWorkArea wa = new WindowWorkArea(ref _x);

                    //Nodi
                    int index = -1;
                    wa.NodeHome = -1;

                    RevisoftApplication.XmlManager xt = new XmlManager();
                    xt.TipoCodifica = RevisoftApplication.XmlManager.TipologiaCodifica.Normale;
                    XmlDataProvider TreeXmlProvider = new XmlDataProvider();
                    TreeXmlProvider.Document = xt.LoadEncodedFile(App.AppTemplateTreeBilancio);

                    if (TreeXmlProvider.Document != null && TreeXmlProvider.Document.SelectSingleNode("/Tree") != null)
                    {
                        foreach (XmlNode item in TreeXmlProvider.Document.SelectNodes("/Tree//Node"))
                        {
                            if (item.Attributes["Tipologia"].Value == "Nodo Multiplo" || item.ChildNodes.Count == 1)
                            {
                                index++;

                                if (item.Attributes["ID"].Value == ((TextBlock)(sender)).MaxHeight.ToString())
                                {
                                    wa.NodeHome = index;
                                }

                                wa.Nodes.Add(index, item);
                            }
                        }
                    }

                    if (wa.NodeHome == -1)
                    {
                        e.Handled = true;
                        return;
                    }

                    wa.NodeNow = wa.NodeHome;

                    wa.Owner = Window.GetWindow(this);

                    //posizione e dimensioni finestra
                    wa.WindowStartupLocation = System.Windows.WindowStartupLocation.CenterScreen;
                    wa.Height    = System.Windows.SystemParameters.PrimaryScreenHeight * 90.0 / 100.0;
                    wa.Width     = System.Windows.SystemParameters.PrimaryScreenWidth * 90.0 / 100.0;
                    wa.MaxHeight = System.Windows.SystemParameters.PrimaryScreenHeight * 90.0 / 100.0;
                    wa.MaxWidth  = System.Windows.SystemParameters.PrimaryScreenWidth * 90.0 / 100.0;
                    wa.MinHeight = System.Windows.SystemParameters.PrimaryScreenHeight * 90.0 / 100.0;
                    wa.MinWidth  = System.Windows.SystemParameters.PrimaryScreenWidth * 90.0 / 100.0;

                    //Sessioni
                    wa.Sessioni       = Sessioni;
                    wa.SessioniTitoli = SessioniTitoli;
                    wa.SessioniID     = SessioniID;

                    foreach (DictionaryEntry item in Sessioni)
                    {
                        if (item.Value.ToString() == _x.File)
                        {
                            wa.SessioneHome = Convert.ToInt32(item.Key.ToString());
                            wa.SessioneNow  = wa.SessioneHome;
                            break;
                        }
                    }

                    //Variabili
                    wa.ReadOnly            = true;
                    wa.ReadOnlyOLD         = true;
                    wa.ApertoInSolaLettura = true;

                    //XmlNode nodeSessione = node.SelectSingleNode( "Sessioni/Sessione[@Alias=\"" + selectedAliasCodificato + "\"]" );
                    //if ( nodeSessione != null )
                    //{
                    //    wa.Stato = ((App.TipoTreeNodeStato)(Convert.ToInt32( nodeSessione.Attributes["Stato"].Value )));
                    //    wa.OldStatoNodo = wa.Stato;
                    //}

                    //passaggio dati
                    wa.IDTree     = IDTree;
                    wa.IDSessione = IDSessione;
                    wa.IDCliente  = IDCliente;

                    //apertura
                    wa.Load();

                    App.MessaggioSolaScrittura      = "Carta in sola lettura, premere tasto ESCI";
                    App.MessaggioSolaScritturaStato = "Carta in sola lettura, premere tasto ESCI";

                    wa.ShowDialog();

                    App.MessaggioSolaScrittura      = "Occorre selezionare Sblocca Stato per modificare il contenuto.";
                    App.MessaggioSolaScritturaStato = "Sessione in sola lettura, impossibile modificare lo stato.";
                }
                else
                {
                    MasterFile mf = MasterFile.Create();
                    string     bilancioAssociato     = mf.GetBilancioAssociatoFromConclusioneFile(Sessioni[SessioneNow].ToString());
                    string     bilancioTreeAssociato = mf.GetBilancioTreeAssociatoFromConclusioneFile(Sessioni[SessioneNow].ToString());
                    string     bilancioIDAssociato   = mf.GetBilancioIDAssociatoFromConclusioneFile(Sessioni[SessioneNow].ToString());


                    if (bilancioAssociato == "")
                    {
                        e.Handled = true;
                        return;
                    }

                    XmlDataProviderManager _xNew = new XmlDataProviderManager(bilancioAssociato);

                    WindowWorkArea wa = new WindowWorkArea(ref _xNew);

                    //Nodi
                    wa.NodeHome = 0;

                    RevisoftApplication.XmlManager xt = new XmlManager();
                    xt.TipoCodifica = RevisoftApplication.XmlManager.TipologiaCodifica.Normale;
                    XmlDataProvider TreeXmlProvider = new XmlDataProvider();
                    TreeXmlProvider.Document = xt.LoadEncodedFile(bilancioTreeAssociato);

                    if (TreeXmlProvider.Document != null && TreeXmlProvider.Document.SelectSingleNode("/Tree") != null)
                    {
                        foreach (XmlNode item in TreeXmlProvider.Document.SelectNodes("/Tree//Node"))
                        {
                            if (item.Attributes["Codice"].Value == ((TextBlock)(sender)).Text)
                            {
                                wa.Nodes.Add(0, item);
                            }
                        }
                    }

                    if (wa.Nodes.Count == 0)
                    {
                        e.Handled = true;
                        return;
                    }

                    wa.NodeNow = wa.NodeHome;

                    wa.Owner = Window.GetWindow(this);

                    //posizione e dimensioni finestra
                    wa.WindowStartupLocation = System.Windows.WindowStartupLocation.CenterScreen;
                    wa.Height    = System.Windows.SystemParameters.PrimaryScreenHeight * 90.0 / 100.0;
                    wa.Width     = System.Windows.SystemParameters.PrimaryScreenWidth * 90.0 / 100.0;
                    wa.MaxHeight = System.Windows.SystemParameters.PrimaryScreenHeight * 90.0 / 100.0;
                    wa.MaxWidth  = System.Windows.SystemParameters.PrimaryScreenWidth * 90.0 / 100.0;
                    wa.MinHeight = System.Windows.SystemParameters.PrimaryScreenHeight * 90.0 / 100.0;
                    wa.MinWidth  = System.Windows.SystemParameters.PrimaryScreenWidth * 90.0 / 100.0;

                    //Sessioni
                    wa.Sessioni.Clear();
                    wa.Sessioni.Add(0, bilancioAssociato);

                    wa.SessioniTitoli.Clear();
                    wa.SessioniTitoli.Add(0, SessioniTitoli[SessioneNow].ToString());

                    wa.SessioniID.Clear();
                    wa.SessioniID.Add(0, bilancioIDAssociato);

                    wa.SessioneHome = 0;
                    wa.SessioneNow  = 0;

                    //Variabili
                    wa.ReadOnly            = true;
                    wa.ReadOnlyOLD         = true;
                    wa.ApertoInSolaLettura = true;

                    //passaggio dati
                    wa.IDTree     = "4";
                    wa.IDSessione = bilancioIDAssociato;
                    wa.IDCliente  = IDCliente;

                    wa.Stato        = App.TipoTreeNodeStato.Sconosciuto;
                    wa.OldStatoNodo = wa.Stato;

                    //apertura
                    wa.Load();

                    App.MessaggioSolaScrittura      = "Carta in sola lettura, premere tasto ESCI";
                    App.MessaggioSolaScritturaStato = "Carta in sola lettura, premere tasto ESCI";

                    wa.ShowDialog();

                    App.MessaggioSolaScrittura      = "Occorre selezionare Sblocca Stato per modificare il contenuto.";
                    App.MessaggioSolaScritturaStato = "Sessione in sola lettura, impossibile modificare lo stato.";
                }
            }
        }
        private void OnItemMouseDoubleClick(object sender, MouseButtonEventArgs e)
        {
            if (e.ClickCount != 2)
            {
                return;
            }

            XmlNode node;

            try
            {
                node = ((XmlNode)(tvMain.SelectedItem));
            }
            catch (Exception ex)
            {
                cBusinessObjects.logger.Error(ex, "wWorkAreaTreeLimited.OnItemMouseDoubleClick1 exception");
                string log = ex.Message;
                e.Handled = true;
                return;
            }

            if (node == null)
            {
                e.Handled = true;
                return;
            }

            if (node.ParentNode == null)
            {
                e.Handled = true;
                return;
            }

            if (node.ParentNode.Name == "Tree")
            {
                NodoFazzoletto o = new NodoFazzoletto();
                o.Owner = this;
                //MM   o.ApertoInSolaLettura = ApertoInSolaLettura;
                // o.ReadOnly = ReadOnly;
                o.ApertoInSolaLettura = false;
                o.ReadOnly            = false;
                //  o.ApertoInSolaLettura = ApertoInSolaLettura;
                o.ReadOnly = ReadOnly;
                o.Nodo     = node.Attributes["ID"].Value;
                o.Load(IDCliente);
                o.ShowDialog();
                ReloadNodi();
                SaveTreeSource();
                e.Handled = true;
                return;
            }

            try
            {
                WindowWorkArea wa = new WindowWorkArea(ref _x);

                //Nodi
                int index = -1;
                wa.NodeHome = -1;

                if (TreeXmlProvider.Document != null && TreeXmlProvider.Document.SelectSingleNode("/Tree") != null)
                {
                    foreach (XmlNode item in TreeXmlProvider.Document.SelectNodes("/Tree//Node"))
                    {
                        if (item.Attributes["Tipologia"].Value == "Nodo Multiplo" || item.ChildNodes.Count == 1)
                        {
                            index++;

                            if (item.Attributes["ID"].Value == node.Attributes["ID"].Value)
                            {
                                wa.NodeHome = index;
                            }

                            wa.Nodes.Add(index, item);
                        }
                    }
                }

                if (wa.NodeHome == -1)
                {
                    e.Handled = true;
                    return;
                }

                wa.NodeNow = wa.NodeHome;

                wa.Owner = Window.GetWindow(this);

                //posizione e dimensioni finestra
                wa.WindowStartupLocation = System.Windows.WindowStartupLocation.CenterScreen;
                switch (base.WindowState)
                {
                case System.Windows.WindowState.Normal:
                    wa.Width  = ActualWidth * 97 / 100;
                    wa.Height = ActualHeight * 95 / 100;
                    break;

                case System.Windows.WindowState.Maximized:
                    wa.Width  = System.Windows.SystemParameters.PrimaryScreenWidth * 97 / 100;
                    wa.Height = System.Windows.SystemParameters.PrimaryScreenHeight * 95 / 100;
                    break;
                }

                //Sessioni
                wa.Sessioni       = htSessioni;
                wa.SessioniTitoli = htSessioniAlias;
                wa.SessioniID     = htSessioniID;

                foreach (DictionaryEntry item in htSessioni)
                {
                    if (item.Value.ToString() == _x.File)
                    {
                        wa.SessioneHome = Convert.ToInt32(item.Key.ToString());
                        wa.SessioneNow  = wa.SessioneHome;
                        break;
                    }
                }

                //Variabili
                wa.ReadOnly            = ReadOnly;
                wa.ReadOnlyOLD         = ReadOnly;
                wa.ApertoInSolaLettura = ApertoInSolaLettura;

                XmlNode nodeSessione = node.SelectSingleNode("Sessioni/Sessione[@Alias=\"" + selectedAliasCodificato + "\"]");
                if (nodeSessione != null)
                {
                    wa.Stato        = ((App.TipoTreeNodeStato)(Convert.ToInt32(nodeSessione.Attributes["Stato"].Value)));
                    wa.OldStatoNodo = wa.Stato;
                }

                //passaggio dati
                wa.IDTree     = IDTree;
                wa.IDSessione = IDSessione;
                wa.IDCliente  = IDCliente;

                //apertura
                wa.Load();

                wa.ShowDialog();
            }
            catch (Exception ex)
            {
                cBusinessObjects.logger.Error(ex, "wWorkAreaTreeLimited.OnItemMouseDoubleClick2 exception");
                string log = ex.Message;
            }

            e.Handled = true;
        }
Esempio n. 3
0
        void txt_MouseDownCicli(object sender, MouseButtonEventArgs e, string Codice)
        {
            MasterFile mf = MasterFile.Create();

            Hashtable revisioneNow           = mf.GetRevisioneFromFileData(Sessioni[SessioneNow].ToString());
            string    revisioneAssociata     = App.AppDataDataFolder + "\\" + revisioneNow["FileData"].ToString();
            string    revisioneTreeAssociata = App.AppDataDataFolder + "\\" + revisioneNow["File"].ToString();
            string    revisioneIDAssociata   = revisioneNow["ID"].ToString();
            string    IDCliente = revisioneNow["Cliente"].ToString();

            if (revisioneAssociata == "")
            {
                e.Handled = true;
                return;
            }

            XmlDataProviderManager _xNew = new XmlDataProviderManager(revisioneAssociata);

            WindowWorkArea wa = new WindowWorkArea(ref _xNew);

            //Nodi
            wa.NodeHome = 0;

            RevisoftApplication.XmlManager xt = new XmlManager();
            xt.TipoCodifica = RevisoftApplication.XmlManager.TipologiaCodifica.Normale;
            XmlDataProvider TreeXmlProvider = new XmlDataProvider();

            TreeXmlProvider.Document = xt.LoadEncodedFile(revisioneTreeAssociata);

            if (TreeXmlProvider.Document != null && TreeXmlProvider.Document.SelectSingleNode("/Tree") != null)
            {
                foreach (XmlNode item in TreeXmlProvider.Document.SelectNodes("/Tree//Node"))
                {
                    if (item.Attributes["Codice"].Value == Codice)
                    {
                        wa.Nodes.Add(0, item);
                    }
                }
            }

            if (wa.Nodes.Count == 0)
            {
                e.Handled = true;
                return;
            }

            wa.NodeNow = wa.NodeHome;

            wa.Owner = Window.GetWindow(this);

            //posizione e dimensioni finestra
            wa.WindowStartupLocation = System.Windows.WindowStartupLocation.CenterScreen;
            wa.Height    = System.Windows.SystemParameters.PrimaryScreenHeight * 90.0 / 100.0;
            wa.Width     = System.Windows.SystemParameters.PrimaryScreenWidth * 90.0 / 100.0;
            wa.MaxHeight = System.Windows.SystemParameters.PrimaryScreenHeight * 90.0 / 100.0;
            wa.MaxWidth  = System.Windows.SystemParameters.PrimaryScreenWidth * 90.0 / 100.0;
            wa.MinHeight = System.Windows.SystemParameters.PrimaryScreenHeight * 90.0 / 100.0;
            wa.MinWidth  = System.Windows.SystemParameters.PrimaryScreenWidth * 90.0 / 100.0;

            //Sessioni
            wa.Sessioni.Clear();
            wa.Sessioni.Add(0, revisioneAssociata);

            wa.SessioniTitoli.Clear();
            wa.SessioniTitoli.Add(0, "");

            wa.SessioniID.Clear();
            wa.SessioniID.Add(0, revisioneIDAssociata);

            wa.SessioneHome = 0;
            wa.SessioneNow  = 0;

            //Variabili
            wa.ReadOnly            = true;
            wa.ReadOnlyOLD         = true;
            wa.ApertoInSolaLettura = true;

            //passaggio dati
            wa.IDTree     = IDTree;
            wa.IDSessione = revisioneIDAssociata;
            wa.IDCliente  = IDCliente;

            wa.Stato        = App.TipoTreeNodeStato.Sconosciuto;
            wa.OldStatoNodo = wa.Stato;

            //apertura
            wa.Load();

            App.MessaggioSolaScrittura      = "Carta in sola lettura, premere tasto ESCI";
            App.MessaggioSolaScritturaStato = "Carta in sola lettura, premere tasto ESCI";

            wa.ShowDialog();

            App.MessaggioSolaScrittura      = "Occorre selezionare Sblocca Stato per modificare il contenuto.";
            App.MessaggioSolaScritturaStato = "Sessione in sola lettura, impossibile modificare lo stato.";
        }
Esempio n. 4
0
        private void buttonApri_Click(object sender, RoutedEventArgs e)
        {
            MasterFile mf = MasterFile.Create();
            string     selectedSession      = "-1";
            string     selectedSessionTitle = "";

            foreach (object item in stpSessioniISQC.Children)
            {
                if (item.GetType().Name == "RadioButton")
                {
                    if (((RadioButton)(item)).IsChecked == true)
                    {
                        selectedSession      = ((RadioButton)(item)).Tag.ToString();
                        selectedSessionTitle = ((RadioButton)(item)).Content.ToString();
                    }
                }
            }

            if (selectedSession == "-1")
            {
                e.Handled = true;
                return;
            }

            Hashtable ht = mf.GetISQC(selectedSession);

            XmlDataProviderManager _xNew = new XmlDataProviderManager(App.AppDataDataFolder + "\\" + ht["FileData"].ToString());

            WindowWorkArea wa = new WindowWorkArea(ref _xNew);

            //Nodi
            wa.NodeHome = 0;

            RevisoftApplication.XmlManager xt = new XmlManager();
            xt.TipoCodifica = RevisoftApplication.XmlManager.TipologiaCodifica.Normale;
            XmlDataProvider TreeXmlProvider = new XmlDataProvider();

            TreeXmlProvider.Document = xt.LoadEncodedFile(App.AppDataDataFolder + "\\" + ht["File"].ToString());

            if (TreeXmlProvider.Document != null && TreeXmlProvider.Document.SelectSingleNode("/Tree") != null)
            {
                foreach (XmlNode item in TreeXmlProvider.Document.SelectNodes("/Tree//Node"))
                {
                    switch (((App.TipoAttivita)(Convert.ToInt32(_IDTree))))
                    {
                    case App.TipoAttivita.Revisione:
                        if (item.Attributes["ID"].Value == "181")
                        {
                            wa.Nodes.Add(0, item);
                        }
                        break;

                    case App.TipoAttivita.Bilancio:
                        if (item.Attributes["ID"].Value == "182")
                        {
                            wa.Nodes.Add(0, item);
                        }
                        break;

                    case App.TipoAttivita.Conclusione:
                        if (item.Attributes["ID"].Value == "183")
                        {
                            wa.Nodes.Add(0, item);
                        }
                        break;

                    case App.TipoAttivita.Verifica:
                        if (item.Attributes["ID"].Value == "185")
                        {
                            wa.Nodes.Add(0, item);
                        }
                        break;

                    default:
                        e.Handled = true;
                        return;
                    }
                }
            }

            if (wa.Nodes.Count == 0)
            {
                e.Handled = true;
                return;
            }

            wa.NodeNow = wa.NodeHome;

            wa.Owner = Window.GetWindow(this);

            //posizione e dimensioni finestra
            wa.WindowStartupLocation = System.Windows.WindowStartupLocation.CenterScreen;
            wa.Height    = System.Windows.SystemParameters.PrimaryScreenHeight * 90.0 / 100.0;
            wa.Width     = System.Windows.SystemParameters.PrimaryScreenWidth * 90.0 / 100.0;
            wa.MaxHeight = System.Windows.SystemParameters.PrimaryScreenHeight * 90.0 / 100.0;
            wa.MaxWidth  = System.Windows.SystemParameters.PrimaryScreenWidth * 90.0 / 100.0;
            wa.MinHeight = System.Windows.SystemParameters.PrimaryScreenHeight * 90.0 / 100.0;
            wa.MinWidth  = System.Windows.SystemParameters.PrimaryScreenWidth * 90.0 / 100.0;

            //Sessioni
            wa.Sessioni.Clear();
            wa.Sessioni.Add(0, App.AppDataDataFolder + "\\" + ht["FileData"].ToString());

            wa.SessioniTitoli.Clear();
            wa.SessioniTitoli.Add(0, selectedSessionTitle);

            wa.SessioniID.Clear();
            wa.SessioniID.Add(0, selectedSession);

            wa.SessioneHome = 0;
            wa.SessioneNow  = 0;

            //Variabili
            wa.ReadOnly            = true;
            wa.ReadOnlyOLD         = true;
            wa.ApertoInSolaLettura = true;

            //passaggio dati
            wa.IDTree     = "28";
            wa.IDSessione = selectedSession;
            wa.IDCliente  = _IDCliente;

            wa.Stato        = App.TipoTreeNodeStato.Sconosciuto;
            wa.OldStatoNodo = wa.Stato;

            //apertura
            wa.Load();

            App.MessaggioSolaScrittura      = "Carta in sola lettura, premere tasto ESCI";
            App.MessaggioSolaScritturaStato = "Carta in sola lettura, premere tasto ESCI";

            wa.ShowDialog();

            App.MessaggioSolaScrittura      = "Occorre selezionare Sblocca Stato per modificare il contenuto.";
            App.MessaggioSolaScritturaStato = "Sessione in sola lettura, impossibile modificare lo stato.";

            base.Close();
        }
        void txt_MouseDown(object sender, MouseButtonEventArgs e)
        {
            if (e.ClickCount == 2)
            {
                WindowWorkArea wa = new WindowWorkArea(ref _x);

                //Nodi
                int index = -1;
                wa.NodeHome = -1;

                RevisoftApplication.XmlManager xt = new XmlManager();
                xt.TipoCodifica = RevisoftApplication.XmlManager.TipologiaCodifica.Normale;
                XmlDataProvider TreeXmlProvider = new XmlDataProvider();
                TreeXmlProvider.Document = xt.LoadEncodedFile(App.AppTemplateTreeBilancio);

                if (TreeXmlProvider.Document != null && TreeXmlProvider.Document.SelectSingleNode("/Tree") != null)
                {
                    foreach (XmlNode item in TreeXmlProvider.Document.SelectNodes("/Tree//Node"))
                    {
                        if (item.Attributes["Tipologia"].Value == "Nodo Multiplo" || item.ChildNodes.Count == 1)
                        {
                            index++;

                            if (item.Attributes["ID"].Value == ((TextBlock)(sender)).MaxHeight.ToString())
                            {
                                wa.NodeHome = index;
                            }

                            wa.Nodes.Add(index, item);
                        }
                    }
                }

                if (wa.NodeHome == -1)
                {
                    e.Handled = true;
                    return;
                }

                wa.NodeNow = wa.NodeHome;

                wa.Owner = Window.GetWindow(this);

                //posizione e dimensioni finestra
                wa.WindowStartupLocation = System.Windows.WindowStartupLocation.CenterScreen;
                wa.Height    = System.Windows.SystemParameters.PrimaryScreenHeight * 90.0 / 100.0;
                wa.Width     = System.Windows.SystemParameters.PrimaryScreenWidth * 90.0 / 100.0;
                wa.MaxHeight = System.Windows.SystemParameters.PrimaryScreenHeight * 90.0 / 100.0;
                wa.MaxWidth  = System.Windows.SystemParameters.PrimaryScreenWidth * 90.0 / 100.0;
                wa.MinHeight = System.Windows.SystemParameters.PrimaryScreenHeight * 90.0 / 100.0;
                wa.MinWidth  = System.Windows.SystemParameters.PrimaryScreenWidth * 90.0 / 100.0;

                //Sessioni
                wa.Sessioni       = Sessioni;
                wa.SessioniTitoli = SessioniTitoli;
                wa.SessioniID     = SessioniID;

                foreach (DictionaryEntry item in Sessioni)
                {
                    if (item.Value.ToString() == _x.File)
                    {
                        wa.SessioneHome = Convert.ToInt32(item.Key.ToString());
                        wa.SessioneNow  = wa.SessioneHome;
                        break;
                    }
                }

                //Variabili
                wa.ReadOnly            = true;
                wa.ReadOnlyOLD         = true;
                wa.ApertoInSolaLettura = true;

                //XmlNode nodeSessione = node.SelectSingleNode( "Sessioni/Sessione[@Alias=\"" + selectedAliasCodificato + "\"]" );
                //if ( nodeSessione != null )
                //{
                //    wa.Stato = ((App.TipoTreeNodeStato)(Convert.ToInt32( nodeSessione.Attributes["Stato"].Value )));
                //    wa.OldStatoNodo = wa.Stato;
                //}

                //passaggio dati
                wa.IDTree     = IDTree;
                wa.IDSessione = IDSessione;
                wa.IDCliente  = IDCliente;

                //apertura
                wa.Load();

                wa.ShowDialog();
            }
        }
        void txt_MouseDownCicli(object sender, MouseButtonEventArgs e)
        {
            if (e.ClickCount == 2)
            {
                MasterFile mf = MasterFile.Create();

                Hashtable revisioneNow           = mf.GetRevisioneFromFileData(Sessioni[SessioneNow].ToString());
                string    revisioneAssociata     = App.AppDataDataFolder + "\\" + revisioneNow["FileData"].ToString();
                string    revisioneTreeAssociata = App.AppDataDataFolder + "\\" + revisioneNow["File"].ToString();
                string    revisioneIDAssociata   = revisioneNow["ID"].ToString();
                string    IDCliente = revisioneNow["Cliente"].ToString();

                if (revisioneAssociata == "")
                {
                    e.Handled = true;
                    return;
                }

                XmlDataProviderManager _xNew = new XmlDataProviderManager(revisioneAssociata);

                WindowWorkArea wa = new WindowWorkArea(ref _xNew);

                //Nodi
                wa.NodeHome = 0;

                RevisoftApplication.XmlManager xt = new XmlManager();
                xt.TipoCodifica = RevisoftApplication.XmlManager.TipologiaCodifica.Normale;
                XmlDataProvider TreeXmlProvider = new XmlDataProvider();
                TreeXmlProvider.Document = cBusinessObjects.NewLoadEncodedFile("", (Convert.ToInt32(App.TipoFile.Revisione)).ToString());

                if (TreeXmlProvider.Document != null && TreeXmlProvider.Document.SelectSingleNode("/Tree") != null)
                {
                    foreach (XmlNode item in TreeXmlProvider.Document.SelectNodes("/Tree//Node"))
                    {
                        if (item.Attributes["Codice"].Value == ((TextBlock)(sender)).ToolTip.ToString().Replace("Fare Doppio CLick per aprire la Carta di lavoro ", ""))
                        {
                            wa.Nodes.Add(0, item);
                        }
                    }
                }

                if (wa.Nodes.Count == 0)
                {
                    e.Handled = true;
                    return;
                }

                wa.NodeNow = wa.NodeHome;

                wa.Owner = Window.GetWindow(this);

                //posizione e dimensioni finestra
                wa.WindowStartupLocation = System.Windows.WindowStartupLocation.CenterScreen;
                wa.Height    = System.Windows.SystemParameters.PrimaryScreenHeight * 90.0 / 100.0;
                wa.Width     = System.Windows.SystemParameters.PrimaryScreenWidth * 90.0 / 100.0;
                wa.MaxHeight = System.Windows.SystemParameters.PrimaryScreenHeight * 90.0 / 100.0;
                wa.MaxWidth  = System.Windows.SystemParameters.PrimaryScreenWidth * 90.0 / 100.0;
                wa.MinHeight = System.Windows.SystemParameters.PrimaryScreenHeight * 90.0 / 100.0;
                wa.MinWidth  = System.Windows.SystemParameters.PrimaryScreenWidth * 90.0 / 100.0;

                //Sessioni
                wa.Sessioni.Clear();
                wa.Sessioni.Add(0, revisioneAssociata);

                wa.SessioniTitoli.Clear();
                wa.SessioniTitoli.Add(0, "");

                wa.SessioniID.Clear();
                wa.SessioniID.Add(0, revisioneIDAssociata);

                wa.SessioneHome = 0;
                wa.SessioneNow  = 0;

                //Variabili
                wa.ReadOnly            = true;
                wa.ReadOnlyOLD         = true;
                wa.ApertoInSolaLettura = true;

                //passaggio dati
                wa.IDTree     = IDTree;
                wa.IDSessione = revisioneIDAssociata;
                wa.IDCliente  = IDCliente;

                wa.Stato        = App.TipoTreeNodeStato.Sconosciuto;
                wa.OldStatoNodo = wa.Stato;

                //apertura
                wa.Load();

                wa.ShowDialog();
            }
        }