<?xml version="1.0" encoding="utf-8"?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns:MadCap="http://www.madcapsoftware.com/Schemas/MadCap.xsd" MadCap:lastBlockDepth="2" MadCap:lastHeight="120" MadCap:lastWidth="624" MadCap:disableMasterStylesheet="true" MadCap:tocPath="Tuning|Selective Persistence|Transient Classes" MadCap:InPreviewMode="false" MadCap:RuntimeFileType="Topic" MadCap:TargetType="WebHelp" MadCap:PathToHelpSystem="../../../../" MadCap:HelpSystemFileName="index.xml" MadCap:SearchType="Stem"> <head><title>Test2 </title> <script type="text/javascript">/* <![CDATA[ */ window.onload = function(){ var pathToFlash = $('html').attr('MadCap:PathToHelpSystem') + 'Content/Resources/Code/ZeroClipboard.swf'; ZeroClipboard.setMoviePath(pathToFlash); function bindToClipBord(element,content){ var clip = new ZeroClipboard.Client(); clip.setText(content); clip.glue(element); }; if(location.protocol==='file:'){ $('.copylink-marker').remove(); } else{ $('.copylink-marker').each(function(){ var text = $(this).parent().parent().children('.prettyprint').html(); $(this).hover(function(){ bindToClipBord(this,text); }, function(){}); }); } prettyPrint(); }; /* ]]> */</script> <link href="../../../SkinSupport/MadCap.css" rel="stylesheet" /> <link href="../../../Resources/Stylesheets/OnlineStyle.css" rel="stylesheet" /> <script src="../../../Resources/Code/prettify.js"> </script> <script src="../../../Resources/Code/lang-vb.js"> </script> <script src="../../../Resources/Code/jquery.min.js"> </script> <script src="../../../Resources/Code/ZeroClipboard.js"> </script> <script src="../../../SkinSupport/MadCapAll.js" type="text/javascript"> </script> </head> <body> <p class="MCWebHelpFramesetLink" style="display: none;"><a href="../../../../index_CSH.html#tuning/selective_persistence/transient_classes/test2.htm" style="">Open topic with navigation</a> </p> <div class="MCBreadcrumbsBox"><span class="MCBreadcrumbsPrefix">You are here: </span><a class="MCBreadcrumbsLink" href="../../../tuning.htm">Tuning</a><span class="MCBreadcrumbsDivider"> > </span><a class="MCBreadcrumbsLink" href="../../selective_persistence.htm">Selective Persistence</a><span class="MCBreadcrumbsDivider"> > </span><a class="MCBreadcrumbsLink" href="../transient_classes.htm">Transient Classes</a><span class="MCBreadcrumbsDivider"> > </span><span class="MCBreadcrumbs">test2</span> </div> <p> <script type="text/javascript">/*<![CDATA[*/document.write('<a href="' + location.href +'">'); document.write("Direct Link"); document.write('</a>');/*]]>*/</script> </p> <p> </p> <h1>Test2</h1> <p MadCap:conditions="Global.Primary:java" /> <p MadCap:conditions="Primary..NET,Primary.c#,Primary.All languages"> <pre class="prettyprint" xml:space="preserve">Test2.cs class Test2 { private Test1 test1; private string name; private NotStorable transientClass; public Test2(string name, NotStorable transientClass, Test1 test1) { this.test1 = test1; this.name = name; this.transientClass = transientClass; } public override string ToString() { if (transientClass == null) { return string.Format("{0}/{1}; test1: {2}", name, "null", test1); } else { return string.Format("{0}/{1}; test1: {2}", name, transientClass, test1); } } } </pre> </p> <p MadCap:conditions="Global.Primary:cs" /> <p MadCap:conditions="Primary..NET,Primary.VB.NET,Primary.All languages"> <pre class="prettyprint lang-vb" xml:space="preserve">Test2.vb Class Test2 Private test1 As Test1 Private name As String Private transientClass As NotStorable Public Sub New(ByVal name As String, _ ByVal transientClass As NotStorable, ByVal test1 As Test1) Me.test1 = test1 Me.name = name Me.transientClass = transientClass End Sub Public Overloads Overrides Function ToString() As String If transientClass Is Nothing Then Return String.Format("{0}/{1}; test1: {2}", name, _ "Nothing", test1.ToString()) Else Return String.Format("{0}/{1}; test1: {2}", name, _ transientClass.ToString(), test1.ToString()) End If End Function End Class </pre> </p> <p MadCap:conditions="Global.Primary:vb" /> <script type="text/javascript" src="../../../SkinSupport/MadCapBodyEnd.js"> </script> </body> </html>