internal static int GetIntValueFromTimeSpan(NameValueCollection config, string valueName, int defaultValue)
        {
            TimeSpan span;
            string   s = config[valueName];

            switch (s)
            {
            case null:
                return(defaultValue);

            case "Infinite":
                return(0x7fffffff);
            }
            if (!TimeSpan.TryParse(s, out span) || (span <= TimeSpan.Zero))
            {
                throw new ArgumentException(RH.Format(R.TimeSpan_invalid_format, new object[] { valueName, s }), "config");
            }
            double totalMilliseconds = span.TotalMilliseconds;

            return((totalMilliseconds < 2147483647.0) ? ((int)totalMilliseconds) : 0x7fffffff);
        }
 private void ValidatePolicy(CacheItemPolicy policy)
 {
     if (policy.AbsoluteExpiration != ObjectCache.InfiniteAbsoluteExpiration &&
         policy.SlidingExpiration != ObjectCache.NoSlidingExpiration)
     {
         throw new ArgumentException(R.Invalid_expiration_combination, "policy");
     }
     if (policy.SlidingExpiration < ObjectCache.NoSlidingExpiration || OneYear < policy.SlidingExpiration)
     {
         throw new ArgumentOutOfRangeException("policy", RH.Format(R.Argument_out_of_range, "SlidingExpiration", ObjectCache.NoSlidingExpiration, OneYear));
     }
     if (policy.RemovedCallback != null &&
         policy.UpdateCallback != null)
     {
         throw new ArgumentException(R.Invalid_callback_combination, "policy");
     }
     if (policy.Priority != CacheItemPriority.Default && policy.Priority != CacheItemPriority.NotRemovable)
     {
         throw new ArgumentOutOfRangeException("policy", RH.Format(R.Argument_out_of_range, "Priority", CacheItemPriority.Default, CacheItemPriority.NotRemovable));
     }
 }
Beispiel #3
0
        private void AddBtn_Click(object sender, EventArgs e)
        {
            try
            {
                BloodType bloodGrp = (BloodType)Enum.Parse(typeof(BloodType), BloodGrpCbBx.Text);

                RH rhesus = RHPlusRdBtn.Checked ? RH.Minus : RH.Plus;

                Donner d = new Donner(CINTxBx.Text, LastNameTxBx.Text, FirstNameTxBx.Text, bloodGrp, rhesus);

                donnerManagement.Add(d);

                RefreshDataGrid();

                MessageBox.Show("Ajout avec succe");
                Reset();
            }
            catch (Exception ep)
            {
                MessageBox.Show(ep.Message);
            }
        }
Beispiel #4
0
        private static ReadOnlyCollection <string> SanitizeFilePathsList(IList <string> filePaths)
        {
            List <string> newList = new List <string>(filePaths.Count);

            foreach (string path in filePaths)
            {
                if (String.IsNullOrEmpty(path))
                {
                    throw new ArgumentException(RH.Format(R.Collection_contains_null_or_empty_string, "filePaths"));
                }
                else
                {
                    // DevDiv #269534: When we use a user-provided string in the constructor to this FileIOPermission and demand the permission,
                    // we need to be certain that we're adding *exactly that string* to the new list we're generating. The original code tried to
                    // optimize by checking all of the permissions upfront then doing a List<T>.AddRange at the end, but this opened the method
                    // to a TOCTOU attack since a malicious user could have modified the original IList<T> between the two calls.
                    new FileIOPermission(FileIOPermissionAccess.PathDiscovery, path).Demand();
                    newList.Add(path);
                }
            }

            return(newList.AsReadOnly());
        }
        internal static int GetIntValue(NameValueCollection config, string valueName, int defaultValue, bool zeroAllowed, int maxValueAllowed)
        {
            int    num;
            string s = config[valueName];

            if (s == null)
            {
                return(defaultValue);
            }
            if ((!int.TryParse(s, out num) || (num < 0)) || (!zeroAllowed && (num == 0)))
            {
                if (zeroAllowed)
                {
                    throw new ArgumentException(RH.Format(R.Value_must_be_non_negative_integer, new object[] { valueName, s }), "config");
                }
                throw new ArgumentException(RH.Format(R.Value_must_be_positive_integer, new object[] { valueName, s }), "config");
            }
            if ((maxValueAllowed > 0) && (num > maxValueAllowed))
            {
                throw new ArgumentException(RH.Format(R.Value_too_big, new object[] { valueName, s, maxValueAllowed.ToString(CultureInfo.InvariantCulture) }), "config");
            }
            return(num);
        }
Beispiel #6
0
 //数据手套初始化,硬件连接
 //! Connect data glove and initialization.
 public void OnConnectGlove()
 {
     if (IsVREnabled && LH_tracker == null && RH_tracker == null)
     {
         return;
     }
     try
     {
         LH_Mode = LH.Init(HANDTYPE.LEFT_HAND);
         if (LH_Mode)
         {
             print("Left hand glove connected!");
             LH.SetThumbOffset(thumb_offset_L[0], VRTRIXBones.L_Thumb_1);
             LH.SetThumbOffset(thumb_offset_L[1], VRTRIXBones.L_Thumb_2);
             LH.SetThumbOffset(thumb_offset_L[2], VRTRIXBones.L_Thumb_3);
             LH.SetThumbSlerpRate(thumb_proximal_slerp, thumb_middle_slerp);
             LH.RegisterCallBack();
             LH.StartStreaming();
         }
         RH_Mode = RH.Init(HANDTYPE.RIGHT_HAND);
         if (RH_Mode)
         {
             print("Right hand glove connected!");
             RH.SetThumbOffset(thumb_offset_R[0], VRTRIXBones.R_Thumb_1);
             RH.SetThumbOffset(thumb_offset_R[1], VRTRIXBones.R_Thumb_2);
             RH.SetThumbOffset(thumb_offset_R[2], VRTRIXBones.R_Thumb_3);
             RH.SetThumbSlerpRate(thumb_proximal_slerp, thumb_middle_slerp);
             RH.RegisterCallBack();
             RH.StartStreaming();
         }
     }
     catch (Exception e)
     {
         print("Exception caught: " + e);
     }
 }
Beispiel #7
0
        protected override void BeforeRun()
        {
            //check for real hardware
            if (RH.onRealHardware() == true)
            {
                RealH = "true";
                RH.RealHardwareAlert();
            }
            //starts the filesystem stuff
            fs = new Sys.FileSystem.CosmosVFS();
            Sys.FileSystem.VFS.VFSManager.RegisterVFS(fs);
            //Check for Username and start Setup
            if (RH.onRealHardware() == true)
            {
            }
            else
            {
                if (File.Exists(@"0:\SYSTEM\Username.set"))
                {
                    username = File.ReadAllText(@"0:\SYSTEM\Username.set");
                }

                else
                {
                    Setup.SetupStart();
                }

                if (File.Exists(@"0:\SYSTEM\Date&Time.set"))
                {
                    if (File.ReadAllText(@"0:\SYSTEM\Date&Time.set").Contains("12hour"))
                    {
                        time = "12hour";
                    }
                    else
                    {
                        time = "24hour";
                    }
                }
            }

            //startup screen
            Console.ResetColor();
            Bcolor();
            Console.Clear();
            printLogoConsole();
            Console.WriteLine("\n");
            Console.WriteLine("Type cmd for a list of commands and Apps. ");
            Console.WriteLine("");

            //check for calender
            if (RH.onRealHardware() == true)
            {
            }
            else
            {
                var root = @"0:\";
                Directory.SetCurrentDirectory(root);
                if (File.Exists(DateTime.Now.Month + "-" + DateTime.Now.Day + "-" + DateTime.Now.Year + ".cal"))
                {
                    Console.BackgroundColor = ConsoleColor.Black;
                    Console.ForegroundColor = ConsoleColor.Yellow;
                    Console.WriteLine("Reminder: You have a Calender for Today! Type 'open " + DateTime.Now.Month + "-" + DateTime.Now.Day + "-" + DateTime.Now.Year + ".cal' to veiw it.\n");
                    Console.ResetColor();
                }
            }
        }
Beispiel #8
0
        protected override void Run()
        {
            //code for the command line
            if (RealH == "true")
            {
                Console.Write("Limited Mode> ");
            }
            else
            {
                Console.Write(username + "| " + current_directory + "> ");
            }
            var input = Console.ReadLine().ToLower();

            shell = input;
            //misc commands
            if (input.StartsWith("echo "))
            {
                var text = Kernel.shell.Substring(5);

                Console.WriteLine(text);
            }

            else if (input == "cls")
            {
                Console.Clear();
            }



            //info amd help
            else if (input == "cmd")
            {
                //lists all commands
                if (RealH == "false")
                {
                    Console.WriteLine("");
                    Console.BackgroundColor = ConsoleColor.Gray;
                    Console.ForegroundColor = ConsoleColor.Black;
                    Console.WriteLine("|List of Commands/Apps on Limited Mode|");
                    Bcolor();
                    Console.WriteLine("");

                    Console.WriteLine("Info/help Commands:");
                    Bcolor();
                    Console.WriteLine(" cmd - Shows all commands");
                    Console.WriteLine(" about - about the Operating System");
                    Console.WriteLine(" new - New Features in Build");

                    Console.WriteLine("Misc Commands:");
                    Bcolor();
                    Console.WriteLine(" cls - Clears the screen");
                    Console.WriteLine(" echo - Repeats Text Given");

                    Console.WriteLine("Programs:");
                    Bcolor();
                    Console.WriteLine(" time - tells the time");
                    Console.WriteLine(" piano - Piano Program");
                    Console.WriteLine(" calc - Simple calculator");

                    Console.WriteLine("Games:");
                    Bcolor();
                    Console.WriteLine(" numguess - A Number Guessing Game");
                    Console.WriteLine(" snake - A Classic Game of Snake");

                    Console.WriteLine("Power Commands:");
                    Bcolor();
                    Console.WriteLine(" shutdown - Powers off your computer");
                    Console.WriteLine(" restart - Restarts your computer");
                    Console.WriteLine("");
                }
                else
                {
                    Console.WriteLine("");
                    Console.BackgroundColor = ConsoleColor.Gray;
                    Console.ForegroundColor = ConsoleColor.Black;
                    Console.WriteLine("|List of Commands/Apps|");
                    Bcolor();
                    Console.WriteLine("");

                    Console.WriteLine("Info/help Commands:");
                    Bcolor();
                    Console.WriteLine(" cmd - Shows all commands");
                    Console.WriteLine(" about - about the Operating System");
                    Console.WriteLine(" new - New Features in Build");

                    Console.WriteLine("Misc Commands:");
                    Bcolor();
                    Console.WriteLine(" cls - Clears the screen");
                    Console.WriteLine(" echo - Repeats Text Given");

                    Console.WriteLine("File System:");
                    Bcolor();
                    Console.WriteLine(" drive - Displays drive info");
                    Console.WriteLine(" dir - displays all files and sub-dirs in directory");
                    Console.WriteLine(" mkdir - Makes a Directory");
                    Console.WriteLine(" rmdir - Removes a Directory");
                    Console.WriteLine(" cd - Changes current directory");
                    Console.WriteLine(" type - Quickly Types out file content (use MIV to view files)");
                    Console.WriteLine(" del - deletes specified file");
                    Console.WriteLine(" copy - copies a file to the location given");
                    Console.WriteLine(" move - moves a file to the location given");
                    Console.WriteLine(" format - Formats the drive");
                    Console.WriteLine("Press any key to Continue...");
                    Console.ReadKey();

                    Console.WriteLine("Programs:");
                    Bcolor();
                    Console.WriteLine(" time - tells the time");
                    Console.WriteLine(" piano - Piano Program");
                    Console.WriteLine(" mkcal - Creates a calender");
                    Console.WriteLine(" chkcal - checks for a calender");
                    Console.WriteLine(" calc - Simple calculator");
                    Console.WriteLine(" MIV - Text Editor");

                    Console.WriteLine("Games:");
                    Bcolor();
                    Console.WriteLine(" numguess - A Number Guessing Game");
                    Console.WriteLine(" snake - A Classic Game of Snake");

                    Console.WriteLine("Power Commands:");
                    Bcolor();
                    Console.WriteLine(" shutdown - Powers off your computer");
                    Console.WriteLine(" restart - Restarts your computer");
                    Console.WriteLine("");
                }
            }

            else if (input == "about")
            {
                //about the OS
                Console.BackgroundColor = ConsoleColor.Gray;
                Console.ForegroundColor = ConsoleColor.Black;
                Console.WriteLine("PC Info:");
                Bcolor();
                Console.WriteLine("Ram:" + Cosmos.Core.CPU.GetAmountOfRAM() + "MB");

                Console.BackgroundColor = ConsoleColor.Gray;
                Console.ForegroundColor = ConsoleColor.Black;
                Console.WriteLine("\nOS Info:");
                Bcolor();
                Console.WriteLine("Sia OS 1.2");
                Console.WriteLine("Built on 4/13/2021.");
                Console.WriteLine("Sia OS is Created by Evyn Vega.");
                Console.WriteLine("Cosmos belongs to the COSMOS Project.");
                //Console.WriteLine("Some code in the project is not mine and some are from the Cobalt and Aura \nProjects.");
            }

            else if (input == "new")
            {
                Console.BackgroundColor = ConsoleColor.Gray;
                Console.ForegroundColor = ConsoleColor.Black;
                Console.WriteLine("|Whats New in 1.2?|\n");
                Bcolor();
                Console.WriteLine("Features and Additions");
                Console.WriteLine("- Snake Game.");
                Console.WriteLine("- Dir command has switches /w(default) /l(list).");
                Console.WriteLine("- Piano 2.0 (More keys).");
                Console.WriteLine("- About command can now tell CPU info.");
                Console.WriteLine("Change Log:");
                Console.WriteLine("- Dir command defaults to the wide format.");
                Console.WriteLine("- Color Personalization Removed");
                Console.WriteLine("- You can now exit out and go into Limited mode at anytime at prompt");
            }

            //File System Commands
            else if (input.StartsWith("cd "))
            {
                if (RealH == "false")
                {
                    chngdir.cd();
                }
                else
                {
                    RH.RError();
                }
            }

            else if (input.StartsWith("mkdir "))
            {
                if (RealH == "false")
                {
                    mkd.mkdir();
                }
                else
                {
                    RH.RError();
                }
            }

            else if (input.StartsWith("rmdir "))
            {
                if (RealH == "false")
                {
                    rmd.rmdir();
                }
                else
                {
                    RH.RError();
                }
            }

            //dir regular. I am to lazy and too dumb to make it work into one thing.
            else if (input == "dir")
            {
                if (RealH == "false")
                {
                    Files.dir();
                }
                else
                {
                    RH.RError();
                }
            }
            //dir option
            else if (input.StartsWith("dir "))
            {
                if (RealH == "false")
                {
                    Files.diropt();
                }
                else
                {
                    RH.RError();
                }
            }

            else if (input == "drive")
            {
                if (RealH == "false")
                {
                    DRV.drives();
                }
                else
                {
                    RH.RError();
                }
            }

            else if (input == "miv")
            {
                if (RealH == "false")
                {
                    MIV.StartMIV();
                }
                else
                {
                    RH.RError();
                }
            }

            else if (input.StartsWith("type "))
            {
                if (RealH == "false")
                {
                    open.type();
                }
                else
                {
                    RH.RError();
                }
            }

            else if (input.StartsWith("del "))
            {
                if (RealH == "false")
                {
                    dl.del();
                }
                else
                {
                    RH.RError();
                }
            }

            else if (input.StartsWith("copy "))
            {
                if (RealH == "false")
                {
                    cpy.copy();
                }
                else
                {
                    RH.RError();
                }
            }

            else if (input.StartsWith("move "))
            {
                if (RealH == "false")
                {
                    mv.move();
                }
                else
                {
                    RH.RError();
                }
            }

            else if (input == "format")
            {
                if (RealH == "false")
                {
                    frm.format();
                }
                else
                {
                    RH.RError();
                }
            }

            // Misc Applications
            else if (input == "time")
            {
                if (time == "12hour")
                {
                    Console.WriteLine(DateTime.UtcNow);
                }
                else
                {
                    Console.WriteLine(DateTime.Now);
                }
            }

            else if (input == "mkcal")
            {
                Calender.mkcal();
            }

            else if (input == "chkcal")
            {
                if (RealH == "false")
                {
                    try
                    {
                        Console.Write("What day do you want to check for (Example: 1-1-2020): ");
                        var day = Console.ReadLine().ToLower();
                        if (File.Exists(day + ".cal"))
                        {
                            Console.BackgroundColor = ConsoleColor.Black;
                            Console.ForegroundColor = ConsoleColor.Yellow;
                            Console.WriteLine("You have a Calender! Type 'open " + day + ".cal' to veiw it.");
                            Console.ResetColor();
                        }
                        else
                        {
                            Console.WriteLine("You have no calenders for that day");
                        }
                    }
                    catch (Exception Ex)
                    {
                        Console.WriteLine("Woah Sia OS just ran into a issue, here's some details.");
                        Console.WriteLine(Ex.ToString());
                    }
                }
                else
                {
                    RH.RError();
                }
            }

            else if (input == "piano")
            {
                Console.WriteLine("Cat Piano ver 1.0");
                Console.WriteLine("Press any key to continue");

                Piano.Pian();
            }

            else if (input == "calc")
            {
                Calculator.Calc();
            }

            else if (input == "setup")
            {
                if (RealH == "false")
                {
                    Setup.SetupStart();
                }
                else
                {
                    RH.RError();
                }
            }

            //Games (I stole lmao)
            else if (input == "numguess")
            {
                try
                {
                    Random random = new Random();

                    int returnValue = random.Next(1, 100);
                    int Guess       = 0;
                    int numGuesses  = 0;

                    Console.WriteLine("I am thinking of a number between 1-100.  Can you guess what it is?");

                    while (Guess != returnValue)
                    {
                        Guess = Convert.ToInt32(Console.Read());
                        string line = Console.ReadLine();   // Get string from user
                        if (!int.TryParse(line, out Guess)) // Try to parse the string as an integer
                        {
                            Console.WriteLine("Not an integer!");
                        }
                        else
                        {
                            numGuesses++;
                            if (Guess < returnValue)
                            {
                                Console.WriteLine("No, the number I am thinking of is higher than " + Guess + " .  Can you guess what it is?");
                            }
                            if (Guess > returnValue)
                            {
                                Console.WriteLine("No, the number I am thinking of is lower than " + Guess + " .  Can you guess what it is");
                            }
                        }
                    }
                    Console.WriteLine("Well done! The answer was " + returnValue + ".\nYou took " + numGuesses + " guesses.");
                }
                catch (Exception Ex)
                {
                    Console.WriteLine("Woah Sia OS just ran into a issue, here's some details.");
                    Console.WriteLine(Ex.ToString());
                }
            }

            else if (input == "snake")
            {
                SnakeGame.Init();
            }

            //Power
            else if (input == "shutdown")
            {
                int sec = 10;
                while (sec > 0)
                {
                    Console.WriteLine("Thank You for using Sia OS. Your computer will shutdown in  " + sec + " seconds, or press any key to shutdown now.");
                    sec--;
                    WaitSeconds(1);

                    if (System.Console.KeyAvailable == true)
                    {
                        Cosmos.System.Power.Shutdown();
                    }
                    else if (sec == 0)
                    {
                        Cosmos.System.Power.Shutdown();
                    }
                    Console.Clear();
                }
            }

            else if (input == "restart")
            {
                Sys.Power.Reboot();
            }

            //Limit mode stuff
            else if (input == "rhoff")
            {
                RealH = "false";

                Console.WriteLine("Real Hardware/Limited Mode Disabled");
            }

            else if (input == "rhon")
            {
                RealH = "true";
                Console.WriteLine("Real Hardware/Limited Mode enabled");
            }

            else if (input == "ison")
            {
                Console.WriteLine("Is in Real Harware/Limited Mode?: " + RealH);
            }

            //if a unknown command is typed then nothing because you deserve nothing because you are nothing to anyone.
            else
            {
            }
        }
Beispiel #9
0
 public static void mkcal()
 {
     if (Kernel.RealH == "false")
     {
         try
         {
             Console.Write("What day is this for? (Example: 1-1-2020): ");
             var    finput  = Console.ReadLine().ToLower();
             string calName = finput + ".cal";
             var    dir     = Directory.GetCurrentDirectory();
             var    file    = (calName);
             Console.Write("12:00 AM: ");
             var twea = Console.ReadLine().ToLower();
             Console.Write("1:00 : ");
             var onea = Console.ReadLine().ToLower();
             Console.Write("2:00 : ");
             var twoa = Console.ReadLine().ToLower();
             Console.Write("3:00 : ");
             var thra = Console.ReadLine().ToLower();
             Console.Write("4:00 : ");
             var fora = Console.ReadLine().ToLower();
             Console.Write("5:00 : ");
             var fiva = Console.ReadLine().ToLower();
             Console.Write("6:00 : ");
             var sixa = Console.ReadLine().ToLower();
             Console.Write("7:00 : ");
             var seva = Console.ReadLine().ToLower();
             Console.Write("8:00 : ");
             var eita = Console.ReadLine().ToLower();
             Console.Write("9:00 : ");
             var nina = Console.ReadLine().ToLower();
             Console.Write("10:00 : ");
             var tena = Console.ReadLine().ToLower();
             Console.Write("11:00 : ");
             var elva = Console.ReadLine().ToLower();
             Console.Write("12:00 PM: ");
             var twep = Console.ReadLine().ToLower();
             Console.Write("1:00 : ");
             var onep = Console.ReadLine().ToLower();
             Console.Write("2:00 : ");
             var twop = Console.ReadLine().ToLower();
             Console.Write("3:00 : ");
             var thrp = Console.ReadLine().ToLower();
             Console.Write("4:00 : ");
             var forp = Console.ReadLine().ToLower();
             Console.Write("5:00 : ");
             var fivp = Console.ReadLine().ToLower();
             Console.Write("6:00 : ");
             var sixp = Console.ReadLine().ToLower();
             Console.Write("7:00 : ");
             var sevp = Console.ReadLine().ToLower();
             Console.Write("8:00 : ");
             var eitp = Console.ReadLine().ToLower();
             Console.Write("9:00 : ");
             var ninp = Console.ReadLine().ToLower();
             Console.Write("10:00 : ");
             var tenp = Console.ReadLine().ToLower();
             Console.Write("11:00 : ");
             var elvp = Console.ReadLine().ToLower();
             if (File.Exists(dir + "\\" + file))
             {
                 File.Delete(dir + "\\" + file);
             }
             using (FileStream fs = File.Create(dir + "\\" + file))
             {
                 //12am
                 Byte[] title = new UTF8Encoding(true).GetBytes("Calender for " + finput + " ");
                 fs.Write(title, 0, title.Length);
                 Byte[] twa = new UTF8Encoding(true).GetBytes("12:00 AM :" + twea + "\n");
                 fs.Write(twa, 0, twa.Length);
                 Byte[] ona = new UTF8Encoding(true).GetBytes("1:00 :" + onea + "\n");
                 fs.Write(ona, 0, ona.Length);
                 Byte[] toa = new UTF8Encoding(true).GetBytes("2:00 :" + twoa + "\n");
                 fs.Write(toa, 0, toa.Length);
                 Byte[] tra = new UTF8Encoding(true).GetBytes("3:00 :" + thra + "\n");
                 fs.Write(tra, 0, tra.Length);
                 Byte[] foa = new UTF8Encoding(true).GetBytes("4:00 :" + fora + "\n");
                 fs.Write(foa, 0, foa.Length);
                 Byte[] fia = new UTF8Encoding(true).GetBytes("5:00 :" + fiva + "\n");
                 fs.Write(fia, 0, fia.Length);
                 Byte[] sia = new UTF8Encoding(true).GetBytes("6:00 :" + sixa + "\n");
                 fs.Write(sia, 0, sia.Length);
                 Byte[] sea = new UTF8Encoding(true).GetBytes("7:00 :" + seva + "\n");
                 fs.Write(sea, 0, sea.Length);
                 Byte[] eia = new UTF8Encoding(true).GetBytes("8:00 :" + eita + "\n");
                 fs.Write(eia, 0, eia.Length);
                 Byte[] nia = new UTF8Encoding(true).GetBytes("9:00 :" + nina + "\n");
                 fs.Write(nia, 0, nia.Length);
                 Byte[] tea = new UTF8Encoding(true).GetBytes("10:00 :" + tena + "\n");
                 fs.Write(tea, 0, tea.Length);
                 Byte[] ela = new UTF8Encoding(true).GetBytes("11:00 :" + elva + "\n");
                 fs.Write(ela, 0, ela.Length);
                 //12pm
                 Byte[] twp = new UTF8Encoding(true).GetBytes("12:00 PM :" + twep + "\n");
                 fs.Write(twp, 0, twp.Length);
                 Byte[] onp = new UTF8Encoding(true).GetBytes("1:00 :" + onep + "\n");
                 fs.Write(onp, 0, onp.Length);
                 Byte[] top = new UTF8Encoding(true).GetBytes("2:00 :" + twop + "\n");
                 fs.Write(top, 0, top.Length);
                 Byte[] trp = new UTF8Encoding(true).GetBytes("3:00 :" + thrp + "\n");
                 fs.Write(trp, 0, trp.Length);
                 Byte[] fop = new UTF8Encoding(true).GetBytes("4:00 :" + forp + "\n");
                 fs.Write(fop, 0, fop.Length);
                 Byte[] fip = new UTF8Encoding(true).GetBytes("5:00 :" + fivp + "\n");
                 fs.Write(fip, 0, fip.Length);
                 Byte[] sip = new UTF8Encoding(true).GetBytes("6:00 :" + sixp + "\n");
                 fs.Write(sip, 0, sip.Length);
                 Byte[] sep = new UTF8Encoding(true).GetBytes("7:00 :" + sevp + "\n");
                 fs.Write(sep, 0, sep.Length);
                 Byte[] eip = new UTF8Encoding(true).GetBytes("8:00 :" + eitp + "\n");
                 fs.Write(eip, 0, eip.Length);
                 Byte[] nip = new UTF8Encoding(true).GetBytes("9:00 :" + ninp + "\n");
                 fs.Write(nip, 0, nip.Length);
                 Byte[] tep = new UTF8Encoding(true).GetBytes("10:00 :" + tenp + "\n");
                 fs.Write(tep, 0, tep.Length);
                 Byte[] elp = new UTF8Encoding(true).GetBytes("11:00 :" + elvp + "\n");
                 fs.Write(elp, 0, elp.Length);
             }
             Console.WriteLine("Calender Made!");
         }
         catch (Exception Ex)
         {
             Console.WriteLine("Woah Sia OS just ran into a issue, here's some details.");
             Console.WriteLine(Ex.ToString());
         }
     }
     else
     {
         RH.RError();
     }
 }
 public Donner(string cin, string lastName, string firstName, BloodType bloodGrp, RH rhesus)
 {
     CIN       = cin;
     LastName  = lastName;
     FirstName = firstName;
     BloodGrp  = bloodGrp;
     Rhesus    = rhesus;
 }
Beispiel #11
0
 public DepartamentoController(RH rh)
 {
     RHContext = rh;
 }
        private Object ConvertKeyValue(Key key, out int length)
        {
            string keyStr = key.ToByteArray().ToHex();

            byte[] keyValue = RH.GetT <byte[]>(keyStr);
            length = keyValue.Length;
            ProtobufSerializer ps      = new ProtobufSerializer();
            string             keyType = key.Type;

            Object returnObj = new Object();

            switch (keyType)
            {
            case "UInt64Value":
                returnObj = ps.Deserialize <UInt64Value>(keyValue);
                break;

            case "Hash":
                returnObj = ps.Deserialize <Hash>(keyValue);
                break;

            case "BlockBody":
                returnObj = ps.Deserialize <BlockBody>(keyValue);
                break;

            case "BlockHeader":
                returnObj = ps.Deserialize <BlockHeader>(keyValue);
                break;

            case "Chain":
                returnObj = ps.Deserialize <Chain>(keyValue);
                break;

            case "Change":
                break;

            case "SmartContractRegistration":
                returnObj = ps.Deserialize <SmartContractRegistration>(keyValue);
                break;

            case "TransactionResult":
                returnObj = ps.Deserialize <TransactionResult>(keyValue);
                break;

            case "Transaction":
                returnObj = ps.Deserialize <Transaction>(keyValue);
                break;

            case "FunctionMetadata":
                returnObj = ps.Deserialize <FunctionMetadata>(keyValue);
                break;

            case "SerializedCallGraph":
                returnObj = ps.Deserialize <SerializedCallGraph>(keyValue);
                break;

            case "WorldState":
                returnObj = ps.Deserialize <WorldState>(keyValue);
                break;

            case "Miners":
                returnObj = ps.Deserialize <Miners>(keyValue);
                break;

            case "BlockProducer":
                returnObj = ps.Deserialize <BlockProducer>(keyValue);
                break;

            case "Round":
                returnObj = ps.Deserialize <Round>(keyValue);
                break;

            case "AElfDPoSInformation":
                returnObj = ps.Deserialize <AElfDPoSInformation>(keyValue);
                break;

            case "Int32Value":
                returnObj = ps.Deserialize <Int32Value>(keyValue);
                break;

            case "StringValue":
                returnObj = ps.Deserialize <StringValue>(keyValue);
                break;

            case "Timestamp":
                returnObj = ps.Deserialize <Timestamp>(keyValue);
                break;

            case "SInt32Value":
                returnObj = ps.Deserialize <SInt32Value>(keyValue);
                break;

            default:
                break;
            }

            return(returnObj);
        }
Beispiel #13
0
 public override void OnStartLocalPlayer()
 {
     //  body.GetComponent<MeshRenderer>().material.color = Color.blue;
     LH.GetComponent <MeshRenderer>().material.color = Color.blue;
     RH.GetComponent <MeshRenderer>().material.color = Color.blue;
 }