public void view_OnSendCollection(object sender, RequestCollectionEvenArgs e)
        {
            OnRequestCollectionCalled = true;

            try
            {
                if (e == null || e.Server == null || e.Target == null)
                {
                    view.ShowErrorMessage(Resource.InvalidConfiguration);
                    return;
                }

                var guid = (GuidAttribute)Assembly.GetExecutingAssembly().GetCustomAttributes(typeof(GuidAttribute), true)[0];
                var clientId = System.Environment.MachineName + "\\" + guid.Value;

                string prefix = String.Empty;
                if (!String.IsNullOrEmpty(e.Server.Address))
                {
                    prefix = (e.Server.Address.StartsWith("http")) ? String.Empty : "http://";
                }

                var address = String.Format("{2}{0}:{1}/CollectService", e.Server.Address, e.Server.Port, prefix);
                modSicConnection = new ModSicConnection(address, e.Server.Username, e.Server.Password, clientId);

                systemCharacteristicsFilename = Path.Combine(e.SaveFolder, "system-characteristics.xml");
                resultsFilename = Path.Combine(e.SaveFolder, "results.xml");
                htmlFilename = Path.Combine(e.SaveFolder, "results.html");

                StartThread(e);
            }
            catch (Exception ex)
            {
                view.ShowErrorMessage(Util.FormatExceptionMessage(ex));
            }
        }
Beispiel #2
0
        public void view_OnSendCollection(object sender, RequestCollectionEvenArgs e)
        {
            OnRequestCollectionCalled = true;

            try
            {
                if (e == null || e.Server == null || e.Target == null)
                {
                    view.ShowErrorMessage(Resource.InvalidConfiguration);
                    return;
                }

                var guid     = (GuidAttribute)Assembly.GetExecutingAssembly().GetCustomAttributes(typeof(GuidAttribute), true)[0];
                var clientId = System.Environment.MachineName + "\\" + guid.Value;

                string prefix = String.Empty;
                if (!String.IsNullOrEmpty(e.Server.Address))
                {
                    prefix = (e.Server.Address.StartsWith("http")) ? String.Empty : "http://";
                }

                var address = String.Format("{2}{0}:{1}/CollectService", e.Server.Address, e.Server.Port, prefix);
                modSicConnection = new ModSicConnection(address, e.Server.Username, e.Server.Password, clientId);

                systemCharacteristicsFilename = Path.Combine(e.SaveFolder, "system-characteristics.xml");
                resultsFilename = Path.Combine(e.SaveFolder, "results.xml");
                htmlFilename    = Path.Combine(e.SaveFolder, "results.html");

                StartThread(e);
            }
            catch (Exception ex)
            {
                view.ShowErrorMessage(Util.FormatExceptionMessage(ex));
            }
        }
Beispiel #3
0
        private void CollectWindow_Shown(object sender, EventArgs e)
        {
            var args = new RequestCollectionEvenArgs()
            {
                Server = this.server, Target = this.target, DefinitionFilename = this.definitioFilename, SaveFolder = this.saveFolder, ExternalVariablesXml = this.externalVariablesXml
            };

            OnRequestCollection(this, args);
        }
Beispiel #4
0
 public virtual void StartThread(RequestCollectionEvenArgs e)
 {
     Thread thread = new Thread(this.Run);
     thread.Start(e);
 }
Beispiel #5
0
 private void CollectWindow_Shown(object sender, EventArgs e)
 {
     var args = new RequestCollectionEvenArgs() { Server = this.server, Target = this.target, DefinitionFilename = this.definitioFilename, SaveFolder = this.saveFolder, ExternalVariablesXml = this.externalVariablesXml };
     OnRequestCollection(this, args);
 }
Beispiel #6
0
        public virtual void StartThread(RequestCollectionEvenArgs e)
        {
            Thread thread = new Thread(this.Run);

            thread.Start(e);
        }