Ejemplo n.º 1
0
        public void SetUp()
        {
            temporaryAssembly = Path.GetTempFileName();
            File.Copy(GetType().Assembly.Location, temporaryAssembly, true);
            module = ModuleDefinition.ReadModule(temporaryAssembly);

            adjuster   = new Adjuster();
            options    = new CodeGenerationOptions();
            inputFile  = Path.GetTempFileName();
            outputFile = inputFile + ".adjusted";

            //We should fail on warnings & errors, and just log debug
            Log.LogDebugAction     = TestContext.Out.WriteLine;
            Log.LogWarningAction   =
                Log.LogErrorAction = Assert.Fail;

            File.WriteAllText(inputFile, @"
<api>
	<package name=""com.mypackage"">
		<class abstract=""false"" deprecated=""not deprecated"" extends=""java.lang.Object"" extends-generic-aware=""java.lang.Object"" final=""false"" name=""foo"" static=""false"" visibility=""public"">
			<constructor deprecated=""not deprecated"" final=""false"" name=""foo"" static=""false"" visibility=""public"" />
			<method abstract=""false"" deprecated=""not deprecated"" final=""false"" name=""bar"" native=""false"" return=""void"" static=""false"" synchronized=""false"" visibility=""public"" />
		</class>
	</package>
</api>");
        }
Ejemplo n.º 2
0
        public ActionResult SaveAdjusterDetail(Adjuster _objAdjuster)
        {
            var _message = GlobalConst.ConstantChar.StringBlank;
            var errors = ModelState.Values.SelectMany(v => v.Errors);
            if (ModelState.IsValid)
            {
                _objAdjuster.AdjFirstName = _objAdjuster.AdjFirstName.Trim();
                _objAdjuster.AdjLastName = _objAdjuster.AdjLastName.Trim();

                if (_objAdjuster.AdjusterID.ToString() == GlobalConst.ConstantChar.StringBlank)
                {
                    if (_iPaticipantService.addAdjuster(Mapper.Map<MMCService.PaticipantService.Adjuster>(_objAdjuster)) > 0)
                        _message = GlobalConst.Message.SaveMessage;
                    else
                        _message = GlobalConst.Message.ErrorMessage;
                }
                else
                {
                    if (_iPaticipantService.updateAdjuster(Mapper.Map<MMCService.PaticipantService.Adjuster>(_objAdjuster)) > 0)
                        _message = GlobalConst.Message.UpdateMessage;
                    else
                        _message = GlobalConst.Message.ErrorMessage;
                }
            }
            else
                _message = GlobalConst.Message.ModelErrorMessage;
            return Json(_message, GlobalConst.ContentTypes.TextHtml);
        }
Ejemplo n.º 3
0
 public ClassMenu()
 {
     this.InitializeComponent();
     Adjuster.AdjustWindow(Floor);
     song.Source = MediaSource.CreateFromUri(new Uri("ms-appx:///GameAssets/Songs/Waterfall.mp3"));
     song.Play();
 }
Ejemplo n.º 4
0
        public void SetUp()
        {
            temporaryAssembly = Path.GetTempFileName();
            File.Copy(GetType().Assembly.Location, temporaryAssembly, true);
            module = ModuleDefinition.ReadModule(temporaryAssembly);

            adjuster   = new Adjuster();
            options    = new CodeGenerationOptions();
            inputFile  = Path.GetTempFileName();
            outputFile = inputFile + ".adjusted";

            //We should fail on warnings & errors, and just log debug
            Log.LogDebugAction     = TestContext.Out.WriteLine;
            Log.LogWarningAction   =
                Log.LogErrorAction = Assert.Fail;

            File.WriteAllText(inputFile, @"
<api>
	<package name=""com.mypackage"">
		<class abstract=""false"" deprecated=""not deprecated"" extends=""java.lang.Object"" extends-generic-aware=""java.lang.Object"" final=""false"" name=""foo"" static=""false"" visibility=""public"">
			<constructor deprecated=""not deprecated"" final=""false"" name=""foo"" static=""false"" visibility=""public"" />
			<method abstract=""false"" deprecated=""not deprecated"" final=""false"" name=""bar"" native=""false"" return=""void"" static=""false"" synchronized=""false"" visibility=""public"" />
		</class>
	</package>
</api>");

            foreach (var type in module.Types.Where(t => t.IsClass && t.Namespace == "Java.Lang"))
            {
                //Make sure we use this method instead of SymbolTable directly, to match what happens in generator.exe
                Xamarin.Android.Binder.CodeGenerator.ProcessReferencedType(type, options);
            }
        }
 public AdjusterFormViewModel()
 {
     if (Adjuster == null)
     {
         Adjuster = new Adjuster();
     }
     InsuranceCompanies = new ObservableCollection <DTO_InsuranceCompany>(ServiceLayer.InsuranceCompaniesList);
 }
Ejemplo n.º 6
0
    private void createGameObjectsForSettings(List <Setting> settings, int tabIndex)
    {
        List <GameObject> settingsInTab  = new List <GameObject>();
        List <Adjuster>   adjustersInTab = new List <Adjuster>();

        foreach (Setting setting in settings)
        {
            if (setting.category == SETTINGS_TABS[tabIndex].transform.Find("Label").gameObject.GetComponent <TextMeshProUGUI>().text)
            {
                GameObject settingGameObject = GameObject.Instantiate(Resources.Load("Prefabs/Setting") as GameObject);
                settingGameObject.transform.Find("Label").GetComponent <TextMeshProUGUI>().text = setting.name;
                Adjuster adjuster = null;
                switch (setting.adjustmentMethod)
                {
                case "Color":
                    adjuster = new ColorAdjuster(colorScheme, setting.name, setting.description, setting.options != null ? setting.options : new string[] { }, setting.currentValue != null ? setting.currentValue : "");
                    break;

                case "Dropdown":
                    adjuster = new DropdownAdjuster(colorScheme, setting.name, setting.description, setting.defaultValue != null ? setting.defaultValue : "", setting.options != null ? setting.options : new string[] { }, setting.currentValue != null ? int.Parse(setting.currentValue) : 0);
                    break;

                case "Image":
                    adjuster = new ImageAdjuster(colorScheme, setting.name, setting.description, setting.options != null ? setting.options : new string[] { }, setting.currentValue != null ? setting.currentValue : "");
                    break;

                case "Increment":
                    adjuster = new IncrementAdjuster(colorScheme, setting.name, setting.description, setting.options != null && setting.options.Length >= 1 ? int.Parse(setting.options[0]) : 0, setting.options != null && setting.options.Length >= 2 ? int.Parse(setting.options[1]) : 0, setting.currentValue != null ? int.Parse(setting.currentValue) : 0);
                    break;

                case "Input":
                    adjuster = new InputAdjuster(colorScheme, setting.name, setting.description, setting.placeholder != null ? setting.placeholder : "", setting.currentValue != null ? setting.currentValue : "", setting.options != null && setting.options.Length >= 1 ? bool.Parse(setting.options[0]) : false);
                    break;

                case "Slider":
                    adjuster = new SliderAdjuster(colorScheme, setting.name, setting.description, setting.options != null && setting.options.Length >= 1 ? float.Parse(setting.options[0]) : 0, setting.options != null && setting.options.Length >= 2 ? float.Parse(setting.options[1]) : 0, setting.currentValue != null ? float.Parse(setting.currentValue) : 0, setting.options != null && setting.options.Length >= 3 ? setting.options[2] : "");
                    break;

                case "Switch":
                    adjuster = new SwitchAdjuster(colorScheme, setting.name, setting.description, setting.options != null && setting.options.Length >= 1 ? setting.options[0] : "", setting.options != null && setting.options.Length >= 2 ? setting.options[1] : "", setting.currentValue != null && bool.Parse(setting.currentValue.ToLower()));
                    break;

                case "Button":
                default:
                    adjuster = new ButtonAdjuster(colorScheme, setting.name, setting.description, setting.options != null && setting.options.Length >= 1 ? setting.options[0] : "", setting.currentValue != null && bool.Parse(setting.currentValue.ToLower()));
                    break;
                }
                adjuster.GAME_OBJECT.transform.SetParent(settingGameObject.transform.Find("AdjustmentMethod"));
                settingsInTab.Add(settingGameObject);
                adjustersInTab.Add(adjuster);
            }
        }
        SETTINGS_IN_TABS[tabIndex]  = settingsInTab;
        ADJUSTERS_IN_TABS[tabIndex] = adjustersInTab;
    }
Ejemplo n.º 7
0
 public ActionResult SaveAdjusterDetail(int? id)
 {
     getNoOfReferralAccordingToProcessLevels();
     if (id != null)
     {
         Adjuster _objAdjusterModel = Mapper.Map<Adjuster>(_iPaticipantService.getAdjusterByID(id.Value));
         return View(_objAdjusterModel);
     }
     else
         return View();
 }
Ejemplo n.º 8
0
 public ActionResult AddAdjuster(Adjuster objAdjuster)
 {
     try
     {
         objAdjuster.AdjusterId = _adjusterBL.AddAdjusterRecord(Mapper.Map <LMGEDI.Core.Data.Model.Adjuster>(objAdjuster));
         return(Json(objAdjuster, GlobalConst.ContentTypes.TextHtml));
     }
     catch (Exception ex)
     {
         _arCommonService.CreateErrorLog(ex.Message, ex.StackTrace);
         return(View());
     }
 }
        public BattleStage()
        {
            this.InitializeComponent();
            Window.Current.CoreWindow.KeyDown += CoreWindow_KeyDown;
            Adjuster.AdjustWindow(Floor);
            SetAllMenusReady();
            Floor.Children.Remove(Turn1);
            Floor.Children.Remove(Turn2);
            song.Source = MediaSource.CreateFromUri(new Uri("ms-appx:///GameAssets/Songs/Battle.mp3"));
            song.Play();
            RemoverMenus();

            delay.Tick    += delayAtaque;
            delaymob.Tick += delayMob;
        }
Ejemplo n.º 10
0
        /// <summary>
        /// Remove fields with given values
        /// </summary>
        /// <param name="adjuster">Adjuster to remove fields from</param>
        private void RemoveFields(Adjuster adjuster)
        {
            if (DatItemFields.Contains(DatItemField.Default))
            {
                adjuster.Default = null;
            }

            if (adjuster.ConditionsSpecified)
            {
                foreach (Condition subCondition in adjuster.Conditions)
                {
                    RemoveFields(subCondition, true);
                }
            }
        }
Ejemplo n.º 11
0
        static void Main(string[] args)
        {
            AdjustDelegate d;

            Console.WriteLine("Delegate Example 1: Plug-In Method ");
            Console.WriteLine("Enter an adjustment percentage between -100 ");
            Console.WriteLine("and + 1000 or <Enter> for standard markup:");
            decimal percentage;

            if (decimal.TryParse(Console.ReadLine(), out percentage) &&
                percentage >= -100.0M && percentage <= 1000.0M)
            {
                // To use an instance method, we need to create an instance
                // of an object that has the method.
                Adjuster adj = new Adjuster(percentage);
                // delegate operation to the object
                d = adj.Apply;
            }
            else
            {
                // To use a static method, we just use the class name to
                // reference the method.
                d = Adjuster.ApplyStandard;
            }

            while (true)
            {
                Console.WriteLine("Enter list price then "
                                  + "<Enter> or just <Enter> to quit:");
                decimal listPrice;
                if (decimal.TryParse(Console.ReadLine(), out listPrice))
                {
                    Console.WriteLine("List Price: "
                                      + listPrice.ToString("c")
                                      + "\t Adj Price: "
                                      + d(listPrice).ToString("c"));
                }
                else
                {
                    break;
                }
            }

            Console.WriteLine("Press <Enter> to quit the program:");
            Console.ReadLine();
        }
Ejemplo n.º 12
0
        public MainPage()
        {
            ApplicationView.PreferredLaunchWindowingMode = ApplicationViewWindowingMode.FullScreen;

            //Teste de tamanho ajustável:
            //......................................................................................................
            //ApplicationView.PreferredLaunchViewSize = new Size(1366, 768);
            //ApplicationView.PreferredLaunchWindowingMode = ApplicationViewWindowingMode.PreferredLaunchViewSize;
            //......................................................................................................
            this.InitializeComponent();

            //Classe de extensão para ajustar todas os xalm:
            Adjuster.AdjustWindow(Floor);
            song.Source = MediaSource.CreateFromUri(new Uri("ms-appx:///GameAssets/Songs/Waterfall.mp3"));
            song.Play();
            Debug.WriteLine(Start.Height + "," + Start.Width);
        }
Ejemplo n.º 13
0
        private static void AssertEqualComponents(Adjuster adjuster, TimeSpanComponent adjustedComponent, int adjustedValue)
        {
            var adjusted = adjuster(sample, adjustedValue);

            for (var component = TimeSpanComponent.Milliseconds; component <= TimeSpanComponent.Days; component++)
            {
                AssertEqualComponent(component);
            }

            void AssertEqualComponent(TimeSpanComponent testedComponent)
            {
                var adjustedTimeSpanComponent = adjusted.GetComponent(testedComponent);
                var expectedComponent         = testedComponent == adjustedComponent ? adjustedValue : sample.GetComponent(testedComponent);

                Assert.AreEqual(expectedComponent, adjustedTimeSpanComponent);
            }
        }
Ejemplo n.º 14
0
        protected static void OnTimer()
        {
            try
            {
                if (sTimer != null)
                {
                    sTimer.Destroy();
                    sTimer = null;
                }

                sTimer = new Adjuster();
                Simulator.AddObject(sTimer);
            }
            catch (Exception exception)
            {
                Common.Exception("OnTimer", exception);
            }
        }
        async private Task <bool> getAdjustments()
        {
            if (LoggedInUser.PermissionID == 1)
            {
                if ((ErrorMessage = await new ServiceLayer().GetAllAdjustments()) != null)
                {
                    return(false);
                }
            }
            else
            {
                /// Obtain list of adjustments for specific employee only
            }

            Adjustments = new ObservableCollection <Adjustment>();
            foreach (DTO_Adjustment adjustment in ServiceLayer.AdjustmentsList)
            {
                Adjustment a = new Adjustment(adjustment);

                if ((ErrorMessage = await new ServiceLayer().GetAdjusterByID(new Adjuster {
                    AdjusterID = adjustment.AdjusterID
                }.toDTO())) != null)
                {
                    return(false);
                }

                Adjuster = new Adjuster(ServiceLayer.Adjuster);

                a.AdjusterName = Adjuster.FirstName + " " + Adjuster.LastName;

                //if ((ErrorMessage = await new ServiceLayer().GetClaimByClaimID(new Claim { ClaimID = a.ClaimID }.toDTO())) != null)
                //    return false;
                Claim = Claims.Where(c => c.ClaimID == a.ClaimID).Single();

                a.MRNNumber = Claim.MRNClaimNumber;

                a.AdjustmentResult = AdjustmentResults.Where(ar => ar.AdjustmentResultID == a.AdjustmentResultID).Single().AdjustmentResult;

                Adjustments.Add(a);
            }

            return(true);
        }
Ejemplo n.º 16
0
        public void addAdjuster()
        {
            Adjuster _adjuster = new Adjuster
            {
                AdjFirstName = "AdjFirstName2",
                AdjLastName  = "vLastName2",
                AdjPhone     = "2135649872",
                AdjAddress1  = "AdjAddress1",
                AdjAddress2  = "AdjAddress2",
                AdjFax       = "2135469872",
                AdjEMail     = "*****@*****.**",
                AdjZip       = "90024",
                AdjCity      = "AdjCity2",
                AdjStateId   = 1,
                ClientID     = 2
            };
            var _id = _adjusterRepository.addAdjuster(_adjuster);

            Assert.IsTrue(_id > 0, "failed");
        }
Ejemplo n.º 17
0
        static void Main(string[] args)
        {
            Console.WriteLine("Delegate Example 2:");
            Console.WriteLine("Delegate as a Call-Back method");

            decimal[] prices   = { 678.34m, 34.22m, 1293.11m };
            Adjuster  adjuster = new Adjuster(100m);

            // Second method argument is a call-back delegate,
            // which the method "plugs into" its code at the
            // appropriate place(s).
            DecimalTransformer.Transformer(prices, adjuster.Apply);

            // Print adjusted prices
            foreach (var item in prices)
            {
                Console.WriteLine("Adjusted Price: "
                                  + item.ToString("c"));
            }

            Console.WriteLine("Press <Enter> to quit the program:");
            Console.ReadLine();
        }
        async private void saveAdjuster(object o)
        {
            if (Adjuster.AdjusterID == 0)
            {
                if ((ErrorMessage = await new ServiceLayer().AddAdjuster(Adjuster.toDTO())) != null)
                {
                    return;
                }

                Adjuster = new Adjuster(ServiceLayer.Adjuster);
                Adjusters.Add(Adjuster);
            }
            else
            {
                if ((ErrorMessage = await new ServiceLayer().UpdateAdjuster(Adjuster.toDTO())) != null)
                {
                    return;
                }

                Adjuster = new Adjuster(ServiceLayer.Adjuster);
            }

            OnRequestClose(this, new EventArgs());
        }
Ejemplo n.º 19
0
 public int updateAdjuster(Adjuster _adjuster)
 {
     return(_iAdjusterRepository.updateAdjuster(Mapper.Map <DTO.Adjuster, MMC.Core.Data.Model.Adjuster>(_adjuster)));
 }
Ejemplo n.º 20
0
 public int addAdjuster(Adjuster _adjuster)
 {
     return(_adjusterRepo.Add(_adjuster).AdjusterID);
 }
Ejemplo n.º 21
0
 public int updateAdjuster(Adjuster _adjuster)
 {
     return(_adjusterRepo.Update(_adjuster));
 }
Ejemplo n.º 22
0
    public void ApplyUsedTool()
    {
        if (activePlant.Value == this)
        {
            // Affect music
            Interaction interaction  = interactionUsed.Value;
            Type        adjusterType = interaction.tool.GetAdjusterType();
            Adjuster    adjuster     = (Adjuster)GetComponentInChildren(adjusterType);
            adjuster.enabled = true;

            // Affect animation
            string statusName = interaction.targetStatus.name;
            if (statusName == "High Pitch")
            {
                graphicsController.OnCut();
            }
            else if (statusName == "Low Pitch")
            {
                graphicsController.OnUnsetCut();
            }
            else if (statusName == "Major Mode")
            {
                graphicsController.OnUnsetMakeBad();
            }
            else if (statusName == "Minor Mode")
            {
                graphicsController.OnMakeBad();
            }
            else if (statusName == "Good Quality")
            {
                graphicsController.OnUnsetMakeSad();
            }
            else if (statusName == "Bad Quality")
            {
                graphicsController.OnMakeSad();
            }

            // Affect status
            List <PlantStatus> statusesToRemove = new List <PlantStatus>();
            foreach (PlantStatus status in currentStatuses)
            {
                foreach (Interaction possibleInteraction in status.interactions)
                {
                    if (interaction == possibleInteraction)
                    {
                        statusesToRemove.Add(status);
                    }
                }
            }
            foreach (PlantStatus statusToRemove in statusesToRemove)
            {
                currentStatuses.Remove(statusToRemove);
            }
            currentStatuses.Add(interaction.targetStatus);
            if (IsOk())
            {
                Celebrate();
            }
            onUpdateStatus.RaiseEvent();
        }
    }