Пример #1
0
 public ProgramController(IRepository <ProgramData> programDataRepository,
                          IRepository <ProgramInfo> programInfoRepository,
                          PalletSystemContext palletSystemContext)
 {
     programManager           = new ProgramManager(programDataRepository, programInfoRepository);
     this.palletSystemContext = palletSystemContext;
 }
Пример #2
0
        /// <summary>
        /// 显示窗口
        /// </summary>
        /// <typeparam name="TResult">窗口返回的结果的类型</typeparam>
        /// <param name="windowmodel">窗口模式,为<see cref="DialogMode"/></param>类型
        /// <param name="parent">窗口父容器</param>
        /// <param name="result">此参数未使用</param>
        /// <param name="close">此参数未使用</param>
        /// <param name="isResizable">窗口是否可拖拽大小</param>
        /// <param name="GUID">
        /// 窗口标识.
        /// 可根据此ID限制此窗口只能弹出一个
        /// </param>
        public void Show <TResult>(DialogMode windowmodel, FrameworkElement parent, TResult result, Action <TResult> close, bool isResizable, string GUID)
        {
            try
            {
                try
                {
                    double height = SMT.SAAS.Main.CurrentContext.AppContext.AppHost.SilverlightHostRoot.ActualHeight;
                    double width  = SMT.SAAS.Main.CurrentContext.AppContext.AppHost.SilverlightHostRoot.ActualWidth;
                    //MessageBox.Show("1高:" + (height - 50) + " 宽:" + (width - 50));
                    this.MinHeight = height - 50;
                    this.MinWidth  = width - 50;
                }
                catch (Exception ex)
                {
                }
                this._window = ProgramManager.ShowProgram(TitleContent.ToString(), string.Empty, GUID, this, isResizable, true, null);

                //MessageBox.Show("1高:" + this._window.MinHeight + " 宽:" + this._window.MinWidth);
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.ToString());
            }
            finally
            {
                //MessageBox.Show("Down");
            }
        }
        /// <summary>
        ///     Validates packaged files, ensures target directory looks like a TR game.
        /// </summary>
        public void ValidateInstallation()
        {
            try
            {
                ValidatePackagedFiles();
                ProgramData.NLogger.Info("Successfully validated packaged files using MD5 hashes.");
                CheckGameDirLooksLikeATrInstall();
                ProgramData.NLogger.Info($"Parent directory seems like a {ProgramData.GameAbbreviation} game installation.");
            }
            catch (Exception e)
            {
                if (e is BadInstallationLocationException ||
                    e is RequiredFileMissingException ||
                    e is InvalidGameFileException)
                {
                    ProgramData.NLogger.Fatal($"Installation failed to validate. {e.Message}\n{e.StackTrace}");
                    ConsoleIO.PrintWithColor(e.Message, ConsoleColor.Red);
                    Console.WriteLine("You are advised to re-install the latest release to fix the issue:");
                    Console.WriteLine(ProgramData.MiscInfo.LatestReleaseLink);
                    TRVSProgramManager.EarlyPauseAndExit(2);
                }

                const string statement = "An unhandled exception occurred while validating your installation.";
                ProgramManager.GiveErrorMessageAndExit(statement, e, 1);
            }
        }
Пример #4
0
        public MilkyManager()
        {
            KeyboardListener = KeyboardListener.GetOrNewInstance();

            ConsoleLoops    = ConsoleLoops.GetOrNewInstance();
            LoopsManager    = LoopsManager.GetOrNewInstance();
            StatisticsLoops = StatisticsLoops.GetOrNewInstance();

            OutputSettings = OutputSettings.GetOrNewInstance();

            ProgramInformations = ProgramInformations.GetOrNewInstance();
            ProgramManager      = ProgramManager.GetOrNewInstance();

            RunInformations = RunInformations.GetOrNewInstance();
            RunLists        = RunLists.GetOrNewInstance();
            RunManager      = RunManager.GetOrNewInstance();

            ConsoleSettings = ConsoleSettings.GetOrNewInstance();
            RunSettings     = RunSettings.GetOrNewInstance();

            CustomStatistics = CustomStatistics.GetOrNewInstance();
            RunStatistics    = RunStatistics.GetOrNewInstance();

            ConsoleUtils  = ConsoleUtils.GetOrNewInstance();
            DateTimeUtils = DateTimeUtils.GetOrNewInstance();
            FileUtils     = FileUtils.GetOrNewInstance();
            FormatUtils   = FormatUtils.GetOrNewInstance();
            HashUtils     = HashUtils.GetOrNewInstance();
            ListUtils     = ListUtils.GetOrNewInstance();
            RequestUtils  = RequestUtils.GetOrNewInstance();
            StringUtils   = StringUtils.GetOrNewInstance();
            UserUtils     = UserUtils.GetOrNewInstance();
        }
Пример #5
0
        protected override void OnStartup(StartupEventArgs e)
        {
            base.OnStartup(e);

            this._appSettings = new AppSettings();

            this._debugLogger = new DebugManager();
            this._debugLogger.Enable();

            this._simLogger = new iRacingLogger(4);
            this._simLogger.DriverConnected    += this.OnRaceLoggerConnection;
            this._simLogger.DriverDisconnected += this.OnRaceLoggerDisconnection;

            this._fuelManager = new FuelManager(this._simLogger, this._debugLogger, 1);

            this._simLogger.StartListening();

            var vm = new ApplicationViewModel();
            var mw = new MainWindow
            {
                DataContext = vm
            };

            mw.Closing += this.WindowClosing;
            mw.Show();

            this._programConfigurator = new ProgramLoader(this.DebugLogger);

            var pm = new ProgramManager(this._simLogger, this._programConfigurator);

            //pm.Load("default");
            //pm.StartProgram();

            this.MainWindow.Title = "Disconnected - Driver ID: ?";
        }
Пример #6
0
        static void Main(string[] args)
        {
            var manager = new ProgramManager();

            manager.GetArguments(args);
            manager.StartMonitoring();
        }
Пример #7
0
            public TestContext()
            {
                MockBackgroundWorker = new Mock <IBackgroundWorker>();

                MockConfigManager = new Mock <IConfigManager>();
                MockConfigManager
                .Setup(x => x.MakeParseOperation())
                .Returns(() => MockParseOperation.Object);

                MockDoorManager = new Mock <IDoorManager>();
                MockDoorManager
                .Setup(x => x.DoorCount)
                .Returns(() => DoorCount);

                MockEchoProvider = new Mock <IEchoProvider>();

                MockGridProgramRuntimeInfo = new Mock <IMyGridProgramRuntimeInfo>();

                MockLogger = new Mock <ILogger>();
                MockLogger
                .Setup(x => x.Render())
                .Returns(() => RenderedLog);

                Uut = new ProgramManager(
                    MockBackgroundWorker.Object,
                    MockConfigManager.Object,
                    MockDoorManager.Object,
                    MockEchoProvider.Object,
                    MockGridProgramRuntimeInfo.Object,
                    MockLogger.Object);

                MockParseOperation = new Mock <IBackgroundOperation>();
            }
Пример #8
0
        void _newsServices_OnGetNewsListCompleted(object sender, GetEntityListEventArgs <SAAS.Platform.Model.NewsModel> e)
        {
            if (e.Error == null)
            {
                try
                {
                    var result = e.Result;
                    if (result.Count > 0)
                    {
                        foreach (var item in e.Result)
                        {
                            NewsShow newsview = new NewsShow();
                            newsview.LoadNewsDetails(item.NEWSID);
                            string titel = "";
                            switch (item.NEWSTYPEID)
                            {
                            case "0": titel = "新    闻"; break;

                            case "1": titel = "动    态"; break;

                            default:
                                break;
                            }
                            var host = ProgramManager.ShowProgram(titel, string.Empty, item.NEWSID, newsview, true, true, null);
                        }
                    }
                }
                catch (Exception)
                {
                }
            }
        }
Пример #9
0
 private void btnMore_Click(object sender, RoutedEventArgs e)
 {
     NewsMore newsview = new NewsMore();
     string   titel    = "新闻动态";
     var      host     = ProgramManager.ShowProgram(titel, string.Empty,
                                                    "DD71AE94-F53B-4B5A-AD09-8F3402C9A280", newsview, true, true, null);
 }
Пример #10
0
        public MainWindow()
        {
            InitializeComponent();
            ProgramManager pM = new ProgramManager();

            this.DataContext = pM;
        }
Пример #11
0
        protected void btnInsert_Click(object sender, EventArgs e)
        {
            try
            {
                program              = new Program();
                program.Description  = txtDescription.Text;
                program.DegreeTypeId = degreeTypes[ddlDegreeTypes.SelectedIndex].Id;

                int results = ProgramManager.Insert(program);
                Response.Write("Inserted " + results + " rows...");

                programs.Add(program);

                Rebind();

                if (results > 0)
                {
                    ddlPrograms.SelectedValue = program.Id.ToString();
                }
                ddlPrograms_SelectedIndexChanged(sender, e);
            }
            catch (Exception ex)
            {
                Response.Write(ex.Message);
            }
        }
Пример #12
0
        private void BtnEdit_Click(object sender, RoutedEventArgs e)
        {
            try
            {
                if (dgNewsList.SelectedItem == null)
                {
                    MessageWindow.Show("", "请先选择一条新闻,再进行编辑!", MessageIcon.Error, MessageWindowType.Flow);

                    return;
                }

                NewsViewModel item = (NewsViewModel)dgNewsList.SelectedItem;
                viewModel.CurrentEntity          = item;
                viewModel.CurrentEntity.ParentVM = viewModel;
                NewsView addView = new NewsView(viewModel.CurrentEntity, ViewState.UPDATE);
                SMT.SAAS.Controls.Toolkit.Windows.Window host = ProgramManager.ShowProgram("修改新闻", "", UpdateFormID, addView, true, true, null);
                addView.Reset += (obj, arg) =>
                {
                    host.Close();
                };
                host.Closed += (obj, arg) =>
                {
                    //  viewModel.Refresh();
                };
            }
            catch (Exception ex)
            {
            }
        }
Пример #13
0
    /// <summary>
    /// OnPostRender is called after a camera finished rendering the Scene.
    /// Accordingly, taking the picture is performed at the end of a frame.
    /// </summary>
    private void OnPostRender()
    {
        if (takePictureOnNextFrame)         // Proceed if the flag is set.
        {
            // Reset the flag.
            takePictureOnNextFrame = false;

            // Get the render texture.
            RenderTexture renderTexture = screenshotCamera.targetTexture;

            // Store the data of a rendered picture. Make it transparent by using ARGB32 format and do not use a bitmap.
            Texture2D renderPicture = new Texture2D(renderTexture.width, renderTexture.height, TextureFormat.ARGB32, false);
            // Create a rectangel to save the picture
            Rect rect = new Rect(0, 0, renderTexture.width, renderTexture.height);
            renderPicture.ReadPixels(rect, 0, 0);

            // Read bytes and encode to a PNG.
            byte[] byteArray = renderPicture.EncodeToPNG();
            string fileName  = GetPictureName(renderTexture.width, renderTexture.height);
            // Save the file.
            System.IO.File.WriteAllBytes(fileName, byteArray);
            Debug.Log("The picture has been taken!");

            // Release a temporary render texture allocated to the camera.
            RenderTexture.ReleaseTemporary(renderTexture);
            screenshotCamera.targetTexture = null;

            ProgramManager.DisplayTakingPhotoPanel(1f);

            // Refresh the folder to see the updated conent.
            UnityEditor.AssetDatabase.Refresh();
        }
    }
Пример #14
0
    void Start()
    {
        //Instatiate Board manager and the Board MVC as a component
        boardManager    = new BoardManager();
        boardController = new BoardController();
        boardManager.SetBoardController(boardController);
        boardManager.InstantiateBoardMVC();
        BoardLayout();

        //Instatiate Program manager and the Program MVC as a component
        programManager    = new ProgramManager();
        programController = new ProgramController();
        programManager.SetProgramController(programController);
        programManager.SetBoardController(boardManager.boardController);
        programManager.InstantiateProgramModeMVC();

        //Program commands from program mode will be used from here,add to list, play commands etc.
        //Futute work will involve a different method of saving commands.
        //Script can be found in the Program Commands folder

        //Display initial board setup
        boardDisplay.text = boardManager.boardView.UpdateBoardDisplay();

        //Win condition UI and instructions
        levelWinCondition.text = WinConditionStatus();
    }
Пример #15
0
        public void UpdateTest()
        {
            Program program = ProgramManager.LoadById(18);

            program.Description = "Updated";
            Assert.IsTrue(ProgramManager.Update(program) > 0);
        }
Пример #16
0
        public ActionResult Create(ProgramDegreeTypes pdts)
        {
            try
            {
                if (pdts.File != null)
                {
                    pdts.Program.ImagePath = pdts.File.FileName;
                    string target = Path.Combine(Server.MapPath("~/images"), Path.GetFileName(pdts.File.FileName));
                    if (!System.IO.File.Exists(target))
                    {
                        pdts.File.SaveAs(target);
                        ViewBag.Message = "File Uploaded Successfully...";
                    }
                    else
                    {
                        ViewBag.Message = "File Already Exists...";
                    }
                }

                // TODO: Add insert logic here
                ProgramManager.Insert(pdts.Program);
                return(RedirectToAction("Index"));
            }
            catch (Exception ex)
            {
                ViewBag.Message = ex.Message;
                return(View(pdts));
            }
        }
Пример #17
0
        // Constructor
        public MainPage()
        {
            InitializeComponent();
            ProgramManager pm = ProgramManager.Instance;

            pm.Initialize();
        }
Пример #18
0
 public Form1()
 {
     InitializeComponent();
     configurationManager = new ConfigurationManager();
     programManager       = new ProgramManager();
     messageParser        = new MessageParser(this);
 }
Пример #19
0
        public static async Task Main(string[] args)
        {
            BootstrapService bootstrapper = new BootstrapService();
            ProgramManager   program      = new ProgramManager(bootstrapper.ServiceProvider);
            await program.Start(args);

            Console.ReadKey();
        }
 public void Undo()
 {
     Console.WriteLine($"mudando tela ativa para {_oldScreen.Name}");
     ProgramManager.ActiveScreen.Screen = _oldScreen;
     invertSelection(_oldScreen);
     invertSelection(_oldScreen);
     ProgramManager.uptadePropertyGrid();
 }
Пример #21
0
 public MainForm()
 {
     InitializeComponent();
     pm = new ProgramManager(this, panel2);
     pm.ManagerChanged += manager_Changed;
     Subscribe();
     BuildInterface();
 }
Пример #22
0
        public void InsertTest()
        {
            Program program = new Program {
                Description = "Basketweaving", DegreeTypeId = 3
            };

            Assert.AreNotEqual(0, ProgramManager.Insert(program));
        }
Пример #23
0
 private void KnobClicked(object sender, PinStatusEventArgs e)
 {
     if (e.Enabled)
     {
         Controls.Instance.ButtonUnsubscribe("ScrollerBtn", KnobClicked);
         ProgramManager.StartProgram(applications.ToList()[0]);
     }
 }
Пример #24
0
 public RobotController(IData d)
 {
     _paginationManager = new PaginationManager(d);
     _contentManager    = new ContentManager(d);
     _robotManager      = new RobotManager(d);
     _programManager    = new ProgramManager(d);
     _commandManager    = new CommandManager(d);
 }
Пример #25
0
        public void TestInit()
        {
            this.categoryController = new ProgramManager();

            this.categories = (List <ICategory>) this.categoryController.GetType()
                              .GetFields(BindingFlags.Instance | BindingFlags.NonPublic)
                              .First(f => f.Name == "listOfCategories")
                              .GetValue(this.categoryController);
        }
Пример #26
0
 public void Start()
 {
     gamePiece = gameObject.GetComponent <GamePiece>();
     foreach (GamePieceTag gamePieceTag in possibleTargets)
     {
         possibleTargetsString.Add(gamePieceTag.ToString());
     }
     programManager = ProgramManager.Instance;
 }
Пример #27
0
        /// <summary>
        /// 显示窗口
        /// </summary>
        /// <typeparam name="TResult">窗口返回的结果的类型</typeparam>
        /// <param name="windowmodel">窗口模式,为<see cref="DialogMode"/></param>类型
        /// <param name="parent">窗口父容器</param>
        /// <param name="result">此参数未使用</param>
        /// <param name="close">此参数未使用</param>
        /// <param name="isResizable">窗口是否可拖拽大小</param>
        /// <param name="GUID">
        /// 窗口标识.
        /// 可根据此ID限制此窗口只能弹出一个
        /// </param>
        public void Show <TResult>(DialogMode windowmodel, FrameworkElement parent, TResult result, Action <TResult> close, bool isResizable, string GUID)
        {
            try
            {
                double height = 0;
                double width  = 0;
                try
                {
                    height = SMT.SAAS.Main.CurrentContext.AppContext.AppHost.SilverlightHostRoot.ActualHeight;
                    width  = SMT.SAAS.Main.CurrentContext.AppContext.AppHost.SilverlightHostRoot.ActualWidth;
                    //MessageBox.Show("1高:" + (height - 50) + " 宽:" + (width - 50));
                }
                catch (Exception ex)
                {
                }
                //string msg = "弹出窗内部Form指定高度:" + this.Height + "类型" + this.Height.GetType().Name + " 宽度:" + this.Width + "类型:" + this.Height.GetType().Name
                //    + "弹出窗内部Form指定最小高度:" + this.MinHeight + "类型" + this.MinHeight.GetType().Name + " 最小宽度:" + this.MinWidth + "类型" + this.MinWidth.GetType().Name
                //    + " 当前silverlight显示区高度:" + height + " 宽度:" + width;
                //SMT.SAAS.Main.CurrentContext.AppContext.SystemMessage(msg);
                //SMT.SAAS.Main.CurrentContext.AppContext.ShowSystemMessageText();
                if (height > 0)
                {
                    if (this.MinHeight > height)
                    {
                        this.MinHeight = height - 50;
                    }
                    if (this.Height > height)
                    {
                        this.MinHeight = height - 50;
                    }
                }
                if (width > 0)
                {
                    if (this.MinWidth > width)
                    {
                        this.MinWidth = width - 50;
                    }
                    if (this.Width > width)
                    {
                        this.MinWidth = width - 50;
                    }
                }

                this._window = ProgramManager.ShowProgram(TitleContent.ToString(), string.Empty, GUID, this, isResizable, true, null);

                //MessageBox.Show("1高:" + this._window.MinHeight + " 宽:" + this._window.MinWidth);
            }
            catch (Exception ex)
            {
                SMT.SAAS.Main.CurrentContext.AppContext.SystemMessage(ex.ToString());
                SMT.SAAS.Main.CurrentContext.AppContext.ShowSystemMessageText();
            }
            finally
            {
                //MessageBox.Show("Down");
            }
        }
Пример #28
0
        public void TestInitialization()
        {
            // Create starting and ending commands
            ICommand startCommand = new Command(new Eticheta("Start"));
            ICommand endCommand   = new Command(new Eticheta("End"));

            // Create the program manager to use for the test
            _programManager = new ProgramManager(startCommand, endCommand);
        }
Пример #29
0
        public JsonResult AutocompleteServiceTypeProviderOrProgram(string term)
        {
            var serviceTypeNames = ServiceTypeManager.SearchNames(term);
            var providerNames    = ProviderManager.SearchProviderNames(term);
            var programNames     = ProgramManager.SearchProgramNames(term);
            var filteredItems    = serviceTypeNames.Union(providerNames).Union(programNames).Distinct().OrderBy(n => n);

            return(Json(filteredItems, JsonRequestBehavior.AllowGet));
        }
Пример #30
0
        protected void Page_Load(object sender, EventArgs e)
        {
            //Get the programs
            List <Program> programs = ProgramManager.Load();

            // Bind the data to the data repeater
            dpPrograms.DataSource = programs;
            dpPrograms.DataBind();
        }
Пример #31
0
	public void Init(ProgramManager localProgMan, int numSlots, int index){
		localProgramManager = localProgMan;
//		Debug.Log (localProgramManager);
		funcIndex = index;
		slots = new CommandSlot[numSlots];
		for(int i = 0; i<slots.Length; i++){
			GameObject slot = GameObject.Instantiate(commandSlotPrefab);
			slot.transform.SetParent(this.transform);
			slots[i] = slot.GetComponent<CommandSlot>();
			slot.name = "CommandSlot " + i;
			slot.GetComponent<GridLayoutGroup>().cellSize = Vector2.one * ProgramUI.tileSize;
		}
	}
Пример #32
0
	public void SetLocalProgramManager (ProgramManager prog)
	{
		localProgramManager = prog;
	}
Пример #33
0
	void Awake(){
		programManager = this.GetComponent<ProgramManager>();
//		Debug.Log("Player awake");
	}
Пример #34
0
 public SchedulerService(ProgramManager programEngine)
 {
     masterControlProgram = programEngine;
 }