本文整理匯總了C#中System.Runtime.Serialization.NetDataContractSerializer.NetDataContractSerializer構造函數的典型用法代碼示例。如果您正苦於以下問題:C# NetDataContractSerializer構造函數的具體用法?C# NetDataContractSerializer怎麽用?C# NetDataContractSerializer使用的例子?那麽, 這裏精選的構造函數代碼示例或許可以為您提供幫助。您也可以進一步了解該構造函數所在類System.Runtime.Serialization.NetDataContractSerializer
的用法示例。
在下文中一共展示了NetDataContractSerializer構造函數的7個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。
示例1: Constructor1
public static void Constructor1()
{
// Create an instance of the NetDataContractSerializer.
NetDataContractSerializer ser =
new NetDataContractSerializer();
// Other code not shown.
}
示例2: Constructor2
public static void Constructor2()
{
// Create an instance of the StreamingContext to hold
// context data.
StreamingContext sc = new StreamingContext
(StreamingContextStates.CrossAppDomain);
// Create a DatatContractSerializer with the collection.
NetDataContractSerializer ser2 = new NetDataContractSerializer(sc);
// Other code not shown.
}
示例3: Constructor3
public static void Constructor3()
{
// Create an instance of the NetDataContractSerializer
// specifying the name and namespace as strings.
NetDataContractSerializer ser =
new NetDataContractSerializer(
"Customer",
"http://www.contoso.com");
// Other code not shown.
}
示例4: Constructor4
public static void Constructor4()
{
// Create an XmlDictionary and add values to it.
XmlDictionary d = new XmlDictionary();
// Initialize the out variables.
XmlDictionaryString name_value = d.Add("Customer");
XmlDictionaryString ns_value = d.Add("http://www.contoso.com");
// Create the serializer.
NetDataContractSerializer ser =
new NetDataContractSerializer(
name_value,
ns_value);
// Other code not shown.
}
示例5: Constructor5
public static void Constructor5()
{
// Create an instance of the StreamingContext to hold
// context data.
StreamingContext sc = new StreamingContext
(StreamingContextStates.CrossAppDomain);
// Create an instance of a class that implements the
// ISurrogateSelector interface. The implementation code
// is not shown here.
MySelector mySurrogateSelector = new MySelector();
NetDataContractSerializer ser =
new NetDataContractSerializer(
sc,
int.MaxValue,
true,
FormatterAssemblyStyle.Simple,
mySurrogateSelector);
// Other code not shown.
}
示例6: Constructor6
public static void Constructor6()
{
// Create an instance of the StreamingContext to hold
// context data.
StreamingContext sc = new StreamingContext
(StreamingContextStates.CrossAppDomain);
// Create an instance of a class that implements the
// ISurrogateSelector interface. The implementation code
// is not shown here.
MySelector mySurrogateSelector = new MySelector();
NetDataContractSerializer ser =
new NetDataContractSerializer(
"Customer",
"http://www.contoso.com",
sc,
int.MaxValue,
true,
FormatterAssemblyStyle.Simple,
mySurrogateSelector);
// Other code not shown.
}
示例7: Constructor7
public static void Constructor7()
{
// Create an instance of the StreamingContext to hold
// context data.
StreamingContext sc = new StreamingContext
(StreamingContextStates.CrossAppDomain);
// Create an XmlDictionary and add values to it.
XmlDictionary d = new XmlDictionary();
XmlDictionaryString name_value = d.Add("Customer");
XmlDictionaryString ns_value = d.Add("http://www.contoso.com");
// Create an instance of a class that implements the
// ISurrogateSelector interface. The implementation code
// is not shown here.
MySelector mySurrogateSelector = new MySelector();
NetDataContractSerializer ser =
new NetDataContractSerializer(
name_value,
ns_value,
sc,
int.MaxValue,
true,
FormatterAssemblyStyle.Simple,
mySurrogateSelector);
// Other code not shown.
}