Exemplo n.º 1
0
        /// <summary>
        /// <see cref="MFilesServerApplication"/>.Connect() extension method that accepts a class type that is decorated with a <see cref="MFServerAttribute"/>.
        /// </summary>
        /// <param name="sa"><see cref="MFilesServerApplication"/> instance</param>
        /// <param name="decoratedType"><see cref="Type"/> of the class with the connection info decorations</param>
        /// <returns><see cref="MFServerAttribute"/></returns>
        public static MFServerAttribute Connect(this MFilesServerApplication sa, Type decoratedType)
        {
            MFServerAttribute serverInfo = (MFServerAttribute)Attribute.GetCustomAttribute(decoratedType, typeof(MFServerAttribute));

            sa.Connect(serverInfo);

            return(serverInfo);
        }
Exemplo n.º 2
0
        /// <summary>
        /// <see cref="MFilesServerApplication"/>.Connect() extension method that accepts a class type that is decorated with the MFVaultConnectionAttribute attribute.
        /// </summary>
        /// <param name="sa"><see cref="MFilesServerApplication"/> instance</param>
        /// <param name="serverInfo"><see cref="MFServerAttribute"/> server connection info.</param>
        public static void Connect(this MFilesServerApplication sa, MFServerAttribute serverInfo)
        {
            // Test the connection to the server.
            int ms = sa.TestConnectionToServer(serverInfo.NetworkAddress, serverInfo.Endpoint, serverInfo.ProtocolSequence);

            sa.Connect(
                serverInfo.AuthType,
                serverInfo.UserName,
                serverInfo.Password,
                serverInfo.Domain,
                serverInfo.ProtocolSequence,
                serverInfo.NetworkAddress,
                serverInfo.Endpoint,
                serverInfo.LocalComputerName,
                serverInfo.AllowAnonymousConnection
                );
        }