コード例 #1
0
            public override bool Equals(object Obj)
            {
                OutputObj obj = Obj as OutputObj;

                if (obj == null)
                {
                    return(false);
                }
                return(obj.sym == sym && obj.color.Equals(color));
            }
コード例 #2
0
 public Output(Support.Coord StartPos, Support.Coord ScreenSize)
 {
     startPos   = StartPos;
     screenSize = ScreenSize;
     screen     = new OutputObj[screenSize.y, screenSize.x];
     screenBuff = new OutputObj[screenSize.y, screenSize.x];
     for (short i = 0; i < screen.GetLength(0); ++i)
     {
         for (short j = 0; j < screen.GetLength(1); ++j)
         {
             screen[i, j]     = new OutputObj();
             screenBuff[i, j] = new OutputObj();
         }
     }
 }
コード例 #3
0
 OutputObj[] FormatHotkey(string key, string description)
 {
     key = ' ' + key;
     OutputObj[] rez = new OutputObj[key.Length + description.Length + 2];
     for (ushort i = 0; i < key.Length; ++i)
     {
         rez[i] = new OutputObj(key[i], new DColor(ConsoleColor.DarkMagenta, ConsoleColor.Gray));
     }
     rez[key.Length] = new OutputObj(' ', new DColor(ConsoleColor.Black, ConsoleColor.Gray));
     for (ushort i = 0; i < description.Length; ++i)
     {
         rez[i + key.Length + 1] = new OutputObj(description[i], new DColor(ConsoleColor.Black, ConsoleColor.Gray));
     }
     rez[key.Length + description.Length + 1] = new OutputObj(' ', new DColor(ConsoleColor.Black, ConsoleColor.Gray));
     return(rez);
 }
コード例 #4
0
 private void AddOutput(object sender, EventArgs e)
 {
     using (var form = new IdentifierForm <OutputObj>("Output", outputs.Keys))
     {
         if (form.ShowDialog(this) == DialogResult.OK)
         {
             var obj = new OutputObj
             {
                 UserDefined = true,
                 Type        = "any"
             };
             outputs.Add(form.Identifier, obj);
             cmboOutputs.Items.Add(form.Identifier);
             cmboOutputs.SelectedIndex   = cmboOutputs.FindStringExact(form.Identifier);
             cmboVariables.SelectedIndex = -1;
             OutputChanged(null, EventArgs.Empty);
         }
     }
 }
コード例 #5
0
        void CreateBackGround()
        {
            ushort i = 0;

            OutputObj[] obj;
            ElementText text;

            //head nav
            obj = new OutputObj[screen.screenSize.x - 10];
            for (i = 0; i < obj.Length; ++i)
            {
                obj[i] = new OutputObj(' ', new DColor(ConsoleColor.Black, ConsoleColor.Gray));
            }
            text = new ElementEternalText(obj, new Support.Coord(0, 0), 0);
            headDirector.AddElement(text);

            //Time
            obj = new OutputObj[10];
            for (i = 0; i < obj.Length; ++i)
            {
                obj[i] = new OutputObj(' ', new DColor(ConsoleColor.Green, ConsoleColor.Black));
            }
            text = new ElementTextFromFunc(obj, new Support.Coord(screen.screenSize.x - 10, 0), 0, () => ' ' + DateTime.Now.ToLongTimeString());
            headDirector.AddElement(text);


            //Hotkeys
            try {
                AddHotkeysBar();
            }
            catch (Exception) {
            }

            //Console
            obj = new OutputObj[screen.screenSize.x];
            for (i = 0; i < obj.Length; ++i)
            {
                obj[i] = new OutputObj(' ', new DColor(ConsoleColor.White, ConsoleColor.Black));
            }
            i = 0;
            foreach (char c in @"C:\>")
            {
                obj[i++].sym = c;
            }
            text = new ElementEternalText(obj, new Support.Coord((short)0, screen.screenSize.y - 2), 0);
            downDirector.AddElement(text);


            //frame
            obj = new OutputObj[screen.screenSize.x / 2];
            for (i = 0; i < obj.Length; ++i)
            {
                obj[i] = new OutputObj('═', new DColor(ConsoleColor.Cyan, ConsoleColor.DarkGray));
            }
            obj[0].sym = '╔';
            obj[obj.Length - 1].sym = '╗';
            text = new ElementEternalText(obj, new Support.Coord(0, 1), 0);
            leftDirector.AddElement(text);

            text = new ElementEternalText(obj, new Support.Coord(screen.screenSize.x / 2, 1), 0);
            rightDirector.AddElement(text);

            obj = new OutputObj[screen.screenSize.x / 2];
            for (i = 0; i < obj.Length; ++i)
            {
                obj[i] = new OutputObj('═', new DColor(ConsoleColor.Cyan, ConsoleColor.DarkGray));
            }
            obj[0].sym = '╚';
            obj[obj.Length - 1].sym = '╝';
            text = new ElementEternalText(obj, new Support.Coord(0, screen.screenSize.y - 3), 0);
            leftDirector.AddElement(text);

            text = new ElementEternalText(obj, new Support.Coord(screen.screenSize.x / 2, screen.screenSize.y - 3), 0);
            rightDirector.AddElement(text);

            leftDirector.AddElement(new ElementEternalVLine((short)(screen.screenSize.y - 5), new OutputObj('║', new DColor(ConsoleColor.Cyan, ConsoleColor.DarkGray)), new Support.Coord(0, 2), 0));
            leftDirector.AddElement(new ElementEternalVLine((short)(screen.screenSize.y - 5), new OutputObj('║', new DColor(ConsoleColor.Cyan, ConsoleColor.DarkGray)), new Support.Coord(obj.Length - 1, 2), 0));

            rightDirector.AddElement(new ElementEternalVLine((short)(screen.screenSize.y - 5), new OutputObj('║', new DColor(ConsoleColor.Cyan, ConsoleColor.DarkGray)), new Support.Coord((int)(screen.screenSize.x / 2), 2), 0));
            rightDirector.AddElement(new ElementEternalVLine((short)(screen.screenSize.y - 5), new OutputObj('║', new DColor(ConsoleColor.Cyan, ConsoleColor.DarkGray)), new Support.Coord((int)(obj.Length - 1 + screen.screenSize.x / 2), 2), 0));

            leftDirector.AddElement(new ElemenEternaltHLine((short)(screen.screenSize.x / 2 - 2), new OutputObj('─', new DColor(ConsoleColor.Cyan, ConsoleColor.DarkGray)), new Support.Coord(1, screen.screenSize.y - 7), 0));
            rightDirector.AddElement(new ElemenEternaltHLine((short)(screen.screenSize.x / 2 - 2), new OutputObj('─', new DColor(ConsoleColor.Cyan, ConsoleColor.DarkGray)), new Support.Coord((short)(1 + screen.screenSize.x / 2), screen.screenSize.y - 7), 0));

            leftDirector.AddElement(new ElementEternalVLine((short)(screen.screenSize.y - 9), new OutputObj('│', new DColor(ConsoleColor.Cyan, ConsoleColor.DarkGray)), new Support.Coord((int)(screen.screenSize.x / 6), 2), 0));
            leftDirector.AddElement(new ElementEternalVLine((short)(screen.screenSize.y - 9), new OutputObj('│', new DColor(ConsoleColor.Cyan, ConsoleColor.DarkGray)), new Support.Coord((int)(screen.screenSize.x / 3), 2), 0));

            rightDirector.AddElement(new ElementEternalVLine((short)(screen.screenSize.y - 9), new OutputObj('│', new DColor(ConsoleColor.Cyan, ConsoleColor.DarkGray)), new Support.Coord((int)(screen.screenSize.x / 6 + screen.screenSize.x / 2), 2), 0));
            rightDirector.AddElement(new ElementEternalVLine((short)(screen.screenSize.y - 9), new OutputObj('│', new DColor(ConsoleColor.Cyan, ConsoleColor.DarkGray)), new Support.Coord((int)(screen.screenSize.x / 3 + screen.screenSize.x / 2), 2), 0));
        }