Esempio n. 1
0
        /*++
         *
         *  Routine GetFileProperty
         *
         * Description:
         *
         *  This routine retrieves an FSRM property from a given file.
         *
         * Arguments:
         *
         *  FilePath  - The file whose property is to be retrieved.
         *  PropertyName - The property to be retrieved
         *  FsrmManager - The IFsrmClassificationManager object to retrieve the property for the file.
         *
         * Return value:
         *
         *  void
         *
         * Notes:
         *
         *
         * --*/

        static void GetFileProperty(
            string FilePath,
            string PropertyName,
            IFsrmClassificationManager FsrmManager)
        {
            // Get the file property
            IFsrmProperty property_ = FsrmManager.GetFileProperty(
                FilePath,
                PropertyName,
                _FsrmGetFilePropertyOptions.FsrmGetFilePropertyOptions_None
                );

            DisplayProperty(property_);
        }
Esempio n. 2
0
        /*++
         *
         *  Routine EnumerateFileProperties
         *
         * Description:
         *
         *  This routine enumerates all FSRM properties on a file.
         *
         * Arguments:
         *
         *  FilePath  - The file whose properties are to be enumerated.
         *  FsrmManager - The IFsrmClassificationManager object to retrieve the properties for the file.
         *
         * Return value:
         *
         *  void
         *
         * Notes:
         *
         *
         * --*/

        static void EnumerateFileProperties(
            string FilePath,
            IFsrmClassificationManager FsrmManager)
        {
            IFsrmCollection fsrmCollection;

            // get the list of properties for a file
            fsrmCollection = FsrmManager.EnumFileProperties(
                FilePath,
                _FsrmGetFilePropertyOptions.FsrmGetFilePropertyOptions_None
                );

            // loop over all the properties in the collection and print each
            for (int i = 0; i < fsrmCollection.Count; ++i)
            {
                IFsrmProperty property_ = (IFsrmProperty)fsrmCollection[i + 1];
                Console.WriteLine("Property {0}", i + 1);
                DisplayProperty(property_);
                Console.Write("\n");
            }
        }
Esempio n. 3
0
        /*++
         *
         *  Routine EnumerateProperties
         *
         * Description:
         *
         *  This routine prints an FSRM property to the screen
         *
         * Arguments:
         *
         *  Property - An IFsrmProperty pbject for the property.
         *
         * Return value:
         *
         *  void
         *
         * Notes:
         *
         *
         * --*/

        static void DisplayProperty(
            IFsrmProperty Property)
        {
            string name;
            string value;
            Array  sources;
            int    propertyFlag;

            // get each member for the property
            value        = Property.Value;
            name         = Property.Name;
            propertyFlag = Property.PropertyFlags;
            sources      = Property.Sources;
            //print the properties


            Console.WriteLine("\tName:\t\t{0}", name);
            Console.WriteLine("\tDefinition:\t\t{0}", value);
            Console.Write("\tProperty Flags:\t");

            int FsrmPropertyFlags_Orphaned             = 0x00000001;
            int FsrmPropertyFlags_RetrievedFromCache   = 0x00000002;
            int FsrmPropertyFlags_RetrievedFromStorage = 0x00000004;
            int FsrmPropertyFlags_SetByClassifier      = 0x00000008;
            int FsrmPropertyFlags_Deleted           = 0x00000010;
            int FsrmPropertyFlags_Reclassified      = 0x00000020;
            int FsrmPropertyFlags_AggregationFailed = 0x00000040;
            //int FsrmPropertyFlags_Existing = 0x00000080;
            int FsrmPropertyFlags_FailedLoadingProperties     = 0x00000100;
            int FsrmPropertyFlags_FailedClassifyingProperties = 0x00000200;


            if (((int)propertyFlag & FsrmPropertyFlags_Orphaned) != 0)
            {
                Console.Write("Orphaned ");
            }
            if (((int)propertyFlag & FsrmPropertyFlags_RetrievedFromCache) != 0)
            {
                Console.Write("RetrievedFromCache ");
            }
            if (((int)propertyFlag & FsrmPropertyFlags_RetrievedFromStorage) != 0)
            {
                Console.Write("RetrievedFromStorage ");
            }
            if (((int)propertyFlag & FsrmPropertyFlags_SetByClassifier) != 0)
            {
                Console.Write("SetByClassifier ");
            }
            if (((int)propertyFlag & FsrmPropertyFlags_Deleted) != 0)
            {
                Console.Write("Deleted ");
            }
            if (((int)propertyFlag & FsrmPropertyFlags_Reclassified) != 0)
            {
                Console.Write("Reclassified ");
            }
            if (((int)propertyFlag & FsrmPropertyFlags_AggregationFailed) != 0)
            {
                Console.Write("AggregationFailed");
            }
            if (((int)propertyFlag & FsrmPropertyFlags_FailedLoadingProperties) != 0)
            {
                Console.Write("FailedLoadingProperties ");
            }
            if (((int)propertyFlag & FsrmPropertyFlags_FailedClassifyingProperties) != 0)
            {
                Console.Write("FailedClassifyingProperties");
            }
            Console.Write("\n");

            Console.Write("\tSources:\n");
            for (int i = 0; i < sources.Length; ++i)
            {
                Console.Write("\t\t{0} - {1}\n", i + 1, sources.GetValue(i));
            }
        }
        /*++

            Routine EnumerateProperties

        Description:

            This routine prints an FSRM property to the screen

        Arguments:

            Property - An IFsrmProperty pbject for the property.

        Return value:

            void

        Notes:

        --*/
        static void DisplayProperty(
            IFsrmProperty Property )
        {
            string name;
            string value;
            Array sources;
            int propertyFlag;

            // get each member for the property
            value = Property.Value;
            name = Property.Name;
            propertyFlag = Property.PropertyFlags;
            sources = Property.Sources;
            //print the properties

            Console.WriteLine( "\tName:\t\t{0}", name );
            Console.WriteLine( "\tDefinition:\t\t{0}", value );
            Console.Write( "\tProperty Flags:\t" );

            int FsrmPropertyFlags_Orphaned = 0x00000001;
            int FsrmPropertyFlags_RetrievedFromCache = 0x00000002;
            int FsrmPropertyFlags_RetrievedFromStorage = 0x00000004;
            int FsrmPropertyFlags_SetByClassifier = 0x00000008;
            int FsrmPropertyFlags_Deleted = 0x00000010;
            int FsrmPropertyFlags_Reclassified = 0x00000020;
            int FsrmPropertyFlags_AggregationFailed = 0x00000040;
            //int FsrmPropertyFlags_Existing = 0x00000080;
            int FsrmPropertyFlags_FailedLoadingProperties = 0x00000100;
            int FsrmPropertyFlags_FailedClassifyingProperties = 0x00000200;

            if (((int)propertyFlag & FsrmPropertyFlags_Orphaned) != 0) {
                Console.Write( "Orphaned " );
            }
            if (((int)propertyFlag & FsrmPropertyFlags_RetrievedFromCache) != 0) {
                Console.Write( "RetrievedFromCache " );
            }
            if (((int)propertyFlag & FsrmPropertyFlags_RetrievedFromStorage) != 0) {
                Console.Write( "RetrievedFromStorage " );
            }
            if (((int)propertyFlag & FsrmPropertyFlags_SetByClassifier) != 0) {
                Console.Write( "SetByClassifier " );
            }
            if (((int)propertyFlag & FsrmPropertyFlags_Deleted) != 0) {
                Console.Write( "Deleted " );
            }
            if (((int)propertyFlag & FsrmPropertyFlags_Reclassified) != 0) {
                Console.Write( "Reclassified " );
            }
            if (((int)propertyFlag & FsrmPropertyFlags_AggregationFailed) != 0) {
                Console.Write( "AggregationFailed" );
            }
            if (((int)propertyFlag & FsrmPropertyFlags_FailedLoadingProperties) != 0) {
                Console.Write( "FailedLoadingProperties " );
            }
            if (((int)propertyFlag & FsrmPropertyFlags_FailedClassifyingProperties) != 0) {
                Console.Write( "FailedClassifyingProperties" );
            }
            Console.Write( "\n" );

            Console.Write( "\tSources:\n" );
            for (int i = 0; i < sources.Length; ++i) {
                Console.Write( "\t\t{0} - {1}\n", i + 1, sources.GetValue( i ) );
            }
        }