Inheritance: TreeViewItemViewModel
Exemplo n.º 1
0
 public PageViewModel(Page page, DatabaseViewModel parentDatabase, SessionBase session)
     : base(parentDatabase, true)
 {
     m_dbNum   = page.Database.DatabaseNumber;
     m_pageNum = page.PageNumber;
     m_session = session;
 }
Exemplo n.º 2
0
 public PageViewModel(Page page, DatabaseViewModel parentDatabase, SessionBase session)
   : base(parentDatabase, true)
 {
   m_dbNum = page.Database.DatabaseNumber;
   m_pageNum = page.PageNumber;
   m_session = session;
 }
 public DirectoryInfo Initialize(string dbFilePath)
 {
     if (dbFilePath != null && dbFilePath.Length > 0)
     {
         m_session.BeginRead();
         FileInfo dbFile = new FileInfo(dbFilePath);
         if (dbFile.Exists)
         {
             UInt32 dbNum = 0;
             UInt32.TryParse(dbFile.Name.Substring(0, dbFile.Name.IndexOf('.')), out dbNum);
             DirectoryInfo directory = dbFile.Directory;
             if (directory.GetFiles("0.odb").Length > 0)
             {
                 bool foundIt = false;
                 foreach (var info in m_federationViews)
                 {
                     if (SessionBase.IsSameHost(info.Federationinfo.HostName, SessionBase.LocalHost) &&
                         info.Federationinfo.SystemDbsPath.ToLower() == directory.FullName.ToLower())
                     {
                         foundIt         = true;
                         info.IsExpanded = true;
                         foreach (var child in info.Children)
                         {
                             if (child.GetType() == typeof(DatabaseLocationViewModel))
                             {
                                 child.IsExpanded = true;
                                 foreach (var dbView in child.Children)
                                 {
                                     DatabaseViewModel dbViewModel = dbView as DatabaseViewModel;
                                     if (dbViewModel != null && dbViewModel.DatabaseNumber == dbNum)
                                     {
                                         dbView.IsExpanded = true;
                                     }
                                 }
                             }
                         }
                     }
                 }
                 if (foundIt == false)
                 {
                     return(directory);
                 }
             }
         }
         if (m_session.InTransaction)
         {
             m_session.Commit();
         }
     }
     return(null);
 }
Exemplo n.º 4
0
 public PageViewModel(Page page, DatabaseViewModel parentDatabase, SessionBase session)
     : base(parentDatabase, true)
 {
     _page    = page;
     _session = session;
 }
Exemplo n.º 5
0
 public PageViewModel(Page page, DatabaseViewModel parentDatabase, SessionBase session)
   : base(parentDatabase, true)
 {
   _page = page;
   _session = session;
 }