Exemplo n.º 1
0
        /// <summary>
        /// Finds a visual analysis mode by guid.
        /// </summary>
        /// <param name="id">The globally unique identifier to search for.</param>
        /// <returns>The found visual analysis mode, or null if it was not found, or on error.</returns>
        public static VisualAnalysisMode Find(Guid id)
        {
            VisualAnalysisMode rc = FindLocal(id);

            if (rc != null)
            {
                return(rc);
            }

            IntPtr pMode = UnsafeNativeMethods.CRhinoVisualAnalysisMode_Mode(id);

            if (pMode != IntPtr.Zero)
            {
                if (m_registered_modes == null)
                {
                    m_registered_modes = new System.Collections.Generic.List <VisualAnalysisMode>();
                }
                var native = new NativeVisualAnalysisMode(id);
                m_registered_modes.Add(native);
                return(native);
            }
            return(null);
        }
    /// <summary>
    /// Finds a visual analysis mode by guid.
    /// </summary>
    /// <param name="id">The globally unique identifier to search for.</param>
    /// <returns>The found visual analysis mode, or null if it was not found, or on error.</returns>
    public static VisualAnalysisMode Find(Guid id)
    {
      VisualAnalysisMode rc = FindLocal(id);
      if (rc != null)
        return rc;

      IntPtr pMode = UnsafeNativeMethods.CRhinoVisualAnalysisMode_Mode(id);
      if (pMode != IntPtr.Zero)
      {
        if (m_registered_modes == null)
          m_registered_modes = new System.Collections.Generic.List<VisualAnalysisMode>();
        var native = new NativeVisualAnalysisMode(id);
        m_registered_modes.Add(native);
        return native;
      }
      return null;
    }