Prizm.Main.Synch.Export.DataExporter.WriteAttachments C# (CSharp) Method

WriteAttachments() private method

private WriteAttachments ( string tempDir, Data data ) : void
tempDir string
data Data
return void
        void WriteAttachments(string tempDir, Data data)
        {
            Directory.CreateDirectory(Path.Combine(tempDir, "Attachments"));

            if(data.Pipes != null)
            {
                foreach(PipeObject pipe in data.Pipes)
                {
                    if(pipe.Attachments != null)
                    {
                        WriteAttachments(tempDir, pipe.Attachments);
                    }
                    if(pipe.Railcar != null && pipe.Railcar.ReleaseNote != null && pipe.Railcar.ReleaseNote.Attachments != null)
                    {
                        WriteAttachments(tempDir, pipe.Railcar.ReleaseNote.Attachments);
                    }
                    if(pipe.Spools.Count != 0)
                    {
                        foreach(SpoolObject spoolObj in pipe.Spools)
                        {
                            if(spoolObj.Attachments != null)
                            {
                                WriteAttachments(tempDir, spoolObj.Attachments);
                            }
                        }
                    }
                }
            }


            if(data.Joints != null)
            {
                foreach(JointObject joint in data.Joints)
                {
                    if(joint.Attachments != null)
                    {
                        WriteAttachments(tempDir, joint.Attachments);
                    }
                }
            }

            if(data.Components != null)
            {
                foreach(ComponentObject components in data.Components)
                {
                    if(components.Attachments != null)
                    {
                        WriteAttachments(tempDir, components.Attachments);
                    }
                }
            }
        }

Same methods

DataExporter::WriteAttachments ( string tempDir, IList attachments ) : void