コード例 #1
0
ファイル: InGameForm.cs プロジェクト: omegaGoTeam/omegaGo
 private void timer1_Tick(object sender, EventArgs e)
 {
     if (_game != null)
     {
         TimeInformation blackTime = _game.Controller.Players.Black.Clock.GetDisplayTime(false);
         lblTimeBlackMain.Text = blackTime.MainText;
         lblTimeBlackSub.Text  = blackTime.SubText;
         TimeInformation whiteTime = _game.Controller.Players.White.Clock.GetDisplayTime(false);
         lblTimeWhiteMain.Text = whiteTime.MainText;
         lblTimeWhiteSub.Text  = whiteTime.SubText;
     }
 }
コード例 #2
0
        /// <summary>Validate the document and all its signatures</summary>
        /// <returns>the validation report</returns>
        public virtual ValidationReport ValidateDocument()
        {
            DateTime        verificationTime = DateTime.Now;
            TimeInformation timeInformation  = new TimeInformation(verificationTime);
            IList <SignatureInformation> signatureInformationList = new AList <SignatureInformation
                                                                               >();

            foreach (AdvancedSignature signature in GetSignatures())
            {
                signatureInformationList.AddItem(ValidateSignature(signature, signature.GetSigningTime
                                                                       () == null ? DateTime.Now : signature.GetSigningTime().Value));
            }
            return(new ValidationReport(timeInformation, signatureInformationList));
        }
コード例 #3
0
ファイル: SystemInformation.cs プロジェクト: ni-xue/Tool.Net
        /// <summary>
        /// 系统时间信息结构体
        /// </summary>
        /// <returns></returns>
        public static TimeInformation GetSystemTimeInformation()
        {
            try
            {
                TimeInformation memInfor = new TimeInformation();

                GetSystemTime(ref memInfor);

                return(memInfor);
            }
            catch (Exception)
            {
                return(new TimeInformation());
            }
        }
コード例 #4
0
        public static TimeControlTexts TranslateSubtext(TimeInformation information, TimeControl control)
        {
            if (control.IsViolating())
            {
                return(new TimeControlTexts(Localizer.TimeControl_TimeExceeded, null));
            }
            switch (information.Style)
            {
            case TimeControlStyle.None:
                return(TranslateNoneSubtext());

            case TimeControlStyle.Japanese:
                return(TranslateJapaneseSubtext(information as JapaneseTimeInformation, control as JapaneseTimeControl));

            case TimeControlStyle.Canadian:
                return(TranslateCanadianSubtext(information as CanadianTimeInformation, control as CanadianTimeControl));

            case TimeControlStyle.Absolute:
                return(TranslateAbsoluteSubtext(information as AbsoluteTimeInformation));
            }
            throw new Exception("Unknown time control.");
        }
コード例 #5
0
        /// <summary>
        /// Updates the time control
        /// </summary>
        public void Update()
        {
            bool graceSecond =
                _settings.Display.AddGraceSecond &&
                _player.IsHuman &&
                _isOnline;
            TimeInformation info = Clock.GetDisplayTime(graceSecond);

            TimeControlMainLine = TimeControlTranslator.TranslateMaintext(info);
            var tuple = TimeControlTranslator.TranslateSubtext(info, Clock);

            TimeControlSubLine = tuple.Subtext;
            TimeControlTooltip = tuple.Tooltip;
            if (_controller != null)
            {
                PrisonerCount =
                    _player.Info.Color == StoneColor.Black
                        ? (_controller.GameTree.LastNode?.Prisoners.BlackPrisoners ?? 0)
                        : (_controller.GameTree.LastNode?.Prisoners.WhitePrisoners ?? 0)
                ;
            }
            RaisePropertyChanged(nameof(CapturesLine));
            RaisePropertyChanged(nameof(IsTurnPlayer));
        }
コード例 #6
0
 public static string TranslateMaintext(TimeInformation information)
 {
     return(information.MainText);
 }
コード例 #7
0
ファイル: ExplicitEuler.cs プロジェクト: rohitvuppala/BoSSS
 public void UpdateTimeInfo(TimeInformation timeInfo)
 {
     this.TimeInfo = timeInfo;
 }
コード例 #8
0
ファイル: SystemInformation.cs プロジェクト: ni-xue/Tool.Net
 private static extern void GetSystemTime(ref TimeInformation stinfo);