Пример #1
0
 public Client(int clientid, string clientname, ClientTypes clienttype, Guid guid)
 {
     Id         = clientid;
     ClientName = clientname;
     ClientType = clienttype;
     ClientGuid = guid;
 }
Пример #2
0
        // 3
        public static T GetUserInfo <T>(ClientTypes provider, string accessToken, string tokenType = null)
            where T : class, new()
        {
            var client = GetClient(provider);

            return(client.GetUserInfo <T>(accessToken, tokenType));
        }
Пример #3
0
 public Clients(ClientTypes businessPartnerType)
 {
     ClientViewModel.Errors = 0;
     InitializeComponent();
     Messenger.Default.Send <ClientTypes>(businessPartnerType);
     Messenger.Reset();
 }
        private async void SaveNewClient()
        {
            _CurrentClient.ClientType = ClientTypes.Where(C => C.Id == _CurrentClient.ClientTypeId).FirstOrDefault();
            await _service.AddClient(_CurrentClient);

            Navigate();
        }
Пример #5
0
        // 1
        public static string RequestAuthenticationTokenUrl(ClientTypes provider, string returnUrl)
        {
            var client = GetClient(provider);
            var url    = client.GetAccessCodeUrl(OAuth2Client.AuthenticationResponseType.Token, returnUrl, null, new Dictionary <string, string>());

            return(url);
        }
Пример #6
0
        public static IVersionControlSystem GetClient(ClientTypes type)
        {
            switch (type)
            {
            case ClientTypes.TortoiseSVN:
                return(TortoiseSVNWrapper.Instance);
            }

            return(null);
        }
Пример #7
0
        public Client(int clientid, string clientname, ClientTypes clienttype, Guid guid, byte[] timestamp)
        {
            Guard.Against.NullOrEmpty(Enum.GetName(typeof(ClientTypes), clienttype), nameof(ClientTypes));

            Id         = clientid;
            ClientName = clientname;
            ClientType = clienttype;
            ClientGuid = guid;
            Timestamp  = timestamp;
        }
Пример #8
0
        public static ClientBase Create(ClientTypes type, ClientAuthorition authorition)
        {
            switch (type)
            {
            case ClientTypes.SSH:
                return(new SSHClient(authorition));

            default:
                throw new NotImplementedException();
            }
        }
Пример #9
0
        public IClient CreateFactory(ClientTypes type, IExceptionService exceptionService)
        {
            switch (type)
            {
            case ClientTypes.SMTP:
                return(new SmtpServiceClient(exceptionService));

            default:
                return(null);
            }
        }
Пример #10
0
        /// <summary>
        /// This method contains the core implementation for generating the GeneratedCode
        /// instance.
        /// </summary>
        /// <remarks>
        /// This method decorates every type found in codeNamespace with a CodeTypeMemberExtension.
        /// And then it sends each type through series of ITypeFilters to figure out whether the type
        /// is a service contract, service type, client type, message contract or data contract.
        /// </remarks>
        private void ParseAndFilterCodeNamespace()
        {
            ITypeFilter dataContractTypeFilter    = new DataContractTypeFilter();
            ITypeFilter messageContractTypeFilter = new MessageContractTypeFilter();
            ITypeFilter serviceContractTypeFilter = new ServiceContractTypeFilter();
            ITypeFilter clientTypeTypeFilter      = new ClientTypeTypeFilter();
            ITypeFilter serviceTypeTypeFilter     = new ServiceTypeTypeFilter();

            for (int i = 0; i < codeNamespace.Types.Count; i++)
            {
                // Take a reference to the current CodeTypeDeclaration.
                CodeTypeDeclaration ctd = codeNamespace.Types[i];
                // Create a new instance of CodeTypeMemberExtension to wrap
                // the current CodeTypeDeclaration.
                CodeTypeExtension typeExtension = new CodeTypeExtension(ctd);

                // Also wrap the inner CodeTypeMember(s)
                ExtendTypeMembers(typeExtension);

                // Here we execute the type filters in the highest to lowest probability order.
                if (dataContractTypeFilter.IsMatching(typeExtension))
                {
                    typeExtension.Kind = CodeTypeKind.DataContract;
                    DataContracts.Add(typeExtension);
                    continue;
                }
                if (messageContractTypeFilter.IsMatching(typeExtension))
                {
                    typeExtension.Kind = CodeTypeKind.MessageContract;
                    MessageContracts.Add(typeExtension);
                    continue;
                }
                if (serviceContractTypeFilter.IsMatching(typeExtension))
                {
                    typeExtension.Kind = CodeTypeKind.ServiceContract;
                    ServiceContracts.Add(typeExtension);
                    continue;
                }
                if (clientTypeTypeFilter.IsMatching(typeExtension))
                {
                    typeExtension.Kind = CodeTypeKind.ClientType;
                    ClientTypes.Add(typeExtension);
                    continue;
                }
                if (serviceTypeTypeFilter.IsMatching(typeExtension))
                {
                    typeExtension.Kind = CodeTypeKind.ServiceType;
                    ServiceTypes.Add(typeExtension);
                    continue;
                }
                UnfilteredTypes.Add(typeExtension);
            }
        }
Пример #11
0
    public static ClientInstance Create(ClientTypes ofClientType)
    {
        IClientInstance clientObject = null;

        switch (ofClientType)
        {
        case ClientInstance.ClientTypes.ClientTypeA:
            clientObject = new ClientClassA() as ClientInstance;

        default:
            break;
        }
        return(clientObject);
    }
Пример #12
0
 public override bool Unpack(NetIncomingMessage message)
 {
     try
     {
         ClientType  = (ClientTypes)message.ReadByte();
         Name        = message.ReadString();
         Credentials = message.ReadString();
     }
     catch (Exception)
     {
         return(false);
     }
     return(true);
 }
Пример #13
0
        private FakeDataBase()
        {
            PublicClientType = new ClientType()
            {
                Id      = 1,
                Wording = ClientTypeName.Public
            };

            ConfidentialClientType = new ClientType()
            {
                Id      = 2,
                Wording = ClientTypeName.Confidential
            };

            ClientTypes.Add(PublicClientType);
            ClientTypes.Add(ConfidentialClientType);
        }
Пример #14
0
        public static void Register(ClientTypes type, ClientConfig config)
        {
            switch (type)
            {
            case ClientTypes.Facebook:
                Clients.Add(new FacebookClient(config));
                break;

            case ClientTypes.Deezer:
                Clients.Add(new DeezerClient(config));
                break;

            case ClientTypes.Dropbox:
                Clients.Add(new DropboxClient(config));
                break;

            case ClientTypes.Google:
                Clients.Add(new GoogleClient(config));
                break;

            case ClientTypes.Instagram:
                Clients.Add(new InstagramClient(config));
                break;

            case ClientTypes.Linkedin:
                Clients.Add(new LinkedInClient(config));
                break;

            case ClientTypes.PayPal:
                Clients.Add(new PayPalClient(config));
                break;

            case ClientTypes.Spotify:
                Clients.Add(new SpotifyClient(config));
                break;

            case ClientTypes.WindowsLive:
                Clients.Add(new WindowsLiveClient(config));
                break;

            case ClientTypes.Yandex:
                Clients.Add(new YandexClient(config));
                break;
            }
        }
Пример #15
0
        public static                en[] ToSupported(ClientTypes clientType, AdSystemTypes adSystemType, bool isLandscape)
        {
            if (clientType == ClientTypes.None)
            {
                return(new en[0]);
            }

            if (clientType == ClientTypes.Web)
            {
                return new en[] { en.InlineRectangle }
            }
            ;

            List <en> items = new List <en>();

            if (adSystemType == AdSystemTypes.Banner)
            {
                if (isLandscape)
                {
                    items.Add(en.MobileBannerLandscape);
                }
                else
                {
                    items.Add(en.Banner);
                }
            }
            else if (adSystemType == AdSystemTypes.Interstitial)
            {
                if (isLandscape)
                {
                    items.Add(en.SmartphoneInterstitialLandscape);
                }
                else
                {
                    items.Add(en.SmartphoneInterstitialPortrait);
                }
            }

            return(items.ToArray());
        }
Пример #16
0
        public static OAuth2Client GetClient(ClientTypes provider)
        {
            var client = Clients.FirstOrDefault(d => d.ProviderName == provider);

            return(client);
        }
Пример #17
0
 public void SetGuest()
 {
     ClientType = ClientTypes.Guest;
 }
Пример #18
0
 public void SetHost()
 {
     ClientType = ClientTypes.Host;
 }
Пример #19
0
        //2
        public static AuthenticationToken GetAuthenticationToken(ClientTypes provider, string returnUrl, string code)
        {
            var client = GetClient(provider);

            return(client.GetAuthenticationToken(code, returnUrl));
        }
Пример #20
0
 public NetworkData(MessageTypes types, string message, ClientTypes clientType)
 {
     MessageType = types;
     Message     = message;
     ClientType  = clientType;
 }
 public Customer(ClientTypes clientType, string name)
 {
     this.ClientType = clientType;
     this.Name       = name;
 }
Пример #22
0
        // 2.5
        public static AuthenticationToken GetRefreshToken(ClientTypes provider, string refreshToken)
        {
            var client = GetClient(provider);

            return(client.GetRefreshToken(refreshToken));
        }
Пример #23
0
 public void SetSystemClientMode()
 {
     ClientType = ClientTypes.ServiceClient;
 }