protected ProxyObjectReference(SerializationInfo info, StreamingContext context) { // Deserialize the base type using its assembly qualified name string qualifiedName = info.GetString("__baseType"); _baseType = System.Type.GetType(qualifiedName, true, false); // Rebuild the list of interfaces var interfaceList = new List<System.Type>(); int interfaceCount = info.GetInt32("__baseInterfaceCount"); for (int i = 0; i < interfaceCount; i++) { string keyName = string.Format("__baseInterface{0}", i); string currentQualifiedName = info.GetString(keyName); System.Type interfaceType = System.Type.GetType(currentQualifiedName, true, false); interfaceList.Add(interfaceType); } // Reconstruct the proxy var factory = new ProxyFactory(); System.Type proxyType = factory.CreateProxyType(_baseType, interfaceList.ToArray()); // Initialize the proxy with the deserialized data var args = new object[] {info, context}; _proxy = (IProxy) Activator.CreateInstance(proxyType, args); }
public virtual void RegisteProxy(string proxyName, IProxy proxy) { if (!HasProxy(proxyName)) { _proxyMap[proxyName] = proxy; } }
/// <summary> /// Initializes a new instance of the ProxyObjectReference class. /// </summary> /// <param name="info">The <see cref="SerializationInfo"/> class that contains the serialized data.</param> /// <param name="context">The <see cref="StreamingContext"/> that describes the serialization state.</param> protected ProxyObjectReference(SerializationInfo info, StreamingContext context) { // Deserialize the base type using its assembly qualified name string qualifiedName = info.GetString("__baseType"); _baseType = Type.GetType(qualifiedName, true, false); // Rebuild the list of interfaces List<Type> interfaceList = new List<Type>(); int interfaceCount = info.GetInt32("__baseInterfaceCount"); for (int i = 0; i < interfaceCount; i++) { string keyName = string.Format("__baseInterface{0}", i); string currentQualifiedName = info.GetString(keyName); Type interfaceType = Type.GetType(currentQualifiedName, true, false); interfaceList.Add(interfaceType); } // Reconstruct the proxy ProxyFactory factory = new ProxyFactory(); Type proxyType = factory.CreateProxyType(_baseType, interfaceList.ToArray()); _proxy = (IProxy)Activator.CreateInstance(proxyType); IInterceptor interceptor = (IInterceptor)info.GetValue("__interceptor", typeof(IInterceptor)); _proxy.Interceptor = interceptor; }
/// <summary> /// Visits a <see cref="DocNodeProxy"/> and applies the modifications to the document path of that proxy. /// </summary> /// <param name="proxy">The <see cref="DocNodeProxy"/> to modify.</param> /// <param name="owner">The instance that owns the proxy.</param> /// <param name="propertyName">Name of the property that accesses the proxy in this instance.</param> public void Visit(IProxy proxy, object owner, string propertyName) { if (null == proxy) return; var docPath = proxy.DocumentPath; // the _itemRelocationDictionary has first priority if (_itemRelocationDictionary != null && _itemRelocationDictionary.Count > 0) { for (int i = docPath.Count; i >= 2; --i) { var subPath = docPath.SubPath(0, i); AbsoluteDocumentPath replacePath; if (_itemRelocationDictionary.TryGetValue(subPath, out replacePath)) { proxy.ReplacePathParts(subPath, replacePath, (IDocumentLeafNode)owner); return; } } } // the pathReplacementDictionary has 2nd priority foreach (var levelEntry in _pathPartReplacementDictionary) { foreach (var entry in levelEntry) { if (proxy.ReplacePathParts(entry.Key, entry.Value, (IDocumentLeafNode)owner)) return; } } }
public ReturnValueTests() { this.interceptor = new Mock<IDynamicInterceptor>(); this.BindInterceptorCollection(this.interceptor.Object); this.testee = this.Kernel.Get<IProxy>(); }
public CommandLine(IProxy prx) { _proxy = prx; prx.ListenerStarted += (o, e) => Console.WriteLine("Started {0}", e.Listener); prx.ListenerStopped += (o, e) => Console.WriteLine("Stopped {0}", e.Listener); prx.UserDeleted += (o, e) => Console.WriteLine("User{0} successfully removed.", e.Username); prx.UserCreated += (o, e) => Console.WriteLine("User {0} successfully added.", e.Username); _commands = new Dictionary<String, ProxyCommand> { {"help", new ProxyCommand {Action = ShowHelp, HelpString = "Shows this help message"}}, { "uptime", new ProxyCommand { Action = ShowUpTime, HelpString = "Shows the uptime of the proxy server" } }, //{"version", new ProxyCommand{Action=ShowVersion, HelpString="Prints the version of this program"}}, {"listusers", new ProxyCommand {Action = ShowUsers, HelpString = "Lists all users"}}, { "adduser", new ProxyCommand {Action = ShowAddUser, HelpString = "Adds a user to the user list"} }, { "deluser", new ProxyCommand { Action = ShowDeleteUser, HelpString = "Deletes a user from the user list" } }, { "listlisteners", new ProxyCommand {Action = ShowListeners, HelpString = "Lists all the listeners"} }, { "addlistener", new ProxyCommand {Action = ShowAddListener, HelpString = "Adds a new listener"} }, { "dellistener", new ProxyCommand {Action = ShowDelListener, HelpString = "Deletes a listener"} }, { "listeners", new ProxyCommand { Action = ShowAvailableListeners, HelpString = "List available listeners" } }, {"exit", new ProxyCommand {Action = () => { }, HelpString = "Exit the application"}}, { "save", new ProxyCommand {Action = () => _proxy.SaveData(), HelpString = "Save configuration"} }, }; }
/// <summary> /// Register an <c>IProxy</c> with the <c>Model</c> /// </summary> /// <param name="proxy">An <c>IProxy</c> to be held by the <c>Model</c></param> /// <remarks>This method is thread safe and needs to be thread safe in all implementations.</remarks> public virtual void RegisterProxy(IProxy proxy) { lock (m_syncRoot) { m_proxyMap[proxy.ProxyName] = proxy; } proxy.OnRegister(); }
public App() { DispatcherHelper.Initialize(); _proxy = new ProxyImplement(); VMLocator = new ViewModelLocator(); VMLocator.RegisterInstance(_proxy); VMLocator.RegisterInstance(new ProxyImplement()); }
public ClientActionContext(IProxy proxy, Type contract, MethodInfo action, object[] parameters) : base(contract, action, parameters) { Proxy = proxy; Request = new HttpRequestMessage(); if (Parameters != null) { RequestAborted = Parameters.OfType<CancellationToken>().FirstOrDefault(); } }
public ProxyContact(int factory, IProxy proxy) { deliverData = (a, b) => Table.Deliver(this, a, b); deliverPing = () => Table.DeliverPing(this); this.factoryKey = factory; this.ProxyInstance = proxy; if (proxy != null) proxy.Bind(deliverPing, deliverData); }
protected override void OnStart(string[] args) { Proxy.Updater.Updater.Update(); Assembly ass = Assembly.Load("Mentalis"); Type tp = ass.GetType("Org.Mentalis.Proxy.Proxy"); string dir = Environment.CurrentDirectory; if (!dir.Substring(dir.Length - 1, 1).Equals(@"\")) dir += @"\"; object obj = Activator.CreateInstance(tp, dir + "config.xml"); prx = (IProxy)obj; prx.Run(); }
public MainPresenter(IMainForm view) { this.view = view; this.proxy = new Proxy(); view.LoadAllTables += view_LoadAllTables; view.SaveAllTables += SaveAllTables; view.AddNewPlayer += view_AddNewPlayer; view.AddNewTransaction += view_AddNewTransaction; view.AddNewCombat += view_AddNewCombat; view.AddNewHit += view_AddNewHit; view.EditTransactionCell += view_EditTransactionCell; view.EditCombatCell += view_EditCombatCell; }
public ClientActionContext(IProxy proxy, Type contract, MethodInfo action, object[] parameters) : base(contract, action, parameters) { Proxy = proxy; Request = new HttpRequestMessage(); if (ActionMetadata.CancellationTokenIndex >= 0 && parameters != null) { var cancellation = parameters[ActionMetadata.CancellationTokenIndex]; if (cancellation is CancellationToken) { RequestAborted = (CancellationToken) cancellation; } } }
public Invocation( object target, IProxy proxy, MethodInfo method, object[] arguments, ProxyTargetInvocation proxyTargetInvocation, IInterceptor[] interceptors) { _target = target; _proxy = proxy; _method = method; _arguments = arguments; _proxyTargetInvocation = proxyTargetInvocation; _interceptors = interceptors; }
private static List<string> GetRecipientAddressList(IProxy mailItem) { int count = mailItem.GetRecipientSmtpAddressCount(); if (count == 0) { return new List<string>(); } List<string> list = new List<string>(); for (int i = 0; i != count; ++i) { list.Add(mailItem.GetRecipientSmtpAddress(i)); } return list; }
protected void _RegisterProxy(IProxy proxy) { if (proxy == null) { Log.Error("Module:_RegisterProxy - proxy is null"); return; } if (_proxy != null) { Log.Error("Module:_RegisterProxy - _proxy already exist, Don't regist twice"); return; } _proxy = proxy; _proxy.OnRegister(); }
public void Start(Application app, IProxy proxy) { try { if (!start) { start = true; ConfigureControllers(app); } InjectObjects(app, proxy); } catch (Exception e) { Debug.WriteLine("[ERROR]: " + e.StackTrace); } }
internal bool ExecuteSendLinkAction(IProxy mailItem, RequestManager requestManager) { throw new NotImplementedException("SendLink is not supported for Lotus Notes"); //Interop.Logging.Logger.LogInfo("Executing Send Link Process"); //try //{ // Attachment[] processedAttachments = requestManager.EnforceResponse.ModifiedRequest.Attachments; // if (processedAttachments.Length == 0) // { // Interop.Logging.Logger.LogInfo("No files to upload"); // return true; // } // string id = Guid.NewGuid().ToString(); // List<SendLinkInfo> filesToUpload = GetFilesToUpload(processedAttachments, id); // List<string> emailAddresses = GetRecipientAddressList(mailItem); // string subject = ConvertLineFeed2WhiteSpace(mailItem.GetSubject()).TrimEnd(); // // Upload to the cloud // var sendLinkAction = GetSendLinkAction(requestManager.Response); // var storageLinks = GetStorageLinks(requestManager.Response, sendLinkAction); // storageLinks.Authenticate(); // List<SendLinkInfo> filesUploaded = RetrieveLinks(storageLinks, sendLinkAction, requestManager.Response, filesToUpload, emailAddresses, subject, id); // // Update proxy for Notes extension manager // UpdateProxyForSendLink(mailItem, GetSendLinkText(), filesUploaded, id); // return true; //} //catch (StorageUnavailableException ex) //{ // // note, the class name for Notes window is SWT_Window0 however class name is not unique to notes (most SWT framework apps will have this class name) // WsMessage.ShowMessage(IntPtr.Zero, Resources.PleaseCheckYourInternetConnection, MessageButtons.WsOK, MessageBranding.WsProtect, // MessageType.WsErrorIcon, Resources.UnableToConnectToSendLink, -1); // throw new AbortSendLinkException(ex.Message); //} //catch (Exception e) //{ // Interop.Logging.Logger.LogError(e); // throw; //} }
public static object GetProperty(IProxy proxy, string propertyName, Type propertyType, object refValue) { #if NPDEBUG Console.Write(propertyType.ToString()); #endif bool cancel = false; IInterceptor interceptor = proxy.GetInterceptor(); if (interceptor.Notification != Notification.Disabled) { if (interceptor != null) { interceptor.NotifyPropertyGet(proxy, propertyName, ref refValue, ref cancel); } if (cancel) { return GetDefaultValue(propertyType); } if (interceptor != null) { interceptor.NotifyReadProperty(proxy, propertyName, refValue); } } return refValue; }
private void InternalDisconnect() { if (_proxy != null) { _proxy.ConnectionLost -= OnConnectionLost; _proxy.Disconnect(); _proxy = null; } }
public AsyncSession(IProxy remote) { Remote = remote; }
public void RegisterInstance(IProxy proxy) { if (!SimpleIoc.Default.IsRegistered<IProxy>()) SimpleIoc.Default.Register<IProxy>(() => proxy); }
public static Object NewInstance(IProxy proxy, Type clsType, Type objInterface) { Object objectInstance = Activator.CreateInstance(clsType); return(proxy.NewProxyInstance(objectInstance, objInterface, new ProxyHandler(objectInstance))); }
public DesignDataService(IProxy proxy) { _proxy = proxy; }
public void RegisterProxy(IProxy proxy) { this.m_model.RegisterProxy(proxy); }
public void RegisterProxy(string proxyName, IProxy proxy) { proxyDispatcher?.Register(proxyName, proxy); }
/// <summary> /// Register an <c>IProxy</c> with the <c>Model</c>. /// </summary> /// <param name="proxy">proxy an <c>IProxy</c> to be held by the <c>Model</c>.</param> public virtual void RegisterProxy(IProxy proxy) { proxy.InitializeNotifier(multitonKey); proxyMap[proxy.ProxyName] = proxy; proxy.OnRegister(); }
public SecurityRoles(IProxy client) : base("security_roles", client) { }
public JobsApiService(IProxy proxy) { _proxy = proxy; }
public void RegisterProxy(IProxy proxy) { GetModel.RegisterProxy(proxy); }
/// <summary> /// 通过proxyName获取proxy /// </summary> /// <param name="proxyName"></param> /// <returns></returns> public IProxy RetrieveProxy(string proxyName) { IProxy proxy = HasProxy(proxyName) ? proxyMap[proxyName] : null ; return proxy; }
/// <summary> /// 注册Proxy /// </summary> /// <param name="proxy"></param> public void RegisterProxy(IProxy proxy) { proxyMap[proxy.proxyName] = proxy; proxy.OnRegister(); }
public void Connect(int connectTimeout) { if (m_isConnected) throw new JSchException("session is already connected"); m_io = new IO(); if (m_random == null) try { Class c = Class.ForName(getConfig("random")); m_random = (Random)(c.Instance()); } catch (Exception e) { throw e; } Packet.setRandom(m_random); try { int i, j; if (m_proxy == null) { m_proxy = m_jsch.getProxy(m_host); if (m_proxy != null) lock (m_proxy) { m_proxy.close(); } } if (m_proxy == null) { Stream In; Stream Out; if (m_socket_factory == null) { m_socket = Util.createSocket(m_host, m_port, connectTimeout); In = m_socket.getInputStream(); Out = m_socket.getOutputStream(); } else { m_socket = m_socket_factory.createSocket(m_host, m_port); In = m_socket_factory.getInputStream(m_socket); Out = m_socket_factory.getOutputStream(m_socket); } //if(timeout>0){ socket.setSoTimeout(timeout); } m_socket.setTcpNoDelay(true); m_io.setInputStream(In); m_io.setOutputStream(Out); } else lock (m_proxy) { m_proxy.connect(m_socket_factory, m_host, m_port, connectTimeout); m_io.setInputStream(m_proxy.InputStream); m_io.setOutputStream(m_proxy.OutputStream); m_socket = m_proxy.Socket; } if (connectTimeout > 0 && m_socket != null) m_socket.setSoTimeout(connectTimeout); m_isConnected = true; while (true) { i = 0; j = 0; while (i < m_buf.m_buffer.Length) { j = m_io.getByte(); if (j < 0) break; m_buf.m_buffer[i] = (byte)j; i++; if (j == 10) break; } if (j < 0) throw new JSchException("connection is closed by foreign host"); if (m_buf.m_buffer[i - 1] == '\n') { i--; if (m_buf.m_buffer[i - 1] == '\r') i--; } if (i > 4 && (i != m_buf.m_buffer.Length) && (m_buf.m_buffer[0] != 'S' || m_buf.m_buffer[1] != 'S' || m_buf.m_buffer[2] != 'H' || m_buf.m_buffer[3] != '-') ) continue; if (i == m_buf.m_buffer.Length || i < 7 // SSH-1.99 or SSH-2.0 || (m_buf.m_buffer[4] == '1' && m_buf.m_buffer[6] != '9') // SSH-1.5 ) throw new JSchException("invalid server's version String"); break; } m_server_version = new byte[i]; Array.Copy(m_buf.m_buffer, 0, m_server_version, 0, i); { // Some Cisco devices will miss to read '\n' if it is sent separately. byte[] foo = new byte[m_client_version.Length + 1]; Array.Copy(m_client_version, 0, foo, 0, m_client_version.Length); foo[foo.Length - 1] = (byte)'\n'; m_io.put(foo, 0, foo.Length); } m_buf = read(m_buf); if (m_buf.m_buffer[5] != SSH_MSG_KEXINIT) throw new JSchException("invalid protocol: " + m_buf.m_buffer[5]); KeyExchange kex = receive_kexinit(m_buf); while (true) { m_buf = read(m_buf); if (kex.getState() == m_buf.m_buffer[5]) { bool result = kex.next(m_buf); if (!result) { m_in_kex = false; throw new JSchException("verify: " + result); } } else { m_in_kex = false; throw new JSchException("invalid protocol(kex): " + m_buf.m_buffer[5]); } if (kex.getState() == KeyExchange.STATE_END) break; } try { checkHost(m_host, kex); } catch (JSchException ee) { m_in_kex = false; throw ee; } send_newkeys(); // receive SSH_MSG_NEWKEYS(21) m_buf = read(m_buf); if (m_buf.m_buffer[5] == SSH_MSG_NEWKEYS) receive_newkeys(m_buf, kex); else { m_in_kex = false; throw new JSchException("invalid protocol(newkyes): " + m_buf.m_buffer[5]); } bool auth = false; bool auth_cancel = false; UserAuthNone usn = new UserAuthNone(m_userinfo); auth = usn.start(this); string methods = null; if (!auth) { methods = usn.getMethods(); if (methods != null) methods = methods.ToLowerInvariant(); else methods = "publickey,password,keyboard-interactive"; } while (true) { while (!auth && methods != null && methods.Length > 0) { UserAuth us = null; if (methods.StartsWith("publickey")) { lock (m_jsch.Identities) { if (m_jsch.Identities.Count > 0) us = new UserAuthPublicKey(m_userinfo); } } else if (methods.StartsWith("keyboard-interactive")) { if (m_userinfo is UIKeyboardInteractive) us = new UserAuthKeyboardInteractive(m_userinfo); } else if (methods.StartsWith("password")) us = new UserAuthPassword(m_userinfo); if (us != null) { try { auth = us.start(this); auth_cancel = false; } catch (JSchAuthCancelException) { auth_cancel = true; } catch (JSchPartialAuthException ex) { methods = ex.getMethods(); auth_cancel = false; continue; } catch (RuntimeException ee) { throw ee; } catch (Exception ee) { Console.WriteLine("ee: " + ee); // SSH_MSG_DISCONNECT: 2 Too many authentication failures } } if (!auth) { int comma = methods.IndexOf(","); if (comma == -1) break; methods = methods.Substring(comma + 1); } } break; } if (connectTimeout > 0 || m_timeout > 0) m_socket.setSoTimeout(m_timeout); if (auth) { m_isAuthed = true; m_connectThread = new Thread(this); m_connectThread.Name = "Connect thread " + m_host + " session"; m_connectThread.Start(); return; } if (auth_cancel) throw new JSchException("Auth cancel"); throw new JSchException("Auth fail"); } catch (Exception e) { m_in_kex = false; if (m_isConnected) { try { m_packet.reset(); m_buf.putByte((byte)SSH_MSG_DISCONNECT); m_buf.putInt(3); m_buf.putString(e.ToString()); m_buf.putString("en"); write(m_packet); disconnect(); } catch (Exception) { } } m_isConnected = false; if (e is RuntimeException) throw (RuntimeException)e; if (e is JSchException) throw (JSchException)e; throw new JSchException("Session.connect: " + e); } }
// The ProxyConfiguration and Proxy will be injected the the DI framework public HomeController(IProxyConfiguration proxyConfiguration, IProxy proxy) { this.injectedProxyConfiguration = proxyConfiguration; this.injectedProxy = proxy; }
public GreaterThanValidator(ValidationPipe pipe, IProxy argument, IErrorStringProvider errorProvider, IBoolProxy isEnforced, IValueConverter valueConverter, bool strictValidation, bool validatesOnTargetUpdated) : base(pipe, argument, errorProvider, isEnforced, valueConverter, strictValidation, validatesOnTargetUpdated) { }
public ProxyException(IProxy proxy, string message) : base(message) { Proxy = proxy; }
public MockInfo(IProxy proxy) { this.proxy = proxy ?? throw new ArgumentNullException(nameof(proxy)); proxy.Behaviors.CollectionChanged += OnBehaviorsChanged; }
public WebService() { proxy = ProxyFactory.CreateProxy(); bo = proxy.CreateObject <SmartBox.Console.Bo.AppCenter.AppCenterBO>(); }
public override void RegisterProxy(IProxy proxy) { base.RegisterProxy(proxy); }
// ReSharper disable once InconsistentNaming private HandleResult OnConnect(IAgent sender, IntPtr connId, IProxy proxy) { AddLog($"OnConnect({connId})"); return(HandleResult.Ok); }
public void UnregisterProxy(IProxy proxy) { ModelManager.GetInstance().UnregisterProxy(proxy); }
public Handler(string name, IProxy proxy) { m_handlerName = name; Proxy = proxy; }
public Defects(IProxy client) : base("defects", client) { }
protected virtual void InitializeTest(int iteration = -1, [CallerMemberName] string testName = "") { if (string.IsNullOrWhiteSpace(testName)) { throw new ArgumentNullException(nameof(testName)); } lock (_syncpoint) { if (_initialized) { throw new InvalidOperationException("Test already initialized."); } _iteration = iteration; InitializeTestPaths(testName); var projectDirectory = Path.Combine(_solutionDirectory, _projectDirectory); var options = new ProxyOptions(Translate(TestMode), _solutionDirectory, projectDirectory) { FauxPrefixPath = FauxDataSolutionPath, FauxResultPath = FauxDataResultPath, FauxHomePath = FauxDataHomePath, }; if (_proxy is null) { _proxy = Test.Proxy.Create(Context, options); } switch (TestMode) { case UnitTestMode.Capture: { _proxy.Data.ResultPath = Path.Combine(projectDirectory, TestResultDirectoryName); _proxy.Data.DisplayName = _testName; } break; case UnitTestMode.Replay: { using (var readableStream = File.Open(_testDataFile, FileMode.Open, FileAccess.Read, FileShare.Read)) { _proxy.ReadTestData(readableStream); } _proxy.Data.ResultPath = FauxDataResultPath; } break; case UnitTestMode.NoProxy: break; default: throw new InvalidOperationException($"`{TestMode}` is an undefined value for `{typeof(UnitTestMode).FullName}`."); } _initialized = true; } }
public WebService() { proxy = ProxyFactory.CreateProxy(); bo = proxy.CreateObject<SmartBox.Console.Bo.AppCenter.AppCenterBO>(); }
private void UpdateProxyForSendLink(IProxy mailItem, string message, List<SendLinkInfo> uploadedFiles, string id) { mailItem.SetLinkMessage(message); foreach (SendLinkInfo sli in uploadedFiles) { if (0 != mailItem.ContainsAttachment(sli.ContentId)) { //Update existing global::Interop.Workshare.Client.NotesProxy.Attachment proxyAttachment = mailItem.GetAttachmentById(sli.ContentId); proxyAttachment.SetLink(string.IsNullOrEmpty(sli.Link) ? "" : sli.Link); proxyAttachment.SetProcessStatus(AttachmentProcessStatus.ProcessStatus_ReplaceWithLink); // The displayname of the first item can change if there is a single link for the collection proxyAttachment.SetDisplayName(string.IsNullOrEmpty(sli.DisplayName) ? "" : sli.DisplayName); } } if (ShouldAttachSendLinkContentFile()) { SendLinkInfo sli = CreateSendLinkContentFile(uploadedFiles, id); global::Interop.Workshare.Client.NotesProxy.Attachment proxyAttachment = new global::Interop.Workshare.Client.NotesProxy.Attachment(); proxyAttachment.SetFileName(sli.FilePath); proxyAttachment.SetDisplayName(sli.DisplayName); proxyAttachment.SetProcessStatus(AttachmentProcessStatus.ProcessStatus_New); proxyAttachment.SetContentId(Guid.NewGuid().ToString("B")); //B = 32 digits separated by hyphens, enclosed in brace proxyAttachment.SetContentItemIndex(-1); // -1 = At end of message mailItem.AddAttachment(proxyAttachment); } }
public DiBusinessLibrary(IDbProvider dbProvider, IProxy proxy, ILoggingComponent logger) { _dbProvider = dbProvider; _proxy = proxy; _logger = logger; }
public void bar() { IProxy proxyObj = Helper.GetProxyInstance(1); proxyObj.Foo(); }
public bool Connect(string address, string name, string password) { if (address == null) throw new ArgumentNullException("address"); if (name == null) throw new ArgumentNullException("name"); if (Version == null) { Log.Default.WriteLine(LogLevels.Error, "Cannot connect, version is not set"); return false; } if (_proxy != null) { Log.Default.WriteLine(LogLevels.Error, "Proxy already created, must disconnect before reconnecting"); return false; } try { _proxy = _factory.CreateProxy(this, address); _proxy.ConnectionLost += OnConnectionLost; Name = name; _proxy.Do(x => x.AdminConnect(Version, name, password)); return true; } catch(Exception ex) { Log.Default.WriteLine(LogLevels.Error, "Problem in Connect. Exception:{0}", ex.ToString()); return false; } }
public virtual void RegisterProxy(IProxy proxy) { model.RegisterProxy(proxy); }
public void RegisterProxy(IProxy proxy) { Model.Instance.RegisterProxy(proxy); }
public OrdersRepository(ICompanyContext ctx, IProxy <ICompanyContext, EF.Example.Order> proxy = null) : base(ctx, proxy) { }
public void setProxy(IProxy proxy) { this.m_proxy = proxy; }
public ClientsRepository(ICompanyContext ctx, IProxy <ICompanyContext, EF.Example.Customer> proxy = null) : base(ctx, proxy) { }
public void disconnect() { if (!m_isConnected) return; Channel.disconnect(this); m_isConnected = false; PortWatcher.delPort(this); ChannelForwardedTCPIP.delPort(this); lock (m_connectThread) { m_connectThread.yield(); m_connectThread.Interrupt(); m_connectThread = null; } m_thread = null; try { if (m_io != null) { if (m_io.m_ins != null) m_io.m_ins.Close(); if (m_io.m_outs != null) m_io.m_outs.Close(); if (m_io.m_outs_ext != null) m_io.m_outs_ext.Close(); } if (m_proxy == null) { if (m_socket != null) m_socket.Close(); } else { lock (m_proxy) { m_proxy.close(); } m_proxy = null; } } catch { } m_io = null; m_socket = null; m_jsch.removeSession(this); }
public ProductsRepository(ICompanyContext ctx, IProxy <ICompanyContext, EF.Example.Product> proxy = null) : base(ctx, proxy) { }
public Features(IProxy client) : base("features", client) { }
public SenderFactory(Client client, IProxy proxy) : base(client, proxy) { }
public void RegisterProxy(IProxy prox) { m_model.RegisterProxy(prox); }
protected BasePresentationService(string instance) { this.proxy = new Proxy(instance); }