Пример #1
0
 public void MouseDown()
 {
     StatEvent += ConsoleHi;
     StatEvent.Invoke();
     StatEvent -= ConsoleHi;
     StatEvent.Invoke();
 }
Пример #2
0
 /// <summary>
 /// Flip-Flat controller constructor
 /// </summary>
 public AlnitakController()
 {
     InitializeComponent();
     //create new instance of FlipFlatLib
     FF = new FlipFlatLib();
     currentDomain.UnhandledException += new UnhandledExceptionEventHandler(MyHandler);
     onStatEvent += new StatEvent(setStatEvent);
 }
Пример #3
0
 private void OnLoad(StreamingContext context)
 {
     onSet        = new StatEvent();
     onMinReached = new StatEvent();
     onMaxReached = new StatEvent();
     onMinSet     = new StatEvent();
     onMaxSet     = new StatEvent();
 }
Пример #4
0
 protected override void OnLoad(StreamingContext context)
 {
     base.OnLoad(context);
     onMinReached = new StatEvent();
     onMaxReached = new StatEvent();
     onMinSet     = new StatEvent();
     onMaxSet     = new StatEvent();
 }
        public S2C_IncrementPlayerStat(PacketReader reader, ChannelID channelID, NetID senderNetID)
        {
            this.SenderNetID = senderNetID;
            this.ChannelID   = channelID;

            this.PlayerNetID = reader.ReadNetID();
            this.StatEvent   = reader.ReadStatEvent();

            this.ExtraBytes = reader.ReadLeft();
        }
Пример #6
0
 public void Load(Project project, StatEvent evt)
 {
     if (evt is LineupEvent)
     {
         LoadLineup(project, evt as LineupEvent);
     }
     else
     {
         LoadSubstitution(project, evt as SubstitutionEvent);
     }
 }
Пример #7
0
        public void OnGenerated(DataModel model, string input, StatEvent statEvent)
        {
            var    dm        = Parse(model);
            string dmString  = JObject.FromObject(dm).ToString(Newtonsoft.Json.Formatting.None);
            int    hash      = StringHash(dmString);
            var    statistic = dbContext.Statistics.SingleOrDefault(s => s.Hash == hash);

            if (statistic != null)
            {
                statistic.Updated = DateTime.Now;
                switch (statEvent)
                {
                case StatEvent.Download:
                    statistic.DownloadedCount += 1;
                    break;

                case StatEvent.Generate:
                    statistic.GeneratedCount += 1;
                    break;
                }
                if (input.Length > statistic.Example.Length)
                {
                    statistic.Example = input;
                }
                dbContext.SaveChanges();
                return;
            }

            dbContext.Statistics.Add(new Statistic
            {
                Created         = DateTime.Now,
                Updated         = DateTime.Now,
                DataModel       = dmString,
                Hash            = hash,
                Example         = input,
                Diff            = Diff(dm, Sample),
                Complexity      = Complexity(dm),
                GeneratedCount  = statEvent == StatEvent.Generate ? 1 : 0,
                DownloadedCount = statEvent == StatEvent.Download ? 1 : 0
            });
            dbContext.SaveChanges();
        }
Пример #8
0
 private void setStatEvent(object sender, StatEventArgs e)
 {
     if (statusLabel.InvokeRequired)
     {
         StatEvent s = new StatEvent(setStatEvent);
         this.Invoke(s, new object[] { sender, e });
     }
     else
         this.statusLabel.Text = e.StatLabel;
     if (Form.ActiveForm != null)
         Form.ActiveForm.Refresh();
 }
Пример #9
0
 public static void WriteStatEvent(this PacketWriter writer, StatEvent data)
 {
     writer.WriteByte((byte)data);
 }
Пример #10
0
 public StatEventArgs(StatEvent statEvent)
 {
     this.EventData = statEvent;
 }
Пример #11
0
 protected virtual void OnLoad(StreamingContext context)
 {
     onSet = new StatEvent();
 }