public override int GetHashCode()
        {
            int hash = 1;

            if (UserId != 0)
            {
                hash ^= UserId.GetHashCode();
            }
            if (ActivityId != 0)
            {
                hash ^= ActivityId.GetHashCode();
            }
            if (SignDay != 0)
            {
                hash ^= SignDay.GetHashCode();
            }
            if (RefreshTime != 0L)
            {
                hash ^= RefreshTime.GetHashCode();
            }
            if (StartSignInTime != 0L)
            {
                hash ^= StartSignInTime.GetHashCode();
            }
            return(hash);
        }
Exemplo n.º 2
0
 public override int GetHashCode()
 {
     unchecked
     {
         int hashCode = Enabled.GetHashCode();
         hashCode = (hashCode * 397) ^ RefreshTime.GetHashCode();
         hashCode = (hashCode * 397) ^ ExpirationTime.GetHashCode();
         return(hashCode);
     }
 }
        /// <summary>
        /// Code GPS coordinates into a thread
        /// </summary>
        public string CodeTrame(List <LatitudeLongitude> zone)
        {
            if (zone?.Count <= 0)
            {
                return(null);
            }
            var trame = RefreshTime.ToString();

            foreach (var point in zone)
            {
                trame += string.Format(_enCultureInfo, ";{0:0.#########}:{1:0.#########}", point.Latitude, point.Longitude);
            }
            return(trame);
        }
 public override int GetHashCode()
 {
     unchecked
     {
         int hashCode = Enabled.GetHashCode();
         hashCode = (hashCode * 397) ^ ResponseKindsToCache.GetHashCode();
         hashCode = (hashCode * 397) ^ ResponseKindsToIgnore.GetHashCode();
         hashCode = (hashCode * 397) ^ RefreshMode.GetHashCode();
         hashCode = (hashCode * 397) ^ RefreshTime.GetHashCode();
         hashCode = (hashCode * 397) ^ ExpirationTime.GetHashCode();
         hashCode = (hashCode * 397) ^ FailedRefreshDelay.GetHashCode();
         hashCode = (hashCode * 397) ^ RequestGroupingBehavior.GetHashCode();
         hashCode = (hashCode * 397) ^ RefreshBehavior.GetHashCode();
         hashCode = (hashCode * 397) ^ RevokedResponseBehavior.GetHashCode();
         hashCode = (hashCode * 397) ^ ExpirationBehavior.GetHashCode();
         hashCode = (hashCode * 397) ^ CacheResponsesWhenSupressedBehavior.GetHashCode();
         hashCode = (hashCode * 397) ^ NotIgnoredResponseBehavior.GetHashCode();
         return(hashCode);
     }
 }
Exemplo n.º 5
0
        public void Save()
        {
            //数据库配置
            m_Configuration.AppSettings.Settings["DBSource"].Value   = DBSource;
            m_Configuration.AppSettings.Settings["DBName"].Value     = DBName;
            m_Configuration.AppSettings.Settings["DBPort"].Value     = DBPort.ToString();
            m_Configuration.AppSettings.Settings["DBUserName"].Value = DBUserName;
            m_Configuration.AppSettings.Settings["DBPassword"].Value = DBPassword;

            m_Configuration.AppSettings.Settings["RefreshTime"].Value     = RefreshTime.ToString();
            m_Configuration.AppSettings.Settings["OfflineTime"].Value     = OfflineTime.ToString();
            m_Configuration.AppSettings.Settings["TollStationName"].Value = TollStationName;

            //LED文字
            int i = 1;

            foreach (LEDChannelInfo vTempLedText in LedTextArray)
            {
                if (i <= 10)
                {
                    m_Configuration.AppSettings.Settings[string.Format("LedText{0}", i)].Value = string.Format("{0}|{1}|{2}|{3}", vTempLedText.Content, vTempLedText.HoldTime, vTempLedText.InEff, vTempLedText.OutEff);
                }
                else
                {
                    break;
                }
                i++;
            }

            //LED图片
            i = 1;
            foreach (LEDChannelInfo vTempLedPic in LedPicArray)
            {
                if (i <= 4)
                {
                    m_Configuration.AppSettings.Settings[string.Format("LedPic{0}", i)].Value = string.Format("{0}|{1}|{2}|{3}", vTempLedPic.Content, vTempLedPic.HoldTime, vTempLedPic.InEff, vTempLedPic.OutEff);
                }
                else
                {
                    break;
                }
                i++;
            }

            //LED视频
            i = 1;
            foreach (LEDChannelInfo vTempLedVideo in LedVideoArray)
            {
                if (i <= 4)
                {
                    m_Configuration.AppSettings.Settings[string.Format("LedVideo{0}", i)].Value = string.Format("{0}|{1}|{2}|{3}", vTempLedVideo.Content, vTempLedVideo.HoldTime, vTempLedVideo.InEff, vTempLedVideo.OutEff);
                }
                else
                {
                    break;
                }
                i++;
            }


            m_Configuration.Save();
        }
Exemplo n.º 6
0
        public static void SaveConfiguration()
        {
            string fullFileName = Path.Combine(Assembly.GetExecutingAssembly().Location, fileName);

            if (!LocalConfig)
            {
                fullFileName = Path.Combine(GetLocalStoragePath(), fileName);
            }
            if (File.Exists(fullFileName))
            {
                FileInfo fileInfo = new FileInfo(fullFileName);
                fileInfo.Attributes = FileAttributes.Normal;
            }
            XmlWriterSettings xwSettings = new XmlWriterSettings();

            xwSettings.Indent = true;
            MemoryStream ms = new MemoryStream();

            using (XmlWriter xw = XmlWriter.Create(ms, xwSettings)) {
                xw.WriteStartDocument();
                xw.WriteStartElement("config");
                xw.WriteStartElement("integrators");
                foreach (string url in FarmList)
                {
                    xw.WriteStartElement("integrator");
                    xw.WriteAttributeString("url", url);
                    xw.WriteEndElement();
                }
                xw.WriteEndElement();
                xw.WriteStartElement("buildNotifications");
                foreach (BuildNotificationViewInfo bnvi in buildNotifications)
                {
                    xw.WriteStartElement("notification");
                    xw.WriteRaw(SmartCCNetHelper.GetSerializeString(bnvi.Notification));
                    xw.WriteEndElement();
                }
                xw.WriteEndElement();
                xw.WriteStartElement("PowerShellScripts");
                foreach (PSScript script in powerShellScripts)
                {
                    xw.WriteStartElement("PowerShellScript");
                    xw.WriteRaw(SmartCCNetHelper.GetSerializeString(script));
                    xw.WriteEndElement();
                }
                xw.WriteEndElement();
                xw.WriteStartElement("lastProjectDurationDictionary");
                byte[] lastBuildDurationData = ProjectInfo.GetLastBuildDurationDictSaveData();
                xw.WriteBase64(lastBuildDurationData, 0, lastBuildDurationData.Length);
                xw.WriteEndElement();
                xw.WriteStartElement("layoutXml");
                xw.WriteRaw(layoutXml);
                xw.WriteEndElement();
                xw.WriteStartElement("gridProjectXml");
                xw.WriteRaw(gridProjectXml);
                xw.WriteEndElement();
                xw.WriteStartElement("gridTestsXml");
                xw.WriteRaw(gridTestsXml);
                xw.WriteEndElement();
                xw.WriteStartElement("gridServersXml");
                xw.WriteRaw(gridServersXml);
                xw.WriteEndElement();
                xw.WriteStartElement("gridNotificationsXml");
                xw.WriteRaw(gridNotificationsXml);
                xw.WriteEndElement();
                xw.WriteElementString("volunteerColorString", VolunteerColorString);
                xw.WriteElementString("alwaysOnTop", AlwaysOnTop.ToString());
                xw.WriteElementString("refreshTime", RefreshTime.ToString());
                xw.WriteElementString("minimized", Minimized.ToString());
                xw.WriteElementString("buildLogMaximized", BuildLogMaximized.ToString());
                xw.WriteElementString("formWidth", FormWidth.ToString());
                xw.WriteElementString("formHeight", FormHeight.ToString());
                xw.WriteElementString("formLeft", FormLeft.ToString());
                xw.WriteElementString("formTop", FormTop.ToString());
                xw.WriteElementString("updateUrl", UpdateUrl);
                xw.WriteElementString("workUserName", WorkUserName);
                xw.WriteElementString("useSkin", UseSkin.ToString());
                xw.WriteElementString("UsePowerShellScript", UsePowerShellScript.ToString());
                xw.WriteElementString("needAskForStutup", NeedAskForStutup.ToString());
                xw.WriteElementString("alreadyReloadGridTestsLayout", AlreadyReloadGridTestsLayout.ToString());
                xw.WriteElementString("skinName", SkinName);
                xw.WriteElementString("popupHideTimeout", PopupHideTimeout.ToString());
                xw.WriteStartElement("trackedProjects");
                foreach (ProjectShortInfo info in TrackedProjects)
                {
                    xw.WriteStartElement("trackedProject");
                    xw.WriteAttributeString("name", info.Name);
                    xw.WriteAttributeString("status", info.BuildStatus);
                    xw.WriteEndElement();
                }
                xw.WriteEndElement();
                xw.WriteEndElement();
                xw.WriteEndDocument();
            }
            File.WriteAllBytes(fullFileName, ms.ToArray());
        }
Exemplo n.º 7
0
 public void UpdateInterval(RefreshTime interval)
 {
     timer.Interval = TimeSpan.FromMinutes((int)interval);
 }
Exemplo n.º 8
0
 public EventDispatcher(Action action, RefreshTime interval, bool autoReset = false)
     : this(action, (int)interval * 60 * 1000, autoReset)
 {
 }