コード例 #1
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));
            }
        }
コード例 #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));
            }
        }
コード例 #3
0
ファイル: CollectionWindow.cs プロジェクト: solind/modSIC
        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);
        }
コード例 #4
0
ファイル: CollectionController.cs プロジェクト: ywcsz/modSIC
 public virtual void StartThread(RequestCollectionEvenArgs e)
 {
     Thread thread = new Thread(this.Run);
     thread.Start(e);
 }
コード例 #5
0
ファイル: CollectionWindow.cs プロジェクト: ywcsz/modSIC
 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);
 }
コード例 #6
0
        public virtual void StartThread(RequestCollectionEvenArgs e)
        {
            Thread thread = new Thread(this.Run);

            thread.Start(e);
        }