Exemplo n.º 1
0
        public DirectoryNode(FileSystemTreeView treeView, string directory) : base(directory)
        {
            _rights = new UserFileAccessRights(directory);
            if (_rights.canWrite() && _rights.canRead())
            {
                //"R/W access";
                _directory = directory;
                ForeColor  = Color.DarkGreen;
            }
            else
            {
                if (_rights.canWrite())
                {
                    //"Only Write access";
                    _directory = directory;
                    ForeColor  = Color.DarkBlue;
                }
                else if (_rights.canRead())
                {
                    //"Only Read access";
                    _directory = directory;
                    ForeColor  = Color.DarkRed;
                }
                else
                {
                    //No Rights
                    return;
                }
            }

            DirectoryInfo dir = new DirectoryInfo(_directory);

            this.Text     = dir.Name;
            this.FullPath = _directory;

            ImageIndex         = FileSystemTreeView.Folder;
            SelectedImageIndex = ImageIndex;
            treeView.Nodes.Add(this);
            Virtualize();
        }
Exemplo n.º 2
0
        private void MainForm_Load(object sender, EventArgs e)
        {
            mTree = new FileSystemTreeView();
            mTree.FolderSelected += tree_FolderSelected;
            treePanel.Controls.Add(mTree);
            mTree.Dock          = DockStyle.Fill;
            mTree.HideSelection = false;

            mUserId    = -1;
            mImagePath = "";

            lblVersion.Text = "Version " + Assembly.GetAssembly(typeof(MainForm)).GetName().Version.ToString();

#if (DEBUG)
            txtMachineName.Text = "HONB-RICHARDT";
#else
            txtMachineName.Text = Environment.MachineName;
#endif
            var configurationCore = new TMT.Core.Camera.Interfaces.Configuration();

            var redRoomConfiguration = new cConfiguration();

            List <cCamera> cameras = redRoomConfiguration.GetCameras(Path.Combine(DefaultPath(), "Config"), "CameraConfig.xml");
            mPhysicalStudio              = new cPhysicalStudio();
            mPhysicalStudio.evFilmAdded += mPhysicalStudioFilmAdded;
            foreach (cCamera abstractCamera in cameras)
            {
                mPhysicalStudio.Register(abstractCamera);
            }

            dateTimePickerFilterAfter.Value = DateTime.Now.Subtract(new TimeSpan(1, 0, 0, 0));

            resetForm();

            if (App.AuthenticatedUser != null)
            {
                btnLoginLogout.PerformClick();
            }
        }