BuildTools.GoogleAnalytics.SendEvent C# (CSharp) Метод

SendEvent() публичный Метод

public SendEvent ( string category, string action ) : void
category string
action string
Результат void
        public void SendEvent(string category, string action)
        {
            NameValueCollection values = new NameValueCollection() {
                    { "t", "event" },
                    { "ec", category },
                    { "ea", action },
                    { "el", action },
                    { "ua", "Mozilla/5.0 (compatible; MSIE 10.0; Windows NT " + Environment.OSVersion.Version.Major + "." + Environment.OSVersion.Version.Minor +  "; Trident/6.0; Touch)" }
            };

            Send(values);
        }

Usage Example

Пример #1
0
        /// <summary>
        /// Constructor for the form
        /// </summary>
        public BuildTools(Guid guid, Job job)
        {
            InitializeComponent();
            _job = job;
            _googleAnalytics = new GoogleAnalytics(guid);
            _runner = new Runner(this, _job, _googleAnalytics);
            undoBT.Visible = false;
            progress.Visible = false;

            versionBox.SelectedIndex = 0;
            GetVersions();

            // delegates
            _appendDelegate = AppendText;
            _appendRawDelegate = AppendRawText;
            _disableDelegate = Disable;
            _enableDelegate = Enable;
            _showProgressDelegate = ProgressShow;
            _hideProgressDelegate = ProgressHide;
            _indeterminateProgressDelegate = ProgressIndeterminate;
            _progressPercentDelegate = Progress;
            _updateVersionsDelegate = UpdateVersions;

            if (File.Exists(Program.CheckUpdate)) {
                string text = File.ReadAllText(Program.CheckUpdate);
                if (string.IsNullOrEmpty(text) || text.Trim().ToLower() == "false") {
                    autoUpdateCB.Checked = false;
                }
            }

            Console.WriteLine(guid.ToString());
            new Thread(delegate () {
                _googleAnalytics.SendEvent("Application", "Start");
            }).Start();
        }
All Usage Examples Of BuildTools.GoogleAnalytics::SendEvent