private void SetContextOption(ContextOption option, int value) { if (_contextProxy.SetContextOption((int)option, value) == -1) { throw new ZmqException(ErrorProxy.GetLastError()); } }
public static void CtxSet(Ctx ctx, ContextOption option, int optval) { if (ctx == null || !ctx.CheckTag()) { throw NetMQException.Create(ErrorCode.EFAULT); } ctx.Set(option, optval); }
public static int CtxGet(Ctx ctx, ContextOption option) { if (ctx == null || !ctx.CheckTag()) { throw NetMQException.Create(ErrorCode.EFAULT); } return(ctx.Get(option)); }
/// <summary> /// Return either the max-sockets or the I/O-thread-count, depending upon which ContextOption is indicated. /// </summary> /// <param name="option">this determines which of the two properties to get</param> public int Get(ContextOption option) { if (option == ContextOption.MaxSockets) { return(m_maxSockets); } if (option == ContextOption.IOThreads) { return(m_ioThreadCount); } throw new InvalidException(String.Format("In Ctx.Get({0}), option must be MaxSockets or IOThreads.", option)); }
// public methods... #region PropagateChoiceToParents public void PropagateChoiceToParents() { if (_Parent != null) { ContextOption lSaveParentChoice = _Parent.Choice; ContextOption lNewParentChoice = _Parent.CalculateState(); if (lNewParentChoice != lSaveParentChoice) { _Parent.PropagateChoiceToParents(); } } }
public int Get(ContextOption option) { if (option == ContextOption.MaxSockets) { return(m_maxSockets); } else if (option == ContextOption.IOThreads) { return(m_ioThreadCount); } else { throw new InvalidException("option = " + option); } }
public int Get(ContextOption option) { int rc = 0; if (option == ContextOption.MaxSockets) { rc = m_maxSockets; } else if (option == ContextOption.IOThreads) { rc = m_ioThreadCount; } else { throw InvalidException.Create("option = " + option); } return(rc); }
/// <summary> /// Set either the max-sockets or the I/O-thread-count, depending upon which ContextOption is indicated. /// </summary> /// <param name="option">this determines which of the two properties to set</param> /// <param name="optionValue">the value to assign to that property</param> public void Set(ContextOption option, int optionValue) { if (option == ContextOption.MaxSockets && optionValue >= 1) { lock (m_optSync) { m_maxSockets = optionValue; } } else if (option == ContextOption.IOThreads && optionValue >= 0) { lock (m_optSync) { m_ioThreadCount = optionValue; } } else { throw new InvalidException(String.Format("In Ctx.Set({0}, {1}), option must be MaxSockets or IOThreads, and optionValue >= 1 or 0.", option, optionValue)); } }
public ContextOption CalculateState() { bool firstTime = true; _Choice = ContextOption.Ignored; foreach (ContextEntry contextEntry in _SubContext) { if (firstTime) { firstTime = false; _Choice = contextEntry.Choice; } else if (_Choice != contextEntry.Choice) { _Choice = ContextOption.Mixed; break; } } return(_Choice); }
public void Set(ContextOption option, int optval) { if (option == ContextOption.MaxSockets && optval >= 1) { lock (m_optSync) { m_maxSockets = optval; } } else if (option == ContextOption.IOThreads && optval >= 0) { lock (m_optSync) { m_ioThreadCount = optval; } } else { throw new InvalidException("option = " + option); } }
/// <summary> /// /// </summary> /// <param name="httpContext"></param> /// <param name="option"></param> /// <param name="siteCollectionUrl"></param> private void ExecuteConstructor(HttpContext httpContext, ContextOption option, string siteCollectionUrl = null) { this.SharePointClientCtx = null; try { switch (option) { case ContextOption.OneListGuid: if (!string.IsNullOrWhiteSpace(siteCollectionUrl)) { this.SharePointClientCtx = this.StartObjectVariables(httpContext, siteCollectionUrl); this.ListContext = this.SharePointClientCtx.Web.Lists.GetById(this.ListGuid); } else { this.SharePointClientCtx = this.StartObjectVariables(httpContext); this.ListContext = this.SharePointClientCtx.Web.Lists.GetById(this.ListGuid); } break; case ContextOption.MultipleListsGuids: if (!string.IsNullOrWhiteSpace(siteCollectionUrl)) { this.SharePointClientCtx = this.StartObjectVariables(httpContext, siteCollectionUrl); this.ListsContext = new Dictionary <string, List>(); this.ListsContext = this.ContextingLists(this.SharePointClientCtx.Web, this.ListGuids).ToDictionary(x => x.Key, x => x.Value); } else { this.SharePointClientCtx = this.StartObjectVariables(httpContext); this.ListsContext = new Dictionary <string, List>(); this.ListsContext = this.ContextingLists(this.SharePointClientCtx.Web, this.ListGuids).ToDictionary(x => x.Key, x => x.Value); } break; case ContextOption.OneListName: if (!string.IsNullOrWhiteSpace(siteCollectionUrl)) { this.SharePointClientCtx = this.StartObjectVariables(httpContext, siteCollectionUrl, this.ListName); this.ListContext = this.SharePointClientCtx.Web.Lists.GetByTitle(this.ListName); } else { this.SharePointClientCtx = this.StartObjectVariables(httpContext); this.ListContext = this.SharePointClientCtx.Web.Lists.GetByTitle(this.ListName); } break; case ContextOption.MultipleListsNames: if (!string.IsNullOrWhiteSpace(siteCollectionUrl)) { this.SharePointClientCtx = this.StartObjectVariables(httpContext, siteCollectionUrl); this.ListsContext = new Dictionary <string, List>(); this.ListsContext = this.ContextingLists(this.SharePointClientCtx.Web, this.ListNames).ToDictionary(x => x.Key, x => x.Value); } else { this.SharePointClientCtx = this.StartObjectVariables(httpContext); this.ListsContext = new Dictionary <string, List>(); this.ListsContext = this.ContextingLists(this.SharePointClientCtx.Web, this.ListNames).ToDictionary(x => x.Key, x => x.Value); } break; } } catch (Exception ex) { throw new Exception("Ocorreu algum durante a rotina de autenticaĆ§Ć£o ao SharePoint.", ex); } }
public static int CtxGet(Ctx ctx, ContextOption option) { if (ctx == null || !ctx.CheckTag()) { throw NetMQException.Create(ErrorCode.EFAULT); } return ctx.Get(option); }
public static void CtxSet(Ctx ctx, ContextOption option, int optval) { if (ctx == null || !ctx.CheckTag()) { throw NetMQException.Create(ErrorCode.EFAULT); } ctx.Set(option, optval); }
public static int CtxGet(Ctx ctx, ContextOption option) { if (ctx == null || !ctx.CheckTag()) { throw new InvalidOperationException(); } return ctx.Get(option); }
public static extern Result zmq_ctx_set(this context context, ContextOption option, int optval);
public void Set(ContextOption option, int optval) { if (option == ContextOption.MaxSockets && optval >= 1) { lock (m_optSync) { m_maxSockets = optval; } } else if (option == ContextOption.IOThreads && optval >= 0) { lock (m_optSync) { m_ioThreadCount = optval; } } else { throw new ArgumentException("option = " + option); } }
public int Get(ContextOption option) { int rc = 0; if (option == ContextOption.MaxSockets) rc = m_maxSockets; else if (option == ContextOption.IOThreads) rc = m_ioThreadCount; else { throw new ArgumentException("option = " + option); } return rc; }
public int Get(ContextOption option) { int rc = 0; if (option == ContextOption.MaxSockets) rc = m_maxSockets; else if (option == ContextOption.IOThreads) rc = m_ioThreadCount; else { throw InvalidException.Create("option = " + option); } return rc; }
/// <summary> /// Return either the max-sockets or the I/O-thread-count, depending upon which ContextOption is indicated. /// </summary> /// <param name="option">this determines which of the two properties to get</param> /// <exception cref="InvalidException">option must be MaxSockets or IOThreads.</exception> public int Get(ContextOption option) { if (option == ContextOption.MaxSockets) return m_maxSockets; if (option == ContextOption.IOThreads) return m_ioThreadCount; throw new InvalidException(string.Format("In Ctx.Get({0}), option must be MaxSockets or IOThreads.", option)); }
/// <summary> /// Set either the max-sockets or the I/O-thread-count, depending upon which ContextOption is indicated. /// </summary> /// <param name="option">this determines which of the two properties to set</param> /// <param name="optionValue">the value to assign to that property</param> /// <exception cref="InvalidException">option must be MaxSockets with optionValue >= 1, or IOThreads with optionValue >= 0.</exception> public void Set(ContextOption option, int optionValue) { if (option == ContextOption.MaxSockets && optionValue >= 1) { lock (m_optSync) { m_maxSockets = optionValue; } } else if (option == ContextOption.IOThreads && optionValue >= 0) { lock (m_optSync) { m_ioThreadCount = optionValue; } } else { throw new InvalidException(string.Format("In Ctx.Set({0}, {1}), option must be MaxSockets with optionValue >= 1, or IOThreads with optionValue >= 0.", option, optionValue)); } }
public static extern int zmq_ctx_get(this context context, ContextOption option);
public static void CtxSet(Ctx ctx, ContextOption option, int optval) { if (ctx == null || !ctx.CheckTag()) { throw new InvalidOperationException(); } ctx.Set(option, optval); }