Example #1
0
        public PackagerView()
        {
            InitializeComponent();

            FetchPackages(Folder.Text);

            UpdateUsagesMenuItem.Click         += UpdateUsages;
            MarkUsagesMenuItem.Click           += (sender, e) => { FindUsages(true); };
            ShowUsagesMenuItem.Click           += (sender, e) => { FindUsages(false); };
            ShowLogMenuItem.Click              += ShowLog;
            OpenMenuItem.Click                 += Open;
            GitHubMenuItem.Click               += GitHub;
            RemoveFromNugetCacheMenuItem.Click += RemoveFromNugetCache;

            _msbuildPath = ConfigurationItem <string> .ReadSetting("MSBuildPath").GetValue();

            if (!_msbuildPath.ToLower().EndsWith("msbuild.exe"))
            {
                _msbuildPath = Path.Combine(_msbuildPath, "MSBuild.exe");
            }

            var doubleBuffered =
                typeof(Control).GetProperty(
                    "DoubleBuffered",
                    BindingFlags.NonPublic |
                    BindingFlags.Instance);

            if (doubleBuffered != null)
            {
                doubleBuffered.SetValue(BuildLog, true, null);
            }
        }
        public void Initialize(IServiceBus bus)
        {
            Guard.AgainstNull(bus, "bus");

            _corruptTransportMessageFolder = ConfigurationItem <string> .ReadSetting("CorruptTransportMessageFolder").GetValue();

            bus.Events.TransportMessageDeserializationException += OnTransportMessageDeserializationException;
        }
Example #3
0
        public EMailConfiguration()
        {
            attachmentFolder = ConfigurationItem <string> .ReadSetting("AttachmentFolder");

            if (!Directory.Exists(AttachmentFolder))
            {
                var message = string.Format("Attachment folder '{0}' does not exist.", AttachmentFolder);

                Log.Error(message);

                throw new DirectoryNotFoundException(message);
            }
        }
        public MsmqQueue(Uri uri, bool isTransactional)
        {
            Guard.AgainstNull(uri, "uri");

            if (!uri.Scheme.Equals(SCHEME, StringComparison.InvariantCultureIgnoreCase))
            {
                throw new InvalidSchemeException(SCHEME, uri.ToString());
            }

            localQueueTimeout = ConfigurationItem <int> .ReadSetting("LocalQueueTimeout", 0);

            remoteQueueTimeout = ConfigurationItem <int> .ReadSetting("RemoteQueueTimeout", 2000);

            log = Log.For(this);

            var builder = new UriBuilder(uri);

            host = uri.Host;

            if (host.Equals("."))
            {
                builder.Host = Environment.MachineName.ToLower();
            }

            if (uri.LocalPath == "/")
            {
                throw new UriFormatException(string.Format(ESBResources.UriFormatException, "msmq://{{host-name}}/{{queue-name}}",
                                                           uri));
            }

            Uri = builder.Uri;

            IsLocal = Uri.Host.Equals(Environment.MachineName, StringComparison.InvariantCultureIgnoreCase);

            IsTransactional = isTransactional;
            usesIPAddress   = regexIPAddress.IsMatch(host);

            path = IsLocal
                                       ? string.Format(@"{0}\private$\{1}", host, uri.Segments[1])
                                       : usesIPAddress
                                                 ? string.Format(@"FormatName:DIRECT=TCP:{0}\private$\{1}", host, uri.Segments[1])
                                                 : string.Format(@"FormatName:DIRECT=OS:{0}\private$\{1}", host, uri.Segments[1]);

            timeout = IsLocal
                                          ? TimeSpan.FromMilliseconds(localQueueTimeout.GetValue())
                                          : TimeSpan.FromMilliseconds(remoteQueueTimeout.GetValue());
        }
Example #5
0
        public RabbitMqQueue(RabbitMqConnector connector)
        {
            _connector         = connector;
            _localQueueTimeout = ConfigurationItem <int> .ReadSetting("LocalQueueTimeout", 0);

            _remoteQueueTimeout = ConfigurationItem <int> .ReadSetting("RemoteQueueTimeout", 2000);

            _log = Log.For(this);

            IsLocal         = connector.QueuePath.Host.Equals(Environment.MachineName, StringComparison.InvariantCultureIgnoreCase);
            IsTransactional = connector.QueueConfiguration.IsTransactional;

            Uri = connector.QueuePath.Uri;

            _timeout = IsLocal
                                                ? TimeSpan.FromMilliseconds(_localQueueTimeout.GetValue())
                                                : TimeSpan.FromMilliseconds(_remoteQueueTimeout.GetValue());
        }
Example #6
0
        public void Start()
        {
            Log.Assign(new Log4NetLog(LogManager.GetLogger(typeof(Host))));

            if (ConfigurationItem <bool> .ReadSetting("SkipCertificateValidation", true).GetValue())
            {
                ServicePointManager.ServerCertificateValidationCallback += (sender, certificate, chain, sslPolicyErrors) => true;
            }

            ServicePointManager.Expect100Continue       = false;
            ServicePointManager.MaxServicePointIdleTime = 0;

            _container = new NinjectComponentContainer(_kernel);

            _container.Register <IMalwareService, McAfeeMalwareService>();

            ServiceBus.Register(_container);

            _container.Resolve <IDatabaseContextFactory>().ConfigureWith("DocumentStore");

            _bus = ServiceBus.Create(_container).Start();
        }
Example #7
0
        public ScriptProvider()
        {
            ScriptFolder = ConfigurationItem <string> .ReadSetting("ScriptFolder", Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "scripts")).GetValue();

            ScriptBatchSeparator = ConfigurationItem <string> .ReadSetting("ScriptBatchSeparator", "GO").GetValue();
        }
Example #8
0
 public DbCommandFactory()
     : this(ConfigurationItem <int> .ReadSetting("Shuttle.Core.Data.DbCommandFactory.CommandTimeout", 15).GetValue())
 {
 }
        public ActiveTimeRangeConfiguration()
        {
            activeFromTime = ConfigurationItem <string> .ReadSetting("ActiveFromTime", "*");

            activeToTime = ConfigurationItem <string> .ReadSetting("ActiveToTime", "*");
        }
Example #10
0
        public string GetConnectionString(string name)
        {
            Guard.AgainstNullOrEmptyString(name, nameof(name));

            return(ConfigurationItem <string> .ReadSetting(name).GetValue());
        }