public static OLEPropertiesContainer CreateNewSummaryInfo(SummaryInfoProperties sumInfoProps)
 {
     return(null);
 }
예제 #2
0
        public static void V8DgnGetProperties(string fileName)
        {
            try
            {
                FileName     = fileName;
                using var fs = new FileStream(fileName, FileMode.Open, FileAccess.Read);
                var cf = new CompoundFile(fs);

                Action <CFItem> va = delegate(CFItem target)
                {
                    if (target.IsStream)
                    {
                        if (target.Name == "\u0005SummaryInformation")
                        {
                            OLEPropertiesContainer c = ((CFStream)target).AsOLEPropertiesContainer();
                            var thumbnail            = GetThumbnailePropertyValue(c, "PIDSI_THUMBNAIL");
                            summaryInfoProperties = new SummaryInfoProperties
                            {
                                Title            = GetPropertyValue(c, "PIDSI_TITLE"),
                                Subject          = GetPropertyValue(c, "PIDSI_SUBJECT"),
                                Author           = GetPropertyValue(c, "PIDSI_AUTHOR"),
                                Keywords         = GetPropertyValue(c, "PIDSI_KEYWORDS"),
                                Comments         = GetPropertyValue(c, "PIDSI_COMMENTS"),
                                Template         = GetPropertyValue(c, "PIDSI_TEMPLATE"),
                                LastSavedBy      = GetPropertyValue(c, "PIDSI_LASTAUTHOR"),
                                RevisionNumber   = GetPropertyValue(c, "PIDSI_REVNUMBER"),
                                ApplicationName  = GetPropertyValue(c, "PIDSI_APPNAME"),
                                TotalEditingTime = GetPropertyValue(c, "PIDSI_EDITTIME"),
                                LastPrintedTime  = GetPropertyValue(c, "PIDSI_LASTPRINTED"),
                                CreatedTime      = GetPropertyValue(c, "PIDSI_CREATE_DTM"),
                                LastSavedTime    = GetPropertyValue(c, "PIDSI_LASTSAVE_DTM"),
                                Security         = GetPropertyValue(c, "PIDSI_DOC_SECURITY"),
                                Thumbnail        = thumbnail != null ? (byte[])thumbnail.Clone() : null,
                            };
                        }
                        else if (target.Name == "\u0005DocumentSummaryInformation")
                        {
                            OLEPropertiesContainer c = ((CFStream)target).AsOLEPropertiesContainer();
                            documentSummaryInfoProperties = new DocumentSummaryInfoProperties
                            {
                                Category = GetPropertyValue(c, "PIDDSI_CATEGORY"),
                                Manager  = GetPropertyValue(c, "PIDDSI_MANAGER"),
                                Company  = GetPropertyValue(c, "PIDDSI_COMPANY"),
                                BentleyProjectProperties = GetUserDeefinedPropertyValue(c, "BentleyProjectProperties"),
                                BentleyWorkSetProperties = GetUserDeefinedPropertyValue(c, "BentleyWorkSetProperties"),
                            };
                        }
                        else if (target.Name == "\u0005SebiesnrMkudrfcoIaamtykdDa")
                        {
                        }
                        else
                        {
                        }
                    }
                };

                // iterate over storage & streams
                cf.RootStorage.VisitEntries(va, true);
                cf.Close();
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex.Message);
            }
        }