Exemple #1
0
        private void CreateLateResolverItem(MOG_DBPackageCommandInfo packageCommand)
        {
            MOG_Filename assetName = new MOG_Filename(packageCommand.mAssetName);

            if (assetName.GetFilenameType() == MOG_FILENAME_TYPE.MOG_FILENAME_Asset)
            {
                ListViewItem item = new ListViewItem();

                // "NAME, CLASSIFICATION, DATE, TARGET PACKAGE, OWNER, FULLNAME, COMMANDID, LABEL, VERSION"

                item.Text = assetName.GetAssetLabel();
                item.SubItems.Add(assetName.GetAssetClassification());                 // Class
                item.SubItems.Add(MogUtils_StringVersion.VersionToString(packageCommand.mAssetVersion));
                item.SubItems.Add(packageCommand.mPackageName);
                item.SubItems.Add((packageCommand.mBlessedBy.Length != 0) ? packageCommand.mBlessedBy : packageCommand.mCreatedBy);
                item.SubItems.Add(packageCommand.mAssetName);
                item.SubItems.Add(packageCommand.mID.ToString());
                item.SubItems.Add(packageCommand.mLabel);
                item.SubItems.Add(packageCommand.mAssetVersion);

                item.ImageIndex = MogUtil_AssetIcons.GetAssetIconIndex(packageCommand.mAssetName, null, false);

                mainForm.ConnectionManagerLateResolversListView.Items.Add(item);
            }
        }
        private void AddTagListViewItem(MOG_DBBranchInfo branch, bool isActiveTag)
        {
            ListViewItem item = new ListViewItem();

            item.Text = branch.mBranchName;
            item.SubItems.Add(MogUtils_StringVersion.VersionToString(branch.mCreatedDate));
            item.SubItems.Add(branch.mCreatedBy);
            if (isActiveTag)
            {
                item.ImageKey = "check";
            }

            TagsListView.Items.Add(item);
        }
        private void AddBranchListViewItem(MOG_DBBranchInfo branch)
        {
            ListViewItem item = new ListViewItem();

            item.Text = branch.mBranchName;
            item.SubItems.Add(MogUtils_StringVersion.VersionToString(branch.mCreatedDate));
            item.SubItems.Add(branch.mCreatedBy);
            item.SubItems.Add(MogUtils_StringVersion.VersionToString(branch.mRemovedDate));
            item.SubItems.Add(branch.mRemovedBy);

            // This is a removed branch
            if (branch.mRemovedBy.Length != 0)
            {
                item.BackColor = System.Drawing.Color.Red;
            }

            BranchesListView.Items.Add(item);
        }
 public void LoadCommand(MOG_Command command)
 {
     tbComputer.Text    = command.GetComputerName();
     tbDate.Text        = MogUtils_StringVersion.VersionToString(command.GetCommandTimeStamp());
     tbIp.Text          = command.GetComputerIP();
     tbID.Text          = command.GetCommandID().ToString();
     tbProject.Text     = command.GetProject();
     tbType.Text        = command.GetCommandType().ToString();
     tbUser.Text        = command.GetUserName();
     tbBranch.Text      = command.GetBranch();
     tbJobId.Text       = command.GetJobLabel();
     tbBlocking.Text    = command.IsBlocking().ToString();
     tbSlaveID.Text     = command.mAssignedSlaveID.ToString();
     tbCompleted.Text   = command.IsCompleted().ToString();
     tbValidSlaves.Text = command.GetValidSlaves();
     if (command.GetAssetFilename() != null)
     {
         tbAssetName.Text = command.GetAssetFilename().GetAssetFullName();
     }
 }
Exemple #5
0
        private void CreatePostItem(MOG_DBPostInfo post)
        {
            MOG_Filename assetName = new MOG_Filename(post.mAssetName);

            if (assetName.GetFilenameType() == MOG_FILENAME_TYPE.MOG_FILENAME_Asset)
            {
                ListViewItem item = new ListViewItem();

                // "NAME, CLASSIFICATION, DATE, OWNER, FULLNAME, COMMANDID"

                item.Text = assetName.GetAssetLabel();
                //item.SubItems.Add(assetName.GetAssetLabel());
                item.SubItems.Add(assetName.GetAssetClassification());
                item.SubItems.Add(MogUtils_StringVersion.VersionToString(post.mAssetVersion));
                item.SubItems.Add(post.mBlessedBy);
                item.SubItems.Add(post.mAssetName);
                item.SubItems.Add(post.mID.ToString());
                item.SubItems.Add(post.mLabel);
                item.SubItems.Add(post.mAssetVersion);
                item.ImageIndex = MogUtil_AssetIcons.GetAssetIconIndex(post.mAssetName, null, false);

                mainForm.ConnectionManagerPostingListView.Items.Add(item);
            }
        }
Exemple #6
0
        private void UpdateItem(ListViewItem item)
        {
            string status         = "";
            string username       = "";
            string comment        = "";
            string localTimestamp = "";

            // Find our desired columns
            int statusIdx          = FindColumn("Status");
            int userIdx            = FindColumn("User");
            int commentIdx         = FindColumn("Comment");
            int localTimestampIdx  = FindColumn("Local Timestamp");
            int serverTimestampIdx = FindColumn("Server Timestamp");
            int localFileIdx       = FindColumn("LocalFile");
            int repositoryFileIdx  = FindColumn("RepositoryFile");

            string       repositoryFile          = item.SubItems[repositoryFileIdx].Text;
            MOG_Filename repositoryAssetFilename = new MOG_Filename(repositoryFile);

            // Check if this file exist locally?
            string localFile = item.SubItems[localFileIdx].Text;

            if (localFile.Length != 0)
            {
                // Obtain the localFile info
                FileInfo fileInfo = new FileInfo(localFile);
                // Does this local file exist?
                if (fileInfo != null && fileInfo.Exists)
                {
                    // Compare our local file's timestamp to the server's revision
                    localTimestamp = MOG_Time.GetVersionTimestamp(fileInfo.LastWriteTime);
                    if (localTimestamp == repositoryAssetFilename.GetVersionTimeStamp())
                    {
                        // Indicate this item is synced and up-to-date
                        status = "Up-to-date";
                    }
                    else
                    {
                        // Indicate this item is synced
                        status = "Out-of-date";
                    }
                }
                else
                {
                    // Indicate this item is not synced
                    status = "unSynced";
                }
            }
            else
            {
                // Indicate this item is not synced
                status = "unSynced";
            }

            // Check if this file exists in the repository?
            if (repositoryFile.Length != 0)
            {
                // Check the lock statusIdx of the asset
                MOG_Command sourceLock = MOG_ControllerProject.PersistentLock_Query(repositoryAssetFilename.GetAssetFullName());
                if (sourceLock.IsCompleted() && sourceLock.GetCommand() != null)
                {
                    MOG_Command lockHolder = sourceLock.GetCommand();

                    // Obtain the lock info
                    item.ImageIndex = MogUtil_AssetIcons.GetLockedBinaryIcon(repositoryFile);
                    username        = lockHolder.GetUserName();
                    comment         = lockHolder.GetDescription();

                    // Check if this is locked by me?
                    if (username == MOG_ControllerProject.GetUserName())
                    {
                        status = "CheckedOut";
                    }
                    else
                    {
                        status = "Locked";
                    }
                }
                else
                {
                    // Update this file's icon
                    item.ImageIndex = MogUtil_AssetIcons.GetFileIconIndex(repositoryFile);
                }
            }

            // Update the item with the new information
            item.SubItems[statusIdx].Text          = status;
            item.SubItems[userIdx].Text            = username;
            item.SubItems[commentIdx].Text         = comment;
            item.SubItems[localTimestampIdx].Text  = MogUtils_StringVersion.VersionToString(localTimestamp);
            item.SubItems[serverTimestampIdx].Text = MogUtils_StringVersion.VersionToString(repositoryAssetFilename.GetVersionTimeStamp());

            // Update the color for this locked item
            UpdateListViewItemColors(item, status);
        }