public IMTextManager(ITextPrinter textPrinter, SLNetCom netcom, PrefsManager preferences)
        {
            this.textPrinter = textPrinter;
            this.netcom = netcom;
            this.prefs = preferences;

            this.AddNetcomEvents();
        }
예제 #2
0
파일: IMTextManager.cs 프로젝트: SObS/SLeek
        public void CleanUp()
        {
            RemoveNetcomEvents();

            textBuffer.Clear();
            textBuffer = null;

            textPrinter = null;
        }
예제 #3
0
        public ChatTextManager(RadegastInstance instance, ITextPrinter textPrinter)
        {
            this.textPrinter = textPrinter;
            this.textBuffer = new List<ChatBufferItem>();

            this.instance = instance;
            InitializeConfig();

            // Callbacks
            netcom.ChatReceived += new EventHandler<ChatEventArgs>(netcom_ChatReceived);
            netcom.ChatSent += new EventHandler<ChatSentEventArgs>(netcom_ChatSent);
            netcom.AlertMessageReceived += new EventHandler<AlertMessageEventArgs>(netcom_AlertMessageReceived);
        }
예제 #4
0
        public IMTextManager(RadegastInstance instance, ITextPrinter textPrinter, IMTextManagerType type, UUID sessionID, string sessionName)
        {
            this.sessionID = sessionID;
            this.sessionName = sessionName;
            this.textPrinter = textPrinter;
            this.textBuffer = new ArrayList();
            this.Type = type;

            this.instance = instance;
            PrintLastLog();
            AddNetcomEvents();
            InitializeConfig();
        }
예제 #5
0
        public ChatTextManager(RadegastInstance instance, ITextPrinter textPrinter)
        {
            TextPrinter = textPrinter;
            textBuffer  = new List <ChatBufferItem>();

            this.instance = instance;
            InitializeConfig();

            // Callbacks
            netcom.ChatReceived         += new EventHandler <ChatEventArgs>(netcom_ChatReceived);
            netcom.ChatSent             += new EventHandler <ChatSentEventArgs>(netcom_ChatSent);
            netcom.AlertMessageReceived += new EventHandler <AlertMessageEventArgs>(netcom_AlertMessageReceived);
        }
예제 #6
0
        public IMTextManager(RadegastInstance instance, ITextPrinter textPrinter, IMTextManagerType type, UUID sessionID, string sessionName)
        {
            this.sessionID   = sessionID;
            this.sessionName = sessionName;
            this.textPrinter = textPrinter;
            this.textBuffer  = new ArrayList();
            this.Type        = type;

            this.instance = instance;
            PrintLastLog();
            AddNetcomEvents();
            InitializeConfig();
        }
예제 #7
0
        public ChatTextManager(SleekInstance instance, ITextPrinter textPrinter)
        {
            this.textPrinter = textPrinter;
            this.textBuffer = new List<ChatBufferItem>();

            this.instance = instance;
            netcom = this.instance.Netcom;
            client = this.instance.Client;
            AddNetcomEvents();

            showTimestamps = this.instance.Config.CurrentConfig.ChatTimestamps;
            this.instance.Config.ConfigApplied += new EventHandler<ConfigAppliedEventArgs>(Config_ConfigApplied);
        }
예제 #8
0
파일: IMTextManager.cs 프로젝트: SObS/SLeek
        public IMTextManager(SleekInstance instance, ITextPrinter textPrinter, LLUUID sessionID)
        {
            this.sessionID = sessionID;

            this.textPrinter = textPrinter;
            this.textBuffer = new ArrayList();

            this.instance = instance;
            netcom = this.instance.Netcom;
            AddNetcomEvents();

            showTimestamps = this.instance.Config.CurrentConfig.IMTimestamps;
            this.instance.Config.ConfigApplied += new EventHandler<ConfigAppliedEventArgs>(Config_ConfigApplied);
        }
예제 #9
0
        public static void DrawString(this ITextPrinter textPrinter, string text, double left, double top)
        {
#if DEBUG
            if (text == null)
            {
                return;
            }
#endif
            //TODO: review here!!!
            //Do Not alloc new char[]
            //plan: use Span<T>  or some ptr to string

            char[] textBuffer = text.ToCharArray();
            textPrinter.DrawString(textBuffer, 0, textBuffer.Length, left, top);
        }
예제 #10
0
        public IMTextManager(METAboltInstance instance, ITextPrinter textPrinter, UUID sessionID, string avname)
        {
            SetExceptionReporter();
            Application.ThreadException += new ThreadExceptionHandler().ApplicationThreadException;

            this.sessionID = sessionID;
            this.sessionAVname = avname;

            this.textPrinter = textPrinter;
            //this.textBuffer = new ArrayList();

            this.instance = instance;
            client = this.instance.Client;
            netcom = this.instance.Netcom;
            AddNetcomEvents();

            showTimestamps = this.instance.Config.CurrentConfig.IMTimestamps;
            //tName = this.instance.Config.CurrentConfig.TweeterName;
            //tPwd = this.instance.Config.CurrentConfig.TweeterPwd;
            //TEnabled = this.instance.Config.CurrentConfig.EnableTweeter;
            //tweet = this.instance.Config.CurrentConfig.Tweet;
            //tweetname = this.instance.Config.CurrentConfig.TweeterUser;
            classiclayout = this.instance.Config.CurrentConfig.ClassicChatLayout;

            this.instance.Config.ConfigApplied += new EventHandler<ConfigAppliedEventArgs>(Config_ConfigApplied);

            myBot = this.instance.ABot;

            //if (this.instance.Config.CurrentConfig.AIon)
            //{
            //    myBot = this.instance.ABot;
            //    //brain = new METAbrain(instance, myBot);
            //}
        }
예제 #11
0
 public GCodeContext(CNCContext context, ITextPrinter textprinter)
 {
     CNC = context;
     TextPrinter = textprinter;
 }
예제 #12
0
 public static ITextPrinter PrintFormatLn(this ITextPrinter printer, string format, params object[] args)
 {
     return(printer.Print(string.Format(format, args)).Print(Environment.NewLine));
 }
예제 #13
0
 public static ITextPrinter PrintFormat(this ITextPrinter printer, string format, params object[] args)
 {
     return(printer.Print(string.Format(format, args)));
 }
예제 #14
0
 public static ITextPrinter PrintLn(this ITextPrinter printer, string text)
 {
     return(printer.Print(text).Print(Environment.NewLine));
 }
예제 #15
0
 public static void DrawString(this ITextPrinter textPrinter, string text, double x, double y)
 {
     char[] textBuffer = text.ToCharArray();
     textPrinter.DrawString(textBuffer, 0, textBuffer.Length, x, y);
 }
예제 #16
0
 public GCodeContext(CNCContext context, ITextPrinter textprinter)
 {
     CNC         = context;
     TextPrinter = textprinter;
 }
예제 #17
0
 public BasePlantUmlPrinter(ITextPrinter printer)
 {
     this.printer = printer;
 }
예제 #18
0
        public ChatTextManager(METAboltInstance instance, ITextPrinter textPrinter)
        {
            SetExceptionReporter();
            Application.ThreadException += new ThreadExceptionHandler().ApplicationThreadException;

            this.textPrinter = textPrinter;
            //this.textBuffer = new List<ChatBufferItem>();

            this.instance = instance;
            netcom = this.instance.Netcom;
            client = this.instance.Client;
            AddNetcomEvents();

            //TEnabled = this.instance.Config.CurrentConfig.EnableTweeter;
            //tName = this.instance.Config.CurrentConfig.TweeterName;
            //tPwd = this.instance.Config.CurrentConfig.TweeterPwd;
            //tweet = this.instance.Config.CurrentConfig.Tweet;
            //tweetname = this.instance.Config.CurrentConfig.TweeterUser;
            classiclayout = this.instance.Config.CurrentConfig.ClassicChatLayout;

            //added by GM on 2-JUL-2009
            gmu = this.instance.Config.CurrentConfig.GroupManagerUID;
            imu = this.instance.Config.CurrentConfig.IgnoreUID;
            commandin = this.instance.Config.CurrentConfig.CommandInID;

            cau = this.instance.Config.CurrentConfig.ChairAnnouncerUUID;
            chairAnnouncerInterval = this.instance.Config.CurrentConfig.ChairAnnouncerInterval;
            chairAnnEnabled = this.instance.Config.CurrentConfig.ChairAnnouncerEnabled;
            chairAnnChat = this.instance.Config.CurrentConfig.ChairAnnouncerChat;
            chairAnnouncerGroups = new UUID[6];
            chairAnnouncerGroupNames = new string[6]; //filled as joined
            chairAnnouncerGroups[0] = this.instance.Config.CurrentConfig.ChairAnnouncerGroup1;
            chairAnnouncerGroups[1] = this.instance.Config.CurrentConfig.ChairAnnouncerGroup2;
            chairAnnouncerGroups[2] = this.instance.Config.CurrentConfig.ChairAnnouncerGroup3;
            chairAnnouncerGroups[3] = this.instance.Config.CurrentConfig.ChairAnnouncerGroup4;
            chairAnnouncerGroups[4] = this.instance.Config.CurrentConfig.ChairAnnouncerGroup5;
            chairAnnouncerGroups[5] = this.instance.Config.CurrentConfig.ChairAnnouncerGroup6;
            CountActives();
            indexGroup = 0;
            nextCallTime = DateTime.Now;
            //added by GM on 1-APR-2010
            chairAnnAdvert = this.instance.Config.CurrentConfig.ChairAnnouncerAdvert;

            client.Groups.GroupMembersReply += new EventHandler<GroupMembersReplyEventArgs>(GroupMembersHandler);

            showTimestamps = this.instance.Config.CurrentConfig.ChatTimestamps;
            this.instance.Config.ConfigApplied += new EventHandler<ConfigAppliedEventArgs>(Config_ConfigApplied);

            scriptbuffer.SetBuffer(instance.Config.CurrentConfig.ScriptUrlBufferLimit);
            urlbuffer.SetBuffer(instance.Config.CurrentConfig.ScriptUrlBufferLimit);
            instance.chatbuffer.SetBuffer(instance.Config.CurrentConfig.ChatBufferLimit);
        }
예제 #19
0
        /// <summary>Load resources here.</summary>
        /// <param name="e">Not used.</param>
        public override void OnLoad(EventArgs e)
        {
            base.OnLoad(e);

            //
            // Init. sim
            //
            m_pause           = false;
            m_gravity         = Constants.GRAVITY * Constants.PARTICLE_MASS;
            m_fluidSim        = new SPHSimulation(Constants.CELL_SPACE, Constants.SIM_DOMAIN);
            m_collisionSolver = new CollisionResolver
            {
                BoundingVolumes = new BoundingVolumes
                {
                    new OBB
                    {
                        Position = new Vector2(Constants.SIM_DOMAIN.Width / 3, Constants.SIM_DOMAIN.Height / 2),
                        Extents  = new Vector2(Constants.SIM_DOMAIN.Width / 6, Constants.SIM_DOMAIN.Height / 30),
                    }
                },
                Bounciness = 0.2f,
                Friction   = 0.01f,
            };

            // Init. particle system
            double freq    = 30;
            int    maxPart = 2000;

            m_particleSystem = new ParticleSystem
            {
                Emitters = new ParticleEmitters
                {
                    new ParticleEmitter
                    {
                        Position     = new Vector2(Constants.SIM_DOMAIN.X, Constants.SIM_DOMAIN.Bottom),
                        VelocityMin  = Constants.PARTICLE_MASS * 0.30f,
                        VelocityMax  = Constants.PARTICLE_MASS * 0.35f,
                        Direction    = new Vector2(0.8f, -0.25f),
                        Distribution = Constants.SIM_DOMAIN.Width * 0.0001f,
                        Frequency    = freq,
                        ParticleMass = Constants.PARTICLE_MASS,
                    },
                },

                MaxParticles = maxPart,
                MaxLife      = (int)((double)maxPart / freq / Constants.DELTA_TIME_SEC),
                TestMaxLife  = false,
            };


            //
            // Init blobs
            //
            m_blobs    = new BlobRenderer(1.0f, 0.4f, 0.8f, BLOB_RADIUS, TEX_SIZE, Color.LightSkyBlue);
            m_useBlobs = true;
            m_drawVel  = false;


            //
            // Init OpenGL
            //
            GL.ClearColor(System.Drawing.Color.Black);
            GL.PointSize(5.0f);
            GL.Hint(HintTarget.PerspectiveCorrectionHint, HintMode.Nicest);
            GL.BlendFunc(BlendingFactorSrc.SrcAlpha, BlendingFactorDest.OneMinusSrcAlpha);

            // Init OpenTK text
            m_showHelp    = false;
            m_textPrinter = new TextPrinter();
            m_textFont    = new TextureFont(new Font(FontFamily.GenericMonospace, 12.0f));
            m_textPrinter.Prepare(
                "Press [F1] to hide / show this text\r\n"
                + "Press [R] to change particle rendering\r\n"
                + "Press [D] to draw velocity direction\r\n"
                + "Press [E] to switch emitter on / off\r\n"
                + "Press [P] to pause\r\n"
                + "Press [Space] to tilt (add random impulse)\r\n"
                + "Press [Esc] to close the program\r\n"
                + "\r\n"
                + "Use left mouse button <LMB> to select a box\r\n"
                + "Select a box + <LMB> to move the selected box\r\n"
                + "Hold [Ctrl] + <RMB> to remove a box\r\n"
                + "Hold [Ctrl] + <LMB> to draw a new box (AABB)\r\n"
                + "(Release <LMB> to add the drawn box (AABB))\r\n"
                + "\r\n"
                + "Hold [Alt] + <LMB> to exert a negative force field\r\n"
                + "Hold [Alt] + <RMB> to exert a positive force field\r\n"
                + "\r\n"
                + "Use mousewheel <MW> to change some values\r\n"
                + "(Hold [Shift] to change smaller steps)\r\n"
                + "Select a box + <MW> to rotate the selected box\r\n"
                + "Hold [V] + <MW> to change viscosity\r\n"
                + "Hold [B] + <MW> to change bounciness\r\n"
                + "Hold [F] + <MW> to change friction\r\n"
                + "\r\n"
                + "This program is free software (GPLv3) -> License.txt",
                m_textFont, out m_textHandleHelp);

            // Add Keyboard- and Mouse-Handler
            Keyboard.KeyUp   += new KeyUpEvent(Keyboard_KeyUp);
            Mouse.ButtonDown += new MouseButtonDownEvent(Mouse_ButtonDown);
            Mouse.ButtonUp   += new MouseButtonUpEvent(Mouse_ButtonUp);

            // Init. misc.
            m_mouseWheelLastValue = Mouse.Wheel;
        }