Пример #1
0
        void MakeButtons()
        {
            Buttons[0] = "F1 Help";
            Buttons[1] = "F2 Disk";
            Buttons[2] = "F3 Read";
            Buttons[3] = "F4 Edit";
            Buttons[4] = "F5 Copy";
            Buttons[5] = "F6 Make File";
            Buttons[6] = "F7 Make Dir";
            Buttons[7] = "F8 Delete";
            Buttons[8] = "F9 Tree";
            Buttons[9] = "F10 Exit";

            ButtonField.Array  = new char[3, Global.Sizes.Primis - 4];
            ButtonField.Koords = MyFunc.Set(2, Global.Sizes.Secundus - 4);

            int Step = ButtonField.Array.GetLength(1) / 10;
            int ToCenter;

            MyFunc.Geminus <int> TempoKoords = MyFunc.Set(2, 1);
            for (int i = 0; i < 10; ++i)
            {
                ToCenter           = (Step - Buttons[i].Length) / 2;
                TempoKoords.Primis = 2 + i * Step + ToCenter;

                MyFunc.CopyStringToArray(TempoKoords, Buttons[i], ButtonField.Array, true);
            }

            Global.FillBroders(ButtonField.Array);
            MyFunc.CopyStringToArray(MyFunc.Set(2, 0), " Buttons ", ButtonField.Array, true);
            MyFunc.Copy(ref ButtonField.Koords, ButtonField.Array, Global.Field);
        }
Пример #2
0
        void MakeDiskSelecter()
        {
            int Step = 7;

            Drives = DriveInfo.GetDrives();

            MyFunc.Geminus <int> Sizes = MyFunc.Set(Drives.Length * Step + 2, 5);
            Field.Array  = new char[Sizes.Secundus, Sizes.Primis];
            Field.Koords = MyFunc.Set(MyFunc.AlignString(Sizes.Primis, Global.Sizes.Primis, 1), Global.Sizes.Secundus / 4);

            MyFunc.FillArray(Field.Array, ' ');

            Label.SomeString = "";
            Label.Koords     = MyFunc.Set(2, 0);

            Global.FillBroders(Field.Array);

            HorizKoords = new MyFunc.Quadrupla <int> [Drives.Length];
            string TempoName = "";

            for (int i = 0; i < Drives.Length; ++i)
            {
                HorizKoords[i] = MyFunc.Set(0, i * Step + Field.Koords.Primis + 2, (i + 1) * Step + Field.Koords.Primis, Global.Sizes.Primis);

                TempoName += Drives[i].Name[0];
                MyFunc.CopyStringToArray(MyFunc.Set(i * Step + 4, 2), TempoName, Field.Array, true);
                TempoName = "";
            }

            CurrentIndex = Field.Koords.Secundus + 2;

            Indexer.SetMinMax(0, Drives.Length - 1);
            Indexer.Set(0);
        }
Пример #3
0
        void MakeOkCancel()
        {
            MyFunc.Geminus <int> Sizes = MyFunc.Set(36, 5);
            Field.Array  = new char[Sizes.Secundus, Sizes.Primis];
            Field.Koords = MyFunc.Set(MyFunc.AlignString(Sizes.Primis, Global.Sizes.Primis, 1), MyFunc.AlignString(Sizes.Secundus, Global.Sizes.Secundus, 1));

            MyFunc.FillArray(Field.Array, ' ');

            string[] Names = { "YES", "NO" };
            MyFunc.CopyStringToArray(MyFunc.Set(MyFunc.AlignString(Names[0].Length, Sizes.Primis / 2, 1), 2), Names[0], Field.Array, true);
            MyFunc.CopyStringToArray(MyFunc.Set(MyFunc.AlignString(Names[1].Length, Sizes.Primis / 2, 1) + 18, 2), Names[1], Field.Array, true);

            Label.SomeString = "";
            Label.Koords     = MyFunc.Set(2, 0);

            Global.FillBroders(Field.Array);
            //MyFunc.CopyStringToArray(Label.Koords, Label.SomeString, Field.Array, true);

            HorizKoords    = new MyFunc.Quadrupla <int> [2];
            HorizKoords[0] = MyFunc.Set(0, Field.Koords.Primis + 2, Field.Koords.Primis + Sizes.Primis / 2 - 1, Global.Sizes.Primis);
            HorizKoords[1] = MyFunc.Set(0, Field.Koords.Primis + Sizes.Primis / 2 + 1, Field.Koords.Primis + Sizes.Primis - 2, Global.Sizes.Primis);

            CurrentIndex = Field.Koords.Secundus + 2;

            Indexer.SetMinMax(0, 1);
            Indexer.Set(0);
        }
Пример #4
0
        public void AddContent(MyFunc.Geminus <int> StartKoords, string Content001)
        {
            Clear();

            CurrentContent = Content001;
            ContentKoords  = StartKoords;
            MyFunc.CopyStringToArray(StartKoords, CurrentContent, Field, true);
        }
Пример #5
0
        public void Init(MyFunc.Geminus <int> Koords001, string Name001, int NewSize001)
        {
            if (NewSize001 < 1)
            {
                NewSize001 = 1;
            }
            SomeArray = new char[NewSize001];
            MyFunc.FillArray(SomeArray, ' ');

            Koords = Koords001;

            MyFunc.CopyStringToArray(0, Name001, SomeArray);
        }
Пример #6
0
        public void AddContent(MyFunc.Geminus <int> StartKoords, string[] Content)
        {
            if (Content == null)
            {
                return;
            }

            ContentKoords = StartKoords;
            foreach (var Item in Content)
            {
                MyFunc.CopyStringToArray(StartKoords, Item, Field, true);
                ++StartKoords.Secundus;
            }
        }
Пример #7
0
        public void Show(ref List<Global.Str_Properties> NewEntaries001, int Min001, int Max001)
        {
            if (NewEntaries001.Any() && NewEntaries001 == null)
            {
                return;
            }

            MyFunc.FillArray(PartesOfContent[0].Array, ' ');
            MyFunc.FillArray(PartesOfContent[1].Array, ' ');
            MyFunc.FillArray(PartesOfContent[2].Array, ' ');
            MyFunc.FillArray(PartesOfContent[3].Array, ' ');

            MyFunc.Geminus<int> TempoPlacer = MyFunc.Set(0, 0);
            MyFunc.Geminus<int> SizePlacer = MyFunc.Set(0, 0);
            MyFunc.Geminus<int> AlignPlacer = MyFunc.Set(0, 0);
            string NameSize;

            for (int i = Min001; i < Max001; ++i)
            { 
                MyFunc.CopyStringToArray(ref TempoPlacer, NewEntaries001[i].Name, PartesOfContent[0].Array, true);
                
                AlignPlacer = TempoPlacer;
                AlignPlacer.Primis = MyFunc.AlignString(NewEntaries001[i].Type.ToString().Length, PartesOfContent[1].Array.GetLength(1), 1);
                if(NewEntaries001[i].Type != Global.Types.LevelUp)
                {
                    MyFunc.CopyStringToArray(ref AlignPlacer, NewEntaries001[i].Type.ToString(), PartesOfContent[1].Array, true);
                }
                AlignPlacer.Primis = MyFunc.AlignString(NewEntaries001[i].Attribute.Length, PartesOfContent[2].Array.GetLength(1), 1);
                MyFunc.CopyStringToArray(ref AlignPlacer, NewEntaries001[i].Attribute, PartesOfContent[2].Array, true);
                if(NewEntaries001[i].Size > 0)
                {
                    SizePlacer = TempoPlacer;
                    NameSize = NewEntaries001[i].Size.ToString();
                    //SizePlacer.Primis = TempoPlacer .Primis + PartesOfContent[3].Array.GetLength(1) - NameSize.Length;
                    SizePlacer.Primis = TempoPlacer.Primis + MyFunc.AlignString(NameSize.Length, PartesOfContent[3].Array.GetLength(1), 2);
                    MyFunc.CopyStringToArray(ref SizePlacer, NameSize, PartesOfContent[3].Array, true);
                }
                
                ++TempoPlacer.Secundus;
            }

            MyFunc.Copy(ref PartesOfContent[0].Koords, PartesOfContent[0].Array, MainField.Array);
            MyFunc.Copy(ref PartesOfContent[1].Koords, PartesOfContent[1].Array, MainField.Array);
            MyFunc.Copy(ref PartesOfContent[2].Koords, PartesOfContent[2].Array, MainField.Array);
            MyFunc.Copy(ref PartesOfContent[3].Koords, PartesOfContent[3].Array, MainField.Array);

            MyFunc.Copy(ref MainField.Koords, MainField.Array, Global.Field);
        }
Пример #8
0
        public void Init(MyFunc.Geminus <int> Koords001, int i001, int j001, MyFunc.Geminus <int> ContentKoords001)
        {
            if (i001 < 1)
            {
                i001 = 1;
            }
            if (j001 < 1)
            {
                j001 = 1;
            }
            Field = new char[i001, j001];
            MyFunc.FillArray(Field, ' ');

            Koords        = Koords001;
            ContentKoords = ContentKoords001;
        }
Пример #9
0
 public void Init(MyFunc.Geminus <int> Koords001, int NumberPart001)
 {
     //Получаем декущий путь
     MaWalker.Init(ConfigFile, NumberPart001);
     //Указываем размеры относительно размеров глобального поля
     ContentSizes = MyFunc.Set(Global.Sizes.Primis / 2 - 3, (Global.Sizes.Secundus * 3) / 4 + 2);
     //Общая рамка
     TableContent.Init(MyFunc.Set(Koords001.Primis, Koords001.Secundus + 5), ContentSizes);
     //Указываем горизонтальные границы для маркера, они будут всё время одинаковыми
     MainMarker.SetHorizontalLimites(0, Koords001.Primis + 1, Koords001.Primis + TableContent.GetHorLengthMarker(), Global.Sizes.Primis);
     //Подготовка заголовка с полным путём
     CurrentPath.Init(MyFunc.Set(Koords001.Primis, Koords001.Secundus + 2), 3, ContentSizes.Primis, MyFunc.Set(2, 1));
     CurrentPath.SetLabel(MyFunc.Set(1, 0), " Full Path ");
     //Подготовка списка директории и сопутствующих элементов
     PrepareDirectory();
 }
Пример #10
0
        public void Init(MyFunc.Geminus<int> Koords001, MyFunc.Geminus<int> Sizes001)
        {
            MainField.Array = new char[Sizes001.Secundus, Sizes001.Primis];
            MainField.Koords = Koords001;
            Global.FillBroders(MainField.Array);
            
            MyFunc.Geminus<int> PartSizes = MyFunc.Set(Sizes001.Primis / 6, Sizes001.Secundus - 2);

            PartesOfContent[0].Array = new char[PartSizes.Secundus, PartSizes.Primis * 3];
            PartesOfContent[0].Koords = MyFunc.Set(1, 1);

            PartesOfContent[1].Array = new char[PartSizes.Secundus, PartSizes.Primis];
            PartesOfContent[1].Koords = MyFunc.Set(Sizes001.Primis - 3 * PartSizes.Primis - 1, 1);

            PartesOfContent[2].Array = new char[PartSizes.Secundus, PartSizes.Primis];
            PartesOfContent[2].Koords = MyFunc.Set(Sizes001.Primis - 2 * PartSizes.Primis - 1, 1);

            PartesOfContent[3].Array = new char[PartSizes.Secundus, PartSizes.Primis];
            PartesOfContent[3].Koords = MyFunc.Set(Sizes001.Primis - PartSizes.Primis - 1, 1);
            
            Labels[0].SomeString = " Content ";
            Labels[1].SomeString = " Type ";
            Labels[2].SomeString = " Attribute ";
            Labels[3].SomeString = " Size ";

            
            Labels[0].Koords = MyFunc.Set(PartesOfContent[0].Koords.Primis, 0);

            for (int i = 1; i < 4; ++i)
            {
                int Aligner001 = MyFunc.AlignString(Labels[i].SomeString.Length, PartesOfContent[i].Array.GetLength(1), 1);
                Labels[i].Koords = MyFunc.Set(PartesOfContent[i].Koords.Primis + Aligner001, 0);
            }
            /*
            Labels[1].Koords = MyFunc.Set(PartesOfContent[1].Koords.Primis, 0);
            Labels[2].Koords = MyFunc.Set(PartesOfContent[2].Koords.Primis, 0);
            Labels[3].Koords = MyFunc.Set(PartesOfContent[3].Koords.Primis + Labels[2].SomeString.Length / 2, 0);*/

            MyFunc.CopyStringToArray(Labels[0].Koords, Labels[0].SomeString, MainField.Array, true);
            MyFunc.CopyStringToArray(Labels[1].Koords, Labels[1].SomeString, MainField.Array, true);
            MyFunc.CopyStringToArray(Labels[2].Koords, Labels[2].SomeString, MainField.Array, true);
            MyFunc.CopyStringToArray(Labels[3].Koords, Labels[3].SomeString, MainField.Array, true);

            Line.Array = new char[Sizes001.Secundus - 2];
            Line.Koords = MyFunc.Set(0, 1);
        }
Пример #11
0
        public Nortoneiro()
        {
            MaWalker.Init(@"C:\Windows", 0);

            ContentSizes = MyFunc.Set(Global.Sizes.Primis / 6, (Global.Sizes.Secundus * 2) / 3);

            AncPoints    = new MyFunc.Geminus <int> [4];
            AncPoints[0] = MyFunc.Set(HorizontalCollumn, 3);
            AncPoints[1] = MyFunc.Set(HorizontalCollumn, 5);
            AncPoints[2] = MyFunc.Set(HorizontalCollumn, AncPoints[1].Secundus + ContentSizes.Secundus + 2);
            AncPoints[3] = MyFunc.Set(HorizontalCollumn, Global.Sizes.Secundus - 2);

            //Console.BackgroundColor = ConsoleColor.DarkGray;
            //Console.ForegroundColor = ConsoleColor.Gray;

            LabelCurrentPath.Init(AncPoints[0], CurrentPath, WidthPlacer);

            VisibleContent.Init(AncPoints[1], ContentSizes.Secundus, WidthPlacer, MyFunc.Set(1, 1));

            /*
             * Placer.Field = new char[Global.Sizes.Secundus - 12, WidthPlacer];
             * Placer.Koords = AncPoints[1];*/
            VertStep = ContentSizes.Secundus / 2;

            Nintus.Init(AncPoints[2], "", WidthPlacer);

            /*
             * Nintus.SomeArray = new char[Placer.Field.GetLength(1)];
             * //Nintus.SomeString = "";
             * Nintus.Koords = AncPoints[2];*/

            MainMarker.SetHorizontalLimites(0, HorizontalCollumn, HorizontalCollumn + ContentSizes.Primis - 1, Global.Sizes.Primis);


            Left.SetMinMax(0, Global.Sizes.Primis - 1);
            Left.Set(HorizontalCollumn);

            Right.SetMinMax(0, Global.Sizes.Primis);
            Right.Set(HorizontalCollumn + ContentSizes.Primis - 1);

            NewPath = CurrentPath;
        }
Пример #12
0
        void MakeHelper()
        {
            List <string> HelpContent = new List <string>();

            HelpContent.Add("Up and Down Arrows, PageUp and PageDown, Home and End - To navigate in current Directory");
            HelpContent.Add("BackSpace - To Up Level Directory");
            HelpContent.Add("SpaceBar - Select files or directories");
            HelpContent.Add("Escape - Close Helper Or Cancel Selected Files");
            HelpContent.Add("F1 - Open Helper");
            HelpContent.Add("F2 - Change Disk in current part of MaNorto");
            HelpContent.Add("F3 - Open some file in Reader");
            HelpContent.Add("F4 - Edit File");
            HelpContent.Add("F5 - Copy selected files or directories from Current Part to Another");
            HelpContent.Add("F6 - Make file");
            HelpContent.Add("F7 - Make Directory");
            HelpContent.Add("F8 - Delete selected files or directories");
            HelpContent.Add("F9 - Show Tree current active directoy");
            HelpContent.Add("F10 - Exit");

            MyFunc.Geminus <int> TempoKoords = MyFunc.Set((Global.Sizes.Primis - HelpContent[0].Length) / 2, (Global.Sizes.Secundus - HelpContent.Count) / 8);
            Helper.Init(TempoKoords, HelpContent.Count + 2, HelpContent[0].Length + 2, MyFunc.Set(1, 1));
            Helper.SetLabel(MyFunc.Set(2, 0), " Helper ");
            Helper.AddContent(MyFunc.Set(1, 1), ref HelpContent);
        }
Пример #13
0
        public void Show()
        {
            if (!Enabled)
            {
                return;
            }

            if (Data == null)
            {
                return;
            }
            MyFunc.FillArray(VisibleField.Array, ' ');
            //Global.FillBroders(Field);
            //MyFunc.CopyStringToArray(Label.Koords, Label.SomeString, Field, true);

            Pages.Primis = Scroller001.GetMin() / VisibleField.Array.GetLength(0) + 1;
            string TempoString = $" Current Page {Pages.Primis} of {Pages.Secundus} ";

            HelpField.SetLabel(MyFunc.Set(MyFunc.AlignString(TempoString.Length, VisibleField.Array.GetLength(1), 1), 0), TempoString);

            MyFunc.Geminus <int> TempoKoords = MyFunc.Set(0, 0);
            for (int i = Scroller001.GetMin(); i < Scroller001.GetMax(); ++i)
            {
                MyFunc.CopyStringToArray(ref TempoKoords, Data[i], VisibleField.Array, true);
                ++TempoKoords.Secundus;
            }

            //Global.FillBroders(VisibleField.Array);
            //MyFunc.CopyStringToArray(Label.Koords, Label.SomeString, VisibleField.Array, true);

            MyFunc.Copy(ref VisibleField.Koords, VisibleField.Array, MainField.GetField());
            MainField.Show();

            HelpField.Show();
            //MyFunc.Copy(ref VisibleField.Koords, VisibleField.Array, Global.Field);
        }
Пример #14
0
        public void Init(MyFunc.Geminus <int> Koords001, int i001, int j001)
        {
            MainField.Init(Koords001, i001, j001, MyFunc.Set(0, 0));
            MainField.Enabled   = true;
            VisibleField.Koords = MyFunc.Set(2, 1);
            VisibleField.Array  = new char[i001 - 6, j001 - 2];

            //Label.SomeString = FileName001;
            //Label.Koords = MyFunc.Set(( j001 - FileName001.Length ) / 2, 0);

            ImageBorder.Array  = new char[i001 + j001];
            ImageBorder.Koords = MyFunc.Set(0, 0);

            List <string> Helper = new List <string>();

            Helper.Add("Up and Down Arrows, PageUp and PageDown, Home and End - Navigate");
            Helper.Add("Escape - Close reader");

            //MainField.AddContent(MyFunc.Set(3, i001 - 3), ref Helper);

            HelpField.Init(MyFunc.Set(1, i001 - 5), 4, j001 - 2, MyFunc.Set(1, 1));
            HelpField.AddContent(MyFunc.Set(1, 1), ref Helper);
            HelpField.Enabled = true;
        }
Пример #15
0
 static public void ReadText(MyFunc.Geminus <int> TextKoords001, bool Start001)
 {
     TextKoords = TextKoords001;
     TextReader = Start001;
 }
Пример #16
0
 public void SetLabel(MyFunc.Geminus <int> Koords001, string NewLabel001)
 {
     Label.SomeString = NewLabel001;
     Label.Koords     = Koords001;
 }
Пример #17
0
 static public void AddTextVertBorders(MyFunc.Geminus <int> VertBorders001)
 {
     TextVertBorders = VertBorders001;
 }