maxGraph/dotnet/docs/html/classcom_1_1mxgraph_1_1mxSe...

398 lines
21 KiB
HTML

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<title>mxGraph: com::mxgraph::mxSession Class Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="doxygen.css" rel="stylesheet" type="text/css"/>
</head>
<body>
<!-- Generated by Doxygen 1.6.3 -->
<div class="navigation" id="top">
<div class="tabs">
<ul>
<li><a href="index.html"><span>Main&nbsp;Page</span></a></li>
<li class="current"><a href="annotated.html"><span>Classes</span></a></li>
<li><a href="dirs.html"><span>Directories</span></a></li>
</ul>
</div>
<div class="tabs">
<ul>
<li><a href="annotated.html"><span>Class&nbsp;List</span></a></li>
<li><a href="hierarchy.html"><span>Class&nbsp;Hierarchy</span></a></li>
<li><a href="functions.html"><span>Class&nbsp;Members</span></a></li>
</ul>
</div>
<div class="navpath"><b>com</b>::<b>mxgraph</b>::<a class="el" href="classcom_1_1mxgraph_1_1mxSession.html">mxSession</a>
</div>
</div>
<div class="contents">
<h1>com::mxgraph::mxSession Class Reference</h1><!-- doxytag: class="com::mxgraph::mxSession" -->
<p>Implements a session that may be attached to a shared diagram.
<a href="#_details">More...</a></p>
<p><a href="classcom_1_1mxgraph_1_1mxSession-members.html">List of all members.</a></p>
<table border="0" cellpadding="0" cellspacing="0">
<tr><td colspan="2"><h2>Public Member Functions</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classcom_1_1mxgraph_1_1mxSession.html#a742d17a2f7b65e4ca58287ab87a1bbed">mxSession</a> (string <a class="el" href="classcom_1_1mxgraph_1_1mxSession.html#a5b93137a33bc765be42be673de5abc4b">id</a>, <a class="el" href="classcom_1_1mxgraph_1_1mxSharedDiagram.html">mxSharedDiagram</a> <a class="el" href="classcom_1_1mxgraph_1_1mxSession.html#ad1c81c4f7d9e14d47e2abcaeed7d2537">diagram</a>)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Constructs a new session with the given ID. <a href="#a742d17a2f7b65e4ca58287ab87a1bbed"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">string&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classcom_1_1mxgraph_1_1mxSession.html#af45decd662d3d2eba53103718b5fb3cb">Init</a> ()</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Initializes the session buffer and returns a string that represents the state of the session. <a href="#af45decd662d3d2eba53103718b5fb3cb"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">string&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classcom_1_1mxgraph_1_1mxSession.html#a509f4e15b46aaa9c3430e7e7fff7e529">GetInitialMessage</a> ()</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Returns an XML string that represents the current state of the session and the shared diagram. A globally unique ID is used as the session's namespace, which is used on the client side to prefix IDs of newly created cells. <a href="#a509f4e15b46aaa9c3430e7e7fff7e529"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classcom_1_1mxgraph_1_1mxSession.html#abb3efdea7640145a0c45c3d867db6843">Receive</a> (XmlNode message)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Posts the change represented by the given XML string to the shared diagram. <a href="#abb3efdea7640145a0c45c3d867db6843"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">string&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classcom_1_1mxgraph_1_1mxSession.html#a602341adc9d083af3c799bf1249d8903">Poll</a> ()</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Returns the changes received by other sessions for the shared diagram. The method returns an empty XML node if no change was received within 10 seconds. <a href="#a602341adc9d083af3c799bf1249d8903"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">string&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classcom_1_1mxgraph_1_1mxSession.html#a6c6fa3d1fce445afbf3b1b98821aa4d5">Poll</a> (int timeout)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Returns the changes received by other sessions for the shared diagram. The method returns an empty XML node if no change was received within the given timeout. <a href="#a6c6fa3d1fce445afbf3b1b98821aa4d5"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classcom_1_1mxgraph_1_1mxSession.html#a8e4a0cb888cd971989859ac593fa9b5a">DiagramChanged</a> (Object sender, string xml)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Invoked when the shared diagram has changed. <a href="#a8e4a0cb888cd971989859ac593fa9b5a"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">long&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classcom_1_1mxgraph_1_1mxSession.html#a26506ed45699525b39a3140d5721f501">InactiveTimeMillis</a> ()</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Returns the number of milliseconds this session has been inactive. <a href="#a26506ed45699525b39a3140d5721f501"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classcom_1_1mxgraph_1_1mxSession.html#a435f6fac66560ec4c38a9f0cdf101a1a">Destroy</a> ()</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Destroys the session and removes its listener from the shared diagram. <a href="#a435f6fac66560ec4c38a9f0cdf101a1a"></a><br/></td></tr>
<tr><td colspan="2"><h2>Static Public Attributes</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">static int&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classcom_1_1mxgraph_1_1mxSession.html#aa12b929541f6a5a68b73d2a48133f40c">DEFAULT_TIMEOUT</a> = 10000</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Default timeout is 10000 ms. <a href="#aa12b929541f6a5a68b73d2a48133f40c"></a><br/></td></tr>
<tr><td colspan="2"><h2>Protected Attributes</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">string&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classcom_1_1mxgraph_1_1mxSession.html#a5b93137a33bc765be42be673de5abc4b">id</a></td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Holds the session ID. <a href="#a5b93137a33bc765be42be673de5abc4b"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="classcom_1_1mxgraph_1_1mxSharedDiagram.html">mxSharedDiagram</a>&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classcom_1_1mxgraph_1_1mxSession.html#ad1c81c4f7d9e14d47e2abcaeed7d2537">diagram</a></td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Reference to the shared diagram. <a href="#ad1c81c4f7d9e14d47e2abcaeed7d2537"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">StringBuilder&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classcom_1_1mxgraph_1_1mxSession.html#a67c9f110e62aa2417ffe28decef0d462">buffer</a> = new StringBuilder()</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Holds the send buffer for this session. <a href="#a67c9f110e62aa2417ffe28decef0d462"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">long&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classcom_1_1mxgraph_1_1mxSession.html#aa61c27d2f2bc6c4a6c9813083b80bf8b">lastTimeMillis</a> = 0</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Holds the last active time millis. <a href="#aa61c27d2f2bc6c4a6c9813083b80bf8b"></a><br/></td></tr>
<tr><td colspan="2"><h2>Properties</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">string&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classcom_1_1mxgraph_1_1mxSession.html#aacafca1659c347daa5756352e34e8776">Id</a><code> [get]</code></td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Returns the session ID. <a href="#aacafca1659c347daa5756352e34e8776"></a><br/></td></tr>
</table>
<hr/><a name="_details"></a><h2>Detailed Description</h2>
<p>Implements a session that may be attached to a shared diagram. </p>
<hr/><h2>Constructor &amp; Destructor Documentation</h2>
<a class="anchor" id="a742d17a2f7b65e4ca58287ab87a1bbed"></a><!-- doxytag: member="com::mxgraph::mxSession::mxSession" ref="a742d17a2f7b65e4ca58287ab87a1bbed" args="(string id, mxSharedDiagram diagram)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">com::mxgraph::mxSession::mxSession </td>
<td>(</td>
<td class="paramtype">string&nbsp;</td>
<td class="paramname"> <em>id</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype"><a class="el" href="classcom_1_1mxgraph_1_1mxSharedDiagram.html">mxSharedDiagram</a>&nbsp;</td>
<td class="paramname"> <em>diagram</em></td><td>&nbsp;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td><td><code> [inline]</code></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Constructs a new session with the given ID. </p>
<dl><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"></td><td valign="top"><em>id</em>&nbsp;</td><td>Specifies the session ID to be used.</td></tr>
<tr><td valign="top"></td><td valign="top"><em>diagram</em>&nbsp;</td><td>Reference to the shared diagram.</td></tr>
</table>
</dd>
</dl>
</div>
</div>
<hr/><h2>Member Function Documentation</h2>
<a class="anchor" id="a435f6fac66560ec4c38a9f0cdf101a1a"></a><!-- doxytag: member="com::mxgraph::mxSession::Destroy" ref="a435f6fac66560ec4c38a9f0cdf101a1a" args="()" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void com::mxgraph::mxSession::Destroy </td>
<td>(</td>
<td class="paramname"></td>
<td>&nbsp;)&nbsp;</td>
<td><code> [inline]</code></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Destroys the session and removes its listener from the shared diagram. </p>
</div>
</div>
<a class="anchor" id="a8e4a0cb888cd971989859ac593fa9b5a"></a><!-- doxytag: member="com::mxgraph::mxSession::DiagramChanged" ref="a8e4a0cb888cd971989859ac593fa9b5a" args="(Object sender, string xml)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void com::mxgraph::mxSession::DiagramChanged </td>
<td>(</td>
<td class="paramtype">Object&nbsp;</td>
<td class="paramname"> <em>sender</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">string&nbsp;</td>
<td class="paramname"> <em>xml</em></td><td>&nbsp;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td><td><code> [inline]</code></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Invoked when the shared diagram has changed. </p>
<dl><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"></td><td valign="top"><em>sender</em>&nbsp;</td><td>Session where the change was received from.</td></tr>
<tr><td valign="top"></td><td valign="top"><em>xml</em>&nbsp;</td><td>XML string that represents the change.</td></tr>
</table>
</dd>
</dl>
</div>
</div>
<a class="anchor" id="a509f4e15b46aaa9c3430e7e7fff7e529"></a><!-- doxytag: member="com::mxgraph::mxSession::GetInitialMessage" ref="a509f4e15b46aaa9c3430e7e7fff7e529" args="()" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">string com::mxgraph::mxSession::GetInitialMessage </td>
<td>(</td>
<td class="paramname"></td>
<td>&nbsp;)&nbsp;</td>
<td><code> [inline]</code></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Returns an XML string that represents the current state of the session and the shared diagram. A globally unique ID is used as the session's namespace, which is used on the client side to prefix IDs of newly created cells. </p>
</div>
</div>
<a class="anchor" id="a26506ed45699525b39a3140d5721f501"></a><!-- doxytag: member="com::mxgraph::mxSession::InactiveTimeMillis" ref="a26506ed45699525b39a3140d5721f501" args="()" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">long com::mxgraph::mxSession::InactiveTimeMillis </td>
<td>(</td>
<td class="paramname"></td>
<td>&nbsp;)&nbsp;</td>
<td><code> [inline]</code></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Returns the number of milliseconds this session has been inactive. </p>
</div>
</div>
<a class="anchor" id="af45decd662d3d2eba53103718b5fb3cb"></a><!-- doxytag: member="com::mxgraph::mxSession::Init" ref="af45decd662d3d2eba53103718b5fb3cb" args="()" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">string com::mxgraph::mxSession::Init </td>
<td>(</td>
<td class="paramname"></td>
<td>&nbsp;)&nbsp;</td>
<td><code> [inline]</code></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Initializes the session buffer and returns a string that represents the state of the session. </p>
<dl class="return"><dt><b>Returns:</b></dt><dd>Returns the initial state of the session.</dd></dl>
</div>
</div>
<a class="anchor" id="a6c6fa3d1fce445afbf3b1b98821aa4d5"></a><!-- doxytag: member="com::mxgraph::mxSession::Poll" ref="a6c6fa3d1fce445afbf3b1b98821aa4d5" args="(int timeout)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">string com::mxgraph::mxSession::Poll </td>
<td>(</td>
<td class="paramtype">int&nbsp;</td>
<td class="paramname"> <em>timeout</em></td>
<td>&nbsp;)&nbsp;</td>
<td><code> [inline]</code></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Returns the changes received by other sessions for the shared diagram. The method returns an empty XML node if no change was received within the given timeout. </p>
<dl><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"></td><td valign="top"><em>timeout</em>&nbsp;</td><td>Time in milliseconds to wait for changes.</td></tr>
</table>
</dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>Returns a string representing the changes to the shared diagram.</dd></dl>
</div>
</div>
<a class="anchor" id="a602341adc9d083af3c799bf1249d8903"></a><!-- doxytag: member="com::mxgraph::mxSession::Poll" ref="a602341adc9d083af3c799bf1249d8903" args="()" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">string com::mxgraph::mxSession::Poll </td>
<td>(</td>
<td class="paramname"></td>
<td>&nbsp;)&nbsp;</td>
<td><code> [inline]</code></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Returns the changes received by other sessions for the shared diagram. The method returns an empty XML node if no change was received within 10 seconds. </p>
<dl class="return"><dt><b>Returns:</b></dt><dd>Returns a string representing the changes to the shared diagram.</dd></dl>
</div>
</div>
<a class="anchor" id="abb3efdea7640145a0c45c3d867db6843"></a><!-- doxytag: member="com::mxgraph::mxSession::Receive" ref="abb3efdea7640145a0c45c3d867db6843" args="(XmlNode message)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void com::mxgraph::mxSession::Receive </td>
<td>(</td>
<td class="paramtype">XmlNode&nbsp;</td>
<td class="paramname"> <em>message</em></td>
<td>&nbsp;)&nbsp;</td>
<td><code> [inline]</code></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Posts the change represented by the given XML string to the shared diagram. </p>
<dl><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"></td><td valign="top"><em>xml</em>&nbsp;</td><td>XML string that represents the change.</td></tr>
</table>
</dd>
</dl>
</div>
</div>
<hr/><h2>Member Data Documentation</h2>
<a class="anchor" id="a67c9f110e62aa2417ffe28decef0d462"></a><!-- doxytag: member="com::mxgraph::mxSession::buffer" ref="a67c9f110e62aa2417ffe28decef0d462" args="" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">StringBuilder <a class="el" href="classcom_1_1mxgraph_1_1mxSession.html#a67c9f110e62aa2417ffe28decef0d462">com::mxgraph::mxSession::buffer</a> = new StringBuilder()<code> [protected]</code></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Holds the send buffer for this session. </p>
</div>
</div>
<a class="anchor" id="aa12b929541f6a5a68b73d2a48133f40c"></a><!-- doxytag: member="com::mxgraph::mxSession::DEFAULT_TIMEOUT" ref="aa12b929541f6a5a68b73d2a48133f40c" args="" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">int <a class="el" href="classcom_1_1mxgraph_1_1mxSession.html#aa12b929541f6a5a68b73d2a48133f40c">com::mxgraph::mxSession::DEFAULT_TIMEOUT</a> = 10000<code> [static]</code></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Default timeout is 10000 ms. </p>
</div>
</div>
<a class="anchor" id="ad1c81c4f7d9e14d47e2abcaeed7d2537"></a><!-- doxytag: member="com::mxgraph::mxSession::diagram" ref="ad1c81c4f7d9e14d47e2abcaeed7d2537" args="" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="classcom_1_1mxgraph_1_1mxSharedDiagram.html">mxSharedDiagram</a> <a class="el" href="classcom_1_1mxgraph_1_1mxSession.html#ad1c81c4f7d9e14d47e2abcaeed7d2537">com::mxgraph::mxSession::diagram</a><code> [protected]</code></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Reference to the shared diagram. </p>
</div>
</div>
<a class="anchor" id="a5b93137a33bc765be42be673de5abc4b"></a><!-- doxytag: member="com::mxgraph::mxSession::id" ref="a5b93137a33bc765be42be673de5abc4b" args="" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">string <a class="el" href="classcom_1_1mxgraph_1_1mxSession.html#a5b93137a33bc765be42be673de5abc4b">com::mxgraph::mxSession::id</a><code> [protected]</code></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Holds the session ID. </p>
</div>
</div>
<a class="anchor" id="aa61c27d2f2bc6c4a6c9813083b80bf8b"></a><!-- doxytag: member="com::mxgraph::mxSession::lastTimeMillis" ref="aa61c27d2f2bc6c4a6c9813083b80bf8b" args="" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">long <a class="el" href="classcom_1_1mxgraph_1_1mxSession.html#aa61c27d2f2bc6c4a6c9813083b80bf8b">com::mxgraph::mxSession::lastTimeMillis</a> = 0<code> [protected]</code></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Holds the last active time millis. </p>
</div>
</div>
<hr/><h2>Property Documentation</h2>
<a class="anchor" id="aacafca1659c347daa5756352e34e8776"></a><!-- doxytag: member="com::mxgraph::mxSession::Id" ref="aacafca1659c347daa5756352e34e8776" args="" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">string com::mxgraph::mxSession::Id<code> [get]</code></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Returns the session ID. </p>
</div>
</div>
<hr/>The documentation for this class was generated from the following file:<ul>
<li>src/sharing/mxSession.cs</li>
</ul>
</div>
<hr class="footer"/><address style="text-align: right;"><small>Generated on Fri May 25 10:15:54 2012 for mxGraph by&nbsp;
<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.6.3 </small></address>
</body>
</html>