UpdateDictionary() 공개 정적인 메소드

public static UpdateDictionary ( object>.IDictionary original, object>.IDictionary updates ) : void
original object>.IDictionary
updates object>.IDictionary
리턴 void
예제 #1
0
        public IFolder CreateFolder(CmisPath path, bool recursive,
                                    IDictionary <string, object> properties)
        {
            path = path.WithoutTrailingSlash();

            if (recursive)
            {
                // check if it already exists and proceed to create otherwise
                try
                {
                    return(GetFolder(path));
                }
                catch (CmisObjectNotFoundException)
                {
                }
            }

            var     components = path.GetComponents();
            var     dirname    = components[0];
            var     basename   = components[1];
            IFolder parent     = recursive ? CreateFolder(dirname, true, null) : GetFolder(dirname);

            var allProps = new Dictionary <string, object>()
            {
                { PropertyIds.ObjectTypeId, "cmis:folder" },
                { PropertyIds.Name, basename }
            };

            Utilities.UpdateDictionary(allProps, properties);
            return(parent.CreateFolder(allProps));
        }
예제 #2
0
        public IDocument CreateDocument(CmisPath path, ContentStream stream,
                                        IDictionary <string, object> properties)
        {
            var components = path.GetComponents();
            var name       = components[1];

            if (name.Length == 0)
            {
                throw new CmisNameConstraintViolationException("The document name is empty.");
            }
            var folder = GetFolder(components[0]);

            var allProps = new Dictionary <string, object>()
            {
                { PropertyIds.ObjectTypeId, "cmis:document" },
                { PropertyIds.Name, name }
            };

            Utilities.UpdateDictionary(allProps, properties);
            return(folder.CreateDocument(allProps, stream, VersioningState.Major));
        }