Beispiel #1
0
        public static void Main(string[] args)
        {
            //create the event source - do this here as the editor is the first thing to run after install
            if (!EventLog.SourceExists(Application.ProductName))
                EventLog.CreateEventSource(Application.ProductName, "Application");

            Trace.TraceInformation("Begin RunEditor: " + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"));
            EventLog.WriteEntry(Application.ProductName, "Begin RunEditor", EventLogEntryType.Information);

            try {
                //Run Configuration Editor
                System.Windows.Forms.Application.EnableVisualStyles();
                using (EditSettings editor = new EditSettings()) {

                    //***  This is the settings class to load ***
                    editor.Settings = AppSettings.Default;

                    System.Windows.Forms.Application.Run(editor);
                }

                Trace.TraceInformation("Completed RunEditor: " + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"));
                EventLog.WriteEntry(Application.ProductName, "Completed RunEditor", EventLogEntryType.Information);

            } catch (Exception ex) {
                System.Windows.Forms.MessageBox.Show("ERROR RunEditor: " + ex.Message);
                Trace.TraceInformation("ERROR RunEditor: " + ex.Message);
                EventLog.WriteEntry(Application.ProductName, "ERROR RunEditor: " + ex.Message, EventLogEntryType.Error);
            }
        }
Beispiel #2
0
        private void dgvAccountList_CellContentClick(object sender, DataGridViewCellEventArgs e)
        {
            if (dgvAccountList.SelectedRows.Count > 0)
            {
                EditSettings frm    = new EditSettings(Settings.Single(x => x.Username == (string)dgvAccountList.SelectedRows[0].Cells[0].Value && x.Server == (string)dgvAccountList.SelectedRows[0].Cells[1].Value));
                DialogResult result = frm.ShowDialog();

                if (result == DialogResult.OK)
                {
                    Refresh();
                }
            }
        }
 private void EditSettingsFinished(EditSettings obj)
 {
     this.SettingsVisible = false;
     this.AllowCommands   = true;
 }
 /// <summary>
 /// Handles the Click event of the MenuFileSettings control.
 /// </summary>
 /// <param name="sender">The source of the event.</param>
 /// <param name="e">The <see cref="RoutedEventArgs"/> instance containing the event data.</param>
 private void MenuFileSettings_Click(object sender, RoutedEventArgs e)
 {
     EditSettings?.Invoke(this, new EventArgs());
 }
Beispiel #5
0
 void Update()
 {
     if (bInSettings)
     {
         if (Input.GetKeyDown (KeyCode.DownArrow))
         {
             CurrentSetting = EditSettings.DURATION;
             foreach (SpriteRenderer sr in ModeSetting.GetComponentsInChildren<SpriteRenderer>())
             {
                 sr.enabled = false;
             }
             foreach (SpriteRenderer sr in DurationSetting.GetComponentsInChildren<SpriteRenderer>())
             {
                 sr.enabled = true;
                 if (sr.gameObject.name.Contains ("right"))
                 {
                     RightTriangle = sr;
                 }
                 else
                 {
                     LeftTriangle = sr;
                 }
             }
         }
         else if (Input.GetKeyDown (KeyCode.UpArrow))
         {
             CurrentSetting = EditSettings.MODE;
             foreach (SpriteRenderer sr in DurationSetting.GetComponentsInChildren<SpriteRenderer>())
             {
                 sr.enabled = false;
             }
             foreach (SpriteRenderer sr in ModeSetting.GetComponentsInChildren<SpriteRenderer>())
             {
                 if (sr.gameObject.name.Contains ("right"))
                 {
                     RightTriangle = sr;
                 }
                 else
                 {
                     LeftTriangle = sr;
                 }
                 if (GameMode == EGameMode.MP)
                 {
                     RightTriangle.enabled = true;
                 }
                 else
                 {
                     LeftTriangle.enabled = true;
                 }
             }
         }
         else if (Input.GetKeyDown (KeyCode.RightArrow))
         {
             if (CurrentSetting == EditSettings.MODE)
             {
                 ModeSetting.GetComponent<TextMesh>().text = "single player";
                 GameMode = EGameMode.SP;
                 RightTriangle.enabled = false;
                 LeftTriangle.enabled = true;
             }
             else
             {
                 LeftTriangle.enabled = true;
                 GameDuration += 5;
                 DurationSetting.GetComponent<TextMesh>().text = GameDuration + " seconds";
             }
         }
         else if (Input.GetKeyDown (KeyCode.LeftArrow))
         {
             if (CurrentSetting == EditSettings.MODE)
             {
                 ModeSetting.GetComponent<TextMesh>().text = "multiplayer";
                 GameMode = EGameMode.MP;
                 RightTriangle.enabled = true;
                 LeftTriangle.enabled = false;
             }
             else
             {
                 if (GameDuration > 0)
                 {
                     GameDuration -= 5;
                     DurationSetting.GetComponent<TextMesh>().text = GameDuration + " seconds";
                 }
                 if (GameDuration == 0)
                 {
                     LeftTriangle.enabled = false;
                 }
             }
         }
     }
     if (bGameStarted)
     {
         SpriteScreen.GetComponent<SpriteRenderer>().color = Color.Lerp (SpriteScreen.GetComponent<SpriteRenderer>().color, EndColor, FadeSpeed*Time.deltaTime);
     }
     if (GameView == EGameView.Game)
     {
         TimeSinceGameStart += Time.deltaTime;
         if (TimeSinceGameStart >= GameDuration)
         {
             EndGame (EGryll.BEARD);
         }
     }
 }
Beispiel #6
0
    void OnEnable()
    {
        ins = this;
        LevelMgr = gameObject.GetComponent<LevelManager> ();
        PlayerMgr = gameObject.GetComponent<PlayerManager> ();
        InputMgr = gameObject.GetComponent<InputManager> ();

        GameView = EGameView.Menu;
        bGameStarted = false;
        MainCamera.clearFlags = CameraClearFlags.Nothing;
        MainCamera.depth = 5;
        CurrentSetting = EditSettings.MODE;
    }
        public ActionResult Index(EditSettings model)
        {
            if (!ModelState.IsValid)
            {
                return(View(model));
            }

            // get existing data
            var existingContent = db.PageContent.FirstOrDefault();

            bool isError = false;

            // validate and update each content
            if (ValidateInput(model.ChairmanSpeech, 5, 350))
            {
                existingContent.ChairmanSpeech = model.ChairmanSpeech;
            }
            else
            {
                ViewBag.ChairError = Error;
                isError            = true;
            }

            if (ValidateInput(model.AimsAndObjectives, 5, 85))
            {
                existingContent.AimsAndObjectives = model.AimsAndObjectives;
            }
            else
            {
                ViewBag.AimsError = Error;
                isError           = true;
            }

            if (ValidateInput(model.Story, 10, 500))
            {
                existingContent.Story = model.Story;
            }
            else
            {
                ViewBag.StoryError = Error;
                isError            = true;
            }

            if (ValidateInput(model.Mission, 5, 80))
            {
                existingContent.Mission = model.Mission;
            }
            else
            {
                ViewBag.MissionError = Error;
                isError = true;
            }

            if (ValidateInput(model.Vision, 5, 80))
            {
                existingContent.Vision = model.Vision;
            }
            else
            {
                ViewBag.VissionError = Error;
                isError = true;
            }


            existingContent.Achievements = model.Achievements;

            // save changes
            db.SaveChanges();

            // set success msg
            if (isError)
            {
                TempData["ERR"] = "Update completed with some errors.";
            }
            else
            {
                TempData["SCC"] = "Update Successful";
            }

            return(View(model));
        }
        private void executeCommand(CommandItem commandItem)
        {
            switch (commandItem.Command)
            {
            case HotBabeCommand.UpdateInterval:
            {
                settings.UpdateInterval = (int)commandItem.Parameter * 1000;
            }
            break;

            case HotBabeCommand.AutoRun:
            {
                settings.AutoRun = !settings.AutoRun;
            }
            break;

            case HotBabeCommand.AlwaysOnTop:
            {
                settings.AlwaysOnTop = !settings.AlwaysOnTop;
            }
            break;

            case HotBabeCommand.BlendImages:
            {
                settings.BlendImages = (BlendImagesMode)commandItem.Parameter;
            }
            break;

            case HotBabeCommand.HideOnFullscreen:
            {
                settings.HideOnFullscreen = !settings.HideOnFullscreen;
            }
            break;

            case HotBabeCommand.ClickThrough:
            {
                settings.ClickThrough = !settings.ClickThrough;
            }
            break;

            case HotBabeCommand.Opacity:
            {
                float opacity = (int)commandItem.Parameter / 100f;
                settings.Opacity = opacity;
            }
            break;

            case HotBabeCommand.RequestIconText:
            {
                commandItem.Parameter = getIconText();
            }
            break;

            case HotBabeCommand.LocationChanged:
            {
                Point location = (Point)commandItem.Parameter;
                settings.Left = location.X;
                settings.Top  = location.Y;
            }
            break;

            case HotBabeCommand.AdvancedSettings:
            {
                EditSettings.Fire(this);
            }
            break;

            case HotBabeCommand.DropFile:
            {
                handleDroppedFile((string)commandItem.Parameter);
            }
            break;

            case HotBabeCommand.Console:
            {
                Logger.Debug("Started debug console.");
                new Console().Show();
            }
            break;

            case HotBabeCommand.LoadPack:
            {
                loadPack((string)commandItem.Parameter);
            }
            break;

            case HotBabeCommand.Priority:
            {
                settings.Priority = (ProcessPriorityClass)commandItem.Parameter;
            }
            break;

            case HotBabeCommand.MaxImageCacheSize:
            {
                long cacheSize = (long)commandItem.Parameter;
                settings.MaxImageCacheSize = cacheSize;
                cachedImages.MaxSize       = cacheSize;
            }
            break;

            case HotBabeCommand.HorizontalAlignment:
            {
                settings.HorizontalAlignment = (Alignment)commandItem.Parameter;
            }
            break;

            case HotBabeCommand.VerticalAlignment:
            {
                settings.VerticalAlignment = (Alignment)commandItem.Parameter;
            }
            break;
            }
            applySettings();
        }