Exemplo n.º 1
0
    public void Add(MasterClass item)
    {
        int val     = item.Stuff();
        var visitor = new Visitor(this, val);

        item.Accept(visitor);
    }
Exemplo n.º 2
0
        public string Index()
        {
            ApplicationUser appuser;

            try {
                MasterClass master = new MasterClass();

                if (User.Identity.IsAuthenticated)
                {
                    appuser = _context.Users.FirstOrDefault(u => u.UserName == User.Identity.Name);
                    master.IsAuthenticated = true;
                    master.User            = _mapper.Map <ApplicationUserView>(appuser);
                    master.UserRoles       = _userManager.GetRolesAsync(appuser).Result;
                }
                else
                {
                    master.IsAuthenticated = false;
                }
                master.Countries         = _context.Countries.ToArray();
                master.Roles             = _context.Roles.Select(r => r.Name).ToArray();
                returnObject.ChangedData = master;
                returnObject.isSuccess   = true;
                returnObject.Message     = "";
                return(returnObject.GetResponse());
            }
            catch (Exception ex)
            {
                returnObject.isSuccess = false;
                returnObject.Message   = returnObject.GetErrorMessage(ex);
                return(returnObject.GetResponse());
            }
        }
        public async Task <IActionResult> Edit(int id, [Bind("mClassId,mClassName,mClassCode,IsActive")] MasterClass masterClass)
        {
            if (id != masterClass.mClassId)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(masterClass);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!MasterClassExists(masterClass.mClassId))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(masterClass));
        }
Exemplo n.º 4
0
        public RecordsViewer(MasterClass masterClass)
        {
            //this.masterClass = masterClass;
            this.masterClass = masterClass;
            InitializeComponent();

            int index = 0;
            Dictionary <string, List <Record> > dictionary = masterClass.countries;
            List <Record> records;

            records = masterClass.RecordsByCountry("Colombia");

            for (int i = 0; i < records.Count; i++)
            {
                Record record = records[i];
                index = dataGridView1.Rows.Add();
                dataGridView1.Rows[index].Cells[0].Value = "Colombia";
                dataGridView1.Rows[index].Cells[1].Value = record.Year;
                dataGridView1.Rows[index].Cells[2].Value = record.AgeLower;
                dataGridView1.Rows[index].Cells[3].Value = record.AgeUpper;
                dataGridView1.Rows[index].Cells[4].Value = record.Generation;
                dataGridView1.Rows[index].Cells[5].Value = record.Sex;
                dataGridView1.Rows[index].Cells[6].Value = record.Suicide_no;
                dataGridView1.Rows[index].Cells[7].Value = record.Population;
                dataGridView1.Rows[index].Cells[8].Value = record.Ratio;
            }
        }
Exemplo n.º 5
0
        public async Task GetMasterclassByTopic(IDialogContext context, LuisResult result)
        {
            await context.PostAsync("Let me see...");

            MasterClass masterClass = null;

            if (result.TryFindEntity("TopicReference", out EntityRecommendation entityRecommendation) == false)
            {
                await context.PostAsync($"I'm sorry, but I couldn't figure out the topic you asked for.");
            }
            else
            {
                masterClass = await WebApiApplication
                              .Container
                              .GetInstance <ILeapRestClient>()
                              .GetMasterClassByTopic(entityRecommendation.Entity);

                if (masterClass == null)
                {
                    await context.PostAsync($"Sorry but I couldn't find any masterclasses covering '{entityRecommendation.Entity}'");
                }
                else
                {
                    var reply = context.MakeMessage();
                    reply.Text = "I found this masterclass for you: ";
                    reply.Attachments.Add(ConvertMasterclassToHeroCardAttachment(masterClass));

                    await context.PostAsync(reply);
                }
            }
            context.Wait(MessageReceived);
        }
Exemplo n.º 6
0
        static void Main(string[] args)
        {
            try
            {
                master = new MasterClass();
                string line;
                System.IO.StreamReader file = new System.IO.StreamReader(args[0]);
                while ((line = file.ReadLine()) != null)
                {
                    line = line.Trim();
                    String[] sottocomandi = line.Split('=');
                    switch (sottocomandi[0])
                    {
                    case "porta":
                        master.portname = sottocomandi[1];
                        break;

                    case "baudrate":
                        master.BaudRate = int.Parse(sottocomandi[1]);
                        break;
                    }
                }

                file.Close();
            }
            catch (Exception e)
            {
                Console.WriteLine(e.Message);
                return;
            }
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            Application.Run(new Form1());
        }
 public void HandleMasterClass(MasterClass item)
 {
     /*
      * stuff generic to both subclasses...
      */
     item.SpecificMethod()
 }
Exemplo n.º 8
0
        public void ProtoypingTest()
        {
            // Входной параметр: новый объект класса MasterClass.
            var obj = new MasterClass();

            obj.Prototyping(true);
            Assert.True(obj.Prototyped);
        }
Exemplo n.º 9
0
    public void SetUp()
    {
        master = MasterClass.inst;
        cam    = FindObjectOfType <Camera>().transform;

        player = master.player.transform;
        pos    = cam.position;
    }
 // Start is called before the first frame update
 void Start()
 {
     WeaponPicker(0);
     lr             = GetComponent <LineRenderer>();
     master         = MasterClass.inst;
     Cursor.visible = false;
     clickerNum     = weapons.Length - 1;
 }
Exemplo n.º 11
0
        public MainWindow()
        {
            InitializeComponent();

            mc = new MasterClass();

            BringToFront();
        }
Exemplo n.º 12
0
    public static MasterClass CreateMaster(string val)
    {
        MasterClass mc = new MasterClass()
        {
            MyValue = val
        };

        return(mc);
    }
Exemplo n.º 13
0
        public void CheckNotNullPropertiesTest2()
        {
            // Входной параметр: новый объект класса MasterClass.
            var obj = new MasterClass();

            string[] actual = obj.CheckNotNullProperties(Information.GetView("MasterClassE", typeof(MasterClass)), false);

            // Ожидаемый результат: пустой массив строк.
            Assert.True(EquivalenceMethods.EqualStringArrays(new string[0], actual));
        }
Exemplo n.º 14
0
    public MOD_AdminMenu(MasterClass newMaster) : base(newMaster)
    {
        dataService = StartupScript.ds;

        if (!PlayerPrefs.HasKey(ON_OFF_KEY))
        {
            PlayerPrefs.SetInt(ON_OFF_KEY, 0);
        }

        // Debug.Log("********************* \n IN MODEL ON OFF KEY IS " + PlayerPrefs.GetInt(ON_OFF_KEY).ToString() + "\n*************************");
    }
Exemplo n.º 15
0
        public void InsertNullReferenceExceptionTest()
        {
            var exception = Xunit.Record.Exception(() =>
            {
                var master = new MasterClass();
                var arra   = new DetailArrayOfDetailClass(master);
                arra.Insert(0, null);
            });

            Assert.IsType(typeof(NullReferenceException), exception);
        }
        public async Task <IActionResult> Create([Bind("mClassId,mClassName,mClassCode,IsActive")] MasterClass masterClass)
        {
            masterClass.IsActive = true;
            if (ModelState.IsValid)
            {
                _context.Add(masterClass);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(masterClass));
        }
Exemplo n.º 17
0
    /// <summary>
    /// This is the constructor for the game loop model.
    /// </summary>
    /// <param name="newMaster"></param>
    public MOD_GameLoop(MasterClass newMaster) : base(newMaster)
    {
        dataService = StartupScript.ds;

        GrabListData();

        entryMax = playListData.Count;

        GetGameLoopSettings(0);

        TotalRoundCount();
    }
Exemplo n.º 18
0
    ///<summary>
    /// Creates the model(s) and controller(s) workers of the next provided Domain.
    ///</summary>
    ///<param name="nextDomain">The name of the next domain.</param>
    private static void CreateWorkers(string nextDomain)
    {
        //If the domain is in the masterpool, attempt to kill its workers
        if (masterPool.ContainsKey(nextDomain))
        {
            MasterClass next = (MasterClass)masterPool[nextDomain];

            if (!next.WorkersAlive)
            {
                next.CreateAndAssignWorkers();
            }
        }
    }
Exemplo n.º 19
0
        public void Add(MasterClass item)
    {
        int val = item.Stuff();

        if (item is SubClass1)
        {
            subClass1Dict[val] = item;
        }
        if (item is SubClass2)
        {
            subClass2Dict[val] = item;
        }
    }
Exemplo n.º 20
0
    public MOD_WordEditing(MasterClass newMaster) : base(newMaster)
    {
        dataService      = StartupScript.ds;
        wordList         = new Dictionary <string, WordDO>();
        textureList      = new List <Texture2D>();
        stockTextureList = new List <Texture2D>();
        wordImageNames   = new List <string>();
        lastPlayEntryId  = dataService.GetLastPlayEntryId();

        if (wordList == null || wordList.Count == 0)
        {
            LoadWordList();
        }
    }
Exemplo n.º 21
0
        public static void Init(AppPressDemo p, MasterClass Master)
        {
            var adminLogin  = p.appPressDemoSessionData.isAdmin;
            var sessionData = p.appPressDemoSessionData;
            var Employeeid  = p.loginUserId;

            Master.ProductIcon.val    = "Resources/img/ProductIcon.png";
            Master.ProductLogo.val    = "Resources/img/ProductLogo.png";
            Master.ProductURL.val     = AppPressApplication.Settings.ProductURL;
            Master.ProductName.val    = AppPressApplication.Settings.ProductName;
            Master.EmployeeName.val   = sessionData.loginName;
            Master.EmployeeImgUrl.val = sessionData.loginImgUrl;
            Master.EmployeeEmail.val  = sessionData.email;
        }
Exemplo n.º 22
0
        public void CheckNotNullPropertiesTest()
        {
            // Входной параметр: новый объект класса MasterClass.
            var obj = new MasterClass();

            // Ожидаемый результат: пустой массив строк.
            var expected = new string[0];

            string[] actual = obj.CheckNotNullProperties();
            Assert.True(EquivalenceMethods.EqualStringArrays(expected, actual));
            obj.SetStatus(ObjectStatus.Deleted);
            actual = obj.CheckNotNullProperties();
            Assert.True(EquivalenceMethods.EqualStringArrays(expected, actual));
        }
Exemplo n.º 23
0
                // TODO: Insta reload ?
                // TODO: A class Die ?
                private IEnumerator Die()
                {
                    Destroy(GetComponent <Rigidbody2D>());
                    Destroy(GetComponent <Controller>());
                    Destroy(GetComponent <Jump>());

                    foreach (Collider2D col in GetComponents <Collider2D>())
                    {
                        Destroy(col);
                    }

                    Destroy(GetComponent <Collider2D>());

                    GameObject deathGO = GameObject.Find("death");

                    deathGO.transform.GetChild(0).gameObject.SetActive(true);

                    Image deathImg = deathGO.GetComponent <Image>();
                    Text  deathTxt = deathGO.GetComponentInChildren <Text>();

                    deathTxt.text = Lang.GetString("player.death");

                    // A fade-in black screen

                    int remainingTime = 255;

                    while (remainingTime > 0)
                    {
                        deathImg.color = new Color(0, 0, 0, deathImg.color.a + 2 / 255F);
                        remainingTime -= 2;

                        if (remainingTime % 3 == 0)
                        {
                            deathTxt.fontSize++;
                        }

                        yield return(new WaitForSeconds(0.02F));
                    }

                    // Black screen for 2 secs for reloading the game

                    yield return(new WaitForSeconds(2F));

                    // TODO: Insta reload ?
                    MasterClass.InitializeTheGame();
                    UnityEngine.SceneManagement.SceneManager.LoadScene(0);
                    MasterClass.InitializeAwakes();
                }
        public void GetExistingVariableNamesNotFoundFunctionParametersExceptionTest()
        {
            var exception = Record.Exception(() =>
            {
                var obj = new MasterClass()
                {
                    StringMasterProperty = "prop", IntMasterProperty = 666
                };
                SQLWhereLanguageDef langdef = SQLWhereLanguageDef.LanguageDef;
                Function lf2 = langdef.GetFunction(
                    langdef.funcNOT,
                    langdef.GetFunction(langdef.funcEQ, new VariableDef(langdef.GuidType, "MasterClass"), obj.DetailClass));
            });

            Assert.IsType(typeof(FunctionalLanguageDef.NotFoundFunctionParametersException), exception);
        }
Exemplo n.º 25
0
        public void FullClearDataCopyTest()
        {
            // Входные параметры: объекты данных классов MasterClass и DetailClass.
            var obj       = new MasterClass();
            var detailobj = new DetailClass();

            obj.StringMasterProperty = "StringMasterProperty";
            obj.DetailClass.Add(detailobj);
            obj.IntMasterProperty    = 666;
            detailobj.Detailproperty = "DetailProperty";
            obj.FullClearDataCopy();

            // Ожидаемый результат: после очистки, всех данные равны null.
            Assert.Null(obj.GetDataCopy());
            Assert.Null(detailobj.GetDataCopy());
        }
Exemplo n.º 26
0
        public override PluginV1 GetConfiguration()
        {
            List <Recording> recordings = new List <Recording>();

            foreach (UCRecord ucr in flowLayoutPanel1.Controls)
            {
                recordings.Add(ucr.GetConfig());
            }

            MasterClass mc = new MasterClass();

            mc.Recordings = recordings.ToArray();

            _cf.SetCustomObjectV2(mc);

            return(base.GetConfiguration());
        }
Exemplo n.º 27
0
        public void InsertArgumentOutOfRangeExceptionTest()
        {
            var exception = Xunit.Record.Exception(() =>
            {
                var obj = new MasterClass();

                // Массив детейловых объектов.
                var dArr = new DetailArrayOfDetailClass(obj);

                // Детейловый объект.
                var дObj1 = new DetailClass()
                {
                    Detailproperty = "первый"
                };
                dArr.Insert(-1, дObj1);
            });

            Assert.IsType(typeof(ArgumentOutOfRangeException), exception);
        }
Exemplo n.º 28
0
    public MOD_PlayList(MasterClass newMaster) : base(newMaster)
    {
        dataService = StartupScript.ds;

        playListEntries = new List <DO_PlayListObject>();

        entryCheckSet = new HashSet <DO_PlayListObject>();

        wordIdCheckSet = new HashSet <int>();

        RetrieveAndSort();

        PopulateWordList();

        PopulateWordTagList();

        PopulateTagsDictionary();

        GetGameLoopSettings(0);
    }
Exemplo n.º 29
0
        private Attachment ConvertMasterclassToHeroCardAttachment(MasterClass masterClass)
        {
            var currentYear = GetCurrentYear();


            var heroCard = new HeroCard
            {
                Title    = masterClass.Title,
                Subtitle = masterClass.Date.ToString("dddd, dd MMMM"),
                Text     = masterClass.Description,
                Images   = new List <CardImage> {
                    new CardImage($"https://leap.microsoft.no/Content/images/MasterClasses/{currentYear}/{masterClass.Number + 1}.png")
                },
                Buttons = new List <CardAction> {
                    new CardAction(ActionTypes.OpenUrl, "View online", null, "https://leap.microsoft.no/masterclasses")
                }
            };

            return(heroCard.ToAttachment());
        }
Exemplo n.º 30
0
        public async Task GetNextMasterClass(IDialogContext context, LuisResult result)
        {
            await context.PostAsync("Let's see now...");

            var masterClasses = await WebApiApplication.Container.GetInstance <ILeapRestClient>()
                                .GetMasterClasses();

            var nextMasterClass = masterClasses.OrderBy(m => m.Date).FirstOrDefault(m => m.Date >= DateTime.Now.Date);

            SelectedMasterclass = nextMasterClass;


            var reply = context.MakeMessage();

            reply.Text = "Here is the next masterclass:";
            reply.Attachments.Add(ConvertMasterclassToHeroCardAttachment(nextMasterClass));

            await context.PostAsync(reply);

            context.Wait(MessageReceived);
        }