bool CheckMouseOverTe()
 {
     if (!insideTe)
     {
         te.Text = "Move the mouse here";
     }
     else
     {
         if (movedOverTe)
         {
             te.Text = "Mouse is moving";
             Console.WriteLine("[" + te.GetType() + "] Mouse Moving");
             movedOverTe  = false;                       // reset and check next time
             movingOverTe = true;
         }
         else if (movingOverTe)
         {
             te.Text = "Mouse has stopped";
             Console.WriteLine("[" + te.GetType() + "] Mouse Stopped");
             movingOverTe = false;
         }
     }
     return(insideTe);
 }
Esempio n. 2
0
        public static void WriteTextEntry(BinaryWriter writer, TextEntry entry, int buildVersion)
        {
            writer.Write(entry.Flags);
            writer.Write((byte)entry.HistoryType);

            switch (entry)
            {
            case BaseTextEntry baseText:
            {
                writer.WriteLengthPrefixedString(baseText.Namespace);
                writer.WriteLengthPrefixedString(baseText.Key);
                writer.WriteLengthPrefixedString(baseText.Value);
            }
            break;

            case ArgumentFormatTextEntry argumentFormatText:
            {
                WriteTextEntry(writer, argumentFormatText.SourceFormat, buildVersion);

                writer.Write(argumentFormatText.Arguments.Count);
                foreach (var arg in argumentFormatText.Arguments)
                {
                    writer.WriteLengthPrefixedString(arg.Name);
                    writer.Write((byte)arg.ValueType);
                    WriteTextEntry(writer, arg.Value, buildVersion);
                }
            }
            break;

            case NoneTextEntry noneText:
            {
                if (buildVersion >= CultureInvariantChangeBuild && noneText.HasCultureInvariantString.HasValue)
                {
                    writer.Write(noneText.HasCultureInvariantString.Value ? 1 : 0);

                    if (noneText.HasCultureInvariantString.Value)
                    {
                        writer.WriteLengthPrefixedString(noneText.CultureInvariantString);
                    }
                }
            }
            break;

            default:
                throw new NotImplementedException($"Unknown ETextHistoryType {entry.GetType()}");
            }
        }