コード例 #1
0
        private void Initialize()
        {
            var environmentFactory = EnvironmentFactoryFactory.Create();

            _authenticationContext = Substitute.For <IAuthenticationContext>();

            var userOperations = environmentFactory.ManagementEnvironment.MgmtUserOperations;

            _companyOperations = environmentFactory.ManagementEnvironment.MgmtCompanyOperations;
            var settingProvider = new SettingProvider(environmentFactory.ManagementEnvironment.MgmtSettingOperations);
            var userService     = new UserService(userOperations, _authenticationContext, settingProvider, null);

            _userId = userService.Register(new RegisterDto()
            {
                Name = "user", Email = EmailHelper.Generate(), Password = "******"
            }, null);

            _companyService = new CompanyService(_companyOperations, _authenticationContext, null, new CapabilityProvider(settingProvider));

            _authenticationContext.GetContextUser().Returns(_userId);

            _companyId = _companyService.Create("new company");

            _serviceOperations = environmentFactory.ManagementEnvironment.MgmtServiceOperations;
            _serviceService    = new ServiceService(_serviceOperations, _companyOperations, _authenticationContext, null, new CapabilityProvider(settingProvider));
            _serviceId         = _serviceService.Create(new ServiceDto()
            {
                CompanyId = _companyId, Name = "new service"
            });

            _networkOperations = environmentFactory.ManagementEnvironment.MgmtNetworkOperations;
            _networkService    = new NetworkService(_networkOperations, _serviceOperations, _companyOperations, _authenticationContext, null);
        }
コード例 #2
0
        public void TestInitialize()
        {
            queueManager      = Substitute.For <IQueueManagerAsync>();
            view              = Substitute.For <IExplorerView>();
            eventAggregator   = Substitute.For <IEventAggregator>();
            windowManagerEx   = Substitute.For <IWindowManagerEx>();
            networkOperations = Substitute.For <INetworkOperations>();
            explorer          = new QueueExplorerViewModel(queueManager, eventAggregator, windowManagerEx, networkOperations);

            queue    = new Queue("TestQueue");
            subQueue = new Queue("TestQueue.Subscriptions");

            IList <Queue> queues = new List <Queue> {
                queue, subQueue
            };

            queueManager.GetQueues(Arg.Any <string>()).Returns(Task.Run(() => queues));
            queueManager.GetQueues().Returns(Task.Run(() => queues));
            queueManager.GetMessageCount(Arg.Any <Queue>()).Returns(Task.Run(() => queues.Count));
            queueManager.IsMsmqInstalled(Arg.Any <string>()).Returns(Task.Run(() => true));

            AsyncHelper.Run(() => explorer.AttachView(view, null));
            AsyncHelper.Run(() => explorer.ConnectToQueue(Environment.MachineName));

            queueNode = explorer.MachineRoot.Children.OfType <QueueExplorerItem>().First();
        }
コード例 #3
0
ファイル: Pop3Client.cs プロジェクト: rfinochi/pop3dotnet
        internal Pop3Client( INetworkOperations networkOperations )
        {
            if ( networkOperations == null )
                throw new ArgumentNullException( "networkOperations", "The parameter networkOperation can't be null" );

            _networkOperations = networkOperations;
        }
コード例 #4
0
        public void TestInitialize()
        {
            ScreenFactory     = Substitute.For <IScreenFactory>();
            WindowManager     = Substitute.For <IWindowManagerEx>();
            QueueExplorer     = Substitute.For <IQueueExplorerViewModel>();
            EndpointExplorer  = Substitute.For <IEndpointExplorerViewModel>();
            MessageList       = Substitute.For <IMessageListViewModel>();
            NetworkOperations = Substitute.For <INetworkOperations>();
            ExceptionHandler  = Substitute.For <IExceptionHandler>();
            StatusbarManager  = Substitute.For <StatusBarManager>();
            EventAggregator   = Substitute.For <IEventAggregator>();
            MessageFlow       = Substitute.For <IMessageFlowViewModel>();
            MessageBodyView   = Substitute.For <IMessageBodyViewModel>();
            MessageProperties = Substitute.For <IMessagePropertiesViewModel>();
            View               = Substitute.For <IShellViewStub>();
            SettingsProvider   = Substitute.For <ISettingsProvider>();
            LicenseManager     = Substitute.For <ILicenseManager>();
            LogWindow          = Substitute.For <ILogWindowViewModel>();
            ConnectToViewModel = Substitute.For <ConnectToMachineViewModel>(NetworkOperations);
            SettingsProvider.GetSettings <ProfilerSettings>().Returns(DefaultAppSetting());
            App   = Substitute.For <IAppCommands>();
            shell = new ShellViewModel(App, ScreenFactory, WindowManager, QueueExplorer, EndpointExplorer, MessageList,
                                       StatusbarManager, EventAggregator, LicenseManager, MessageFlow, MessageBodyView,
                                       SettingsProvider, MessageProperties, LogWindow);

            ScreenFactory.CreateScreen <ConnectToMachineViewModel>().Returns(ConnectToViewModel);

            shell.AttachView(View, null);
        }
コード例 #5
0
 public NetworkService(INetworkOperations networkOperations, IServiceOperations serviceOperations, ICompanyOperations companyOperations, IAuthenticationContext authenticationContext, ITelemetryDataSinkSetupServiceClient telemetryDataSinkSetupServiceClient) :
     base(companyOperations, authenticationContext)
 {
     _networkOperations = networkOperations;
     _serviceOperations = serviceOperations;
     _telemetryDataSinkSetupServiceClient = telemetryDataSinkSetupServiceClient;
 }
コード例 #6
0
 /// <summary>
 /// Initializes a new instance of the SiteRecoveryManagementClient
 /// class.
 /// </summary>
 /// <param name='httpClient'>
 /// The Http client
 /// </param>
 public SiteRecoveryManagementClient(HttpClient httpClient)
     : base(httpClient)
 {
     this._alertSettings                      = new AlertSettingsOperations(this);
     this._events                             = new EventOperations(this);
     this._fabrics                            = new FabricOperations(this);
     this._jobs                               = new JobOperations(this);
     this._logicalNetwork                     = new LogicalNetworkOperations(this);
     this._networkMapping                     = new NetworkMappingOperations(this);
     this._network                            = new NetworkOperations(this);
     this._policies                           = new PolicyOperations(this);
     this._protectableItem                    = new ProtectableItemOperations(this);
     this._protectionContainerMapping         = new ProtectionContainerMappingOperations(this);
     this._protectionContainer                = new ProtectionContainerOperations(this);
     this._recoveryPlan                       = new RecoveryPlanOperations(this);
     this._recoveryPoint                      = new RecoveryPointOperations(this);
     this._recoveryServicesProvider           = new RecoveryServicesProviderOperations(this);
     this._replicationProtectedItem           = new ReplicationProtectedItemOperations(this);
     this._storageClassificationMapping       = new StorageClassificationMappingOperations(this);
     this._storageClassification              = new StorageClassificationOperations(this);
     this._vCenters                           = new VCenterOperations(this);
     this._apiVersion                         = "2015-01-01";
     this._longRunningOperationInitialTimeout = -1;
     this._longRunningOperationRetryTimeout   = -1;
     this.HttpClient.Timeout                  = TimeSpan.FromSeconds(300);
 }
コード例 #7
0
 /// <summary>
 /// Creates or updates a network resource.
 /// </summary>
 /// <remarks>
 /// Creates a network resource with the specified name, description and
 /// properties. If a network resource with the same name exists, then it is
 /// updated with the specified description and properties.
 /// </remarks>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='resourceGroupName'>
 /// Azure resource group name
 /// </param>
 /// <param name='networkResourceName'>
 /// The identity of the network.
 /// </param>
 /// <param name='networkResourceDescription'>
 /// Description for creating a Network resource.
 /// </param>
 /// <param name='cancellationToken'>
 /// The cancellation token.
 /// </param>
 public static async Task <NetworkResourceDescription> CreateAsync(this INetworkOperations operations, string resourceGroupName, string networkResourceName, NetworkResourceDescription networkResourceDescription, CancellationToken cancellationToken = default(CancellationToken))
 {
     using (var _result = await operations.CreateWithHttpMessagesAsync(resourceGroupName, networkResourceName, networkResourceDescription, null, cancellationToken).ConfigureAwait(false))
     {
         return(_result.Body);
     }
 }
コード例 #8
0
        public void Initialize()
        {
            _networkOperations = Substitute.For<INetworkOperations>();
            _serviceControl = Substitute.For<IServiceControl>();
            _licenseRegistration = Substitute.For<ILicenseRegistrationViewModel>();

            _sut = new AboutViewModel(_networkOperations, _serviceControl, _licenseRegistration);
        }
コード例 #9
0
        public void Initialize()
        {
            _networkOperations   = Substitute.For <INetworkOperations>();
            _serviceControl      = Substitute.For <IServiceControl>();
            _licenseRegistration = Substitute.For <ILicenseRegistrationViewModel>();

            _sut = new AboutViewModel(_networkOperations, _serviceControl, _licenseRegistration);
        }
コード例 #10
0
 public void TestInitialize()
 {
     IList<string> networkMachines = new List<string> { "FirstServer", "SecondServer", Environment.MachineName };
     NetworkOperations = Substitute.For<INetworkOperations>();
     NetworkOperations.GetMachines().Returns(Task.FromResult(networkMachines));
     Conductor = new TestConductorScreen();
     ConnectTo = new ConnectToMachineViewModel(NetworkOperations) { Parent = Conductor };
 }
コード例 #11
0
 public TelemetryDataSinkProcessor(ITelemetryDataSinkSetupServiceClient telemetryDataSinkSetupServiceClient, INetworkOperations networkOperations, IServiceOperations serviceOperations, ICompanyOperations companyOperations, IDynamicConnectionStringResolver dynamicConnectionStringResolver)
 {
     _telemetryDataSinkSetupServiceClient = telemetryDataSinkSetupServiceClient;
     _networkOperations = networkOperations;
     _serviceOperations = serviceOperations;
     _companyOperations = companyOperations;
     _dynamicConnectionStringResolver = dynamicConnectionStringResolver;
 }
コード例 #12
0
 /// <summary>
 /// Abort Virtual Network migration api validates and aborts the given
 /// virtual network for IaaS Classic to ARM migration.
 /// </summary>
 /// <param name='operations'>
 /// Reference to the
 /// Microsoft.WindowsAzure.Management.Network.INetworkOperations.
 /// </param>
 /// <param name='virtualNetworkName'>
 /// Required. Name of the Virtual Network to be migrated.
 /// </param>
 /// <returns>
 /// The response body contains the status of the specified asynchronous
 /// operation, indicating whether it has succeeded, is inprogress, or
 /// has failed. Note that this status is distinct from the HTTP status
 /// code returned for the Get Operation Status operation itself. If
 /// the asynchronous operation succeeded, the response body includes
 /// the HTTP status code for the successful request. If the
 /// asynchronous operation failed, the response body includes the HTTP
 /// status code for the failed request, and also includes error
 /// information regarding the failure.
 /// </returns>
 public static OperationStatusResponse AbortMigration(this INetworkOperations operations, string virtualNetworkName)
 {
     return(Task.Factory.StartNew((object s) =>
     {
         return ((INetworkOperations)s).AbortMigrationAsync(virtualNetworkName);
     }
                                  , operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult());
 }
コード例 #13
0
 /// <summary>
 /// The List Virtual network sites operation retrieves the virtual
 /// networks configured for the subscription.  (see
 /// http://msdn.microsoft.com/en-us/library/windowsazure/jj157185.aspx
 /// for more information)
 /// </summary>
 /// <param name='operations'>
 /// Reference to the
 /// Microsoft.WindowsAzure.Management.Network.INetworkOperations.
 /// </param>
 /// <returns>
 /// The response structure for the Network Operations List operation.
 /// </returns>
 public static NetworkListResponse List(this INetworkOperations operations)
 {
     return(Task.Factory.StartNew((object s) =>
     {
         return ((INetworkOperations)s).ListAsync();
     }
                                  , operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult());
 }
コード例 #14
0
 /// <summary>
 /// The Begin Setting Network Configuration operation asynchronously
 /// configures the virtual network.  (see
 /// http://msdn.microsoft.com/en-us/library/windowsazure/jj157181.aspx
 /// for more information)
 /// </summary>
 /// <param name='operations'>
 /// Reference to the
 /// Microsoft.WindowsAzure.Management.Network.INetworkOperations.
 /// </param>
 /// <param name='parameters'>
 /// Required. Parameters supplied to the Set Network Configuration
 /// operation.
 /// </param>
 /// <returns>
 /// A standard service response including an HTTP status code and
 /// request ID.
 /// </returns>
 public static OperationResponse BeginSettingConfiguration(this INetworkOperations operations, NetworkSetConfigurationParameters parameters)
 {
     return(Task.Factory.StartNew((object s) =>
     {
         return ((INetworkOperations)s).BeginSettingConfigurationAsync(parameters);
     }
                                  , operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult());
 }
コード例 #15
0
 public DeviceService(IDeviceOperations deviceOperations, INetworkOperations networkOperations, IServiceOperations serviceOperations, ICompanyOperations companyOperations, IAuthenticationContext authenticationContext, IMessagingServiceClient messagingServiceClient) :
     base(companyOperations, authenticationContext)
 {
     _deviceOperations       = deviceOperations;
     _networkOperations      = networkOperations;
     _serviceOperations      = serviceOperations;
     _messagingServiceClient = messagingServiceClient;
 }
 /// <summary>
 /// Get list of Networks.
 /// </summary>
 /// <param name='operations'>
 /// Reference to the
 /// Microsoft.Azure.Management.SiteRecovery.INetworkOperations.
 /// </param>
 /// <param name='customRequestHeaders'>
 /// Optional. Request header parameters.
 /// </param>
 /// <returns>
 /// The response model for the list of Networks.
 /// </returns>
 public static NetworksListResponse GetAll(this INetworkOperations operations, CustomRequestHeaders customRequestHeaders)
 {
     return(Task.Factory.StartNew((object s) =>
     {
         return ((INetworkOperations)s).GetAllAsync(customRequestHeaders);
     }
                                  , operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult());
 }
コード例 #17
0
 public LicenseRegistrationViewModel(
     AppLicenseManager licenseManager,
     IDialogManager dialogManager,
     INetworkOperations network)
 {
     this.licenseManager = licenseManager;
     _dialogManager      = dialogManager;
     _network            = network;
 }
コード例 #18
0
 public TelemetryDataSinkResolver(IDeviceOperations deviceOperations, INetworkOperations networkOperations, IServiceOperations serviceOperations, ICompanyOperations companyOperations, ITelemetryDataSinkMetadataRegistry telemetryDataSinkMetadataRegistry, IDynamicConnectionStringResolver dynamicConnectionStringResolver)
 {
     _deviceOperations  = deviceOperations;
     _networkOperations = networkOperations;
     _serviceOperations = serviceOperations;
     _companyOperations = companyOperations;
     _telemetryDataSinkMetadataRegistry = telemetryDataSinkMetadataRegistry;
     _dynamicConnectionStringResolver   = dynamicConnectionStringResolver;
 }
コード例 #19
0
 public LicenseRegistrationViewModel(
     ILicenseManager licenseManager, 
     IDialogManager dialogManager,
     INetworkOperations network)
 {
     _licenseManager = licenseManager;
     _dialogManager = dialogManager;
     _network = network;
 }
コード例 #20
0
ファイル: Pop3Client.cs プロジェクト: kenegozi/pop3dotnet
        internal Pop3Client(INetworkOperations networkOperations)
        {
            if (networkOperations == null)
            {
                throw new ArgumentNullException("networkOperations", "The parameter networkOperation can't be null");
            }

            _networkOperations = networkOperations;
        }
コード例 #21
0
 public void TestInitialize()
 {
     IList<string> machines = new List<string> { Environment.MachineName, "AnotherMachine" };
     QueueManager = Substitute.For<IQueueManagerAsync>();
     Explorer = Substitute.For<IQueueExplorerViewModel>();
     Network = Substitute.For<INetworkOperations>();
     Model = new Desktop.Shell.QueueCreationViewModel(QueueManager, Explorer, Network);
     Network.GetMachines().Returns(Task.FromResult(machines));
 }
コード例 #22
0
 /// <summary>
 /// Initializes a new instance of the VirtualNetworkManagementClient
 /// class.
 /// </summary>
 private VirtualNetworkManagementClient()
     : base()
 {
     this._clientRootCertificates = new ClientRootCertificateOperations(this);
     this._gateways          = new GatewayOperations(this);
     this._networks          = new NetworkOperations(this);
     this._reservedIPs       = new ReservedIPOperations(this);
     this._staticIPs         = new StaticIPOperations(this);
     this.HttpClient.Timeout = TimeSpan.FromSeconds(300);
 }
コード例 #23
0
 /// <summary>
 /// Initializes a new instance of the <see cref="DataOperations" /> class.
 /// </summary>
 /// <param name="logger">The logger.</param>
 /// <param name="networkOps">The network ops.</param>
 /// <param name="view">The view.</param>
 protected DataOperations(IGenericLogger logger, INetworkOperations networkOps, UserControl view = null)
 {
     Logger     = logger;
     NetworkOps = networkOps;
     Renderer   = new Renderer()
     {
         View = view
     };
     InitializeDb();
 }
コード例 #24
0
ファイル: AboutViewModel.cs プロジェクト: 4lx/Profiler
 public AboutViewModel(INetworkOperations networkOperations)
 {
     _networkOperations = networkOperations;
     DisplayName        = "About";
     _assembly          = GetType().Assembly;
     _copyright         = _assembly.GetAttribute <AssemblyCopyrightAttribute>();
     _title             = _assembly.GetAttribute <AssemblyTitleAttribute>();
     _version           = _assembly.GetAttribute <AssemblyInformationalVersionAttribute>();
     _support           = _assembly.GetAttribute <SupportWebUrlAttribute>();
 }
コード例 #25
0
 public AboutViewModel(
     INetworkOperations networkOperations, 
     IServiceControl serviceControl,
     ILicenseRegistrationViewModel licenseInfo)
 {
     _networkOperations = networkOperations;
     _serviceControl = serviceControl;
     
     License = licenseInfo;
     IsSplash = false;
 }
コード例 #26
0
 public AboutViewModel(
     INetworkOperations networkOperations, 
     IManagementService managementService,
     ILicenseRegistrationViewModel licenseInfo)
 {
     _networkOperations = networkOperations;
     _managementService = managementService;
     
     License = licenseInfo;
     DisplayName = "About";
 }
コード例 #27
0
        public AboutViewModel(
            INetworkOperations networkOperations,
            IServiceControl serviceControl,
            ILicenseRegistrationViewModel licenseInfo)
        {
            _networkOperations = networkOperations;
            _serviceControl    = serviceControl;

            License  = licenseInfo;
            IsSplash = false;
        }
コード例 #28
0
 public QueueCreationViewModel(
     IQueueManagerAsync queueManager, 
     IQueueExplorerViewModel explorer,
     INetworkOperations networkOperations)
 {
     _queueManager = queueManager;
     _explorer = explorer;
     _networkOperations = networkOperations;
     Machines = new List<string>();
     DisplayName = "Queue";
     IsTransactional = true;
 }
コード例 #29
0
ファイル: Pop3Client.cs プロジェクト: kenegozi/pop3dotnet
 protected virtual void Dispose(bool disposing)
 {
     if (disposing)
     {
         if (_networkOperations != null)
         {
             _networkOperations.Close( );
             _networkOperations.Dispose( );
             _networkOperations = null;
         }
     }
 }
コード例 #30
0
 public QueueCreationViewModel(
     IQueueManager queueManager,
     IExplorerViewModel explorer,
     INetworkOperations networkOperations)
 {
     _queueManager      = queueManager;
     _explorer          = explorer;
     _networkOperations = networkOperations;
     Machines           = new List <string>();
     DisplayName        = "Queue";
     IsTransactional    = true;
 }
コード例 #31
0
        public void TestInitialize()
        {
            IList <string> machines = new List <string> {
                Environment.MachineName, "AnotherMachine"
            };

            QueueManager = Substitute.For <IQueueManagerAsync>();
            Explorer     = Substitute.For <IQueueExplorerViewModel>();
            Network      = Substitute.For <INetworkOperations>();
            Model        = new Desktop.Shell.QueueCreationViewModel(QueueManager, Explorer, Network);
            Network.GetMachines().Returns(Task.FromResult(machines));
        }
コード例 #32
0
 public QueueExplorerViewModel(
     IQueueManagerAsync queueManager,
     IEventAggregator eventAggregator,
     IWindowManagerEx windowManager,
     INetworkOperations networkOperations)
 {
     _queueManager = queueManager;
     _eventAggregator = eventAggregator;
     _windowManager = windowManager;
     _networkOperations = networkOperations;
     Items = new BindableCollection<ExplorerItem>();
     IsMSMQInstalled = true;
 }
コード例 #33
0
 public QueueExplorerViewModel(
     IQueueManagerAsync queueManager,
     IEventAggregator eventAggregator,
     IWindowManagerEx windowManager,
     INetworkOperations networkOperations)
 {
     _queueManager      = queueManager;
     _eventAggregator   = eventAggregator;
     _windowManager     = windowManager;
     _networkOperations = networkOperations;
     Items           = new BindableCollection <ExplorerItem>();
     IsMSMQInstalled = true;
 }
コード例 #34
0
 /// <summary>
 /// Initializes a new instance of the NetworkManagementClient class.
 /// </summary>
 /// <param name='httpClient'>
 /// The Http client
 /// </param>
 private NetworkManagementClient(HttpClient httpClient)
     : base(httpClient)
 {
     this._clientRootCertificates = new ClientRootCertificateOperations(this);
     this._gateways    = new GatewayOperations(this);
     this._networks    = new NetworkOperations(this);
     this._reservedIPs = new ReservedIPOperations(this);
     this._staticIPs   = new StaticIPOperations(this);
     this._apiVersion  = "2014-05-01";
     this._longRunningOperationInitialTimeout = -1;
     this._longRunningOperationRetryTimeout   = -1;
     this.HttpClient.Timeout = TimeSpan.FromSeconds(300);
 }
コード例 #35
0
 public EndpointExplorerViewModel(
     IEventAggregator eventAggregator,
     ISettingsProvider settingsProvider,
     IServiceControlConnectionProvider connectionProvider,
     IServiceControl serviceControl,
     INetworkOperations networkOperations)
 {
     _eventAggregator    = eventAggregator;
     _settingsProvider   = settingsProvider;
     _serviceControl     = serviceControl;
     _networkOperations  = networkOperations;
     _connectionProvider = connectionProvider;
     Items = new BindableCollection <ExplorerItem>();
 }
コード例 #36
0
 public EndpointExplorerViewModel(
     IEventAggregator eventAggregator, 
     ISettingsProvider settingsProvider,
     IManagementConnectionProvider managementConnection,
     IManagementService managementService,
     INetworkOperations networkOperations)
 {
     _eventAggregator = eventAggregator;
     _settingsProvider = settingsProvider;
     _managementService = managementService;
     _networkOperations = networkOperations;
     _managementConnection = managementConnection;
     Items = new BindableCollection<ExplorerItem>();
 }
コード例 #37
0
        public void TestInitialize()
        {
            IList <string> networkMachines = new List <string> {
                "FirstServer", "SecondServer", Environment.MachineName
            };

            NetworkOperations = Substitute.For <INetworkOperations>();
            NetworkOperations.GetMachines().Returns(Task.FromResult(networkMachines));
            Conductor = new TestConductorScreen();
            ConnectTo = new ConnectToMachineViewModel(NetworkOperations)
            {
                Parent = Conductor
            };
        }
コード例 #38
0
 public EndpointExplorerViewModel(
     IEventAggregator eventAggregator, 
     ISettingsProvider settingsProvider,
     IServiceControlConnectionProvider connectionProvider,
     IServiceControl serviceControl,
     INetworkOperations networkOperations)
 {
     _eventAggregator = eventAggregator;
     _settingsProvider = settingsProvider;
     _serviceControl = serviceControl;
     _networkOperations = networkOperations;
     _connectionProvider = connectionProvider;
     Items = new BindableCollection<ExplorerItem>();
 }
コード例 #39
0
 /// <summary>
 /// Initializes a new instance of the NetworkManagementClient class.
 /// </summary>
 public NetworkManagementClient()
     : base()
 {
     this._applicationGateways    = new ApplicationGatewayOperations(this);
     this._clientRootCertificates = new ClientRootCertificateOperations(this);
     this._gateways = new GatewayOperations(this);
     this._networks = new NetworkOperations(this);
     this._networkSecurityGroups = new NetworkSecurityGroupOperations(this);
     this._reservedIPs           = new ReservedIPOperations(this);
     this._routes     = new RouteOperations(this);
     this._staticIPs  = new StaticIPOperations(this);
     this._apiVersion = "2014-10-01";
     this._longRunningOperationInitialTimeout = -1;
     this._longRunningOperationRetryTimeout   = -1;
     this.HttpClient.Timeout = TimeSpan.FromSeconds(300);
 }
コード例 #40
0
 /// <summary>
 /// The Set Network Configuration operation asynchronously configures
 /// the virtual network  (see
 /// http://msdn.microsoft.com/en-us/library/windowsazure/jj157181.aspx
 /// for more information)
 /// </summary>
 /// <param name='operations'>
 /// Reference to the
 /// Microsoft.WindowsAzure.Management.Network.INetworkOperations.
 /// </param>
 /// <param name='parameters'>
 /// The updated network configuration.
 /// </param>
 /// <returns>
 /// A standard storage response including an HTTP status code and
 /// request ID.
 /// </returns>
 public static OperationResponse BeginSettingConfiguration(this INetworkOperations operations, NetworkSetConfigurationParameters parameters)
 {
     try
     {
         return(operations.BeginSettingConfigurationAsync(parameters).Result);
     }
     catch (AggregateException ex)
     {
         if (ex.InnerExceptions.Count > 1)
         {
             throw;
         }
         else
         {
             throw ex.InnerException;
         }
     }
 }
コード例 #41
0
 /// <summary>
 /// The List Virtual network sites operation retrieves the virtual
 /// networks configured for the subscription.  (see
 /// http://msdn.microsoft.com/en-us/library/windowsazure/jj157185.aspx
 /// for more information)
 /// </summary>
 /// <param name='operations'>
 /// Reference to the
 /// Microsoft.WindowsAzure.Management.Network.INetworkOperations.
 /// </param>
 /// <returns>
 /// The response structure for the Server List operation.
 /// </returns>
 public static NetworkListResponse List(this INetworkOperations operations)
 {
     try
     {
         return(operations.ListAsync().Result);
     }
     catch (AggregateException ex)
     {
         if (ex.InnerExceptions.Count > 1)
         {
             throw;
         }
         else
         {
             throw ex.InnerException;
         }
     }
 }
コード例 #42
0
ファイル: Pop3Client.cs プロジェクト: rfinochi/pop3dotnet
 public InternalPop3Client( )
 {
     _networkOperations = new StreamSocketNetworkOperations( );
 }
コード例 #43
0
        public void TestInitialize()
        {
            queueManager = Substitute.For<IQueueManagerAsync>();
            view = Substitute.For<IExplorerView>();
            eventAggregator = Substitute.For<IEventAggregator>();
            windowManagerEx = Substitute.For<IWindowManagerEx>();
            networkOperations = Substitute.For<INetworkOperations>();
            explorer = new QueueExplorerViewModel(queueManager, eventAggregator, windowManagerEx, networkOperations);

            queue = new Queue("TestQueue");
            subQueue = new Queue("TestQueue.Subscriptions");

            IList<Queue> queues = new List<Queue> { queue, subQueue };
            queueManager.GetQueues(Arg.Any<string>()).Returns(Task.Run(() => queues));
            queueManager.GetQueues().Returns(Task.Run(() => queues));
            queueManager.GetMessageCount(Arg.Any<Queue>()).Returns(Task.Run(() => queues.Count));
            queueManager.IsMsmqInstalled(Arg.Any<string>()).Returns(Task.Run(() => true));

            AsyncHelper.Run(() => explorer.AttachView(view, null));
            AsyncHelper.Run(() => explorer.ConnectToQueue(Environment.MachineName));

            queueNode = explorer.MachineRoot.Children.OfType<QueueExplorerItem>().First();
        }
コード例 #44
0
        public void TestInitialize()
        {
            ScreenFactory = Substitute.For<IScreenFactory>();
            WindowManager = Substitute.For<IWindowManagerEx>();
            QueueExplorer = Substitute.For<IQueueExplorerViewModel>();
            EndpointExplorer = Substitute.For<IEndpointExplorerViewModel>();
            MessageList = Substitute.For<IMessageListViewModel>();
            NetworkOperations = Substitute.For<INetworkOperations>();
            ExceptionHandler = Substitute.For<IExceptionHandler>();
            StatusbarManager = Substitute.For<StatusBarManager>();
            EventAggregator = Substitute.For<IEventAggregator>();
            MessageFlow = Substitute.For<IMessageFlowViewModel>();
            MessageBodyView = Substitute.For<IMessageBodyViewModel>();
            MessageProperties = Substitute.For<IMessagePropertiesViewModel>();
            View = Substitute.For<IShellViewStub>();
            SettingsProvider = Substitute.For<ISettingsProvider>();
            LicenseManager = Substitute.For<ILicenseManager>();
            LogWindow = Substitute.For<ILogWindowViewModel>();
            ConnectToViewModel = Substitute.For<ConnectToMachineViewModel>(NetworkOperations);
            SettingsProvider.GetSettings<ProfilerSettings>().Returns(DefaultAppSetting());
            App = Substitute.For<IAppCommands>();
            shell = new ShellViewModel(App, ScreenFactory, WindowManager, QueueExplorer, EndpointExplorer, MessageList,
                                       StatusbarManager, EventAggregator, LicenseManager, MessageFlow, MessageBodyView,
                                       SettingsProvider, MessageProperties, LogWindow);

            ScreenFactory.CreateScreen<ConnectToMachineViewModel>().Returns(ConnectToViewModel);

            shell.AttachView(View, null);
        }
コード例 #45
0
ファイル: Pop3Client.cs プロジェクト: rfinochi/pop3dotnet
        protected virtual void Dispose( bool disposing )
        {
            if ( disposing )
            {
                if ( _networkOperations != null )
                {
                    _networkOperations.Close( );
                    _networkOperations.Dispose( );
                    _networkOperations = null;
                }
            }

        }
コード例 #46
0
ファイル: Pop3Client.cs プロジェクト: rfinochi/pop3dotnet
 public Pop3Client( )
 {
     _networkOperations = new TcpClientNetworkOperations( );
 }
コード例 #47
0
 public ConnectToMachineViewModel(INetworkOperations networkOperations)
 {
     _networkOperations = networkOperations;
     Machines = new List<string>();
     DisplayName = "Connect To Queue";
 }