-
Notifications
You must be signed in to change notification settings - Fork 1.6k
/
Copy pathPackagePart.xml
1376 lines (1233 loc) · 96.3 KB
/
PackagePart.xml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<Type Name="PackagePart" FullName="System.IO.Packaging.PackagePart">
<TypeSignature Language="C#" Value="public abstract class PackagePart" />
<TypeSignature Language="ILAsm" Value=".class public auto ansi abstract beforefieldinit PackagePart extends System.Object" />
<TypeSignature Language="DocId" Value="T:System.IO.Packaging.PackagePart" />
<TypeSignature Language="VB.NET" Value="Public MustInherit Class PackagePart" />
<TypeSignature Language="F#" Value="type PackagePart = class" />
<TypeSignature Language="C++ CLI" Value="public ref class PackagePart abstract" />
<AssemblyInfo>
<AssemblyName>System.IO.Packaging</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.3.0</AssemblyVersion>
<AssemblyVersion>4.0.4.0</AssemblyVersion>
<AssemblyVersion>4.0.5.0</AssemblyVersion>
<AssemblyVersion>5.0.0.0</AssemblyVersion>
<AssemblyVersion>6.0.0.0</AssemblyVersion>
<AssemblyVersion>7.0.0.0</AssemblyVersion>
<AssemblyVersion>8.0.0.0</AssemblyVersion>
<AssemblyVersion>9.0.0.0</AssemblyVersion>
<AssemblyVersion>10.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>WindowsBase</AssemblyName>
<AssemblyVersion>3.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<TypeForwardingChain>
<TypeForwarding From="System.IO.Packaging" FromVersion="10.0.0.0" To="WindowsBase" ToVersion="4.0.0.0" FrameworkAlternate="netframework-4.6.2-pp" />
<TypeForwarding From="WindowsBase" FromVersion="10.0.0.0" To="System.IO.Packaging" ToVersion="10.0.0.0" FrameworkAlternate="windowsdesktop-10.0" />
<TypeForwarding From="WindowsBase" FromVersion="4.0.0.0" To="System.IO.Packaging" ToVersion="4.0.4.0" FrameworkAlternate="windowsdesktop-3.0" />
<TypeForwarding From="WindowsBase" FromVersion="4.0.0.0" To="System.IO.Packaging" ToVersion="4.0.5.0" FrameworkAlternate="windowsdesktop-3.1" />
<TypeForwarding From="WindowsBase" FromVersion="5.0.0.0" To="System.IO.Packaging" ToVersion="5.0.0.0" FrameworkAlternate="windowsdesktop-5.0" />
<TypeForwarding From="WindowsBase" FromVersion="6.0.0.0" To="System.IO.Packaging" ToVersion="6.0.0.0" FrameworkAlternate="windowsdesktop-6.0" />
<TypeForwarding From="WindowsBase" FromVersion="7.0.0.0" To="System.IO.Packaging" ToVersion="7.0.0.0" FrameworkAlternate="windowsdesktop-7.0" />
<TypeForwarding From="WindowsBase" FromVersion="8.0.0.0" To="System.IO.Packaging" ToVersion="8.0.0.0" FrameworkAlternate="windowsdesktop-8.0" />
<TypeForwarding From="WindowsBase" FromVersion="9.0.0.0" To="System.IO.Packaging" ToVersion="9.0.0.0" FrameworkAlternate="windowsdesktop-9.0" />
</TypeForwardingChain>
<Base>
<BaseTypeName>System.Object</BaseTypeName>
</Base>
<Interfaces />
<Attributes>
<Attribute FrameworkAlternate="net-10.0-pp;net-8.0-pp;net-9.0-pp;windowsdesktop-10.0;windowsdesktop-8.0;windowsdesktop-9.0">
<AttributeName Language="C#">[System.Runtime.CompilerServices.Nullable(0)]</AttributeName>
<AttributeName Language="F#">[<System.Runtime.CompilerServices.Nullable(0)>]</AttributeName>
</Attribute>
</Attributes>
<Docs>
<summary>Provides a base class for parts stored in a <see cref="T:System.IO.Packaging.Package" />. This class is abstract.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
A <xref:System.IO.Packaging.PackagePart> consists of three basic elements:
|Access|Description|
|------------|-----------------|
|<xref:System.IO.Packaging.PackagePart.Uri%2A>|The URI of the part.|
|<xref:System.IO.Packaging.PackagePart.ContentType%2A>|The MIME type of the content stream.|
|<xref:System.IO.Packaging.PackagePart.GetStream%2A>|The content data stream of the part.|
]]></format>
</remarks>
<related type="ExternalDocumentation" href="https://www.ecma-international.org/publications-and-standards/standards/ecma-376/">Open Packaging Conventions Specification</related>
</Docs>
<Members>
<MemberGroup MemberName=".ctor">
<AssemblyInfo>
<AssemblyName>System.IO.Packaging</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Docs>
<summary>Initializes a new instance of the <see cref="T:System.IO.Packaging.PackagePart" /> class.</summary>
<remarks>
<format type="text/markdown"><
[Open Packaging Conventions Specification](https://www.ecma-international.org/publications-and-standards/standards/ecma-376/)
]]></format>
</remarks>
</Docs>
</MemberGroup>
<Member MemberName=".ctor">
<MemberSignature Language="C#" Value="protected PackagePart (System.IO.Packaging.Package package, Uri partUri);" />
<MemberSignature Language="ILAsm" Value=".method familyhidebysig specialname rtspecialname instance void .ctor(class System.IO.Packaging.Package package, class System.Uri partUri) cil managed" />
<MemberSignature Language="DocId" Value="M:System.IO.Packaging.PackagePart.#ctor(System.IO.Packaging.Package,System.Uri)" />
<MemberSignature Language="VB.NET" Value="Protected Sub New (package As Package, partUri As Uri)" />
<MemberSignature Language="F#" Value="new System.IO.Packaging.PackagePart : System.IO.Packaging.Package * Uri -> System.IO.Packaging.PackagePart" Usage="new System.IO.Packaging.PackagePart (package, partUri)" />
<MemberSignature Language="C++ CLI" Value="protected:
 PackagePart(System::IO::Packaging::Package ^ package, Uri ^ partUri);" />
<MemberType>Constructor</MemberType>
<AssemblyInfo>
<AssemblyName>System.IO.Packaging</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.4.0</AssemblyVersion>
<AssemblyVersion>4.0.5.0</AssemblyVersion>
<AssemblyVersion>5.0.0.0</AssemblyVersion>
<AssemblyVersion>6.0.0.0</AssemblyVersion>
<AssemblyVersion>7.0.0.0</AssemblyVersion>
<AssemblyVersion>8.0.0.0</AssemblyVersion>
<AssemblyVersion>9.0.0.0</AssemblyVersion>
<AssemblyVersion>10.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>WindowsBase</AssemblyName>
<AssemblyVersion>3.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Attributes>
<Attribute FrameworkAlternate="netframework-4.0">
<AttributeName Language="C#">[System.Runtime.TargetedPatchingOptOut("Performance critical to inline this type of method across NGen image boundaries")]</AttributeName>
<AttributeName Language="F#">[<System.Runtime.TargetedPatchingOptOut("Performance critical to inline this type of method across NGen image boundaries")>]</AttributeName>
</Attribute>
</Attributes>
<Parameters>
<Parameter Name="package" Type="System.IO.Packaging.Package" />
<Parameter Name="partUri" Type="System.Uri" />
</Parameters>
<Docs>
<param name="package">The parent <see cref="T:System.IO.Packaging.Package" /> of the part.</param>
<param name="partUri">The URI of the part, relative to the parent <see cref="T:System.IO.Packaging.Package" /> root.</param>
<summary>Initializes a new instance of the <see cref="T:System.IO.Packaging.PackagePart" /> class with a specified parent <see cref="P:System.IO.Packaging.PackagePart.Package" /> and part URI.</summary>
<remarks>
<format type="text/markdown">< *Uniform Resource Identifier (URI) Generic Syntax* specification and the [Open Packaging Conventions](https://www.ecma-international.org/publications-and-standards/standards/ecma-376/) specification.
Use this constructor when the <xref:System.IO.Packaging.PackagePart.ContentType%2A> of the part is not immediately known and will be set later when <xref:System.IO.Packaging.Package.CreatePart%2A> is called.
By default, the <xref:System.IO.Packaging.PackagePart.CompressionOption%2A> property of the part is initialized to <xref:System.IO.Packaging.CompressionOption.NotCompressed>.
]]></format>
</remarks>
<exception cref="T:System.ArgumentNullException">
<paramref name="package" /> or <paramref name="partUri" /> is <see langword="null" />.</exception>
<altmember cref="M:System.IO.Packaging.PackUriHelper.CreatePartUri(System.Uri)" />
<altmember cref="Overload:System.IO.Packaging.PackagePart.GetStream" />
<related type="ExternalDocumentation" href="https://www.ecma-international.org/publications-and-standards/standards/ecma-376/">Open Packaging Conventions Specification</related>
</Docs>
</Member>
<Member MemberName=".ctor">
<MemberSignature Language="C#" Value="protected PackagePart (System.IO.Packaging.Package package, Uri partUri, string? contentType);" FrameworkAlternate="net-10.0-pp;net-8.0-pp;net-9.0-pp;netstandard-2.0-pp;windowsdesktop-10.0;windowsdesktop-5.0;windowsdesktop-6.0;windowsdesktop-7.0;windowsdesktop-8.0;windowsdesktop-9.0" />
<MemberSignature Language="ILAsm" Value=".method familyhidebysig specialname rtspecialname instance void .ctor(class System.IO.Packaging.Package package, class System.Uri partUri, string contentType) cil managed" />
<MemberSignature Language="DocId" Value="M:System.IO.Packaging.PackagePart.#ctor(System.IO.Packaging.Package,System.Uri,System.String)" />
<MemberSignature Language="VB.NET" Value="Protected Sub New (package As Package, partUri As Uri, contentType As String)" />
<MemberSignature Language="F#" Value="new System.IO.Packaging.PackagePart : System.IO.Packaging.Package * Uri * string -> System.IO.Packaging.PackagePart" Usage="new System.IO.Packaging.PackagePart (package, partUri, contentType)" />
<MemberSignature Language="C++ CLI" Value="protected:
 PackagePart(System::IO::Packaging::Package ^ package, Uri ^ partUri, System::String ^ contentType);" />
<MemberSignature Language="C#" Value="protected PackagePart (System.IO.Packaging.Package package, Uri partUri, string contentType);" FrameworkAlternate="netcore-1.0;netcore-1.1;netframework-3.0;netframework-3.5;netframework-4.0;netframework-4.5;netframework-4.5.1;netframework-4.5.2;netframework-4.6;netframework-4.6.1;netframework-4.6.2;netframework-4.6.2-pp;netframework-4.7;netframework-4.7.1;netframework-4.7.2;netframework-4.8;netframework-4.8.1;windowsdesktop-3.0;windowsdesktop-3.1" />
<MemberType>Constructor</MemberType>
<AssemblyInfo>
<AssemblyName>System.IO.Packaging</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.4.0</AssemblyVersion>
<AssemblyVersion>4.0.5.0</AssemblyVersion>
<AssemblyVersion>5.0.0.0</AssemblyVersion>
<AssemblyVersion>6.0.0.0</AssemblyVersion>
<AssemblyVersion>7.0.0.0</AssemblyVersion>
<AssemblyVersion>8.0.0.0</AssemblyVersion>
<AssemblyVersion>9.0.0.0</AssemblyVersion>
<AssemblyVersion>10.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>WindowsBase</AssemblyName>
<AssemblyVersion>3.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Attributes>
<Attribute FrameworkAlternate="netframework-4.0">
<AttributeName Language="C#">[System.Runtime.TargetedPatchingOptOut("Performance critical to inline this type of method across NGen image boundaries")]</AttributeName>
<AttributeName Language="F#">[<System.Runtime.TargetedPatchingOptOut("Performance critical to inline this type of method across NGen image boundaries")>]</AttributeName>
</Attribute>
</Attributes>
<Parameters>
<Parameter Name="package" Type="System.IO.Packaging.Package" />
<Parameter Name="partUri" Type="System.Uri" />
<Parameter Name="contentType" Type="System.String">
<Attributes>
<Attribute FrameworkAlternate="net-10.0-pp;net-8.0-pp;net-9.0-pp;windowsdesktop-10.0;windowsdesktop-8.0;windowsdesktop-9.0">
<AttributeName Language="C#">[System.Runtime.CompilerServices.Nullable(2)]</AttributeName>
<AttributeName Language="F#">[<System.Runtime.CompilerServices.Nullable(2)>]</AttributeName>
</Attribute>
</Attributes>
</Parameter>
</Parameters>
<Docs>
<param name="package">The parent <see cref="T:System.IO.Packaging.Package" /> of the part.</param>
<param name="partUri">The URI of the part, relative to the parent <see cref="T:System.IO.Packaging.Package" /> root.</param>
<param name="contentType">The MIME content type of the part data stream.</param>
<summary>Initializes a new instance of the <see cref="T:System.IO.Packaging.PackagePart" /> class with a specified parent <see cref="P:System.IO.Packaging.PackagePart.Package" />, part URI, and MIME content type.</summary>
<remarks>
<format type="text/markdown">< *Uniform Resource Identifier (URI) Generic Syntax* specification and the [Open Packaging Conventions](https://www.ecma-international.org/publications-and-standards/standards/ecma-376/) specification.
By default, the <xref:System.IO.Packaging.PackagePart.CompressionOption%2A> property of the part is initialized to <xref:System.IO.Packaging.CompressionOption.NotCompressed>.
`contentType` must be a MIME type formed in accordance with the [RFC 2616](https://www.w3.org/Protocols/rfc2616/rfc2616.html) *Hypertext Transfer Protocol - HTTP*, Section 3.7. The following table shows an example of the content MIME types used in XML Paper Specification (XPS) documents.
|Description|Content Type|
|-----------------|------------------|
|Font|application/vnd.ms-opentype|
|ICC profile|application/vnd.ms-color.iccprofile|
|JPEG image|image/jpeg|
|Obfuscated font|application/vnd.ms-package.obfuscated-opentype|
|PNG image|image/png|
|PrintTicket|application/vnd.ms-printing.printticket+xml|
|TIFF image|image/tiff|
|Windows Media Photo image|image/vnd.ms-photo|
]]></format>
</remarks>
<exception cref="T:System.ArgumentNullException">
<paramref name="package" /> or <paramref name="partUri" /> is <see langword="null" />.</exception>
<exception cref="T:System.ArgumentException">
<paramref name="partUri" /> is not a valid <see cref="T:System.IO.Packaging.PackagePart" /> URI.</exception>
<altmember cref="M:System.IO.Packaging.PackUriHelper.CreatePartUri(System.Uri)" />
<altmember cref="Overload:System.IO.Packaging.PackagePart.GetStream" />
<related type="ExternalDocumentation" href="https://www.ecma-international.org/publications-and-standards/standards/ecma-376/">Open Packaging Conventions Specification</related>
</Docs>
</Member>
<Member MemberName=".ctor">
<MemberSignature Language="C#" Value="protected PackagePart (System.IO.Packaging.Package package, Uri partUri, string? contentType, System.IO.Packaging.CompressionOption compressionOption);" FrameworkAlternate="net-10.0-pp;net-8.0-pp;net-9.0-pp;netstandard-2.0-pp;windowsdesktop-10.0;windowsdesktop-5.0;windowsdesktop-6.0;windowsdesktop-7.0;windowsdesktop-8.0;windowsdesktop-9.0" />
<MemberSignature Language="ILAsm" Value=".method familyhidebysig specialname rtspecialname instance void .ctor(class System.IO.Packaging.Package package, class System.Uri partUri, string contentType, valuetype System.IO.Packaging.CompressionOption compressionOption) cil managed" />
<MemberSignature Language="DocId" Value="M:System.IO.Packaging.PackagePart.#ctor(System.IO.Packaging.Package,System.Uri,System.String,System.IO.Packaging.CompressionOption)" />
<MemberSignature Language="VB.NET" Value="Protected Sub New (package As Package, partUri As Uri, contentType As String, compressionOption As CompressionOption)" />
<MemberSignature Language="F#" Value="new System.IO.Packaging.PackagePart : System.IO.Packaging.Package * Uri * string * System.IO.Packaging.CompressionOption -> System.IO.Packaging.PackagePart" Usage="new System.IO.Packaging.PackagePart (package, partUri, contentType, compressionOption)" />
<MemberSignature Language="C++ CLI" Value="protected:
 PackagePart(System::IO::Packaging::Package ^ package, Uri ^ partUri, System::String ^ contentType, System::IO::Packaging::CompressionOption compressionOption);" />
<MemberSignature Language="C#" Value="protected PackagePart (System.IO.Packaging.Package package, Uri partUri, string contentType, System.IO.Packaging.CompressionOption compressionOption);" FrameworkAlternate="netcore-1.0;netcore-1.1;netframework-3.0;netframework-3.5;netframework-4.0;netframework-4.5;netframework-4.5.1;netframework-4.5.2;netframework-4.6;netframework-4.6.1;netframework-4.6.2;netframework-4.6.2-pp;netframework-4.7;netframework-4.7.1;netframework-4.7.2;netframework-4.8;netframework-4.8.1;windowsdesktop-3.0;windowsdesktop-3.1" />
<MemberType>Constructor</MemberType>
<AssemblyInfo>
<AssemblyName>System.IO.Packaging</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.4.0</AssemblyVersion>
<AssemblyVersion>4.0.5.0</AssemblyVersion>
<AssemblyVersion>5.0.0.0</AssemblyVersion>
<AssemblyVersion>6.0.0.0</AssemblyVersion>
<AssemblyVersion>7.0.0.0</AssemblyVersion>
<AssemblyVersion>8.0.0.0</AssemblyVersion>
<AssemblyVersion>9.0.0.0</AssemblyVersion>
<AssemblyVersion>10.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>WindowsBase</AssemblyName>
<AssemblyVersion>3.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Parameters>
<Parameter Name="package" Type="System.IO.Packaging.Package" />
<Parameter Name="partUri" Type="System.Uri" />
<Parameter Name="contentType" Type="System.String">
<Attributes>
<Attribute FrameworkAlternate="net-10.0-pp;net-8.0-pp;net-9.0-pp;windowsdesktop-10.0;windowsdesktop-8.0;windowsdesktop-9.0">
<AttributeName Language="C#">[System.Runtime.CompilerServices.Nullable(2)]</AttributeName>
<AttributeName Language="F#">[<System.Runtime.CompilerServices.Nullable(2)>]</AttributeName>
</Attribute>
</Attributes>
</Parameter>
<Parameter Name="compressionOption" Type="System.IO.Packaging.CompressionOption" />
</Parameters>
<Docs>
<param name="package">The parent <see cref="T:System.IO.Packaging.Package" /> of the part.</param>
<param name="partUri">The URI of the part, relative to the parent <see cref="T:System.IO.Packaging.Package" /> root.</param>
<param name="contentType">The MIME content type of the part's data stream.</param>
<param name="compressionOption">The compression option of the part data stream.</param>
<summary>Initializes a new instance of the <see cref="T:System.IO.Packaging.PackagePart" /> class with a specified parent <see cref="P:System.IO.Packaging.PackagePart.Package" />, part URI, MIME content type, and <see cref="T:System.IO.Packaging.CompressionOption" />.</summary>
<remarks>
<format type="text/markdown">< *Uniform Resource Identifier (URI) Generic Syntax* specification and the [Open Packaging Conventions](https://www.ecma-international.org/publications-and-standards/standards/ecma-376/) specification.
`contentType` must be a MIME type formed in accordance with the [RFC 2616](https://www.w3.org/Protocols/rfc2616/rfc2616.html) *Hypertext Transfer Protocol - HTTP*, Section 3.7. The following table shows an example of the content MIME types used in XML Paper Specification (XPS) documents.
|Description|Content Type|
|-----------------|------------------|
|Font|application/vnd.ms-opentype|
|ICC profile|application/vnd.ms-color.iccprofile|
|JPEG image|image/jpeg|
|Obfuscated font|application/vnd.ms-package.obfuscated-opentype|
|PNG image|image/png|
|PrintTicket|application/vnd.ms-printing.printticket+xml|
|TIFF image|image/tiff|
|Windows Media Photo image|image/vnd.ms-photo|
]]></format>
</remarks>
<exception cref="T:System.ArgumentNullException">
<paramref name="package" /> or <paramref name="partUri" /> is <see langword="null" />.</exception>
<exception cref="T:System.ArgumentException">
<paramref name="partUri" /> is not a valid <see cref="T:System.IO.Packaging.PackagePart" /> URI.</exception>
<exception cref="T:System.ArgumentOutOfRangeException">The <paramref name="compressionOption" /> value is not valid.</exception>
<altmember cref="M:System.IO.Packaging.PackUriHelper.CreatePartUri(System.Uri)" />
<altmember cref="Overload:System.IO.Packaging.PackagePart.GetStream" />
<related type="ExternalDocumentation" href="https://www.ecma-international.org/publications-and-standards/standards/ecma-376/">Open Packaging Conventions Specification</related>
</Docs>
</Member>
<Member MemberName="CompressionOption">
<MemberSignature Language="C#" Value="public System.IO.Packaging.CompressionOption CompressionOption { get; }" />
<MemberSignature Language="ILAsm" Value=".property instance valuetype System.IO.Packaging.CompressionOption CompressionOption" />
<MemberSignature Language="DocId" Value="P:System.IO.Packaging.PackagePart.CompressionOption" />
<MemberSignature Language="VB.NET" Value="Public ReadOnly Property CompressionOption As CompressionOption" />
<MemberSignature Language="F#" Value="member this.CompressionOption : System.IO.Packaging.CompressionOption" Usage="System.IO.Packaging.PackagePart.CompressionOption" />
<MemberSignature Language="C++ CLI" Value="public:
 property System::IO::Packaging::CompressionOption CompressionOption { System::IO::Packaging::CompressionOption get(); };" />
<MemberType>Property</MemberType>
<AssemblyInfo>
<AssemblyName>System.IO.Packaging</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.4.0</AssemblyVersion>
<AssemblyVersion>4.0.5.0</AssemblyVersion>
<AssemblyVersion>5.0.0.0</AssemblyVersion>
<AssemblyVersion>6.0.0.0</AssemblyVersion>
<AssemblyVersion>7.0.0.0</AssemblyVersion>
<AssemblyVersion>8.0.0.0</AssemblyVersion>
<AssemblyVersion>9.0.0.0</AssemblyVersion>
<AssemblyVersion>10.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>WindowsBase</AssemblyName>
<AssemblyVersion>3.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.IO.Packaging.CompressionOption</ReturnType>
</ReturnValue>
<Docs>
<summary>Gets the compression option of the part content stream.</summary>
<value>The compression option of the part content stream.</value>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
<xref:System.IO.Packaging.PackagePart.CompressionOption%2A> is a read-only property that can be accessed only when the parent <xref:System.IO.Packaging.Package> is open.
The <xref:System.IO.Packaging.PackagePart.CompressionOption%2A> property is automatically set by the <xref:System.IO.Packaging.PackagePart.%23ctor%2A> constructor. After it is set by the constructor, the <xref:System.IO.Packaging.PackagePart.CompressionOption%2A> cannot be changed.
]]></format>
</remarks>
<exception cref="T:System.InvalidOperationException">The part has been deleted.
-or-
The <see cref="P:System.IO.Packaging.PackagePart.Package" /> is not open (<see cref="M:System.IO.Packaging.Package.Dispose(System.Boolean)" /> or <see cref="M:System.IO.Packaging.Package.Close" /> has been called).</exception>
<altmember cref="Overload:System.IO.Packaging.PackagePart.GetStream" />
</Docs>
</Member>
<Member MemberName="ContentType">
<MemberSignature Language="C#" Value="public string ContentType { get; }" />
<MemberSignature Language="ILAsm" Value=".property instance string ContentType" />
<MemberSignature Language="DocId" Value="P:System.IO.Packaging.PackagePart.ContentType" />
<MemberSignature Language="VB.NET" Value="Public ReadOnly Property ContentType As String" />
<MemberSignature Language="F#" Value="member this.ContentType : string" Usage="System.IO.Packaging.PackagePart.ContentType" />
<MemberSignature Language="C++ CLI" Value="public:
 property System::String ^ ContentType { System::String ^ get(); };" />
<MemberType>Property</MemberType>
<AssemblyInfo>
<AssemblyName>System.IO.Packaging</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.4.0</AssemblyVersion>
<AssemblyVersion>4.0.5.0</AssemblyVersion>
<AssemblyVersion>5.0.0.0</AssemblyVersion>
<AssemblyVersion>6.0.0.0</AssemblyVersion>
<AssemblyVersion>7.0.0.0</AssemblyVersion>
<AssemblyVersion>8.0.0.0</AssemblyVersion>
<AssemblyVersion>9.0.0.0</AssemblyVersion>
<AssemblyVersion>10.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>WindowsBase</AssemblyName>
<AssemblyVersion>3.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.String</ReturnType>
</ReturnValue>
<Docs>
<summary>Gets the MIME type of the content stream.</summary>
<value>The MIME type of the content data stream for the part.</value>
<remarks>
<format type="text/markdown">< *Hypertext Transfer Protocol - HTTP*, Section 3.7. The following table shows an example of the content MIME types used in XML Paper Specification (XPS) documents.
|Description|Content Type|
|-----------------|------------------|
|Font|application/vnd.ms-opentype|
|ICC profile|application/vnd.ms-color.iccprofile|
|JPEG image|image/jpeg|
|Obfuscated font|application/vnd.ms-package.obfuscated-opentype|
|PNG image|image/png|
|PrintTicket|application/vnd.ms-printing.printticket+xml|
|TIFF image|image/tiff|
|Windows Media Photo image|image/vnd.ms-photo|
]]></format>
</remarks>
<exception cref="T:System.InvalidOperationException">The part has been deleted.
-or-
The <see cref="P:System.IO.Packaging.PackagePart.Package" /> is not open (<see cref="M:System.IO.Packaging.Package.Dispose(System.Boolean)" /> or <see cref="M:System.IO.Packaging.Package.Close" /> has been called).
-or-
The string returned by the derived class <see cref="M:System.IO.Packaging.PackagePart.GetContentTypeCore" /> method is empty.</exception>
<altmember cref="Overload:System.IO.Packaging.PackagePart.GetStream" />
<related type="ExternalDocumentation" href="https://www.ecma-international.org/publications-and-standards/standards/ecma-376/">Open Packaging Conventions Specification</related>
</Docs>
</Member>
<MemberGroup MemberName="CreateRelationship">
<AssemblyInfo>
<AssemblyName>System.IO.Packaging</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Docs>
<summary>Creates a part-level relationship between this <see cref="T:System.IO.Packaging.PackagePart" /> to a specified target <see cref="T:System.IO.Packaging.PackagePart" /> or external resource.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
A part-level relationship defines an association between this part and a target part or resource. A part-level relationship can be one of two forms.
- Between a source <xref:System.IO.Packaging.PackagePart> to a target <xref:System.IO.Packaging.PackagePart> inside the <xref:System.IO.Packaging.Package>.
- Between a source <xref:System.IO.Packaging.PackagePart> to a target resource outside the package.
In a part-relationship the source part is considered the "owner" of the relationship. When the source part is deleted, all the relationships owned by the part are also deleted. The process of creating or deleting the relationship does not physically alter the target part or resource in any way.
The <xref:System.IO.Packaging.PackagePart.CreateRelationship%2A> method does not physically change either the source part, or the target part or resource in any way.
The target of a relationship cannot be another relationship.
For more information about package relationships see section 1.3 of the *Open Packaging Conventions (OPC)* specification available for download at <https://www.ecma-international.org/publications-and-standards/standards/ecma-376/>.
For more information about XPS documents, see the Open XML Paper Specification (XPS) available for download at <https://www.ecma-international.org/publications-and-standards/standards/ecma-388/>.
]]></format>
</remarks>
<related type="ExternalDocumentation" href="https://www.ecma-international.org/publications-and-standards/standards/ecma-376/">Open Packaging Conventions Specification</related>
</Docs>
</MemberGroup>
<Member MemberName="CreateRelationship">
<MemberSignature Language="C#" Value="public System.IO.Packaging.PackageRelationship CreateRelationship (Uri targetUri, System.IO.Packaging.TargetMode targetMode, string relationshipType);" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig instance class System.IO.Packaging.PackageRelationship CreateRelationship(class System.Uri targetUri, valuetype System.IO.Packaging.TargetMode targetMode, string relationshipType) cil managed" />
<MemberSignature Language="DocId" Value="M:System.IO.Packaging.PackagePart.CreateRelationship(System.Uri,System.IO.Packaging.TargetMode,System.String)" />
<MemberSignature Language="VB.NET" Value="Public Function CreateRelationship (targetUri As Uri, targetMode As TargetMode, relationshipType As String) As PackageRelationship" />
<MemberSignature Language="F#" Value="member this.CreateRelationship : Uri * System.IO.Packaging.TargetMode * string -> System.IO.Packaging.PackageRelationship" Usage="packagePart.CreateRelationship (targetUri, targetMode, relationshipType)" />
<MemberSignature Language="C++ CLI" Value="public:
 System::IO::Packaging::PackageRelationship ^ CreateRelationship(Uri ^ targetUri, System::IO::Packaging::TargetMode targetMode, System::String ^ relationshipType);" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.IO.Packaging</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.4.0</AssemblyVersion>
<AssemblyVersion>4.0.5.0</AssemblyVersion>
<AssemblyVersion>5.0.0.0</AssemblyVersion>
<AssemblyVersion>6.0.0.0</AssemblyVersion>
<AssemblyVersion>7.0.0.0</AssemblyVersion>
<AssemblyVersion>8.0.0.0</AssemblyVersion>
<AssemblyVersion>9.0.0.0</AssemblyVersion>
<AssemblyVersion>10.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>WindowsBase</AssemblyName>
<AssemblyVersion>3.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Attributes>
<Attribute FrameworkAlternate="netframework-4.0">
<AttributeName Language="C#">[System.Runtime.TargetedPatchingOptOut("Performance critical to inline this type of method across NGen image boundaries")]</AttributeName>
<AttributeName Language="F#">[<System.Runtime.TargetedPatchingOptOut("Performance critical to inline this type of method across NGen image boundaries")>]</AttributeName>
</Attribute>
</Attributes>
<ReturnValue>
<ReturnType>System.IO.Packaging.PackageRelationship</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="targetUri" Type="System.Uri" />
<Parameter Name="targetMode" Type="System.IO.Packaging.TargetMode" />
<Parameter Name="relationshipType" Type="System.String" />
</Parameters>
<Docs>
<param name="targetUri">The URI of the target part.</param>
<param name="targetMode">One of the enumeration values. For example, <see cref="F:System.IO.Packaging.TargetMode.Internal" /> if the target part is inside the <see cref="T:System.IO.Packaging.Package" />; or <see cref="F:System.IO.Packaging.TargetMode.External" /> if the target is a resource outside the <see cref="T:System.IO.Packaging.Package" />.</param>
<param name="relationshipType">The role of the relationship.</param>
<summary>Creates a part-level relationship between this <see cref="T:System.IO.Packaging.PackagePart" /> to a specified target <see cref="T:System.IO.Packaging.PackagePart" /> or external resource.</summary>
<returns>The part-level relationship between this <see cref="T:System.IO.Packaging.PackagePart" /> to the target <see cref="T:System.IO.Packaging.PackagePart" /> or external resource.</returns>
<remarks>
<format type="text/markdown">< *Uniform Resource Identifier (URI) Generic Syntax* specification. The internal relative URI can be either an absolute path that starts with a forward slash ("/") character such as "/page1.xaml" or "/images/picture4.jpg", or a relative path such as "../imagespicture1.jpg" that resolves against the package root ("/") as the base URI.
If `targetMode` is specified as <xref:System.IO.Packaging.TargetMode.External>, `targetUri` can be either an absolute or relative URI formed in accordance with the [RFC 3986](https://tools.ietf.org/html/rfc3986) *Uniform Resource Identifier (URI) Generic Syntax* specification. `"https://www.microsoft.com/page2.xml"` is an example of an absolute URI that references an external target resource "page2.xml". "images/picture1.jpg" is an example of a relative URI that also references an external target resource "1.jpg" but which resolves against the URI of the package itself.
`relationshipType` must be a URI that is formed according to the [RFC 3986](https://tools.ietf.org/html/rfc3986) *Uniform Resource Identifier (URI) Generic Syntax* specification. Different package types can define different part-level relationship types. The following table shows the part-level `relationshipType` URIs defined for documents that conform to the *Open XML Paper Specification (XPS)*.
| XPS Document Part-Level Relationship | Relationship Type URI |
|--------------------------------------|------------------------------------------------------------------|
| Digital Signature Definitions | `http://schemas.microsoft.com/xps/2005/06/signature-definitions` |
| DiscardControl | `http://schemas.microsoft.com/xps/2005/06/discard-control` |
| DocumentStructure | `http://schemas.microsoft.com/xps/2005/06/documentstructure` |
| PrintTicket | `http://schemas.microsoft.com/xps/2005/06/printticket` |
| Required Resource | `http://schemas.microsoft.com/xps/2005/06/required-resource` |
| Restricted Font | `http://schemas.microsoft.com/xps/2005/06/restricted-font` |
| StartPart | `http://schemas.microsoft.com/xps/2005/06/fixedrepresentation` |
| StoryFragments | `http://schemas.microsoft.com/xps/2005/06/storyfragments` |
For more information about package relationships see section 1.3 of the *Open Packaging Conventions (OPC)* specification available for download at <https://www.ecma-international.org/publications-and-standards/standards/ecma-376/>.
For more information about XPS documents, see the *Open XML Paper Specification (XPS)* available for download at <https://www.ecma-international.org/publications-and-standards/standards/ecma-388/>.
]]></format>
</remarks>
<exception cref="T:System.InvalidOperationException">The part has been deleted.
-or-
The <see cref="P:System.IO.Packaging.PackagePart.Package" /> is not open (<see cref="M:System.IO.Packaging.Package.Dispose(System.Boolean)" /> or <see cref="M:System.IO.Packaging.Package.Close" /> has been called).</exception>
<exception cref="T:System.ArgumentNullException">
<paramref name="targetUri" /> or <paramref name="relationshipType" /> is <see langword="null" />.</exception>
<exception cref="T:System.ArgumentOutOfRangeException">The <paramref name="targetMode" /> parameter is not a valid <see cref="T:System.IO.Packaging.TargetMode" /> enumeration value.</exception>
<exception cref="T:System.ArgumentException">The part identified by the <paramref name="targetUri" /> is a relationship (the target of a relationship cannot be another relationship).
-or-
<paramref name="targetMode" /> is specified as <see cref="F:System.IO.Packaging.TargetMode.Internal" /> but <paramref name="targetUri" /> is an absolute external URI.</exception>
<exception cref="T:System.IO.IOException">The package is read-only (a new relationship cannot be added).</exception>
<altmember cref="Overload:System.IO.Packaging.Package.CreateRelationship" />
<altmember cref="M:System.IO.Packaging.PackagePart.DeleteRelationship(System.String)" />
<altmember cref="M:System.IO.Packaging.PackagePart.GetRelationship(System.String)" />
<altmember cref="M:System.IO.Packaging.PackagePart.GetRelationships" />
<altmember cref="M:System.IO.Packaging.PackagePart.GetRelationshipsByType(System.String)" />
<related type="ExternalDocumentation" href="https://www.ecma-international.org/publications-and-standards/standards/ecma-376/">Open Packaging Conventions Specification</related>
</Docs>
</Member>
<Member MemberName="CreateRelationship">
<MemberSignature Language="C#" Value="public System.IO.Packaging.PackageRelationship CreateRelationship (Uri targetUri, System.IO.Packaging.TargetMode targetMode, string relationshipType, string? id);" FrameworkAlternate="net-10.0-pp;net-8.0-pp;net-9.0-pp;netstandard-2.0-pp;windowsdesktop-10.0;windowsdesktop-5.0;windowsdesktop-6.0;windowsdesktop-7.0;windowsdesktop-8.0;windowsdesktop-9.0" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig instance class System.IO.Packaging.PackageRelationship CreateRelationship(class System.Uri targetUri, valuetype System.IO.Packaging.TargetMode targetMode, string relationshipType, string id) cil managed" />
<MemberSignature Language="DocId" Value="M:System.IO.Packaging.PackagePart.CreateRelationship(System.Uri,System.IO.Packaging.TargetMode,System.String,System.String)" />
<MemberSignature Language="VB.NET" Value="Public Function CreateRelationship (targetUri As Uri, targetMode As TargetMode, relationshipType As String, id As String) As PackageRelationship" />
<MemberSignature Language="F#" Value="member this.CreateRelationship : Uri * System.IO.Packaging.TargetMode * string * string -> System.IO.Packaging.PackageRelationship" Usage="packagePart.CreateRelationship (targetUri, targetMode, relationshipType, id)" />
<MemberSignature Language="C++ CLI" Value="public:
 System::IO::Packaging::PackageRelationship ^ CreateRelationship(Uri ^ targetUri, System::IO::Packaging::TargetMode targetMode, System::String ^ relationshipType, System::String ^ id);" />
<MemberSignature Language="C#" Value="public System.IO.Packaging.PackageRelationship CreateRelationship (Uri targetUri, System.IO.Packaging.TargetMode targetMode, string relationshipType, string id);" FrameworkAlternate="netcore-1.0;netcore-1.1;netframework-3.0;netframework-3.5;netframework-4.0;netframework-4.5;netframework-4.5.1;netframework-4.5.2;netframework-4.6;netframework-4.6.1;netframework-4.6.2;netframework-4.6.2-pp;netframework-4.7;netframework-4.7.1;netframework-4.7.2;netframework-4.8;netframework-4.8.1;windowsdesktop-3.0;windowsdesktop-3.1" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.IO.Packaging</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.4.0</AssemblyVersion>
<AssemblyVersion>4.0.5.0</AssemblyVersion>
<AssemblyVersion>5.0.0.0</AssemblyVersion>
<AssemblyVersion>6.0.0.0</AssemblyVersion>
<AssemblyVersion>7.0.0.0</AssemblyVersion>
<AssemblyVersion>8.0.0.0</AssemblyVersion>
<AssemblyVersion>9.0.0.0</AssemblyVersion>
<AssemblyVersion>10.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>WindowsBase</AssemblyName>
<AssemblyVersion>3.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.IO.Packaging.PackageRelationship</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="targetUri" Type="System.Uri" />
<Parameter Name="targetMode" Type="System.IO.Packaging.TargetMode" />
<Parameter Name="relationshipType" Type="System.String" />
<Parameter Name="id" Type="System.String">
<Attributes>
<Attribute FrameworkAlternate="net-10.0-pp;net-8.0-pp;net-9.0-pp;windowsdesktop-10.0;windowsdesktop-8.0;windowsdesktop-9.0">
<AttributeName Language="C#">[System.Runtime.CompilerServices.Nullable(2)]</AttributeName>
<AttributeName Language="F#">[<System.Runtime.CompilerServices.Nullable(2)>]</AttributeName>
</Attribute>
</Attributes>
</Parameter>
</Parameters>
<Docs>
<param name="targetUri">The URI of the target part.</param>
<param name="targetMode">One of the enumeration values. For example, <see cref="F:System.IO.Packaging.TargetMode.Internal" /> if the target part is inside the <see cref="T:System.IO.Packaging.Package" />; or <see cref="F:System.IO.Packaging.TargetMode.External" /> if the target is a resource outside the <see cref="T:System.IO.Packaging.Package" />.</param>
<param name="relationshipType">The role of the relationship.</param>
<param name="id">A unique ID for the relationship.</param>
<summary>Creates a part-level relationship between this <see cref="T:System.IO.Packaging.PackagePart" /> to a specified target <see cref="T:System.IO.Packaging.PackagePart" /> or external resource.</summary>
<returns>The part-level relationship between this <see cref="T:System.IO.Packaging.PackagePart" /> to the target <see cref="T:System.IO.Packaging.PackagePart" /> or external resource.</returns>
<remarks>
<format type="text/markdown"><).
The <xref:System.IO.Packaging.PackagePart.CreateRelationship%2A> method does not physically change either the source part, or the target part or resource in any way.
The target of a relationship cannot be another relationship.
If `targetMode` is specified as <xref:System.IO.Packaging.TargetMode.Internal>, `targetUri` must be a relative URI that is formed in accordance with the [RFC 3986](https://tools.ietf.org/html/rfc3986) *Uniform Resource Identifier (URI) Generic Syntax* specification. The internal relative URI can be either an absolute path that starts with a forward slash ("/") character such as "/page1.xaml" or "/images/picture4.jpg", or a relative path such as "../imagespicture1.jpg" that resolves against the package root ("/") as the base URI.
If `targetMode` is specified as <xref:System.IO.Packaging.TargetMode.External>, `targetUri` can be either an absolute or relative URI formed in accordance with the [RFC 3986](https://tools.ietf.org/html/rfc3986) *Uniform Resource Identifier (URI) Generic Syntax* specification. "https://www.microsoft.com/page2.xml" is an example of an absolute URI that references an external target resource "page2.xml". "images/picture1.jpg" is an example of a relative URI that also references an external target resource "1.jpg" but which resolves against the URI of the package itself.
`relationshipType` must be a URI that is formed according to the [RFC 3986](https://tools.ietf.org/html/rfc3986) *Uniform Resource Identifier (URI) Generic Syntax* specification. Different package types can define different part-level relationship types. The following table shows the part-level `relationshipType` URIs defined for documents that conform to the *Open XML Paper Specification (XPS)*.
| XPS Document Part-Level Relationship | Relationship Type URI |
|--------------------------------------|------------------------------------------------------------------|
| Digital Signature Definitions | `http://schemas.microsoft.com/xps/2005/06/signature-definitions` |
| DiscardControl | `http://schemas.microsoft.com/xps/2005/06/discard-control` |
| DocumentStructure | `http://schemas.microsoft.com/xps/2005/06/documentstructure` |
| PrintTicket | `http://schemas.microsoft.com/xps/2005/06/printticket` |
| Required Resource | `http://schemas.microsoft.com/xps/2005/06/required-resource` |
| Restricted Font | `http://schemas.microsoft.com/xps/2005/06/restricted-font` |
| StartPart | `http://schemas.microsoft.com/xps/2005/06/fixedrepresentation` |
| StoryFragments | `http://schemas.microsoft.com/xps/2005/06/storyfragments` |
For more information about package relationships see section 1.3 of the *Open Packaging Conventions (OPC)* specification available for download at <https://www.ecma-international.org/publications-and-standards/standards/ecma-376/>.
For more information about XPS documents see the *Open XML Paper Specification (XPS)* available for download at <https://www.ecma-international.org/publications-and-standards/standards/ecma-388/>.
]]></format>
</remarks>
<exception cref="T:System.InvalidOperationException">The part has been deleted.
-or-
The <see cref="P:System.IO.Packaging.PackagePart.Package" /> is not open (<see cref="M:System.IO.Packaging.Package.Dispose(System.Boolean)" /> or <see cref="M:System.IO.Packaging.Package.Close" /> has been called).</exception>
<exception cref="T:System.ArgumentNullException">
<paramref name="targetUri" /> or <paramref name="relationshipType" /> is <see langword="null" />.</exception>
<exception cref="T:System.ArgumentOutOfRangeException">The <paramref name="targetMode" /> parameter is not a valid <see cref="T:System.IO.Packaging.TargetMode" /> enumeration value.</exception>
<exception cref="T:System.ArgumentException">The part identified by the <paramref name="targetUri" /> is a relationship (the target of a relationship cannot be another relationship).
-or-
<paramref name="targetMode" /> is specified as <see cref="F:System.IO.Packaging.TargetMode.Internal" /> but <paramref name="targetUri" /> is an absolute external URI.</exception>
<exception cref="T:System.IO.IOException">The package is read-only (a new relationship cannot be added).</exception>
<exception cref="T:System.Xml.XmlException">
<paramref name="id" /> is not a valid XML identifier.
-or-
A part with the specified <paramref name="id" /> already exists.</exception>
<altmember cref="Overload:System.IO.Packaging.Package.CreateRelationship" />
<altmember cref="M:System.IO.Packaging.PackagePart.DeleteRelationship(System.String)" />
<altmember cref="M:System.IO.Packaging.PackagePart.GetRelationship(System.String)" />
<altmember cref="M:System.IO.Packaging.PackagePart.GetRelationships" />
<altmember cref="M:System.IO.Packaging.PackagePart.GetRelationshipsByType(System.String)" />
<related type="ExternalDocumentation" href="https://www.ecma-international.org/publications-and-standards/standards/ecma-376/">Open Packaging Conventions Specification</related>
</Docs>
</Member>
<Member MemberName="DeleteRelationship">
<MemberSignature Language="C#" Value="public void DeleteRelationship (string id);" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig instance void DeleteRelationship(string id) cil managed" />
<MemberSignature Language="DocId" Value="M:System.IO.Packaging.PackagePart.DeleteRelationship(System.String)" />
<MemberSignature Language="VB.NET" Value="Public Sub DeleteRelationship (id As String)" />
<MemberSignature Language="F#" Value="member this.DeleteRelationship : string -> unit" Usage="packagePart.DeleteRelationship id" />
<MemberSignature Language="C++ CLI" Value="public:
 void DeleteRelationship(System::String ^ id);" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.IO.Packaging</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.4.0</AssemblyVersion>
<AssemblyVersion>4.0.5.0</AssemblyVersion>
<AssemblyVersion>5.0.0.0</AssemblyVersion>
<AssemblyVersion>6.0.0.0</AssemblyVersion>
<AssemblyVersion>7.0.0.0</AssemblyVersion>
<AssemblyVersion>8.0.0.0</AssemblyVersion>
<AssemblyVersion>9.0.0.0</AssemblyVersion>
<AssemblyVersion>10.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>WindowsBase</AssemblyName>
<AssemblyVersion>3.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Void</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="id" Type="System.String" />
</Parameters>
<Docs>
<param name="id">The <see cref="P:System.IO.Packaging.PackageRelationship.Id" /> of the relationship to delete.</param>
<summary>Deletes a specified part-level <see cref="T:System.IO.Packaging.PackageRelationship" />.</summary>
<remarks>
<format type="text/markdown"><).
If the specified `id` does not match the <xref:System.IO.Packaging.PackageRelationship.Id%2A> for any of the relationships that are owned by this part, no relationship is deleted and no exception is thrown.
Other than deleting the specified relationship, the <xref:System.IO.Packaging.PackagePart.DeleteRelationship%2A> method does not physically change either this part or the target part.
]]></format>
</remarks>
<exception cref="T:System.InvalidOperationException">The part has been deleted.
-or-
The <see cref="P:System.IO.Packaging.PackagePart.Package" /> is not open (<see cref="M:System.IO.Packaging.Package.Dispose(System.Boolean)" /> or <see cref="M:System.IO.Packaging.Package.Close" /> has been called).</exception>
<exception cref="T:System.ArgumentNullException">
<paramref name="id" /> is <see langword="null" />.</exception>
<exception cref="T:System.IO.IOException">The package is read-only (relationships cannot be deleted).</exception>
<exception cref="T:System.Xml.XmlException">
<paramref name="id" /> is not a valid XML identifier.</exception>
<altmember cref="Overload:System.IO.Packaging.PackagePart.CreateRelationship" />
<altmember cref="M:System.IO.Packaging.PackagePart.GetRelationship(System.String)" />
<altmember cref="M:System.IO.Packaging.PackagePart.GetRelationships" />
<altmember cref="M:System.IO.Packaging.PackagePart.RelationshipExists(System.String)" />
<altmember cref="M:System.IO.Packaging.PackagePart.GetRelationshipsByType(System.String)" />
</Docs>
</Member>
<Member MemberName="GetContentTypeCore">
<MemberSignature Language="C#" Value="protected virtual string GetContentTypeCore ();" />
<MemberSignature Language="ILAsm" Value=".method familyhidebysig newslot virtual instance string GetContentTypeCore() cil managed" />
<MemberSignature Language="DocId" Value="M:System.IO.Packaging.PackagePart.GetContentTypeCore" />
<MemberSignature Language="VB.NET" Value="Protected Overridable Function GetContentTypeCore () As String" />
<MemberSignature Language="F#" Value="abstract member GetContentTypeCore : unit -> string
override this.GetContentTypeCore : unit -> string" Usage="packagePart.GetContentTypeCore " />
<MemberSignature Language="C++ CLI" Value="protected:
 virtual System::String ^ GetContentTypeCore();" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.IO.Packaging</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.4.0</AssemblyVersion>
<AssemblyVersion>4.0.5.0</AssemblyVersion>
<AssemblyVersion>5.0.0.0</AssemblyVersion>
<AssemblyVersion>6.0.0.0</AssemblyVersion>
<AssemblyVersion>7.0.0.0</AssemblyVersion>
<AssemblyVersion>8.0.0.0</AssemblyVersion>
<AssemblyVersion>9.0.0.0</AssemblyVersion>
<AssemblyVersion>10.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>WindowsBase</AssemblyName>
<AssemblyVersion>3.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.String</ReturnType>
</ReturnValue>
<Parameters />
<Docs>
<summary>When overridden in a derived class, returns the MIME type of the part content.</summary>
<returns>The MIME type of the part content.</returns>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
<xref:System.IO.Packaging.PackagePart.GetContentTypeCore%2A> is a virtual method of the <xref:System.IO.Packaging.PackagePart> abstract base class. Implement this method only in derived types where the value for the content type cannot be provided at the time of construction, or if calculating the content type value is a nontrivial or costly operation. The return value must be a valid MIME content type.
Derived classes can call <xref:System.IO.Packaging.PackagePart.GetContentTypeCore%2A> to initialize the <xref:System.IO.Packaging.PackagePart.ContentType%2A> property of the derived class to a default value. After the <xref:System.IO.Packaging.PackagePart.ContentType%2A> property has been set it cannot be changed.
]]></format>
</remarks>
<exception cref="T:System.NotSupportedException">The derived class does not provide an override implementation required for the <see cref="M:System.IO.Packaging.PackagePart.GetContentTypeCore" /> method.</exception>
</Docs>
</Member>
<Member MemberName="GetRelationship">
<MemberSignature Language="C#" Value="public System.IO.Packaging.PackageRelationship GetRelationship (string id);" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig instance class System.IO.Packaging.PackageRelationship GetRelationship(string id) cil managed" />
<MemberSignature Language="DocId" Value="M:System.IO.Packaging.PackagePart.GetRelationship(System.String)" />
<MemberSignature Language="VB.NET" Value="Public Function GetRelationship (id As String) As PackageRelationship" />
<MemberSignature Language="F#" Value="member this.GetRelationship : string -> System.IO.Packaging.PackageRelationship" Usage="packagePart.GetRelationship id" />
<MemberSignature Language="C++ CLI" Value="public:
 System::IO::Packaging::PackageRelationship ^ GetRelationship(System::String ^ id);" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.IO.Packaging</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.4.0</AssemblyVersion>
<AssemblyVersion>4.0.5.0</AssemblyVersion>
<AssemblyVersion>5.0.0.0</AssemblyVersion>
<AssemblyVersion>6.0.0.0</AssemblyVersion>
<AssemblyVersion>7.0.0.0</AssemblyVersion>
<AssemblyVersion>8.0.0.0</AssemblyVersion>
<AssemblyVersion>9.0.0.0</AssemblyVersion>
<AssemblyVersion>10.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>WindowsBase</AssemblyName>
<AssemblyVersion>3.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.IO.Packaging.PackageRelationship</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="id" Type="System.String" />
</Parameters>
<Docs>
<param name="id">The <see cref="P:System.IO.Packaging.PackageRelationship.Id" /> of the relationship to return.</param>
<summary>Returns the relationship that has a specified <see cref="P:System.IO.Packaging.PackageRelationship.Id" />.</summary>
<returns>The relationship that matches the specified <paramref name="id" />.</returns>
<remarks>
<format type="text/markdown"><).
You can use the <xref:System.IO.Packaging.PackagePart.RelationshipExists%2A> method to determine if a relationship with a specified <xref:System.IO.Packaging.PackageRelationship.Id%2A> is owned by this part.
]]></format>
</remarks>
<exception cref="T:System.ArgumentNullException">
<paramref name="id" /> is <see langword="null" />.</exception>
<exception cref="T:System.Xml.XmlException">
<paramref name="id" /> is not a valid XML identifier.</exception>
<exception cref="T:System.InvalidOperationException">The part has been deleted.
-or-
The <see cref="P:System.IO.Packaging.PackagePart.Package" /> is not open (<see cref="M:System.IO.Packaging.Package.Dispose(System.Boolean)" /> or <see cref="M:System.IO.Packaging.Package.Close" /> has been called).
-or-
A relationship with the specified <paramref name="id" /> does not exist in the package.</exception>
<exception cref="T:System.IO.IOException">The package is write-only (relationship information cannot be read).</exception>
<altmember cref="Overload:System.IO.Packaging.PackagePart.CreateRelationship" />
<altmember cref="M:System.IO.Packaging.PackagePart.DeleteRelationship(System.String)" />
<altmember cref="M:System.IO.Packaging.PackagePart.GetRelationships" />
<altmember cref="M:System.IO.Packaging.PackagePart.GetRelationshipsByType(System.String)" />
<altmember cref="M:System.IO.Packaging.PackagePart.RelationshipExists(System.String)" />
</Docs>
</Member>
<Member MemberName="GetRelationships">
<MemberSignature Language="C#" Value="public System.IO.Packaging.PackageRelationshipCollection GetRelationships ();" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig instance class System.IO.Packaging.PackageRelationshipCollection GetRelationships() cil managed" />
<MemberSignature Language="DocId" Value="M:System.IO.Packaging.PackagePart.GetRelationships" />
<MemberSignature Language="VB.NET" Value="Public Function GetRelationships () As PackageRelationshipCollection" />
<MemberSignature Language="F#" Value="member this.GetRelationships : unit -> System.IO.Packaging.PackageRelationshipCollection" Usage="packagePart.GetRelationships " />
<MemberSignature Language="C++ CLI" Value="public:
 System::IO::Packaging::PackageRelationshipCollection ^ GetRelationships();" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.IO.Packaging</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.4.0</AssemblyVersion>
<AssemblyVersion>4.0.5.0</AssemblyVersion>
<AssemblyVersion>5.0.0.0</AssemblyVersion>
<AssemblyVersion>6.0.0.0</AssemblyVersion>
<AssemblyVersion>7.0.0.0</AssemblyVersion>
<AssemblyVersion>8.0.0.0</AssemblyVersion>
<AssemblyVersion>9.0.0.0</AssemblyVersion>
<AssemblyVersion>10.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>WindowsBase</AssemblyName>
<AssemblyVersion>3.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Attributes>
<Attribute FrameworkAlternate="netframework-4.0">
<AttributeName Language="C#">[System.Runtime.TargetedPatchingOptOut("Performance critical to inline this type of method across NGen image boundaries")]</AttributeName>
<AttributeName Language="F#">[<System.Runtime.TargetedPatchingOptOut("Performance critical to inline this type of method across NGen image boundaries")>]</AttributeName>
</Attribute>
</Attributes>
<ReturnValue>
<ReturnType>System.IO.Packaging.PackageRelationshipCollection</ReturnType>
</ReturnValue>
<Parameters />
<Docs>
<summary>Returns a collection of all the relationships that are owned by this part.</summary>
<returns>A collection of all the relationships that are owned by the part.</returns>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
The returned collection is never `null`; however, the collection might contain zero elements if the part does not define any relationships.
]]></format>
</remarks>
<exception cref="T:System.InvalidOperationException">The part has been deleted.
-or-
The <see cref="P:System.IO.Packaging.PackagePart.Package" /> is not open (<see cref="M:System.IO.Packaging.Package.Dispose(System.Boolean)" /> or <see cref="M:System.IO.Packaging.Package.Close" /> has been called).</exception>
<exception cref="T:System.IO.IOException">The package is write-only (relationship information cannot be read).</exception>
<altmember cref="Overload:System.IO.Packaging.PackagePart.CreateRelationship" />
<altmember cref="M:System.IO.Packaging.PackagePart.DeleteRelationship(System.String)" />
<altmember cref="M:System.IO.Packaging.PackagePart.GetRelationship(System.String)" />
<altmember cref="M:System.IO.Packaging.PackagePart.GetRelationshipsByType(System.String)" />
</Docs>
</Member>
<Member MemberName="GetRelationshipsByType">
<MemberSignature Language="C#" Value="public System.IO.Packaging.PackageRelationshipCollection GetRelationshipsByType (string relationshipType);" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig instance class System.IO.Packaging.PackageRelationshipCollection GetRelationshipsByType(string relationshipType) cil managed" />
<MemberSignature Language="DocId" Value="M:System.IO.Packaging.PackagePart.GetRelationshipsByType(System.String)" />
<MemberSignature Language="VB.NET" Value="Public Function GetRelationshipsByType (relationshipType As String) As PackageRelationshipCollection" />
<MemberSignature Language="F#" Value="member this.GetRelationshipsByType : string -> System.IO.Packaging.PackageRelationshipCollection" Usage="packagePart.GetRelationshipsByType relationshipType" />
<MemberSignature Language="C++ CLI" Value="public:
 System::IO::Packaging::PackageRelationshipCollection ^ GetRelationshipsByType(System::String ^ relationshipType);" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.IO.Packaging</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.4.0</AssemblyVersion>
<AssemblyVersion>4.0.5.0</AssemblyVersion>
<AssemblyVersion>5.0.0.0</AssemblyVersion>
<AssemblyVersion>6.0.0.0</AssemblyVersion>
<AssemblyVersion>7.0.0.0</AssemblyVersion>
<AssemblyVersion>8.0.0.0</AssemblyVersion>
<AssemblyVersion>9.0.0.0</AssemblyVersion>
<AssemblyVersion>10.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>WindowsBase</AssemblyName>
<AssemblyVersion>3.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.IO.Packaging.PackageRelationshipCollection</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="relationshipType" Type="System.String" />
</Parameters>
<Docs>
<param name="relationshipType">The <see cref="P:System.IO.Packaging.PackageRelationship.RelationshipType" /> of the relationships to locate and return in the collection.</param>
<summary>Returns a collection of the relationships that match a specified <see cref="P:System.IO.Packaging.PackageRelationship.RelationshipType" />.</summary>
<returns>A collection of the relationships that match the specified <paramref name="relationshipType" />.</returns>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
The returned collection is never `null`; however, the collection might contain zero elements if no relationships match the specified `relationshipType` that is defined for the part.
Any leading or trailing spaces in the `relationshipType` string are automatically trimmed.
]]></format>
</remarks>
<exception cref="T:System.ArgumentNullException">
<paramref name="relationshipType" /> is <see langword="null" />.</exception>
<exception cref="T:System.ArgumentException">
<paramref name="relationshipType" /> is an empty string.</exception>
<exception cref="T:System.InvalidOperationException">The part has been deleted.
-or-
The <see cref="P:System.IO.Packaging.PackagePart.Package" /> is not open (<see cref="M:System.IO.Packaging.Package.Dispose(System.Boolean)" /> or <see cref="M:System.IO.Packaging.Package.Close" /> has been called).</exception>
<exception cref="T:System.IO.IOException">The package is write-only (relationship information cannot be read).</exception>
<related type="ExternalDocumentation" href="https://www.ecma-international.org/publications-and-standards/standards/ecma-376/">Open Packaging Conventions Specification</related>
</Docs>
</Member>
<MemberGroup MemberName="GetStream">
<AssemblyInfo>
<AssemblyName>System.IO.Packaging</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Docs>
<summary>Returns the part content data stream.</summary>
<block subset="none" type="usage">
<para>
<see cref="Overload:System.IO.Packaging.PackagePart.GetStream" /> internally calls the derived <see cref="M:System.IO.Packaging.PackagePart.GetStreamCore(System.IO.FileMode,System.IO.FileAccess)" /> method to actually open and return the part data stream based on the physical format implemented in the derived class.
By default, the <see cref="T:System.IO.Packaging.ZipPackagePart" /> subclass implementation of the abstract <see cref="T:System.IO.Packaging.PackagePart" /> class is provided and used. In the default operation, <see cref="Overload:System.IO.Packaging.PackagePart.GetStream" /> internally calls <see cref="M:System.IO.Packaging.PackagePart.GetStreamCore(System.IO.FileMode,System.IO.FileAccess)" /> of the <see cref="T:System.IO.Packaging.ZipPackagePart" /> class to open and return the part data stream from a ZIP file.</para>
</block>
</Docs>
</MemberGroup>
<Member MemberName="GetStream">
<MemberSignature Language="C#" Value="public System.IO.Stream GetStream ();" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig instance class System.IO.Stream GetStream() cil managed" />
<MemberSignature Language="DocId" Value="M:System.IO.Packaging.PackagePart.GetStream" />
<MemberSignature Language="VB.NET" Value="Public Function GetStream () As Stream" />
<MemberSignature Language="F#" Value="member this.GetStream : unit -> System.IO.Stream" Usage="packagePart.GetStream " />
<MemberSignature Language="C++ CLI" Value="public:
 System::IO::Stream ^ GetStream();" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.IO.Packaging</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.4.0</AssemblyVersion>
<AssemblyVersion>4.0.5.0</AssemblyVersion>
<AssemblyVersion>5.0.0.0</AssemblyVersion>
<AssemblyVersion>6.0.0.0</AssemblyVersion>
<AssemblyVersion>7.0.0.0</AssemblyVersion>
<AssemblyVersion>8.0.0.0</AssemblyVersion>
<AssemblyVersion>9.0.0.0</AssemblyVersion>
<AssemblyVersion>10.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>WindowsBase</AssemblyName>
<AssemblyVersion>3.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>