/// <summary>
        /// Used to get an Asset node with a good node.Tag for this TreeView or any inheriting classes.
        /// </summary>
        private TreeNode CreateAssetNode(MOG_Filename asset, System.Drawing.Color foreColor, bool useFullFilename)
        {
            string       assetName = asset.GetAssetFullName();
            MOG_Filename assetFullFilename;

            // If we found revisions, go ahead and select the first one as the full filename for our tag...
            assetFullFilename = MOG_ControllerRepository.GetAssetBlessedPath(asset);

            TreeNode assetNode = new TreeNode(asset.GetAssetName());

            if (useFullFilename)
            {
                assetNode.Text = asset.GetAssetFullName();
            }

            assetNode.Tag = new Mog_BaseTag(assetNode, assetFullFilename.GetEncodedFilename(), RepositoryFocusLevel.Repository, true);

            // If we are Archive_Color, remain displayed as such
            if (foreColor == Archive_Color)
            {
                assetNode.ForeColor = Archive_Color;
            }

            assetNode.Nodes.Add(new TreeNode(Blank_Node_Text));
            assetNode.Name = asset.GetAssetFullName();

            SetImageIndices(assetNode, GetAssetImageIndex(((Mog_BaseTag)assetNode.Tag).FullFilename));

            return(assetNode);
        }
示例#2
0
        public bool ToolNewerCheck(MOG_Filename mogAsset, string version, MOG_Project pProject, ref string failedString)
        {
            MOG_Time assetTime        = new MOG_Time(version);
            MOG_Time correctAssetTime = new MOG_Time();

            DirectoryInfo [] dirs = DosUtils.DirectoryGetList(MOG_ControllerRepository.GetAssetBlessedPath(mogAsset).GetEncodedFilename(), "*.*");

            if (dirs != null)
            {
                foreach (DirectoryInfo dir in dirs)
                {
                    string   checkVersion = dir.Name.Substring(dir.Name.LastIndexOf(".") + 1);
                    MOG_Time dirTime      = new MOG_Time(checkVersion);

                    // Is this asset equal or newer than this dir version?
                    if (assetTime.Compare(dirTime) < 0)
                    {
                        failedString = "Out of date," + failedString;
                        return(false);
                    }
                }
            }

            return(true);
        }
示例#3
0
 static protected MOG_Filename GetAssetFullname(MOG_Filename asset, string contentsInfo)
 {
     // The source will be out in the blessed asset tree
     return(MOG_ControllerRepository.GetAssetBlessedPath(asset));
 }
示例#4
0
 static protected MOG_Filename GetAssetFullname(MOG_Filename asset, string contentsInfo)
 {
     return(MOG_ControllerRepository.GetAssetBlessedPath(asset));
 }