/// <summary>
        /// Write to binary archive
        /// </summary>
        public bool WriteDocument(BinaryArchiveWriter archive)
        {
            var rc = false;

            if (null != archive)
            {
                try
                {
                    archive.Write3dmChunkVersion(MAJOR, MINOR);
                    archive.WriteInt(Count);
                    for (var i = 0; i < Count; i++)
                    {
                        var item = this.ElementAt(i);
                        archive.WriteString(item.Key);
                        item.Value.WriteToArchive(archive);
                    }
                    rc = archive.WriteErrorOccured;
                }
                catch
                {
                    // ignored
                }
            }
            return(rc);
        }
예제 #2
0
 /// <summary>
 /// Write the makefile to the given archive
 /// </summary>
 /// <param name="Writer">The archive to write to</param>
 public void Write(BinaryArchiveWriter Writer)
 {
     Writer.WriteLong(CreateTimeUtc.Ticks);
     Writer.WriteString(ToolchainInfo);
     Writer.WriteString(ExternalMetadata);
     Writer.WriteFileReference(ReceiptFile);
     Writer.WriteDirectoryReference(ProjectIntermediateDirectory);
     Writer.WriteInt((int)TargetType);
     Writer.WriteBool(bDeployAfterCompile);
     Writer.WriteBool(bHasProjectScriptPlugin);
     Writer.WriteArray(AdditionalArguments, Item => Writer.WriteString(Item));
     Writer.WriteArray(PreBuildScripts, Item => Writer.WriteFileReference(Item));
     Writer.WriteList(Actions, Action => Action.Write(Writer));
     Writer.WriteList(EnvironmentVariables, x => { Writer.WriteString(x.Item1); Writer.WriteString(x.Item2); });
     Writer.WriteList(OutputItems, Item => Writer.WriteFileItem(Item));
     Writer.WriteDictionary(ModuleNameToOutputItems, k => Writer.WriteString(k), v => Writer.WriteArray(v, e => Writer.WriteFileItem(e)));
     Writer.WriteHashSet(HotReloadModuleNames, x => Writer.WriteString(x));
     Writer.WriteDictionary(DirectoryToSourceFiles, k => Writer.WriteDirectoryItem(k), v => Writer.WriteArray(v, e => Writer.WriteFileItem(e)));
     Writer.WriteHashSet(WorkingSet, x => Writer.WriteFileItem(x));
     Writer.WriteHashSet(CandidatesForWorkingSet, x => Writer.WriteFileItem(x));
     Writer.WriteList(UObjectModules, e => e.Write(Writer));
     Writer.WriteList(UObjectModuleHeaders, x => x.Write(Writer));
     Writer.WriteHashSet(PluginFiles, x => Writer.WriteFileItem(x));
     Writer.WriteHashSet(AdditionalDependencies, x => Writer.WriteFileItem(x));
 }
        /// <summary>
        /// Called when Rhino is saving a .3dm file to allow the plug-in to save document user data.
        /// </summary>
        protected override void WriteDocument(RhinoDoc doc, BinaryArchiveWriter archive, FileWriteOptions options)
        {
            archive.Write3dmChunkVersion(MAJOR, MINOR);
            SampleCsStringTable string_table = SampleCsStringTable.Instance;

            string_table.WriteDocument(doc, archive, options);
        }
        public bool Write(BinaryArchiveWriter archive)
        {
            var rc = false;

            if (null != archive)
            {
                try
                {
                    // Write chunk version
                    archive.Write3dmChunkVersion(1, 0);

                    // Write 'this' object
                    var formatter = new BinaryFormatter();
                    var stream    = new MemoryStream();
                    formatter.Serialize(stream, this);
                    stream.Seek(0, 0);
                    var bytes = stream.ToArray();
                    archive.WriteByteArray(bytes);
                    stream.Close();

                    // Verify writing
                    rc = archive.WriteErrorOccured;
                }
                catch
                {
                    // TODO
                }
            }
            return(rc);
        }
        /// <summary>
        /// Writes data for this dependency cache to disk
        /// </summary>
        private void Write()
        {
            DirectoryReference.CreateDirectory(Location.Directory);
            using (FileStream Stream = File.Open(Location.FullName, FileMode.Create, FileAccess.Write, FileShare.Read))
            {
                using (BinaryArchiveWriter Writer = new BinaryArchiveWriter(Stream))
                {
                    Writer.WriteInt(CurrentVersion);

                    Writer.WriteInt(FileToIncludeInfo.Count);
                    foreach (KeyValuePair <FileItem, IncludeInfo> Pair in FileToIncludeInfo)
                    {
                        Writer.WriteCompactFileItem(Pair.Key);
                        Writer.WriteLong(Pair.Value.LastWriteTimeUtc);
                        Writer.WriteString(Pair.Value.IncludeText);
                    }

                    Writer.WriteInt(FileToReflectionInfo.Count);
                    foreach (KeyValuePair <FileItem, ReflectionInfo> Pair in FileToReflectionInfo)
                    {
                        Writer.WriteCompactFileItem(Pair.Key);
                        Writer.WriteLong(Pair.Value.LastWriteTimeUtc);
                        Writer.WriteBool(Pair.Value.bContainsMarkup);
                    }
                }
            }
            bModified = false;
        }
 /// <summary>
 /// Writes the content of this data to a stream archive.
 /// </summary>
 protected override bool Write(BinaryArchiveWriter archive)
 {
     archive.Write3dmChunkVersion(1, 0);
     archive.WritePlane(Plane);
     archive.WriteGuid(ViewportId);
     archive.WriteBool(Enabled);
     return(!archive.WriteErrorOccured);
 }
예제 #7
0
 /// <summary>
 /// Writes this key to an archive
 /// </summary>
 /// <param name="Writer">Archive to write to</param>
 public void Write(BinaryArchiveWriter Writer)
 {
     Writer.WriteInt((int)Type);
     Writer.WriteDirectoryReference(ProjectDir);
     Writer.WriteUnrealTargetPlatform(Platform);
     Writer.WriteString(SectionName);
     Writer.WriteString(KeyName);
 }
예제 #8
0
 /// <summary>
 /// Saves a makefile to disk
 /// </summary>
 /// <param name="Location">Path to save the makefile to</param>
 public void Save(FileReference Location)
 {
     DirectoryReference.CreateDirectory(Location.Directory);
     using (BinaryArchiveWriter Writer = new BinaryArchiveWriter(Location))
     {
         Writer.WriteInt(CurrentVersion);
         Write(Writer);
     }
 }
예제 #9
0
        protected override bool Write(BinaryArchiveWriter archive)
        {
            // deserialize properties to archivable dictionary
            var dict = DeserializeToDictionary();

            // write dict to archive
            archive.WriteDictionary(dict);

            return(!archive.WriteErrorOccured);
        }
예제 #10
0
 /// <summary>
 /// Saves this action history to disk
 /// </summary>
 void Save()
 {
     DirectoryReference.CreateDirectory(Location.Directory);
     using (BinaryArchiveWriter Writer = new BinaryArchiveWriter(Location))
     {
         Writer.WriteInt(CurrentVersion);
         Writer.WriteDictionary(OutputItemToCommandLineHash, Key => Writer.WriteFileItem(Key), Value => Writer.WriteFixedSizeByteArray(Value));
     }
     bModified = false;
 }
예제 #11
0
        public bool WriteToArchive(BinaryArchiveWriter archive)
        {
            archive.Write3dmChunkVersion(1, 0);

            //HBObject, orphaned objects
            var dic = Serialize();

            archive.WriteDictionary(dic);

            return(!archive.WriteErrorOccured);
        }
예제 #12
0
 /// <summary>
 /// Called when Rhino is saving a .3dm file to allow the plug-in to save document user data.
 /// </summary>
 protected override void WriteDocument(RhinoDoc doc, BinaryArchiveWriter archive, FileWriteOptions options)
 {
     // Write the version of our document data
     archive.Write3dmChunkVersion(MAJOR, MINOR);
     // Write the string table
     StringDocumentDataTable.WriteDocument(archive);
     // Write the simple table
     SimpleDocumentDataTable.WriteDocument(archive);
     // Write the dictionary
     archive.WriteDictionary(Dictionary);
 }
        /// <summary>
        /// Writes the content of this data to a stream archive.
        /// </summary>
        protected override bool Write(BinaryArchiveWriter archive)
        {
            // Write the chuck version
            archive.Write3dmChunkVersion(MAJOR_VERSION, MINOR_VERSION);

            // Write 1.0 fields
            archive.WriteString(Notes);

            // Note, if you every roll the minor version number,
            // then write those fields here.

            return(!archive.WriteErrorOccured);
        }
        private static int SaveDocument(int serial, uint doc_serial, IntPtr pArchive)
        {
            var client = FromSerialNumber(serial);

            if (client != null)
            {
                RhinoDoc            doc     = RhinoDoc.FromRuntimeSerialNumber(doc_serial);
                BinaryArchiveWriter archive = new BinaryArchiveWriter(pArchive);
                bool save_doc = client.SaveDocument(doc, archive);
                return(save_doc ? 1 : 0);
            }
            return(0);
        }
        private static int SaveObject(int serial, uint doc_serial, uint obj_serial, ref Geometry.Transform transform, IntPtr pArchive)
        {
            var client = FromSerialNumber(serial);

            if (client != null)
            {
                RhinoDoc                     doc     = RhinoDoc.FromRuntimeSerialNumber(doc_serial);
                BinaryArchiveWriter          archive = new BinaryArchiveWriter(pArchive);
                Rhino.DocObjects.RhinoObject obj     = new DocObjects.RhinoObject(obj_serial);

                bool save_doc = client.SaveObject(doc, obj, ref transform, archive);
                return(save_doc ? 1 : 0);
            }
            return(0);
        }
예제 #16
0
 /// <summary>
 /// ISerializable: Called when serialized to report additional properties that should be saved
 /// </summary>
 public void Write(BinaryArchiveWriter Writer)
 {
     Writer.WriteByte((byte)ActionType);
     Writer.WriteDirectoryReference(WorkingDirectory);
     Writer.WriteBool(bPrintDebugInfo);
     Writer.WriteFileReference(CommandPath);
     Writer.WriteString(CommandArguments);
     Writer.WriteString(CommandDescription);
     Writer.WriteString(StatusDescription);
     Writer.WriteBool(bCanExecuteRemotely);
     Writer.WriteBool(bCanExecuteRemotelyWithSNDBS);
     Writer.WriteBool(bIsGCCCompiler);
     Writer.WriteBool(bShouldOutputStatusDescription);
     Writer.WriteBool(bProducesImportLibrary);
     Writer.WriteList(PrerequisiteItems, Item => Writer.WriteFileItem(Item));
     Writer.WriteList(ProducedItems, Item => Writer.WriteFileItem(Item));
     Writer.WriteList(DeleteItems, Item => Writer.WriteFileItem(Item));
     Writer.WriteFileItem(DependencyListFile);
 }
예제 #17
0
        /// <summary>
        /// Write to binary archive
        /// </summary>
        public bool Write(BinaryArchiveWriter archive)
        {
            var rc = false;

            if (null != archive)
            {
                try
                {
                    archive.Write3dmChunkVersion(MAJOR, MINOR);
                    archive.WriteInt(Value);
                    rc = archive.WriteErrorOccured;
                }
                catch
                {
                    // ignored
                }
            }
            return(rc);
        }
예제 #18
0
        /// <summary>
        /// Write to binary archive
        /// </summary>
        public bool WriteDocument(BinaryArchiveWriter archive)
        {
            var rc = false;

            if (null != archive)
            {
                try
                {
                    archive.Write3dmChunkVersion(MAJOR, MINOR);
                    archive.WriteInt(Count);
                    for (var i = 0; i < Count; i++)
                    {
                        this[i].Write(archive);
                    }
                    rc = archive.WriteErrorOccured;
                }
                catch
                {
                    // ignored
                }
            }
            return(rc);
        }
예제 #19
0
 /// <summary>
 /// Write the dependencies object to disk
 /// </summary>
 /// <param name="Writer">Archive to write to</param>
 public void Write(BinaryArchiveWriter Writer)
 {
     Writer.WriteDictionary(Dependencies, Key => Key.Write(Writer), Value => Writer.WriteList(Value, x => Writer.WriteString(x)));
 }
 /// <summary>
 /// Called when the user saves a snapshot and SupportsObjects() and SupportsObject(Rhino.DocObjects.RhinoObject doc_object) returns true.
 /// </summary>
 /// <param name="doc">doc is the current document.</param>
 /// <param name="doc_object">doc_obj is the current object.</param>
 /// <param name="transform">transform is a transformation matrix. The matrix is set to identity the first time an object is associated with a snapshot.
 /// After that the matrix is updated when the object is transformed(scale, rotate etc.).</param>
 /// <param name="archive">archive is the archive to write the data to.</param>
 /// <returns>true if successful, otherwise false.</returns>
 /// <since>6.0</since>
 public abstract bool SaveObject(RhinoDoc doc, Rhino.DocObjects.RhinoObject doc_object, ref Rhino.Geometry.Transform transform, BinaryArchiveWriter archive);
 /// <summary>
 /// Called when the user saves a snapshot and SupportDocument() returns true.
 /// </summary>
 /// <param name="doc">doc is the current document</param>
 /// <param name="archive"> archive is the archive to write the data to</param>
 /// <returns>true if successful, otherwise false</returns>
 /// <since>6.0</since>
 public abstract bool SaveDocument(RhinoDoc doc, BinaryArchiveWriter archive);
 protected override bool Write(BinaryArchiveWriter archive)
 {
     archive.Write3dmChunkVersion(1, 0);
     Data.Write(archive);
     return(!archive.WriteErrorOccured);
 }