示例#1
0
        public void InstantiateFileClients( )
        {
            if (!SpeckleIsReady)
            {
                return;
            }

            Debug.WriteLine("Instantiate file clients.");

            string[] receiverKeys = RhinoDoc.ActiveDoc.Strings.GetEntryNames("speckle-client-receivers");

            foreach (string rec in receiverKeys)
            {
                //if ( UserClients.Any( cl => cl.GetClientId() == rec ) )
                //  continue;

                byte[] serialisedClient = Convert.FromBase64String(RhinoDoc.ActiveDoc.Strings.GetValue("speckle-client-receivers", rec));
                using (var ms = new MemoryStream())
                {
                    ms.Write(serialisedClient, 0, serialisedClient.Length);
                    ms.Seek(0, SeekOrigin.Begin);
                    RhinoReceiver client = (RhinoReceiver) new BinaryFormatter().Deserialize(ms);
                    client.Context = this;
                }
            }

            string[] senderKeys = RhinoDoc.ActiveDoc.Strings.GetEntryNames("speckle-client-senders");

            foreach (string sen in senderKeys)
            {
                byte[] serialisedClient = Convert.FromBase64String(RhinoDoc.ActiveDoc.Strings.GetValue("speckle-client-senders", sen));

                using (var ms = new MemoryStream())
                {
                    ms.Write(serialisedClient, 0, serialisedClient.Length);
                    ms.Seek(0, SeekOrigin.Begin);
                    RhinoSender client = (RhinoSender) new BinaryFormatter().Deserialize(ms);
                    client.CompleteDeserialisation(this);
                }
            }
        }
示例#2
0
        public bool AddSenderClientFromSelection(string _payload)
        {
            var mySender = new RhinoSender(_payload, this);

            return(true);
        }