Exemple #1
0
        private ArrayList GetRequiredAssets(string classification)
        {
            ArrayList requiredAssetList = new ArrayList();

            // Break up classification into its parts
            string[] classificationParts = MOG_Filename.SplitClassificationString(classification);

            // Scan our list of required assets looking for any immediate children that should be included?
            foreach (DictionaryEntry requiredAsset in mRequiredAssets)
            {
                MOG_Filename requiredAssetFilename  = new MOG_Filename(requiredAsset.Key.ToString());
                string       requiredClassification = requiredAssetFilename.GetAssetClassification();

                // Check if classification is a parent for requiredClassification?
                if (MOG_Filename.IsParentClassificationString(requiredClassification, classification))
                {
                    // Break up classification into its parts
                    string[] requiredClassificationParts = MOG_Filename.SplitClassificationString(requiredClassification);
                    // Make sure there is an immediate child classification we can extract?
                    if (requiredClassificationParts.Length == classificationParts.Length)
                    {
                        requiredAssetList.Add(requiredAssetFilename);
                    }
                }
            }

            return(requiredAssetList);
        }
        public List <string> DrillToAsset_BuildDrillPathParts(MOG_Filename assetFilename, bool includeRevisions)
        {
            List <string> parts = new List <string>();

            if (Nodes != null)
            {
                if (Nodes.Count > 0)
                {
                    if (!String.IsNullOrEmpty(assetFilename.GetOriginalFilename()))
                    {
                        // Add classification elements
                        string classification = assetFilename.GetAssetClassification();
                        if (!String.IsNullOrEmpty(classification))
                        {
                            string[] classificationParts = MOG_Filename.SplitClassificationString(classification);
                            parts.AddRange(classificationParts);

                            // Add asset name elements
                            string assetName = assetFilename.GetAssetName();
                            if (!String.IsNullOrEmpty(assetName))
                            {
                                parts.Add(assetName);

                                // Check if we have a version?
                                if (!String.IsNullOrEmpty(assetFilename.GetVersionTimeStamp()) && includeRevisions)
                                {
                                    // Date format string
                                    string dateFormat = MOG_Tokens.GetMonth_1() + "/" + MOG_Tokens.GetDay_1() + "/" + MOG_Tokens.GetYear_4()
                                                        + " " + MOG_Tokens.GetHour_1() + ":" + MOG_Tokens.GetMinute_2() + " " + MOG_Tokens.GetAMPM();

                                    parts.Add(Revisions_Text);
                                    parts.Add("<" + assetFilename.GetVersionTimeStampString(dateFormat) + ">");
                                }
                            }
                        }
                    }
                }
            }

            return(parts);
        }
Exemple #3
0
        private string ParseForChildClassification(string rootClassification, string childClassification)
        {
            string child = "";

            // Check if classification is a parent for requiredClassification?
            if (MOG_Filename.IsParentClassificationString(childClassification, rootClassification))
            {
                // Break up the classifications into their parts
                string[] rootClassificationParts  = MOG_Filename.SplitClassificationString(rootClassification);
                string[] childClassificationParts = MOG_Filename.SplitClassificationString(childClassification);

                // Make sure there is an immediate child classification we can extract?
                if (childClassificationParts.Length > rootClassificationParts.Length)
                {
                    // Extract the next immediate child classification of childClassificationParts
                    child = childClassificationParts[rootClassificationParts.Length];
                }
            }

            return(child);
        }