public BaseForm()
        {
            InitializeComponent();

            CheckForIllegalCrossThreadCalls = false;

            WaitSplash = new Splash(this);

            Application.Idle += Application_Idle;
        }
示例#2
0
    public Main()
    {
      InitializeComponent();
      paper = pctPlayField.CreateGraphics();
      muren = new Muren();
      rndAngle = new Random();
      splash = new Splash();
      #region initialize pacman & ghosts
      //pacman
      pacman = new Pacman();
      pacman.X = 10;
      pacman.Y = 12;
      pacman.Angle = 0;
      pacman.Wall = 0;
      pacman.PrevX = 10;
      pacman.PrevY = 12;
      pacman.Sprites = pacman.pacmanUp;

      //red ghost
      redGhost = new Monster();
      redGhost.X = 10;
      redGhost.Y = 10;
      redGhost.Angle = 3;
      redGhost.Wall = 0;
      redGhost.PrevX = 10;
      redGhost.PrevY = 10;
      redGhost.PrevAngle = 0;
      redGhost.Sprites = Image.FromFile("../../images/ghostRed.png");

      //green ghost
      greenGhost = new Monster();
      greenGhost.X = 11;
      greenGhost.Y = 10;
      greenGhost.Angle = 3;
      greenGhost.Wall = 0;
      greenGhost.PrevX = 11;
      greenGhost.PrevY = 10;
      greenGhost.PrevAngle = 0;
      greenGhost.Sprites = Image.FromFile("../../images/ghostGreen.png");

      //yellow ghost
      yellowGhost = new Monster();
      yellowGhost.X = 9;
      yellowGhost.Y = 10;
      yellowGhost.Angle = 3;
      yellowGhost.Wall = 0;
      yellowGhost.PrevX = 9;
      yellowGhost.PrevY = 10;
      yellowGhost.PrevAngle = 0;
      yellowGhost.Sprites = Image.FromFile("../../images/ghostYellow.png");
      #endregion


    }
示例#3
0
 public Snake(Texture2D texture, Vector2 position, Vector2 screenSize, LevelManager levelManager, FruitManager fruitManager, Splash splash, Score score)
     : base(texture, position, screenSize)
 {
     sections.Add(this);
     speed = 1;
     state = new UpState(this);
     this.levelManager = levelManager;
     this.fruitManager = fruitManager;
     this.splash = splash;
     this.score = score;
 }
    public DxMain()
    {
        InitializeComponent();
        Splash sp = new Splash();
        sp.Show();

        timer1.Interval = 2000;
        timer1.Start();
        while(flag == false)
        {
            Application.DoEvents();
        }
        sp.Close();
        details.Show();
    }
示例#5
0
    static void Main()
    {
        Application.EnableVisualStyles();

        //show the splash screen
        Splash splash = new Splash(delegate(object state) {
            Splash st = (Splash)state;
            /*Load the icons*/
            Icons.Load("FileType.", "./icons/filetypes", true);
            Icons.Load("SolutionExplorer.", "./icons/solutionexplorer", true);
            Icons.Load("Menu.", "./icons/menu", true);
            Icons.Load("Icons.", "./icons/icons", true);
            Icons.Load("Tools.", "./icons/tools", true);

            new MainIDE(st).ShowDialog();
        });
        splash.ShowDialog();
    }
示例#6
0
 private void Awake()
 {
     instance = this;
     started = false;
     canStart = false;
 }
示例#7
0
        static public void RenderWAV(string[] inArgs, long unitNumerator, long unitDenominator)
        {
            Splash.Show("Render");
            Console.WriteLine("Timing: " + unitNumerator.ToString() + "/" + unitDenominator.ToString());

            string[] args;

            if (inArgs.Length > 0)
            {
                args = Subfolder.Parse(inArgs);
            }
            else
            {
                args = inArgs;
            }

            if (System.Diagnostics.Debugger.IsAttached && args.Length == 0)
            {
                Console.WriteLine();
                Console.WriteLine("Debugger attached. Input file name:");
                args = new string[] { Console.ReadLine() };
            }

            if (args.Length == 0)
            {
                Console.WriteLine();
                Console.WriteLine("Usage: Render2DX <files..>");
                Console.WriteLine();
                Console.WriteLine("Drag and drop with files and folders is fully supported for this application.");
                Console.WriteLine();
                Console.WriteLine("You must have both the chart file (.1) and the sound file (.2dx).");
                Console.WriteLine("Supported formats:");
                Console.WriteLine("1, 2DX");
            }

            Sound[] sounds  = null;
            Chart[] charts  = null;
            bool    cancel  = false;
            string  outFile = null;

            foreach (string filename in args)
            {
                if (cancel)
                {
                    break;
                }

                if (File.Exists(filename))
                {
                    switch (Path.GetExtension(filename).ToUpper())
                    {
                    case @".1":
                        if (charts == null)
                        {
                            Console.WriteLine();
                            Console.WriteLine("Valid charts:");
                            outFile = Path.Combine(Path.GetDirectoryName(filename), Path.GetFileNameWithoutExtension(filename));
                            using (MemoryStream mem = new MemoryStream(File.ReadAllBytes(filename)))
                            {
                                charts = Bemani1.Read(mem, unitNumerator, unitDenominator).Charts;
                                for (int i = 0; i < charts.Length; i++)
                                {
                                    if (charts[i] != null)
                                    {
                                        Console.Write(i.ToString() + "  ");
                                    }
                                }
                            }
                            Console.WriteLine();
                        }
                        break;

                    case @".2DX":
                        if (sounds == null)
                        {
                            using (MemoryStream mem = new MemoryStream(File.ReadAllBytes(filename)))
                            {
                                sounds = Bemani2DX.Read(mem).Sounds;
                            }
                        }
                        break;
                    }
                }
            }

            if (!cancel && (sounds != null) && (charts != null))
            {
                List <byte[]> rendered      = new List <byte[]>();
                List <int>    renderedIndex = new List <int>();

                for (int k = 0; k < charts.Length; k++)
                {
                    Chart chart = charts[k];

                    if (chart == null)
                    {
                        continue;
                    }

                    Console.WriteLine("Rendering " + k.ToString());
                    byte[] data = ChartRenderer.Render(chart, sounds);

                    int  renderedCount = rendered.Count;
                    int  matchIndex    = -1;
                    bool match         = false;

                    for (int i = 0; i < renderedCount; i++)
                    {
                        int renderedLength = rendered[i].Length;
                        if (renderedLength == data.Length)
                        {
                            byte[] renderedBytes = rendered[i];
                            match = true;
                            for (int j = 0; j < renderedLength; j++)
                            {
                                if (renderedBytes[j] != data[j])
                                {
                                    match = false;
                                    break;
                                }
                            }
                            if (match)
                            {
                                matchIndex = i;
                                break;
                            }
                        }
                    }

                    if (!match)
                    {
                        Console.WriteLine("Writing unique " + k.ToString());
                        File.WriteAllBytes(outFile + "-" + Util.ConvertToDecimalString(k, 2) + ".wav", data);
                        rendered.Add(data);
                        renderedIndex.Add(k);
                    }
                    else
                    {
                        Console.WriteLine("Matches " + renderedIndex[matchIndex].ToString());
                    }
                }
            }
        }
示例#8
0
        static Selector <object> CreateMenuByDirectory(Directory dir, IEnumerable <string> extensions)
        {
            var dirsplash = new Splash()
            {
                ForegroundColor = ConsoleColor.Cyan
            };
            var filesplash = new Splash()
            {
                ForegroundColor = ConsoleColor.Green
            };
            var items = dir.Directories
                        .Select((x) => CreateMenuByDirectory(x, extensions))
                        .Where(x => x != null)
                        .ToList <object>();

            items.AddRange(dir.Files.Where(x => extensions.Any(e => x.FileName.EndsWith(e))));
            var dirname = new DirectoryInfo(dir.Path).Name;

            if (items.Any())
            {
                var menu = new Selector <object>(items)
                {
                    Header = dirname,
                    Title  = dirname,
                    IsMenu = true,
                    PostActivateTrigger = (x) =>
                    {
                        x.IfType <ISelector>(y => y.Activate());
                        if (x is File)
                        {
                            Console.Clear();
                            Console.CursorTop  = 1;
                            Console.CursorLeft = 3;
                            foreach (var line in x.IfType <File>((_) => { }).Content)
                            {
                                Console.WriteLine(line);
                                Console.CursorLeft = 3;
                            }

                            Console.CursorTop += 2;
                            Console.WriteLine("[Press Escape to go back]");
                            for (ConsoleKey key = 0; key != ConsoleKey.Escape; key = Console.ReadKey(true).Key)
                            {
                                ;
                            }
                        }
                    },
                    DisplayFormat = x =>
                    {
                        string value = null;
                        x.IfType <File>(y =>
                        {
                            value     = y.FileName;
                            var index = value.LastIndexOf("\\");
                            if (index >= 0)
                            {
                                value = value.Substring(index + 1);
                            }
                            if (value.EndsWith("."))
                            {
                                value = value.Substring(0, value.LastIndexOf("."));
                            }
                        });
                        x.IfType <ISelector>(y => value = y.Title);
                        return(value);
                    },
                    ContentSplashSelector = y =>
                    {
                        if (y is ISelector)
                        {
                            return(dirsplash);
                        }
                        return(filesplash);
                    }
                };
                return(menu);
            }
            return(null);
        }
示例#9
0
        public Level1(int score, int lives, Splash splash) : base(score, lives, splash)
        {
            Text += ": Level 1";

            SplashHold = splash;

            // Platforms
            Platform plat1 = new Platform(250, 40 * JS, 100, 10, "platform");

            Controls.Add(plat1);
            Platform plat2 = new Platform(400, 35 * JS, 100, 10, "platform");

            Controls.Add(plat2);
            Platform plat3 = new Platform(400, 28 * JS, 100, 10, "platform");

            Controls.Add(plat3);
            Platform plat4 = new Platform(575, 25 * JS, 300, 10, "platform");

            Controls.Add(plat4);
            Platform plat5 = new Platform(300, 20 * JS, 100, 10, "platform");

            Controls.Add(plat5);
            Platform plat6 = new Platform(100, 23 * JS, 100, 10, "platform");

            Controls.Add(plat6);
            Platform plat12 = new Platform(100, 30 * JS, 100, 10, "platform");

            Controls.Add(plat12);
            Platform plat7 = new Platform(100, 15 * JS, 100, 10, "platform");

            Controls.Add(plat7);
            Platform plat8 = new Platform(200, 9 * JS, 100, 10, "platform");

            Controls.Add(plat8);
            Platform plat9 = new Platform(375, 5 * JS, 150, 10, "platform");

            Controls.Add(plat9);
            Platform plat10 = new Platform(660, 13 * JS, 215, 10, "platform");

            Controls.Add(plat10);
            Platform plat11 = new Platform(675, 32 * JS, 200, 10, "platform");

            Controls.Add(plat11);

            // Coins
            Entity coin1 = new Entity(630, 350, "coin");

            Controls.Add(coin1);
            Entity coin2 = new Entity(710, 350, "coin");

            Controls.Add(coin2);
            Entity coin3 = new Entity(790, 350, "coin");

            Controls.Add(coin3);
            Entity coin4 = new Entity(710, 455, "coin");

            Controls.Add(coin4);
            Entity coin5 = new Entity(790, 455, "coin");

            Controls.Add(coin5);
            Entity coin6 = new Entity(420, 55, "coin");

            Controls.Add(coin6);
            Entity coin7 = new Entity(470, 55, "coin");

            Controls.Add(coin7);
            Entity coin8 = new Entity(145, 425, "coin");

            Controls.Add(coin8);
            Entity coin9 = new Entity(840, 175, "coin");

            Controls.Add(coin9);

            // Exit
            Entity exit = new Entity(800, 170, "exit");

            Controls.Add(exit);
        }
示例#10
0
        static void Main(string[] args)
        {
            Config.DefaultGlobalConfigFileName = Constants.GlobalEidssConfigName;
            bool showMessage = true;

            if (!OneInstanceApp.Run(true, ref showMessage))
            {
                if (showMessage)
                {
                    ErrorForm.ShowMessage("msgEIDSSRunning", "You can\'t run multiple EIDSS instances simultaneously. Other instance of EIDSS is running already");
                }
                return;
            }

            //Application.SetCompatibleTextRenderingDefault(False)

            var eh = new UnhandledExceptionHandler();

            // Adds the event handler to the event.
            Application.ThreadException += eh.OnThreadException;
            try
            {
                DbManagerFactory.SetSqlFactory(new ConnectionCredentials().ConnectionString);
                EidssUserContext.Init(
                    () =>
                    EidssSiteContext.Instance.SiteType != SiteType.CDR &&
                    WinUtils.ConfirmMessage(BvMessages.Get("msgReplicationPrompt", "Start the replication to transfer data on other sites?"),
                                            BvMessages.Get("msgREplicationPromptCaption", "Confirm Replication")),
                    () =>
                {
                    EidssEventLog.Instance.CheckNotificationService();
                    EidssEventLog.Instance.StartReplication();
                }
                    );
                ClassLoader.Init("bv_common.dll", null);
                ClassLoader.Init("bvwin_common.dll", null);
                ClassLoader.Init("bv.common.dll", null);
                ClassLoader.Init("bv.winclient.dll", null);
                ClassLoader.Init("eidss*.dll", null);
                Localizer.MenuMessages              = EidssMenu.Instance;
                TranslationToolHelper.RootPath      = Directory.GetParent(Application.CommonAppDataPath).FullName;
                WinClientContext.ApplicationCaption = EidssMessages.Get("EIDSS_Caption", "Electronic Integrated Disease Surveillance System");
                WinClientContext.Init();
                //DevExpress.Skins.SkinManager.Default.RegisterAssembly(typeof(DevExpress.UserSkins.eidssmoneyskin).Assembly);
                if (!string.IsNullOrEmpty(BaseSettings.SkinAssembly) && File.Exists(BaseSettings.SkinAssembly))
                {
                    DevExpress.Skins.SkinManager.Default.RegisterAssembly(
                        Assembly.LoadFrom(BaseSettings.SkinAssembly));
                }
                else
                {
                    DevExpress.Skins.SkinManager.Default.RegisterAssembly(
                        typeof(DevExpress.UserSkins.eidssskin).Assembly);
                }
                //DevExpress.UserSkins.BonusSkins.Register();
                //Application.EnableVisualStyles();
                //Application.SetCompatibleTextRenderingDefault(False)
                DevExpress.Skins.SkinManager.EnableFormSkins();
                Application.DoEvents();
                Splash.ShowSplash();
                //BV.common.db.Core.ConnectionManager.DefaultInstance.ConfigFilesToSave = new string[] {"EIDSS_ClientAgent.exe.config"};

                //string appdir = System.IO.Path.GetDirectoryName(Application.ExecutablePath);
                //var defHelpName = Config.GetSetting("HelpUrl", "file:///" + appdir.Replace("\\", "/") + "/WebHelp_EIDSS_with_Search/");

                var defHelpName = Config.GetSetting("HelpUrl");
                WinClientContext.HelpNames.Add(Localizer.lngEn, Config.GetSetting("HelpUrl." + Localizer.lngEn, defHelpName));
                WinClientContext.HelpNames.Add(Localizer.lngRu, Config.GetSetting("HelpUrl." + Localizer.lngRu, defHelpName));
                WinClientContext.HelpNames.Add(Localizer.lngGe, Config.GetSetting("HelpUrl." + Localizer.lngGe, defHelpName));
                WinClientContext.HelpNames.Add(Localizer.lngKz, Config.GetSetting("HelpUrl." + Localizer.lngKz, defHelpName));
                WinClientContext.HelpNames.Add(Localizer.lngUzCyr, Config.GetSetting("HelpUrl." + Localizer.lngUzCyr, defHelpName));
                WinClientContext.HelpNames.Add(Localizer.lngUzLat, Config.GetSetting("HelpUrl." + Localizer.lngUzLat, defHelpName));
                WinClientContext.HelpNames.Add(Localizer.lngAzLat, Config.GetSetting("HelpUrl." + Localizer.lngAzLat, defHelpName));
                WinClientContext.HelpNames.Add(Localizer.lngUk, Config.GetSetting("HelpUrl." + Localizer.lngUk, defHelpName));
                WinClientContext.HelpNames.Add(Localizer.lngAr, Config.GetSetting("HelpUrl." + Localizer.lngAr, defHelpName));
                WinClientContext.HelpNames.Add(Localizer.lngThai, Config.GetSetting("HelpUrl." + Localizer.lngThai, defHelpName));

                //DevXLocalizer.ForceResourceAdding();
                DevXLocalizer.Init();
                WinClientContext.FieldCaptions   = EidssFields.Instance;
                BaseFieldValidator.FieldCaptions = EidssFields.Instance;
                ErrorForm.Messages                      = EidssMessages.Instance;
                BaseActionPanel.Messages                = EidssMessages.Instance;
                ErrorMessage.Messages                   = EidssMessages.Instance;
                BvLookupColumnInfo.Messages             = EidssMessages.Instance;
                bv.common.win.BaseValidator.Messages    = EidssMessages.Instance;
                bv.common.win.BaseForm.EventLog         = EidssEventLog.Instance;
                bv.common.win.BaseDetailForm.cancelMode = bv.common.win.BaseDetailForm.CancelCloseMode.CallPost;
                //CheckHelpRegistration();
                //LayoutHelper.Init();
                Application.EnableVisualStyles();
                //DevExpress.Data.CurrencyDataController.DisableThreadingProblemsDetection = true;
                //Application.SetCompatibleTextRenderingDefault(false);

                ActionLocker.ShowWaitDialog  = WaitDialog.ShowWaitDialog;
                ActionLocker.CloseWaitDialog = WaitDialog.CloseWaitDialog;

                Application.Idle += ApplicationOnIdle;

                SecurityLog.WriteToEventLogDB(null, SecurityAuditEvent.ProcessStart, true, null, null, "EIDSS is started", SecurityAuditProcessType.Eidss);
                Dbg.Debug("EIDSS is started with ClientID {0}", ModelUserContext.ClientID);
                Application.Run(new MainForm());
                Utils.SaveUsedXtraResource();
            }
            catch (Exception ex)
            {
                MessageForm.Show(ex.ToString(), "Application Error", MessageBoxButtons.OK, MessageBoxIcon.Stop);
                MainForm.ExitApp(true);
            }
        }
示例#11
0
 public virtual void Show(string message)
 {
     Splash.Show();
     Splash.BringToFront();
     label.Text = message;
 }
示例#12
0
    public MainIDE(Splash splash)
    {
        BackColor = Color.FromArgb(255, 230, 230, 230);
        ForeColor = Color.Black;

        Icon = Icons.GetIcon("icons.logo", 32);
        Text = "OS Development Studio";

        //trigger initialization of the text editor core
        TextEditor.Initialize();

        //once the form has loaded, send a signal to the
        //splash screen to close.
        Load += delegate(object sender, EventArgs e) {
            splash.Ready();
            Focus();
        };

        //load the size and location of the window the last time the application
        //was running.
        if (RuntimeState.ObjectExists("mainIDE.windowRect")) {
            RuntimeState.RECTANGLE rect = (RuntimeState.RECTANGLE)RuntimeState.GetObject(
                "mainIDE.windowRect",
                typeof(RuntimeState.RECTANGLE));
            //StartPosition = FormStartPosition.Manual;
            Location = new Point(rect.X, rect.Y);
            Size = new Size(rect.Width, rect.Height);

            //restore the window state
            if (RuntimeState.ObjectExists("mainIDE.windowState")) {
                WindowState = (FormWindowState)(byte)RuntimeState.GetObject(
                    "mainIDE.windowState",
                    typeof(byte));
            }
        }
        else {
            //set the initial size of the window to 75% of the current screen
            Size screenSize = Screen.FromPoint(Cursor.Position).WorkingArea.Size;
            Size = new Size(
                    (int)(screenSize.Width * 0.75),
                    (int)(screenSize.Height * 0.75));
            StartPosition = FormStartPosition.CenterScreen;
        }

        #region Create the initial panels
        p_StatusStrip = new StatusStrip { BackColor = BackColor };
        p_WorkingArea = new Panel { Dock = DockStyle.Fill };
        ToolStrip menu = new ToolStrip {
            GripStyle = ToolStripGripStyle.Hidden,
            Renderer = new toolStripRenderer(),
            BackColor = BackColor,
            ForeColor = ForeColor
        };
        p_Menu = menu;
        Controls.Add(menu);
        Controls.Add(p_StatusStrip);
        Controls.Add(p_WorkingArea);
        p_WorkingArea.BringToFront();
        #endregion

        #region Menu
        /*Build the main menu items*/
        menu.Items.Add(new ToolStripMenuItem("File", null, getFileMenuItems()));
        menu.Items.Add(new ToolStripMenuItem("Edit", null, getEditMenuItems()));
        menu.Items.Add(new ToolStripMenuItem("Build", null, getBuildMenuItems()));
        menu.Items.Add(new ToolStripMenuItem("Tools", null, getToolsMenuItems()));
        menu.Items.Add(new ToolStripMenuItem("Help", null, getHelpMenuItems()));

        /*Build shortcuts*/
        menu.Items.Add(new ToolStripSeparator());
        p_MenuStripRunButton = menu.Items.Add(null, Icons.GetBitmap("tools.run", 16), menu_build_run);
        menu.Items.Add(null, Icons.GetBitmap("tools.stop", 16), menu_build_stop);
        menu.Items.Add(new ToolStripSeparator());
        menu.Items.Add(null, Icons.GetBitmap("tools.build", 16), menu_build_build);
        #endregion

        //initialize the components
        initializeComponentSkeleton();
        initializeSolutionBrowser();
        initializeFileEditor();
        initializeOutputWindow();
        initializeStatusStrip();

        //create a UI update timer
        Timer updTimer = new Timer() {
            Interval = 30,
            Enabled = true
        };
        updTimer.Tick += uiUpdate;

        //clean up
        p_WorkingArea.BringToFront();
        p_SaveStateEnabled = true;
    }
示例#13
0
 private void ShowSplashForm()
 {
     SplashForm = new Splash();
     SplashForm.ShowDialog();
 }
示例#14
0
        public Level4(int score, int lives, Splash splash) : base(score, lives, splash)
        {
            Text += ": Level 4";

            SplashHold = splash;

            // Platforms
            Platform plat1 = new Platform(10, 39 * JS, 50, 10, "platform");

            Controls.Add(plat1);
            Platform plat2 = new Platform(10, 31 * JS, 80, 10, "platform");

            Controls.Add(plat2);
            Platform plat3 = new Platform(200, 33 * JS, 80, 10, "platform");

            Controls.Add(plat3);
            Platform plat4 = new Platform(350, 31 * JS, 80, 10, "platform");

            Controls.Add(plat4);
            Platform plat5 = new Platform(480, 36 * JS, 120, 10, "platform");

            Controls.Add(plat5);
            Platform plat6 = new Platform(660, 36 * JS, 120, 10, "platform");

            Controls.Add(plat6);
            Platform plat7 = new Platform(760, 30 * JS, 80, 10, "platform");

            Controls.Add(plat7);
            Platform edge4 = new Platform(820, 20 * JS, 11, 75, "edge");

            Controls.Add(edge4);
            Platform plat8 = new Platform(800, 25 * JS, 80, 10, "platform");

            Controls.Add(plat8);
            Platform edge2 = new Platform(750, 14 * JS, 11, 90, "edge");

            Controls.Add(edge2);
            Platform plat9 = new Platform(750, 20 * JS, 80, 10, "platform");

            Controls.Add(plat9);
            Platform plat10 = new Platform(750, 14 * JS, 80, 10, "platform");

            Controls.Add(plat10);
            Platform plat11 = new Platform(600, 16 * JS, 100, 10, "platform");

            Controls.Add(plat11);
            Platform plat12 = new Platform(500, 14 * JS, 80, 10, "platform");

            Controls.Add(plat12);
            Platform plat13 = new Platform(400, 14 * JS, 80, 10, "platform");

            Controls.Add(plat13);
            Platform plat14 = new Platform(200, 14 * JS, 100, 10, "platform");

            Controls.Add(plat14);
            Platform plat15 = new Platform(70, 14 * JS, 130, 10, "platform");

            Controls.Add(plat15);
            Platform edge3 = new Platform(150, 14 * JS, 11, 100, "edge");

            Controls.Add(edge3);
            Platform plat16 = new Platform(50, 20 * JS, 100, 10, "platform");

            Controls.Add(plat16);

            // Coins and heart
            Entity coin1 = new Entity(580, 505, "coin");

            Controls.Add(coin1);
            Entity coin2 = new Entity(570, 505, "coin");

            Controls.Add(coin2);
            Entity coin3 = new Entity(560, 505, "coin");

            Controls.Add(coin3);
            Entity coin4 = new Entity(780, 195, "coin");

            Controls.Add(coin4);
            Entity coin5 = new Entity(790, 195, "coin");

            Controls.Add(coin5);
            Entity heart = new Entity(850, 360, "heart");

            Controls.Add(heart);

            // Exit
            Entity exit = new Entity(100, 250, "exit");

            Controls.Add(exit);

            // Barrels
            Barrel barrel1 = new Barrel(710, 650, true);

            Controls.Add(barrel1);
            Barrel barrel2 = new Barrel(730, 650, true);

            Controls.Add(barrel2);
            Barrel barrel3 = new Barrel(750, 650, true);

            Controls.Add(barrel3);
            Barrel barrel4 = new Barrel(690, 650, true);

            Controls.Add(barrel4);
            Barrel barrel5 = new Barrel(670, 650, true);

            Controls.Add(barrel5);
            Barrel barrel6 = new Barrel(650, 650, true);

            Controls.Add(barrel6);
            Barrel barrel7 = new Barrel(770, 650, true);

            Controls.Add(barrel7);
            Barrel barrel8 = new Barrel(630, 650, true);

            Controls.Add(barrel8);

            // Ghosts
            Ghost ghost1 = new Ghost(250, 580, false);

            Controls.Add(ghost1);
            Ghost ghost2 = new Ghost(500, 580, false);

            Controls.Add(ghost2);
            Ghost ghost3 = new Ghost(880, 280, true);

            Controls.Add(ghost3);
            Ghost ghost4 = new Ghost(250, 480, true);

            Controls.Add(ghost4);
            Ghost ghost5 = new Ghost(550, 450, false);

            Controls.Add(ghost5);
            Ghost ghost6 = new Ghost(400, 200, false);

            Controls.Add(ghost6);
            Ghost ghost7 = new Ghost(500, 400, true);

            Controls.Add(ghost7);
            Ghost ghost8 = new Ghost(600, 200, false);

            Controls.Add(ghost8);

            // Turtles
            Turtle turtle1 = new Turtle(480, 524, false);

            Controls.Add(turtle1);
            Turtle turtle2 = new Turtle(660, 524, false);

            Controls.Add(turtle2);
        }
示例#15
0
        /// <summary>
        /// Do startup related things
        /// </summary>
        protected override void OnStartup(StartupEventArgs e)
        {
            _splashScreen = new Splash();
            _splashScreen.Status.Content = "MPTagThat starting ...";
            _splashScreen.Show();

            _commandLineArgs = e.Args;
            _portable        = 0;
            _startupFolder   = "";
            // Process Command line Arguments
            foreach (string arg in _commandLineArgs)
            {
                if (arg.ToLower().StartsWith("/folder="))
                {
                    _startupFolder = arg.Substring(8);
                }
                else if (arg.ToLower() == "/portable")
                {
                    _portable = 1;
                }
            }

            // Read the Config file
            ReadConfig();

            try
            {
                // Let's see, if we already have an instance of MPTagThat open
                using (var mmf = MemoryMappedFile.OpenExisting("MPTagThat"))
                {
                    if (_startupFolder == string.Empty)
                    {
                        // Don't allow a second instance of MPTagThat running
                        return;
                    }

                    byte[] buffer            = Encoding.Default.GetBytes(_startupFolder);
                    var    messageWaitHandle = new EventWaitHandle(false, EventResetMode.AutoReset, "MPTagThat_IPC");

                    // Create accessor to MMF
                    using (var accessor = mmf.CreateViewAccessor(0, buffer.Length))
                    {
                        // Write to MMF
                        accessor.WriteArray(0, buffer, 0, buffer.Length);
                        messageWaitHandle.Set();

                        // End exit this instance
                        return;
                    }
                }
            }
            catch (FileNotFoundException)
            {
                // The Memorymap does not exist, so MPTagThat is not yet running
            }

            try
            {
                // We need to set the app.config file programmatically to point to the users APPDATA Folder
                var configFile          = ConfigurationManager.OpenExeConfiguration(ConfigurationUserLevel.None);
                var appSettingssettings = configFile.AppSettings.Settings;
                var key   = "Raven/WorkingDir";
                var value = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) +
                            "\\MPTagthat2\\Databases";
                if (appSettingssettings[key] == null)
                {
                    appSettingssettings.Add(key, value);
                }
                else
                {
                    appSettingssettings[key].Value = value;
                }

                configFile.Save(ConfigurationSaveMode.Modified);
                ConfigurationManager.RefreshSection(configFile.AppSettings.SectionInformation.Name);
            }
            catch (ConfigurationErrorsException)
            {
            }

            // Need to reset the Working directory, since when we called via the Explorer Context menu, it'll be different
            Directory.SetCurrentDirectory(AppDomain.CurrentDomain.BaseDirectory);

            // Add our Bin and Bin\Bass Directory to the Path
            SetPath(Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "Bin"));
            SetPath(Path.Combine(AppDomain.CurrentDomain.BaseDirectory, @"Bin\x64"));

            base.OnStartup(e);
        }
示例#16
0
 private void UpdateGrid()
 {
     this.gridControl1.DataSource = (null);
     Splash.Show();
     Splash.Status = "状态:正在查询,请稍候...";
     try
     {
         if (this.MakeData())
         {
             this.pDataSet.Tables.Add(this.stable);
             this.pDataSet.Tables.Add(this.Geotable);
             DataRelation relation = new DataRelation("空间表", this.stable.Columns[0], this.Geotable.Columns[0]);
             this.pDataSet.Relations.Add(relation);
             this.gridControl1.DataSource = (this.pDataSet.Tables[0]);
             for (int i = 0; i < this.mainGridView.Columns.Count; i++)
             {
                 this.mainGridView.Columns[i].BestFit();
                 this.mainGridView.Columns[i].Width = ((int)((double)this.mainGridView.Columns[i].Width * 1.4));
                 string key = this.mainGridView.Columns[i].FieldName;
                 if (i == this.OidField)
                 {
                     continue;
                 }
                 if (layerInfo != null)
                 {
                     IYTField pField = layerInfo.Fields.FirstOrDefault(c => c.Name == key);
                     if (pField == null)
                     {
                         this.mainGridView.Columns[i].Visible = false;
                         continue;
                     }
                     this.mainGridView.Columns[i].Caption = pField.AliasName;
                     this.mainGridView.Columns[i].Visible = pField.Visible;
                 }
                 //if (key == "管径" || key == "沟截面宽高")
                 //{
                 //    this.mainGridView.Columns[i].Caption = (key + "[毫米]");
                 //}
                 //else if (key.ToUpper() == "X" || key.ToUpper() == "Y" || key == "地面高程" || key == "起点高程" || key == "终点高程" || key == "起点埋深" || key == "终点埋深")
                 //{
                 //    this.mainGridView.Columns[i].Caption = (key + "[米]");
                 //}
                 //else if (key == "电压")
                 //{
                 //    this.mainGridView.Columns[i].Caption = ("电压[千伏]");
                 //}
                 //else if (key == "压力")
                 //{
                 //    this.mainGridView.Columns[i].Caption = ("压力[兆帕]");
                 //}
                 //Regex regex = new Regex("^[\\u4e00-\\u9fa5]+$");
                 //if (!regex.IsMatch(key))
                 //{
                 //    this.mainGridView.Columns[i].Visible = (false);
                 //}
             }
             this.FormatCurrencyColumns();
         }
         Splash.Close();
     }
     catch
     {
         Splash.Close();
     }
 }
示例#17
0
        static public void Convert(string[] inArgs)
        {
            // configuration
            Configuration config = LoadConfig();

            // splash
            Splash.Show("Bemani To Stepmania");

            // parse args
            string[] args;
            if (inArgs.Length > 0)
            {
                args = Subfolder.Parse(inArgs);
            }
            else
            {
                args = inArgs;
            }

            // usage if no args present
            if (args.Length == 0)
            {
                Console.WriteLine();
                Console.WriteLine("Usage: BemaniToSM <input file>");
                Console.WriteLine();
                Console.WriteLine("Drag and drop with files and folders is fully supported for this application.");
                Console.WriteLine();
                Console.WriteLine("Supported formats:");
                Console.WriteLine("SSQ, XWB");
            }

            // process
            foreach (string filename in args)
            {
                if (File.Exists(filename))
                {
                    Console.WriteLine();
                    Console.WriteLine("Processing File: " + filename);
                    switch (Path.GetExtension(filename).ToUpper())
                    {
                    case @".XWB":
                    {
                        using (FileStream fs = new FileStream(filename, FileMode.Open, FileAccess.Read, FileShare.ReadWrite))
                        {
                            Console.WriteLine("Reading XWB bank");
                            MicrosoftXWB bank    = MicrosoftXWB.Read(fs);
                            string       outPath = Path.Combine(Path.GetDirectoryName(filename), Path.GetFileNameWithoutExtension(filename));

                            Directory.CreateDirectory(outPath);

                            int count = bank.SoundCount;

                            for (int i = 0; i < count; i++)
                            {
                                string outFileName;

                                if ((bank.Sounds[i].Name == null) || (bank.Sounds[i].Name == ""))
                                {
                                    outFileName = Util.ConvertToHexString(i, 4);
                                }
                                else
                                {
                                    outFileName = bank.Sounds[i].Name;
                                }

                                string outFile = Path.Combine(outPath, outFileName + ".wav");
                                Console.WriteLine("Writing " + outFile);
                                bank.Sounds[i].WriteFile(outFile, 1.0f);
                            }

                            bank = null;
                        }
                    }
                    break;

                    case @".SSQ":
                    {
                        string outTitle = Path.GetFileNameWithoutExtension(filename);
                        string outFile  = Path.Combine(Path.GetDirectoryName(filename), Path.GetFileNameWithoutExtension(filename) + ".SM");

                        Console.WriteLine();
                        Console.WriteLine("Processing file " + filename);

                        using (FileStream fs = new FileStream(filename, FileMode.Open, FileAccess.Read, FileShare.ReadWrite))
                        {
                            BemaniSSQ   ssq = BemaniSSQ.Read(fs, 0x1000);
                            StepmaniaSM sm  = new StepmaniaSM();

                            sm.Tags["TITLE"]          = outTitle;
                            sm.Tags["ARTIST"]         = "";
                            sm.Tags["TITLETRANSLIT"]  = "";
                            sm.Tags["ARTISTTRANSLIT"] = "";
                            sm.Tags["CDTITLE"]        = "";
                            sm.Tags["BANNER"]         = outTitle + ".png";
                            sm.Tags["BACKGROUND"]     = outTitle + "-bg.png";
                            sm.Tags["OFFSET"]         = "0.000";
                            sm.Tags["SAMPLELENGTH"]   = "14.000";

                            sm.CreateTempoTags(ssq.TempoEntries.ToArray());

                            foreach (Chart chart in ssq.Charts)
                            {
                                string gameType   = config["SM"]["DanceMode" + chart.Tags["Panels"]];
                                string difficulty = config["SM"]["Difficulty" + config["DDR"]["Difficulty" + chart.Tags["Difficulty"]]];
                                chart.Entries.Sort();

                                // solo chart check
                                if (gameType == config["SM"]["DanceMode6"])
                                {
                                    foreach (Entry entry in chart.Entries)
                                    {
                                        if (entry.Type == EntryType.Marker)
                                        {
                                            switch (entry.Column)
                                            {
                                            case 0: entry.Column = 0; break;

                                            case 1: entry.Column = 2; break;

                                            case 2: entry.Column = 3; break;

                                            case 3: entry.Column = 5; break;

                                            case 4: entry.Column = 1; break;

                                            case 6: entry.Column = 4; break;
                                            }
                                        }
                                    }
                                }

                                // couples chart check
                                else if (gameType == config["SM"]["DanceMode4"])
                                {
                                    foreach (Entry entry in chart.Entries)
                                    {
                                        if (entry.Type == EntryType.Marker && entry.Column >= 4)
                                        {
                                            gameType             = config["SM"]["DanceModeCouple"];
                                            chart.Tags["Panels"] = "8";
                                            break;
                                        }
                                    }
                                }

                                sm.CreateStepTag(chart.Entries.ToArray(), gameType, "", difficulty, "0", "", System.Convert.ToInt32(chart.Tags["Panels"]), config["SM"].GetValue("QuantizeNotes"));
                            }

                            sm.WriteFile(outFile);
                        }
                    }
                    break;
                    }
                }
            }
        }
示例#18
0
 //private void BuildDataviewTabControl()
 //{
 //    int numDataviewTabs = -1;
 //    // Clear the dataview tabs...
 //    ux_tabcontrolDataview.TabPages.Clear();
 //    // Now add back in the tabpage for adding new tabpages...
 //    if (!ux_tabcontrolGroupListNavigator.TabPages.ContainsKey("ux_tabpageDataviewNewTab"))
 //    {
 //        ux_tabcontrolDataview.TabPages.Add(ux_tabpageDataviewNewTab);
 //    }
 //    // Get the number of tabpages saved in the current user's settings...
 //    int.TryParse(_sharedUtils.GetUserSetting("ux_tabcontrolDataview", "TabPages.Count", "-1"), out numDataviewTabs);
 //    // Create the dataview tabs...
 //    if (numDataviewTabs > 0)
 //    {
 //        for (int i = 0; i < numDataviewTabs; i++)
 //        {
 //            //string tabText = GetUserSetting(cno, "ux_tabcontrolDataview", "TabPages[" + i.ToString() + "].Text", "Accessions");
 //            //string tabTag = GetUserSetting(cno, "ux_tabcontrolDataview", "TabPages[" + i.ToString() + "].Tag", "GET_ACCESSION");
 //            //string tabText = userSettings["ux_tabcontrolDataview", "TabPages[" + i.ToString() + "].Text"];
 //            //string tabTag = userSettings["ux_tabcontrolDataview", "TabPages[" + i.ToString() + "].Tag"];
 //            DataviewProperties dp = new DataviewProperties();
 //            //dp.TabName = userSettings["ux_tabcontrolDataview", "TabPages[" + i.ToString() + "].TabName"];
 //            //dp.DataviewName = userSettings["ux_tabcontrolDataview", "TabPages[" + i.ToString() + "].DataviewName"];
 //            //dp.StrongFormName = userSettings["ux_tabcontrolDataview", "TabPages[" + i.ToString() + "].FormName"];
 //            //dp.ViewerStyle = userSettings["ux_tabcontrolDataview", "TabPages[" + i.ToString() + "].ViewerStyle"];
 //            //dp.AlwaysOnTop = userSettings["ux_tabcontrolDataview", "TabPages[" + i.ToString() + "].AlwaysOnTop"];
 //            dp.TabName = _sharedUtils.GetUserSetting("ux_tabcontrolDataview", "TabPages[" + i.ToString() + "].TabName", "");
 //            dp.DataviewName = _sharedUtils.GetUserSetting("ux_tabcontrolDataview", "TabPages[" + i.ToString() + "].DataviewName", "");
 //            dp.StrongFormName = _sharedUtils.GetUserSetting("ux_tabcontrolDataview", "TabPages[" + i.ToString() + "].FormName", "");
 //            dp.ViewerStyle = _sharedUtils.GetUserSetting("ux_tabcontrolDataview", "TabPages[" + i.ToString() + "].ViewerStyle", "");
 //            dp.AlwaysOnTop = _sharedUtils.GetUserSetting("ux_tabcontrolDataview", "TabPages[" + i.ToString() + "].AlwaysOnTop", "");
 //            _sharedUtils.ux_tabcontrolAddTab(ux_tabcontrolDataview, dp.TabName, dp, Math.Min(i, ux_tabcontrolDataview.TabPages.IndexOf(ux_tabpageDataviewNewTab)));
 //        }
 //    }
 //    else
 //    {
 //        //ux_tabcontrolDataview.TabPages.Insert(ux_tabcontrolDataview.TabPages.IndexOf(ux_tabpageDataviewNewTab), tabPage1);
 //        // Make the default Accession dataview tab...
 //        DataviewProperties dp = new DataviewProperties();
 //        dp.TabName = tabPage1.Text;
 //        dp.DataviewName = "get_accession";
 //        dp.StrongFormName = "";
 //        dp.ViewerStyle = "Spreadsheet";
 //        dp.AlwaysOnTop = "false";
 //        _sharedUtils.ux_tabcontrolAddTab(ux_tabcontrolDataview, dp.TabName, dp, Math.Min(0, ux_tabcontrolDataview.TabPages.IndexOf(ux_tabpageDataviewNewTab)));
 //        //ux_tabcontrolDataview.TabPages.Insert(ux_tabcontrolDataview.TabPages.IndexOf(ux_tabpageDataviewNewTab), tabPage2);
 //        // Make the default Inventory dataview tab...
 //        dp = new DataviewProperties();
 //        dp.TabName = tabPage2.Text;
 //        dp.DataviewName = "get_inventory";
 //        dp.StrongFormName = "";
 //        dp.ViewerStyle = "Spreadsheet";
 //        dp.AlwaysOnTop = "false";
 //        _sharedUtils.ux_tabcontrolAddTab(ux_tabcontrolDataview, dp.TabName, dp, Math.Min(1, ux_tabcontrolDataview.TabPages.IndexOf(ux_tabpageDataviewNewTab)));
 //        //ux_tabcontrolDataview.TabPages.Insert(ux_tabcontrolDataview.TabPages.IndexOf(ux_tabpageDataviewNewTab), tabPage3);
 //        // Make the default Orders dataview tab...
 //        dp = new DataviewProperties();
 //        dp.TabName = tabPage3.Text;
 //        dp.DataviewName = "get_order_request";
 //        dp.StrongFormName = "";
 //        dp.ViewerStyle = "Spreadsheet";
 //        dp.AlwaysOnTop = "false";
 //        _sharedUtils.ux_tabcontrolAddTab(ux_tabcontrolDataview, dp.TabName, dp, Math.Min(2, ux_tabcontrolDataview.TabPages.IndexOf(ux_tabpageDataviewNewTab)));
 //    }
 //    // Make the first tab active...
 //    ux_tabcontrolDataview.SelectedTab = ux_tabcontrolDataview.TabPages[0];
 //    // Set the image for the New Tab tab(s)...
 //    ux_tabcontrolDataview.ImageList = navigatorTreeViewImages;
 //    ux_tabpageDataviewNewTab.ImageKey = "new_tab";
 //}
 //        private LookupTables LoadStandardTables(object localDBInstance)
 //        {
 ////LocalDatabase localData = new LocalDatabase((string)localDBInstance);
 ////LookupTables standardTables = new LookupTables(GRINGlobalWebServices, localData);
 //            // Load the lookup code values tables...
 //            //if (!localData.TableExists("code_value_lookup"))
 //            if (!_sharedUtils.LocalDatabaseTableExists("code_value_lookup"))
 //            {
 //                // Looks like the code_value lookup table is not downloaded to the local machine and because it is really needed
 //                // and we can't count on the user to load it manually, we will automatically load it for them...
 //                Splash splash = new Splash();
 //                splash.StartPosition = FormStartPosition.CenterScreen;
 //                splash.Show();
 //                splash.Update();
 ////standardTables.LoadTableFromDatabase("code_value");
 //                _sharedUtils.LookupTablesLoadTableFromDatabase("code_value");
 //                splash.Close();
 //            }
 //            // Okay we *should* be fairly certain that the code_value table has been downloaded to the local machine now
 //            // so let's load it into memory for fast lookups...
 ////DataTable localDBCodeValueLookupTable = localData.GetData("SELECT * FROM code_value_lookup");
 //            DataTable localDBCodeValueLookupTable = _sharedUtils.GetLocalData("SELECT * FROM code_value_lookup");
 //            if (localDBCodeValueLookupTable.Rows.Count > 0)
 //            {
 //                // Since the MRU tables are never saved to the local database, we need to add them to the memory dataset each time...
 //                localDBCodeValueLookupTable.TableName = "MRU_code_value_lookup";
 //                standardTables.Tables.Add(localDBCodeValueLookupTable);
 //                standardTables.Tables["MRU_code_value_lookup"].AcceptChanges();
 //            }
 //            return standardTables;
 //        }
 private void LoadStandardTables()
 {
     if (!_sharedUtils.LocalDatabaseTableExists("code_value_lookup") ||
         !_sharedUtils.LocalDatabaseTableExists("cooperator_lookup"))
     {
         // Looks like the code_value lookup table is not downloaded to the local machine and because it is really needed
         // and we can't count on the user to load it manually, we will automatically load it for them...
         Splash splash = new Splash();
         splash.StartPosition = FormStartPosition.CenterScreen;
         splash.Show();
         splash.Update();
         //standardTables.LoadTableFromDatabase("code_value");
         _sharedUtils.LookupTablesLoadTableFromDatabase("code_value_lookup");
         _sharedUtils.LookupTablesLoadTableFromDatabase("cooperator_lookup");
         splash.Close();
     }
     else
     {
         // The code_value and cooperator LU tables exist so let's update them right now...
         _sharedUtils.LookupTablesUpdateTable("code_value_lookup", false);
         _sharedUtils.LookupTablesUpdateTable("cooperator_lookup", true);
     }
     //// Okay we *should* be fairly certain that the code_value table has been downloaded to the local machine now
     //// so let's load it into memory for fast lookups...
     ////DataTable localDBCodeValueLookupTable = _sharedUtils.GetLocalData("SELECT * FROM code_value_lookup");
     //DataTable localDBCodeValueLookupTable = _sharedUtils.GetLocalData("SELECT * FROM code_value_lookup", "");
     //if (localDBCodeValueLookupTable.Rows.Count > 0)
     //{
     //    // Since the MRU tables are never saved to the local database, we need to add them to the memory dataset each time...
     //    _sharedUtils.LookupTablesCacheMRUTable(localDBCodeValueLookupTable);
     //}
 }
示例#19
0
        internal MainForm(string strView,
            string strGeoTiff, string strGeotiffName, bool bGeotiffTmp,
            string strKMLFile, string strKMLName, bool blKMLTmp,
            string strLastView, Dapple.Extract.Options.Client.ClientType eClientType, RemoteInterface oMRI, GeographicBoundingBox oAoi, string strAoiCoordinateSystem, string strMapFileName)
        {
            if (String.Compare(Path.GetExtension(strView), ViewExt, true) == 0 && File.Exists(strView))
                this.openView = strView;

            m_strOpenGeoTiffFile = strGeoTiff;
            m_strOpenGeoTiffName = strGeotiffName;
            m_blOpenGeoTiffTmp = bGeotiffTmp;

            m_strOpenKMLFile = strKMLFile;
            m_strOpenKMLName = strKMLName;
            m_blOpenKMLTmp = blKMLTmp;

            this.lastView = strLastView;
            s_oMontajRemoteInterface = oMRI;

            // Establish the version number string used for user display,
            // such as the Splash and Help->About screens.
            // To change the Application.ProductVersion make the
            // changes in \WorldWind\AssemblyInfo.cs
            // For alpha/beta versions, include " alphaN" or " betaN"
            // at the end of the format string.
            Version ver = new Version(Application.ProductVersion);
            Release = string.Format(CultureInfo.InvariantCulture, "{0}.{1}.{2}", ver.Major, ver.Minor, ver.Build);
            if (ver.Build % 2 != 0)
                Release += " (BETA)";

            // Name the main thread.
            System.Threading.Thread.CurrentThread.Name = ThreadNames.EventDispatch;

            // Copy/Update any configuration files and other files if needed now
            CurrentSettingsDirectory = Path.Combine(UserPath, "Config");
            Directory.CreateDirectory(CurrentSettingsDirectory);
            Settings.CachePath = Path.Combine(UserPath, "Cache");
            Directory.CreateDirectory(Settings.CachePath);
            this.metaviewerDir = Path.Combine(UserPath, "Metadata");
            Directory.CreateDirectory(this.metaviewerDir);
            string[] cfgFiles = Directory.GetFiles(Path.Combine(DirectoryPath, "Config"), "*.xml");
            foreach (string strCfgFile in cfgFiles)
            {
                string strUserCfg = Path.Combine(CurrentSettingsDirectory, Path.GetFileName(strCfgFile));
                if (!File.Exists(strUserCfg))
                    File.Copy(strCfgFile, strUserCfg);
            }
            string[] metaFiles = Directory.GetFiles(Path.Combine(Path.Combine(DirectoryPath, "Data"), "MetaViewer"), "*.*");
            foreach (string strMetaFile in metaFiles)
            {
                string strUserMeta = Path.Combine(this.metaviewerDir, Path.GetFileName(strMetaFile));
                File.Copy(strMetaFile, strUserMeta, true);
            }

            // --- Set up a new user's favorites list and home view ---

            /*if (!File.Exists(Path.Combine(CurrentSettingsDirectory, "user.dapple_serverlist")))
            {
                File.Copy(Path.Combine(Path.Combine(DirectoryPath, "Data"), "default.dapple_serverlist"), Path.Combine(CurrentSettingsDirectory, "user.dapple_serverlist"));
            }*/
            HomeView.CreateDefault();

            InitSettings();

            if (Settings.NewCachePath.Length > 0)
            {
                try
                {
                    // We want to make sure the new cache path is writable
                    Directory.CreateDirectory(Settings.NewCachePath);
                    if (Directory.Exists(Settings.CachePath))
                        Utility.FileSystem.DeleteFolderGUI(this, Settings.CachePath, "Deleting Existing Cache");
                    Settings.CachePath = Settings.NewCachePath;
                }
                catch
                {
                }
                Settings.NewCachePath = "";
            }

            if (Settings.ConfigurationWizardAtStartup)
            {
                Wizard frm = new Wizard(Settings);
                frm.ShowDialog(this);
                Settings.ConfigurationWizardAtStartup = false;
            }

            if (Settings.ConfigurationWizardAtStartup)
            {
                // If the settings file doesn't exist, then we are using the
                // default settings, and the default is to show the Configuration
                // Wizard at startup. We only want that to happen the first time
                // World Wind is started, so change the setting to false(the user
                // can change it to true if they want).
                if (!File.Exists(Settings.FileName))
                {
                    Settings.ConfigurationWizardAtStartup = false;
                }
                ConfigurationWizard.Wizard wizard = new ConfigurationWizard.Wizard(Settings);
                wizard.TopMost = true;
                wizard.ShowInTaskbar = true;
                wizard.ShowDialog();
                // TODO: should settings be saved now, in case of program crashes,
                //	   and so that XML file on disk matches in-memory settings?
            }

            //#if !DEBUG
            using (this.splashScreen = new Splash())
            {
                this.splashScreen.Owner = this;
                this.splashScreen.Show();

                Application.DoEvents();
                //#endif

                // --- setup the list of images used for the different datatypes ---

                s_oImageList.ColorDepth = ColorDepth.Depth32Bit;
                s_oImageList.ImageSize = new Size(16, 16);
                s_oImageList.TransparentColor = Color.Transparent;

                s_oImageList.Images.Add(EnabledServerIconKey, Resources.enserver);
                s_oImageList.Images.Add(DisabledServerIconKey, Resources.disserver);
                s_oImageList.Images.Add(OfflineServerIconKey, Resources.offline);
                s_oImageList.Images.Add(DapIconKey, Resources.dap);
                s_oImageList.Images.Add(DapDatabaseIconKey, Resources.dap_database);
                s_oImageList.Images.Add(DapDocumentIconKey, Resources.dap_document);
                s_oImageList.Images.Add(DapGridIconKey, Resources.dap_grid);
                s_oImageList.Images.Add(DapMapIconKey, Resources.dap_map);
                s_oImageList.Images.Add(DapPictureIconKey, Resources.dap_picture);
                s_oImageList.Images.Add(DapPointIconKey, Resources.dap_point);
                s_oImageList.Images.Add(DapSpfIconKey, Resources.dap_spf);
                s_oImageList.Images.Add(DapVoxelIconKey, Resources.dap_voxel);
                s_oImageList.Images.Add(FolderIconKey, Resources.folder);
                s_oImageList.Images.Add(DapArcGisIconKey, global::Dapple.Properties.Resources.dap_arcgis);
                s_oImageList.Images.Add(KmlIconKey, Resources.kml);
                s_oImageList.Images.Add(ErrorIconKey, global::Dapple.Properties.Resources.error);
                s_oImageList.Images.Add(LayerIconKey, global::Dapple.Properties.Resources.layer);
                s_oImageList.Images.Add(LiveMapsIconKey, global::Dapple.Properties.Resources.live);
                s_oImageList.Images.Add(TileIconKey, global::Dapple.Properties.Resources.tile);
                s_oImageList.Images.Add(GeorefImageIconKey, global::Dapple.Properties.Resources.georef_image);
                s_oImageList.Images.Add(WmsIconKey, Resources.wms);
                s_oImageList.Images.Add(ArcImsIconKey, global::Dapple.Properties.Resources.arcims);
                s_oImageList.Images.Add(BlueMarbleIconKey, Dapple.Properties.Resources.blue_marble);
                s_oImageList.Images.Add(DesktopCatalogerIconKey, Dapple.Properties.Resources.dcat);

                c_oWorldWindow = new WorldWindow();
            #if !DEBUG
                Utility.AbortUtility.ProgramAborting += new MethodInvoker(c_oWorldWindow.KillD3DAndWorkerThread);
            #endif
                c_oWorldWindow.AllowDrop = true;
                c_oWorldWindow.DragOver += new DragEventHandler(c_oWorldWindow_DragOver);
                c_oWorldWindow.DragDrop += new DragEventHandler(c_oWorldWindow_DragDrop);
                c_oWorldWindow.Resize += new EventHandler(c_oWorldWindow_Resize);
                InitializeComponent();
                this.SuspendLayout();
                c_oLayerList.ImageList = s_oImageList;

            /*#if DEBUG
                // --- Make the server tree HOOGE ---
                this.splitContainerMain.SplitterDistance = 400;
                this.splitContainerLeftMain.SplitterDistance = 400;
            #endif*/

                this.Icon = new System.Drawing.Icon(@"app.ico");
                DappleToolStripRenderer oTSR = new DappleToolStripRenderer();
                c_tsSearch.Renderer = oTSR;
                c_tsLayers.Renderer = oTSR;
                c_tsOverview.Renderer = oTSR;
                c_tsMetadata.Renderer = oTSR;

                c_tsNavigation.Renderer = new BorderlessToolStripRenderer();

                // set Upper and Lower limits for Cache size control, in bytes
                long CacheUpperLimit = (long)Settings.CacheSizeGigaBytes * 1024L * 1024L * 1024L;
                long CacheLowerLimit = (long)Settings.CacheSizeGigaBytes * 768L * 1024L * 1024L;	//75% of upper limit

                try
                {
                    Directory.CreateDirectory(Settings.CachePath);
                }
                catch
                {
                    // We get here when people used a cache drive that since dissappeared (e.g. USB flash)
                    // Revert to default cache directory in this case

                    Settings.CachePath = Path.Combine(UserPath, "Cache");
                    Directory.CreateDirectory(Settings.CachePath);
                }

                //Set up the cache
                c_oWorldWindow.Cache = new Cache(
                    Settings.CachePath,
                    CacheLowerLimit,
                    CacheUpperLimit,
                    Settings.CacheCleanupInterval,
                    Settings.TotalRunTime);

                #region Plugin + World Init.

                WorldWind.Terrain.TerrainTileService terrainTileService = new WorldWind.Terrain.TerrainTileService("http://worldwind25.arc.nasa.gov/wwelevation/wwelevation.aspx", "srtm30pluszip", 20, 150, "bil", 12, Path.Combine(Settings.CachePath, "Earth\\TerrainAccessor\\SRTM"), TimeSpan.FromMinutes(30), "Int16");
                WorldWind.Terrain.TerrainAccessor terrainAccessor = new WorldWind.Terrain.NltTerrainAccessor("SRTM", -180, -90, 180, 90, terrainTileService, null);

                WorldWind.World world = new WorldWind.World("Earth",
                    new Point3d(0, 0, 0), Quaternion4d.RotationYawPitchRoll(0, 0, 0),
                    (float)6378137,
                    System.IO.Path.Combine(c_oWorldWindow.Cache.CacheDirectory, "Earth"),
                    terrainAccessor);

                c_oWorldWindow.CurrentWorld = world;
                c_oWorldWindow.DrawArgs.WorldCamera.CameraChanged += new EventHandler(c_oWorldWindow_CameraChanged);

                string strPluginsDir = Path.Combine(DirectoryPath, "Plugins");

                this.scalebarPlugin = new NASA.Plugins.ScaleBarLegend();
                this.scalebarPlugin.PluginLoad(this, strPluginsDir);
                this.scalebarPlugin.IsVisible = World.Settings.ShowScaleBar;

                this.starsPlugin = new Stars3D.Plugin.Stars3D();
                this.starsPlugin.PluginLoad(this, Path.Combine(strPluginsDir, "Stars3D"));

                this.compassPlugin = new Murris.Plugins.Compass();
                this.compassPlugin.PluginLoad(this, Path.Combine(strPluginsDir, "Compass"));

                String szGlobalCloudsCacheDir = Path.Combine(Settings.CachePath, @"Plugins\GlobalClouds");
                Directory.CreateDirectory(szGlobalCloudsCacheDir);
                String szGlobalCloudsPluginDir = Path.Combine(CurrentSettingsDirectory, @"Plugins\GlobalClouds");
                Directory.CreateDirectory(szGlobalCloudsPluginDir);

                if (!File.Exists(Path.Combine(szGlobalCloudsPluginDir, Murris.Plugins.GlobalCloudsLayer.serverListFileName)))
                {
                    File.Copy(Path.Combine(Path.Combine(strPluginsDir, "GlobalClouds"), Murris.Plugins.GlobalCloudsLayer.serverListFileName), Path.Combine(szGlobalCloudsPluginDir, Murris.Plugins.GlobalCloudsLayer.serverListFileName));
                }

                this.cloudsPlugin = new Murris.Plugins.GlobalClouds(szGlobalCloudsCacheDir);
                this.cloudsPlugin.PluginLoad(this, szGlobalCloudsPluginDir);

                this.skyPlugin = new Murris.Plugins.SkyGradient();
                this.skyPlugin.PluginLoad(this, Path.Combine(strPluginsDir, "SkyGradient"));

                this.threeDConnPlugin = new ThreeDconnexion.Plugin.TDxWWInput();
                this.threeDConnPlugin.PluginLoad(this, Path.Combine(strPluginsDir, "3DConnexion"));

                ThreadPool.QueueUserWorkItem(LoadPlacenames);

                c_scWorldMetadata.Panel1.Controls.Add(c_oWorldWindow);
                c_oWorldWindow.Dock = DockStyle.Fill;

                #endregion

                float[] verticalExaggerationMultipliers = { 0.0f, 1.0f, 1.5f, 2.0f, 3.0f, 5.0f, 7.0f, 10.0f };
                foreach (float multiplier in verticalExaggerationMultipliers)
                {
                    ToolStripMenuItem curItem = new ToolStripMenuItem(multiplier.ToString("f1", System.Threading.Thread.CurrentThread.CurrentCulture) + "x", null, new EventHandler(menuItemVerticalExaggerationChange));
                    c_miVertExaggeration.DropDownItems.Add(curItem);
                    curItem.CheckOnClick = true;
                    if (Math.Abs(multiplier - World.Settings.VerticalExaggeration) < 0.1f)
                        curItem.Checked = true;
                }

                this.c_miShowCompass.Checked = World.Settings.ShowCompass;
                this.c_miShowDLProgress.Checked = World.Settings.ShowDownloadIndicator;
                this.c_miShowCrosshair.Checked = World.Settings.ShowCrosshairs;
                this.c_miShowInfoOverlay.Checked = World.Settings.ShowPosition;
                this.c_miShowGridlines.Checked = World.Settings.ShowLatLonLines;
                this.c_miShowGlobalClouds.Checked = World.Settings.ShowClouds;
                if (World.Settings.EnableSunShading)
                {
                    if (!World.Settings.SunSynchedWithTime)
                        this.c_miSunshadingEnabled.Checked = true;
                    else
                        this.c_miSunshadingSync.Checked = true;
                }
                else
                    this.c_miSunshadingDisabled.Checked = true;
                this.c_miShowAtmoScatter.Checked = World.Settings.EnableAtmosphericScattering;

                this.c_miAskLastViewAtStartup.Checked = Settings.AskLastViewAtStartup;
                if (!Settings.AskLastViewAtStartup)
                    this.c_miOpenLastViewAtStartup.Checked = Settings.LastViewAtStartup;

                #region OverviewPanel

                // Fix: earlier versions of Dapple set the DataPath as an absolute reference, so if Dapple was uninstalled, OMapple could not find
                // the file for the overview control.  To fix this, switch the variable to a relative reference if the absolute one doesn't resolve.
                // Dapple will still work; the relative reference will be from whatever directory Dapple is being run.
                if (!Directory.Exists(Settings.DataPath)) Settings.DataPath = "Data";

                #endregion

                c_oWorldWindow.MouseEnter += new EventHandler(this.c_oWorldWindow_MouseEnter);
                c_oWorldWindow.MouseLeave += new EventHandler(this.c_oWorldWindow_MouseLeave);
                c_oOverview.AOISelected += new Overview.AOISelectedDelegate(c_oOverview_AOISelected);

                #region Search view setup

                this.c_oServerList = new ServerList();
                m_oModel = new DappleModel(c_oLayerList);
                m_oModel.SelectedNodeChanged += new EventHandler(m_oModel_SelectedNodeChanged);
                c_oLayerList.Attach(m_oModel);
                NewServerTree.View.ServerTree newServerTree = new NewServerTree.View.ServerTree();
                newServerTree.Attach(m_oModel);
                c_oServerList.Attach(m_oModel);
                c_oLayerList.LayerSelectionChanged += new EventHandler(c_oLayerList_LayerSelectionChanged);

                m_oMetadataDisplay = new MetadataDisplayThread(this);
                m_oMetadataDisplay.AddBuilder(null);
                c_oServerList.LayerList = c_oLayerList;
                c_oLayerList.GoTo += new LayerList.GoToHandler(this.GoTo);

                c_oLayerList.ViewMetadata += new ViewMetadataHandler(m_oMetadataDisplay.AddBuilder);
                c_oServerList.ViewMetadata += new ViewMetadataHandler(m_oMetadataDisplay.AddBuilder);
                c_oServerList.LayerSelectionChanged += new EventHandler(c_oServerList_LayerSelectionChanged);

                this.cServerViewsTab = new JanaTab();
                this.cServerViewsTab.SetImage(0, Resources.tab_tree);
                this.cServerViewsTab.SetImage(1, Resources.tab_list);
                this.cServerViewsTab.SetToolTip(0, "Server tree view");
                this.cServerViewsTab.SetToolTip(1, "Server list view");
                this.cServerViewsTab.SetNameAndText(0, "TreeView");
                this.cServerViewsTab.SetNameAndText(1, "ListView");
                this.cServerViewsTab.SetPage(0, newServerTree);
                this.cServerViewsTab.SetPage(1, this.c_oServerList);
                cServerViewsTab.PageChanged += new JanaTab.PageChangedDelegate(ServerPageChanged);

                c_oDappleSearch = new DappleSearchList();
                c_oDappleSearch.LayerSelectionChanged += new EventHandler(c_oDappleSearch_LayerSelectionChanged);
                c_oDappleSearch.Attach(m_oModel, c_oLayerList);

                c_tcSearchViews.TabPages[0].Controls.Add(cServerViewsTab);
                cServerViewsTab.Dock = DockStyle.Fill;
                c_tcSearchViews.TabPages[1].Controls.Add(c_oDappleSearch);
                c_oDappleSearch.Dock = DockStyle.Fill;

                c_oLayerList.SetBaseLayer(new BlueMarbleBuilder());

                this.ResumeLayout(false);

                #endregion

                this.PerformLayout();

                while (!this.splashScreen.IsDone)
                    System.Threading.Thread.Sleep(50);

                // Force initial render to avoid showing random contents of frame buffer to user.
                c_oWorldWindow.Render();
                WorldWindow.Focus();

                #region OM Forked Process configuration

                if (IsRunningAsDapClient)
                {
                    c_oLayerList.OMFeaturesEnabled = true;
                    this.MinimizeBox = false;

                    if (oAoi != null && !string.IsNullOrEmpty(strAoiCoordinateSystem))
                    {
                        s_oOMMapExtentNative = oAoi;
                        s_strAoiCoordinateSystem = strAoiCoordinateSystem;
                        s_strOpenMapFileName = strMapFileName;

                        s_oOMMapExtentWGS84 = s_oOMMapExtentNative.Clone() as GeographicBoundingBox;
                        s_oMontajRemoteInterface.ProjectBoundingRectangle(strAoiCoordinateSystem, ref s_oOMMapExtentWGS84.West, ref s_oOMMapExtentWGS84.South, ref s_oOMMapExtentWGS84.East, ref s_oOMMapExtentWGS84.North, Dapple.Extract.Resolution.WGS_84);
                    }
                    s_eClientType = eClientType;

                    c_miLastView.Enabled = false;
                    c_miLastView.Visible = false;
                    c_miDappleHelp.Visible = false;
                    c_miDappleHelp.Enabled = false;
                    toolStripSeparator10.Visible = false;
                    c_miOpenImage.Visible = false;
                    c_miOpenImage.Enabled = false;
                    c_miOpenKeyhole.Visible = false;
                    c_miOpenKeyhole.Enabled = false;

                    // Hide and disable the file menu
                    c_miFile.Visible = false;
                    c_miFile.Enabled = false;
                    c_miOpenSavedView.Visible = false;
                    c_miOpenSavedView.Enabled = false;
                    c_miOpenHomeView.Visible = false;
                    c_miOpenHomeView.Enabled = false;
                    c_miSetHomeView.Visible = false;
                    c_miSetHomeView.Enabled = false;
                    c_miSaveView.Visible = false;
                    c_miSaveView.Enabled = false;
                    c_miSendViewTo.Visible = false;
                    c_miSendViewTo.Enabled = false;
                    c_miOpenKeyhole.Visible = false;
                    c_miOpenKeyhole.Enabled = false;

                    // Show the OM help menu
                    c_miGetDatahelp.Enabled = true;
                    c_miGetDatahelp.Visible = true;

                    // Don't let the user check for updates.  EVER.
                    c_miCheckForUpdates.Visible = false;
                    c_miCheckForUpdates.Enabled = false;
                }
                else
                {
                    c_miExtractLayers.Visible = false;
                    c_miExtractLayers.Enabled = false;
                }

                #endregion

                loadCountryList();
                populateAoiComboBox();
                LoadMRUList();
                CenterNavigationToolStrip();
                //#if !DEBUG

                c_tbSearchKeywords.Text = NO_SEARCH;
            }
            //#endif
        }
示例#20
0
 protected virtual void Show()
 {
     Splash.Show();
 }
        public Window_Return_Info Update(GameTime gameTime, KeyPress keyPress)
        {
            Window_Return_Info window_Return_Info;
            window_Return_Info.windowTransition = false;
            window_Return_Info.newState = Game_Window_State.Splash_Screen_State;
            Base_Components.Camera.offset = Vector2.Zero;

            if (reload == true)
            {
                Reload();
            }

            if (keyPress.key_Up == 1 && konami == 0)
            {
                konami += 1;
            }
            else if (keyPress.key_Up == 1 && konami == 1)
            {
                konami += 1;
            }
            else if (keyPress.key_Down == 1 && konami == 2)
            {
                konami += 1;
            }
            else if (keyPress.key_Down == 1 && konami == 3)
            {
                konami += 1;
            }
            else if (keyPress.key_Left == 1 && konami == 4)
            {
                konami += 1;
            }
            else if (keyPress.key_Right == 1 && konami == 5)
            {
                konami += 1;
            }
            else if (keyPress.key_Left == 1 && konami == 6)
            {
                konami += 1;
            }
            else if (keyPress.key_Right == 1 && konami == 7)
            {
                konami += 1;
            }
            else if (keyPress.key_A == 1 && konami == 8)
            {
                konami += 1;
            }
            else if (keyPress.key_B == 1 && konami == 9)
            {
                window_Return_Info.windowTransition = true;
                window_Return_Info.newState = Game_Window_State.Konami_State;
                Dismiss();
            }

            switch(splash_state)
            {
                case Splash.nwp_Logo:

                    // nwp_logo fade in
                    if (nwp_logo_fade == 0)
                    {
                        nwp_FadeDelay -= gameTime.ElapsedGameTime.TotalSeconds;

                        if (nwp_FadeDelay <= 0)
                        {
                            nwp_FadeDelay = fade_Delay;
                            nwp_AlphaValue -= fadeIncrement;

                            if (nwp_AlphaValue <= 0)
                            {
                                nwp_AlphaValue = MathHelper.Clamp(nwp_AlphaValue, 0, 1);
                                nwp_logo_fade += 1;
                            }
                        }
                    }

                    // nwp_logo pause
                    else if (nwp_logo_fade == 1)
                    {
                        if (elapsedTime >= splash_Pause)
                        {
                            nwp_logo_fade += 1;
                            nwp_AlphaValue = 0f;
                        }
                        else
                        {
                            elapsedTime += gameTime.ElapsedGameTime.TotalSeconds;
                        }
                    }

                    // nwp_logo fade out
                    else if (nwp_logo_fade == 2)
                    {
                        nwp_FadeDelay -= gameTime.ElapsedGameTime.TotalSeconds;

                        if (nwp_FadeDelay <= 0)
                        {
                            nwp_FadeDelay = fade_Delay;
                            nwp_AlphaValue += fadeIncrement;

                            if (nwp_AlphaValue >= 1)
                            {
                                nwp_AlphaValue = MathHelper.Clamp(nwp_AlphaValue, 0, 1);
                                splash_state = Splash.change_State;
                            }
                        }
                    }
                    break;

                case Splash.change_State:

                    // Change Game_Window_State

                    window_Return_Info.windowTransition = true;
                    window_Return_Info.newState = Game_Window_State.Main_Menu_State;
                    Dismiss();
                    break;
            }
            return window_Return_Info;
        }
示例#22
0
 public override void DoDie()
 {
     Splash.At(Center(), Blood(), 10);
     base.DoDie();
 }
示例#23
0
文件: Admin.cs 项目: gasbank/black
    public void GoToMain()
    {
#if BLACK_ADMIN
        Splash.LoadSplashScene();
#endif
    }
示例#24
0
        private static int Main(string[] args)
        {
            var isFirstInstance = true;

            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            // This might fix the SEHException raised sometimes. See issue:
            // https://sourceforge.net/tracker/?func=detail&aid=2335753&group_id=96589&atid=615248
            Application.DoEvents();

            // child threads should impersonate the current windows user
            AppDomain.CurrentDomain.SetPrincipalPolicy(System.Security.Principal.PrincipalPolicy.WindowsPrincipal);

            /* setup handler for unhandled exceptions in non-debug modes */
            // Allow exceptions to be unhandled so they break in the debugger
#if !DEBUG
            ApplicationExceptionHandler eh = new ApplicationExceptionHandler();

            AppDomain.CurrentDomain.UnhandledException += eh.OnAppDomainException;
#endif

#if DEBUG && TEST_I18N_THISCULTURE
            Thread.CurrentThread.CurrentUICulture = new System.Globalization.CultureInfo(new I18NTestCulture().Culture);
            Thread.CurrentThread.CurrentCulture   = Thread.CurrentThread.CurrentUICulture;
#endif

            FormWindowState initialStartupState = Win32.GetStartupWindowState();
            // if you want to debug the minimzed startup (cannot be configured in VS.IDE),
            // comment out the line above and uncomment the next one:
            //FormWindowState initialStartupState =  FormWindowState.Minimized;

            var appInstance            = new RssBanditApplication();
            Action <string[]> callback = appInstance.OnOtherInstance;
            try
            {
                GuiInvoker.Initialize();

                isFirstInstance = ApplicationActivator.LaunchOrReturn(cb => GuiInvoker.Invoke(appInstance.MainForm, () => callback(cb)), args);
            }
            catch (Exception /* ex */)
            {
                //_log.Error(ex); /* other instance is probably still running */
            }
            //_log.Info("Application v" + RssBanditApplication.VersionLong + " started, running instance is " + running);

            RssBanditApplication.StaticInit(appInstance);
            if (isFirstInstance)
            {
                // init to system default:
                RssBanditApplication.SharedCulture   = CultureInfo.CurrentCulture;
                RssBanditApplication.SharedUICulture = CultureInfo.CurrentUICulture;

                if (appInstance.HandleCommandLineArgs(args))
                {
                    if (!string.IsNullOrEmpty(appInstance.CommandLineArgs.LocalCulture))
                    {
                        try
                        {
                            RssBanditApplication.SharedUICulture =
                                CultureInfo.CreateSpecificCulture(appInstance.CommandLineArgs.LocalCulture);
                            RssBanditApplication.SharedCulture = RssBanditApplication.SharedUICulture;
                        }
                        catch (Exception ex)
                        {
                            appInstance.MessageError(String.Format(
                                                         SR.ExceptionProcessCommandlineCulture,
                                                         appInstance.CommandLineArgs.LocalCulture,
                                                         ex.Message));
                        }
                    }

                    // take over customized cultures to current main thread:
                    Thread.CurrentThread.CurrentCulture   = RssBanditApplication.SharedCulture;
                    Thread.CurrentThread.CurrentUICulture = RssBanditApplication.SharedUICulture;

                    if (!appInstance.CommandLineArgs.StartInTaskbarNotificationAreaOnly &&
                        initialStartupState != FormWindowState.Minimized)
                    {
                        // no splash, if start option is tray only or minimized
                        Splash.Show(SR.AppLoadStateLoading, RssBanditApplication.VersionLong);
                    }

                    if (appInstance.Init())
                    {
                        // does also run the windows event loop:
                        appInstance.StartMainGui(initialStartupState);
                        Splash.Close();
                    }
                    else
                    {
                        return(3); // init error
                    }
                    return(0);     // OK
                }
                return(2);         // CommandLine error
            }
            return(1);             // other running instance
        }
示例#25
0
        private void InitializeAddIn()
        {
            if (_isInitialized)
            {
                // The add-in is already initialized. See:
                // The strange case of the add-in initialized twice
                // http://msmvps.com/blogs/carlosq/archive/2013/02/14/the-strange-case-of-the-add-in-initialized-twice.aspx
                return;
            }

            var configLoader = new XmlPersistanceService <GeneralSettings>
            {
                FilePath =
                    Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData),
                                 "Rubberduck", "rubberduck.config")
            };
            var configProvider = new GeneralConfigProvider(configLoader);

            var settings = configProvider.Create();

            if (settings != null)
            {
                try
                {
                    var cultureInfo = CultureInfo.GetCultureInfo(settings.Language.Code);
                    Dispatcher.CurrentDispatcher.Thread.CurrentUICulture = cultureInfo;
                }
                catch (CultureNotFoundException)
                {
                }
            }
            else
            {
                Debug.Assert(false, "Settings could not be initialized.");
            }

            Splash splash = null;

            if (settings.ShowSplash)
            {
                splash = new Splash
                {
                    // note: IVersionCheck.CurrentVersion could return this string.
                    Version = $"version {Assembly.GetExecutingAssembly().GetName().Version}"
                };
                splash.Show();
                splash.Refresh();
            }

            try
            {
                Startup();
            }
            catch (Win32Exception)
            {
                System.Windows.Forms.MessageBox.Show(RubberduckUI.RubberduckReloadFailure_Message, RubberduckUI.RubberduckReloadFailure_Title,
                                                     MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
            }
            catch (Exception exception)
            {
                _logger.Fatal(exception);
                System.Windows.Forms.MessageBox.Show(exception.ToString(), RubberduckUI.RubberduckLoadFailure,
                                                     MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
            finally
            {
                splash?.Dispose();
            }
        }
示例#26
0
        public App()
        {
            InitializeComponent();

            MainPage = new Splash();
        }
示例#27
0
        static void Main(string[] args)
        {
            Range.DefaultSlideWidth = 64;
            var red    = Range.New(0, 255, 1, Default: 0xFF, Title: "Primary color Red");
            var green  = Range.New(0, 255, 1, Default: 0xFF, Title: "Primary color Green");
            var blue   = Range.New(0, 255, 1, Default: 0xFF, Title: "Primary color Blue");
            var red2   = Range.New(0, 255, 1, Default: 0, Title: "Secondary color Red");
            var green2 = Range.New(0, 255, 1, Default: 0, Title: "Secondary color Green");
            var blue2  = Range.New(0, 255, 1, Default: 0, Title: "Secondary color Blue");

            red.SlideSplash = red2.SlideSplash = new Splash()
            {
                ForegroundColor = ConsoleColor.Red, BackgroundColor = ConsoleColor.DarkRed
            };
            green.SlideSplash = green2.SlideSplash = new Splash()
            {
                ForegroundColor = ConsoleColor.Green, BackgroundColor = ConsoleColor.DarkGreen
            };
            blue.SlideSplash = blue2.SlideSplash = new Splash()
            {
                ForegroundColor = ConsoleColor.Blue, BackgroundColor = ConsoleColor.DarkBlue
            };
            TextInput name = null;

            name = new TextInput(x =>
            {
                var chars = x.Intersect(Path.GetInvalidFileNameChars());

                if (x.Length == 0)
                {
                    name.ErrorMessage = $"Value cannot be empty";
                }
                else if (chars.Any())
                {
                    name.ErrorMessage = $"Remove: {Environment.NewLine}{string.Join(Environment.NewLine, chars)}";
                }
                else
                {
                    return(true);
                }
                return(false);
            })
            {
                Title  = "Finish",
                Header = "Choose filename:",
                Footer = "extension will be added (for example '.bmp')"
            };

            var options       = new IInputTool[] { red, green, blue, red2, green2, blue2, name };
            var imageSettings = new InputToolSelector <IInputTool>(options);
            var cancel        = new Selector <bool>(new bool[] { false, true })
            {
                Header = "Do you want to exit without saving?", DisplayFormat = x => x ? "Yes" : "No"
            };

            imageSettings.CancelTrigger = x => imageSettings.Cancel = cancel.Activate().IfType <Selector <bool> >(y => { }).Value;
            var bgsplash = new Splash()
            {
                ForegroundColor = ConsoleColor.DarkGray, BackgroundColor = ConsoleColor.Gray
            };

            imageSettings.ActUponInputToolTree(tool => tool.IfType <IRange <int> >(x =>
            {
                x.IncrementByModifiers[ConsoleModifiers.Control] = 5;
                x.IncrementByModifiers[ConsoleModifiers.Shift | ConsoleModifiers.Control] = 20;
                x.SlideBackgroundSplash = bgsplash;
                x.Header = x.Title;
            }));
            imageSettings.InputSplash.ForegroundColor = ConsoleColor.Cyan;
            name.PostActivateTrigger          = x => imageSettings.Cancel = true;
            name.FooterSplash.ForegroundColor = ConsoleColor.DarkGray;

            var format = new EnumSelector <ImageFormat> {
                Header = "Choose image format", InputSplash = imageSettings.InputSplash
            };

            while (true)
            {
                imageSettings.Activate();
                if (imageSettings.Cancel)
                {
                    return;
                }
                format.Activate();
                if (format.Cancel)
                {
                    continue;
                }

                var size   = 16;
                var drawer = new BitmapDrawer(name.Value, 32 * 8 * size, 32 * 5 * size)
                {
                    Iterations     = 64,
                    Zoom           = 4,
                    XScroll        = 0.45,
                    YScroll        = 0.05,
                    PrimaryColor   = Color.FromArgb(red.Value, green.Value, blue.Value),
                    SecondaryColor = Color.FromArgb(red2.Value, green2.Value, blue2.Value),
                    LimitAlpha     = 1,
                    ImageFormat    = format.Value
                };

                drawer.CreateImage();
                drawer.SaveImage();
                Process.Start($"{Directory.GetCurrentDirectory()}\\{drawer.FullFileName}");
                break;
            }
        }
        public Level3(int score, int lives, Splash splash) : base(score, lives, splash)
        {
            Text += ": Level 3";

            SplashHold = splash;

            // Platforms
            Platform plat1 = new Platform(265, 685, 100, 10, "floor");

            Controls.Add(plat1);
            Platform plat2 = new Platform(365, 675, 100, 10, "floor");

            Controls.Add(plat2);
            Platform plat3 = new Platform(465, 665, 100, 10, "floor");

            Controls.Add(plat3);
            Platform plat4 = new Platform(565, 655, 100, 10, "floor");

            Controls.Add(plat4);
            Platform plat5 = new Platform(665, 645, 100, 10, "floor");

            Controls.Add(plat5);
            Platform plat6 = new Platform(765, 635, 100, 10, "floor");

            Controls.Add(plat6);
            Platform plat7 = new Platform(865, 625, 100, 10, "floor");

            Controls.Add(plat7);
            Platform plat8 = new Platform(750, 550, 100, 10, "platform");

            Controls.Add(plat8);
            Platform plat20 = new Platform(650, 500, 100, 10, "platform");

            Controls.Add(plat20);
            Platform plat9 = new Platform(450, 450, 200, 10, "platform");

            Controls.Add(plat9);
            Platform plat10 = new Platform(650, 350, 315, 10, "platform");

            Controls.Add(plat10);
            Platform plat11 = new Platform(540, 200, 10, 250, "edge");

            Controls.Add(plat11);
            Platform plat12 = new Platform(920, 270, 50, 10, "platform");

            Controls.Add(plat12);
            Platform plat13 = new Platform(700, 200, 200, 10, "platform");

            Controls.Add(plat13);
            Platform plat14 = new Platform(400, 190, 300, 10, "floor");

            Controls.Add(plat14);
            Platform plat15 = new Platform(700, 200, 200, 10, "platform");

            Controls.Add(plat15);
            Platform plat16 = new Platform(700, 200, 200, 10, "platform");

            Controls.Add(plat16);
            Platform plat17 = new Platform(300, 0, 10, 450, "edge");

            Controls.Add(plat17);
            Platform plat18 = new Platform(0, 500, 450, 10, "floor");

            Controls.Add(plat18);
            Platform plat19 = new Platform(450, 450, 10, 60, "edge");

            Controls.Add(plat19);
            Platform plat21 = new Platform(300, 320, 150, 10, "platform");

            Controls.Add(plat21);
            Platform plat22 = new Platform(20, 420, 100, 10, "platform");

            Controls.Add(plat22);
            Platform plat23 = new Platform(170, 350, 130, 10, "platform");

            Controls.Add(plat23);
            Platform plat24 = new Platform(200, 260, 100, 10, "platform");

            Controls.Add(plat24);
            Platform plat25 = new Platform(300, 320, 150, 10, "platform");

            Controls.Add(plat25);
            Platform plat26 = new Platform(120, 180, 100, 10, "platform");

            Controls.Add(plat26);
            Platform plat27 = new Platform(0, 100, 100, 10, "platform");

            Controls.Add(plat27);

            // Barrels
            Barrel barrel1 = new Barrel(400, 100, false);

            Controls.Add(barrel1);
            Barrel barrel2 = new Barrel(600, 400, true);

            Controls.Add(barrel2);
            Barrel barrel3 = new Barrel(800, 500, false);

            Controls.Add(barrel3);
            Barrel barrel4 = new Barrel(800, 600, true);

            Controls.Add(barrel4);
            Barrel barrel5 = new Barrel(600, 600, true);

            Controls.Add(barrel5);
            Barrel barrel6 = new Barrel(100, 300, false);

            Controls.Add(barrel6);
            Barrel barrel7 = new Barrel(100, 300, true);

            Controls.Add(barrel7);

            // Coins
            Entity coin1 = new Entity(910, 580, "coin");

            Controls.Add(coin1);
            Entity coin2 = new Entity(500, 420, "coin");

            Controls.Add(coin2);
            Entity coin3 = new Entity(600, 420, "coin");

            Controls.Add(coin3);
            Entity coin4 = new Entity(935, 315, "coin");

            Controls.Add(coin4);
            Entity coin5 = new Entity(450, 160, "coin");

            Controls.Add(coin5);
            Entity coin6 = new Entity(550, 160, "coin");

            Controls.Add(coin6);
            Entity coin7 = new Entity(650, 160, "coin");

            Controls.Add(coin7);
            Entity coin8 = new Entity(250, 230, "coin");

            Controls.Add(coin8);
            Entity coin9 = new Entity(250, 320, "coin");

            Controls.Add(coin9);

            // Hearts
            Entity heart1 = new Entity(910, 450, "heart");

            Controls.Add(heart1);
            Entity heart2 = new Entity(50, 250, "heart");

            Controls.Add(heart2);

            // Exit
            Entity exit = new Entity(50, 75, "exit");

            Controls.Add(exit);
        }
示例#29
0
 public unsafe static long $Invoke0(long instance, long *args)
 {
     return(GCHandledObjects.ObjectToGCHandle(Splash.CalculateScale()));
 }
示例#30
0
        public static string GetFeedFileCachePath()
        {
            #region old behavior

            //		        // old behavior:
            //				string s = ApplicationDataFolderFromEnv;
            //				if(!Directory.Exists(s)) Directory.CreateDirectory(s);
            //				s = Path.Combine(s, @"Cache");
            //				if(!Directory.Exists(s))
            //					Directory.CreateDirectory(s);
            //				return s;

            #endregion

            if (appCacheFolderPath == null)
            {
                // We activated this in general to use
                // Environment.SpecialFolder.LocalApplicationData for cache
                // to support better roaming profile performance
                string s = Path.Combine(ApplicationLocalDataFolderFromEnv, "Cache");

                if (!Directory.Exists(s))
                {
                    string old_cache = Path.Combine(GetUserPath(), "Cache");
                    // move old content:
                    if (Directory.Exists(old_cache))
                    {
                        if (s.StartsWith(old_cache))
                        {
                            _log.Error("GetFeedFileCachePath(): " + String.Format(SR.CacheFolderInvalid_CannotBeMoved, s));
                            Splash.Close();
                            MessageBox.Show(String.Format(SR.CacheFolderInvalid_CannotBeMoved, s),
                                            Caption,
                                            MessageBoxButtons.OK,
                                            MessageBoxIcon.Error);
                            s = old_cache;
                        }
                        else
                        {
                            try
                            {
                                string s_root_old = Directory.GetDirectoryRoot(old_cache);
                                string s_root     = Directory.GetDirectoryRoot(s);
                                if (s_root_old == s_root)
                                {
                                    // fast move possible on the same drive:
                                    Directory.Move(old_cache, s);
                                }
                                else
                                {
                                    // slower action (source on network/oher drive):
                                    if (!Directory.Exists(s))
                                    {
                                        Directory.CreateDirectory(s);
                                    }
                                    // copy files:
                                    foreach (string f in Directory.GetFiles(old_cache))
                                    {
                                        File.Copy(f, Path.Combine(s, Path.GetFileName(f)), true);
                                    }
                                    // delete source(s):
                                    Directory.Delete(old_cache, true);
                                }
                            }
                            catch (Exception ex)
                            {
                                _log.Error("GetFeedFileCachePath()error while moving cache folder.", ex);
                                Splash.Close();
                                MessageBox.Show(String.Format(
                                                    SR.CacheFolderInvalid_CannotBeMovedException, s, ex.Message),
                                                Caption,
                                                MessageBoxButtons.OK,
                                                MessageBoxIcon.Error);
                                s = old_cache;
                            }
                        }
                    }
                    else
                    {
                        Directory.CreateDirectory(s);
                    }
                }
                appCacheFolderPath = s;
            }
            return(appCacheFolderPath);
        }
示例#31
0
        public static void Main(String[] args)
        {
            // Disallow multiple instances
            if (FileUtils.CheckAppExistingInstance("ACATMutex"))
            {
                return;
            }

            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);

            var assembly = Assembly.GetExecutingAssembly();

            // get appname and copyright information
            object[] attributes = assembly.GetCustomAttributes(typeof(AssemblyTitleAttribute), false);
            var      appName    = (attributes.Length != 0) ?
                                  ((AssemblyTitleAttribute)attributes[0]).Title :
                                  String.Empty;

            var appVersion = "Version " + assembly.GetName().Version;

            attributes = assembly.GetCustomAttributes(typeof(AssemblyCopyrightAttribute), false);
            var appCopyright = (attributes.Length != 0) ?
                               ((AssemblyCopyrightAttribute)attributes[0]).Copyright :
                               String.Empty;

            Log.Info("***** " + appName + ". " + appVersion + ". " + appCopyright + " *****");

            parseCommandLine(args);

            CoreGlobals.AppGlobalPreferences = GlobalPreferences.Load(FileUtils.GetPreferencesFileFullPath(GlobalPreferences.FileName));

            //Set the active user/profile information
            setUserName();
            setProfileName();

            //Create user and profile if they don't already exist
            if (!createUserAndProfile())
            {
                return;
            }

            if (!loadUserPreferences())
            {
                return;
            }

            Log.SetupListeners();

            // Display splash screen and initialize
            Splash splash = new Splash(FileUtils.GetImagePath("SplashScreenImage.png"), appName, appVersion, appCopyright, 5000);

            splash.Show();

            Context.PreInit();
            Common.PreInit();

            if (!Context.Init())
            {
                splash.Close();
                splash = null;

                TimedMessageBox.Show(Context.GetInitCompletionStatus());
                if (Context.IsInitFatal())
                {
                    return;
                }
            }

            AuditLog.Audit(new AuditEvent("Application", "start"));

            Context.ShowTalkWindowOnStartup = Common.AppPreferences.ShowTalkWindowOnStartup;
            Context.AppAgentMgr.EnableContextualMenusForDialogs = Common.AppPreferences.EnableContextualMenusForDialogs;
            Context.AppAgentMgr.EnableContextualMenusForMenus   = Common.AppPreferences.EnableContextualMenusForMenus;

            Context.PostInit();

            if (splash != null)
            {
                splash.Close();
            }

            Common.Init();

            try
            {
                Application.Run();

                AuditLog.Audit(new AuditEvent("Application", "stop"));

                Context.Dispose();

                Common.Uninit();

                //Utils.Dispose();

                Log.Close();
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.ToString());
            }
        }
示例#32
0
        public static void Main(string[] args)
        {
            Application.EnableVisualStyles();
            Welcome   login    = new Welcome();
            Interface mainForm = new Interface();
            Splash    splash   = new Splash();

            Configuration config = new Configuration();

            Configuration.BotInfo info = new Configuration.BotInfo();
            info.Admins               = new ulong[1];
            info.Admins[0]            = 0123456789;
            info.BotControlClass      = "";
            info.ChatResponse         = "";
            info.DisplayName          = "";
            info.DisplayNamePrefix    = "";
            info.LogFile              = "";
            info.LogLevel             = "Info";
            info.MaximumActionGap     = 0;
            info.MaximumTradeTime     = 0;
            info.Password             = "";
            info.TradePollingInterval = 999;
            info.Username             = "";

            splash.Show();

            new Thread(() =>
            {
                int crashes = 0;
                while (crashes < 1000)
                {
                    try
                    {
                        new Bot(info, "120F03A1543C9F22AA9BF4C7B6442154", (Bot bot, SteamID sid) => {
                            return((SteamBot.UserHandler)System.Activator.CreateInstance(Type.GetType(bot.BotControlClass), new object[] { bot, sid }));
                        }, mainForm, false);
                    }
                    catch (Exception e)
                    {
                        Console.WriteLine("Error With Bot: " + e);
                        crashes++;
                    }
                }
            }).Start();

            Thread.Sleep(3000);
            splash.Close();
            splash.Dispose();
            Application.Run(login);

            while (!Welcome.trial || !Welcome.loggedIn)
            {
                if (Welcome.loggedIn || Welcome.trial)
                {
                    mainForm.Text = "SteamGrouper " + Interface.BotVersion;
                    mainForm.ShowDialog();
                    mainForm.Activate();
                    break;
                }
                else if (Application.OpenForms.Count == 0)
                {
                    Environment.Exit(0);
                }
            }
        }
示例#33
0
        static public void Convert(string[] inArgs, long unitNumerator, long unitDenominator)
        {
            // configuration
            Configuration config          = Configuration.LoadIIDXConfig(configFileName);
            Configuration db              = LoadDB();
            int           quantizeMeasure = config["BMS"].GetValue("QuantizeMeasure");
            int           quantizeNotes   = config["BMS"].GetValue("QuantizeNotes");

            // splash
            Splash.Show("Bemani to BeMusic Script");
            Console.WriteLine("Timing: " + unitNumerator.ToString() + "/" + unitDenominator.ToString());
            Console.WriteLine("Measure Quantize: " + quantizeMeasure.ToString());

            // args
            string[] args;
            if (inArgs.Length > 0)
            {
                args = Subfolder.Parse(inArgs);
            }
            else
            {
                args = inArgs;
            }

            // debug args (if applicable)
            if (System.Diagnostics.Debugger.IsAttached && args.Length == 0)
            {
                Console.WriteLine();
                Console.WriteLine("Debugger attached. Input file name:");
                args = new string[] { Console.ReadLine() };
            }

            // show usage if no args provided
            if (args.Length == 0)
            {
                Console.WriteLine();
                Console.WriteLine("Usage: BemaniToBMS <input file>");
                Console.WriteLine();
                Console.WriteLine("Drag and drop with files and folders is fully supported for this application.");
                Console.WriteLine();
                Console.WriteLine("Supported formats:");
                Console.WriteLine("1, 2DX, CS, SD9, SSP");
            }

            // process files
            for (int i = 0; i < args.Length; i++)
            {
                if (File.Exists(args[i]))
                {
                    Console.WriteLine();
                    Console.WriteLine("Processing File: " + args[i]);
                    string filename = args[i];

                    string IIDXDBName = Path.GetFileNameWithoutExtension(filename);
                    while (IIDXDBName.StartsWith("0"))
                    {
                        IIDXDBName = IIDXDBName.Substring(1);
                    }

                    byte[] data = File.ReadAllBytes(args[i]);
                    switch (Path.GetExtension(args[i]).ToUpper())
                    {
                    case @".1":
                        using (MemoryStream source = new MemoryStream(data))
                        {
                            Bemani1 archive = Bemani1.Read(source, unitNumerator, unitDenominator);

                            if (db[IIDXDBName]["TITLE"] != "")
                            {
                                for (int j = 0; j < archive.ChartCount; j++)
                                {
                                    Chart chart = archive.Charts[j];
                                    if (chart != null)
                                    {
                                        chart.Tags["TITLE"]  = db[IIDXDBName]["TITLE"];
                                        chart.Tags["ARTIST"] = db[IIDXDBName]["ARTIST"];
                                        chart.Tags["GENRE"]  = db[IIDXDBName]["GENRE"];
                                        if (j < 6)
                                        {
                                            chart.Tags["PLAYLEVEL"] = db[IIDXDBName]["DIFFICULTYSP" + config["IIDX"]["DIFFICULTY" + j.ToString()]];
                                        }
                                        else if (j < 12)
                                        {
                                            chart.Tags["PLAYLEVEL"] = db[IIDXDBName]["DIFFICULTYDP" + config["IIDX"]["DIFFICULTY" + j.ToString()]];
                                        }
                                    }
                                }
                            }

                            ConvertArchive(archive, config, args[i]);
                        }
                        break;

                    case @".2DX":
                        using (MemoryStream source = new MemoryStream(data))
                        {
                            Console.WriteLine("Converting Samples");
                            Bemani2DX archive = Bemani2DX.Read(source);
                            ConvertSounds(archive.Sounds, filename, 0.6f);
                        }
                        break;

                    case @".CS":
                        using (MemoryStream source = new MemoryStream(data))
                            ConvertChart(BeatmaniaIIDXCSNew.Read(source), config, filename, -1, null);
                        break;

                    case @".CS2":
                        using (MemoryStream source = new MemoryStream(data))
                            ConvertChart(BeatmaniaIIDXCSOld.Read(source), config, filename, -1, null);
                        break;

                    case @".CS5":
                        using (MemoryStream source = new MemoryStream(data))
                            ConvertChart(Beatmania5Key.Read(source), config, filename, -1, null);
                        break;

                    case @".CS9":
                        break;

                    case @".SD9":
                        using (MemoryStream source = new MemoryStream(data))
                        {
                            Sound  sound      = BemaniSD9.Read(source);
                            string targetFile = Path.GetFileNameWithoutExtension(filename);
                            string targetPath = Path.Combine(Path.GetDirectoryName(filename), targetFile) + ".wav";
                            sound.WriteFile(targetPath, 1.0f);
                        }
                        break;

                    case @".SSP":
                        using (MemoryStream source = new MemoryStream(data))
                            ConvertSounds(BemaniSSP.Read(source).Sounds, filename, 1.0f);
                        break;
                    }
                }
            }

            // wrap up
            Console.WriteLine("BemaniToBMS finished.");
        }
示例#34
0
        ///  <summary>
        /// Создать пользователя в домене AD, подключившись к контроллеру по WinRM:Powershell
        ///  </summary>
        /// <param name="user"></param>
        // /// <param name="server">Имя контроллера домена к которому нужно подключиться</param>
        /// <param name="creds"></param>
        /// <param name="path">Путь к OU</param>
        public static void AddUser(AdUser user, PSCredential creds, Splash splash)
        {
            if (splash != null)
            {
                splash.Status = "Генерим скрипт.";
            }
            string Script = $"import-module activedirectory;" +
                            $"$sec_pass = ConvertTo-SecureString {user.Password} -AsPlainText -Force;" +
                            $"New-ADUser -Name '{user.FullName}'" +
                            $" -AccountPassword $sec_pass" +
                            $" -DisplayName '{user.DisplayName}'" +
                            $" -GivenName '{user.FirstName}'" +
                            $" -Surname '{user.SurName}'" +
                            $" -Path '{user.Domain.LoginOU}'" +
                            $" -SamAccountName '{user.Login}'" +
                            $" -UserPrincipalName '{user.UPN}'" +
                            $" -enabled $true;";

            Debug.WriteLine(Script);

            if (splash != null)
            {
                splash.Status = "Создаём ранспейс.";
            }
            WSManConnectionInfo connInfo = new WSManConnectionInfo(new Uri($"http://{user.Domain.DC}:5985"), "http://schemas.microsoft.com/powershell/Microsoft.PowerShell", creds);
            Runspace            runspace = RunspaceFactory.CreateRunspace(connInfo);
            PowerShell          shell    = PowerShell.Create(RunspaceMode.NewRunspace);

            if (splash != null)
            {
                splash.Status = $"Открываем ранспейс на сервере {user.Domain.DC}";
            }
            runspace.Open();
            shell.Runspace = runspace;
            if (splash != null)
            {
                splash.Status = $"Добавляем скрипт в пайплайн.";
            }
            shell.AddScript(Script);
            try {
                if (splash != null)
                {
                    splash.Status = $"Выполняем скрипт.";
                }
                Collection <PSObject> result = shell.Invoke();
                if (shell.HadErrors)
                {
                    foreach (ErrorRecord errorRecord in shell.Streams.Error)
                    {
                        Debug.WriteLine(errorRecord.Exception);
                        throw errorRecord.Exception;
                    }
                }
                foreach (PSObject psObject in result)
                {
                    Debug.WriteLine(psObject.ToString());
                }
            }
            catch (Exception e) {
                Debug.WriteLine(e);
                //throw;
            }

            runspace.CloseAsync();
            shell.Dispose();
        }
示例#35
0
    void Awake()
    {
        if (Instance != null) Debug.LogError("More than one Painter has been instanciated in this scene!");
            Instance = this;

            if (PaintPrefab == null) Debug.LogError("Missing Paint decal prefab!");
    }
示例#36
0
        public static void AddMailUser(AdUser user, PSCredential creds, Splash splash, string server = "fbi-exch01.fbi.local")
        {
            if (splash != null)
            {
                splash.Status = $"Генерим скрипт.";
            }
            string Script = $"New-Mailbox -Name '{user.FullName}'" +
                            $" -Alias '{user.Login}'" +
                            $" -OrganizationalUnit '{user.Domain.MailboxOU}'" +
                            $" -UserPrincipalName '{user.Login}@fbi.local'" +
                            $" -SamAccountName '{user.Login}'" +
                            $" -FirstName '{user.FirstName}'" +
                            $" -Initials ''" +
                            $" -LastName '{user.SurName}'" +
                            $" -LinkedMasterAccount '{user.Domain.AD}\\{user.Login}'" +
                            $" -LinkedDomainController '{user.Domain.DC}'";

            Debug.WriteLine(Script);
            if (splash != null)
            {
                splash.Status = $"Создаём подключение к {server}.";
            }
            WSManConnectionInfo connInfo = new WSManConnectionInfo(new Uri($"https://{server}/Powershell"), "http://schemas.microsoft.com/powershell/Microsoft.Exchange", creds);
            Runspace            runspace = RunspaceFactory.CreateRunspace(connInfo);
            PowerShell          shell    = PowerShell.Create(RunspaceMode.NewRunspace);

            if (splash != null)
            {
                splash.Status = $"Открываем подключение к {server}.";
            }
            runspace.Open();
            shell.Runspace = runspace;

            shell.AddScript(Script);
            try {
                if (splash != null)
                {
                    splash.Status = $"Выполняем скрипт.";
                }
                Collection <PSObject> result = shell.Invoke();
                if (shell.HadErrors)
                {
                    foreach (ErrorRecord errorRecord in shell.Streams.Error)
                    {
                        Debug.WriteLine(errorRecord.Exception);
                        throw errorRecord.Exception;
                    }
                }
                foreach (PSObject psObject in result)
                {
                    Debug.WriteLine(psObject.ToString());
                }
            }
            catch (Exception e) {
                Debug.WriteLine(e);
                //throw;
            }

            runspace.CloseAsync();
            shell.Dispose();
        }
示例#37
0
        private void GrinGlobalClient_Load(object sender, EventArgs e)
        {
            bool validLogin = false;
            //            bool connectedToWebService = false;
            //            int selectedCNOIndex = -1;
            //string selectedNodeFullPath = "";
            //username = "";
            //password = "";
            _usernameCooperatorID = "";// "117534";
            _currentCooperatorID = "";// "117534";
            site = "";// "NC7";
            languageCode = "";
            lastFullPath = "";
            lastTabName = "";
            commonUserApplicationDataPath = System.Environment.GetFolderPath(Environment.SpecialFolder.CommonApplicationData) + @"\GRIN-Global\Curator Tool";
            roamingUserApplicationDataPath = System.Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) + @"\GRIN-Global\Curator Tool";
            userSettingsXMLFilePath = roamingUserApplicationDataPath + @"\UserSettings_v" + System.Reflection.Assembly.GetEntryAssembly().GetName().Version.Build.ToString() + ".xml";

            // Wireup the binding navigator and the Main datagridview...
            // NOTE:(right now the binding source is empty - but later on it will get bound to a data table)...
            defaultBindingSource = new BindingSource();
            defaultBindingSource.DataSource = new DataTable();
            ux_bindingnavigatorMain.BindingSource = defaultBindingSource;
            ux_datagridviewMain.DataSource = defaultBindingSource;

            //// Load the images for the tree view(s)...
            //navigatorTreeViewImages.ColorDepth = ColorDepth.Depth32Bit;
            //navigatorTreeViewImages.Images.Add("active_folder", Icon.ExtractAssociatedIcon(@"Images\active_Folder.ico"));
            //navigatorTreeViewImages.Images.Add("inactive_folder", Icon.ExtractAssociatedIcon(@"Images\inactive_Folder.ico"));
            //navigatorTreeViewImages.Images.Add("active_INVENTORY_ID", Icon.ExtractAssociatedIcon(@"Images\active_INVENTORY_ID.ico"));
            //navigatorTreeViewImages.Images.Add("inactive_INVENTORY_ID", Icon.ExtractAssociatedIcon(@"Images\inactive_INVENTORY_ID.ico"));
            //navigatorTreeViewImages.Images.Add("active_ACCESSION_ID", Icon.ExtractAssociatedIcon(@"Images\active_ACCESSION_ID.ico"));
            //navigatorTreeViewImages.Images.Add("inactive_ACCESSION_ID", Icon.ExtractAssociatedIcon(@"Images\inactive_ACCESSION_ID.ico"));
            //navigatorTreeViewImages.Images.Add("active_ORDER_REQUEST_ID", Icon.ExtractAssociatedIcon(@"Images\active_ORDER_REQUEST_ID.ico"));
            //navigatorTreeViewImages.Images.Add("inactive_ORDER_REQUEST_ID", Icon.ExtractAssociatedIcon(@"Images\inactive_ORDER_REQUEST_ID.ico"));
            //navigatorTreeViewImages.Images.Add("active_COOPERATOR_ID", Icon.ExtractAssociatedIcon(@"Images\active_COOPERATOR_ID.ico"));
            //navigatorTreeViewImages.Images.Add("inactive_COOPERATOR_ID", Icon.ExtractAssociatedIcon(@"Images\inactive_COOPERATOR_ID.ico"));

            //navigatorTreeViewImages.Images.Add("active_GEOGRAPHY_ID", Icon.ExtractAssociatedIcon(@"Images\active_GEOGRAPHY_ID.ico"));
            //navigatorTreeViewImages.Images.Add("inactive_GEOGRAPHY_ID", Icon.ExtractAssociatedIcon(@"Images\inactive_GEOGRAPHY_ID.ico"));
            //navigatorTreeViewImages.Images.Add("active_TAXONOMY_GENUS_ID", Icon.ExtractAssociatedIcon(@"Images\active_TAXONOMY_GENUS_ID.ico"));
            //navigatorTreeViewImages.Images.Add("inactive_TAXONOMY_GENUS_ID", Icon.ExtractAssociatedIcon(@"Images\inactive_TAXONOMY_GENUS_ID.ico"));
            //navigatorTreeViewImages.Images.Add("active_CROP_ID", Icon.ExtractAssociatedIcon(@"Images\active_CROP_ID.ico"));
            //navigatorTreeViewImages.Images.Add("inactive_CROP_ID", Icon.ExtractAssociatedIcon(@"Images\inactive_CROP_ID.ico"));
            //navigatorTreeViewImages.Images.Add("active_CROP_TRAIT_ID", Icon.ExtractAssociatedIcon(@"Images\active_CROP_TRAIT_ID.ico"));
            //navigatorTreeViewImages.Images.Add("inactive_CROP_TRAIT_ID", Icon.ExtractAssociatedIcon(@"Images\inactive_CROP_TRAIT_ID.ico"));

            //navigatorTreeViewImages.Images.Add("new_tab", Icon.ExtractAssociatedIcon(@"Images\GG_newtab.ico"));
            //navigatorTreeViewImages.Images.Add("search", Icon.ExtractAssociatedIcon(@"Images\GG_search.ico"));

            try
            {
                // Load the wizards from the same directory (and all subdirectories) where the Curator Tool was launched...
                System.IO.DirectoryInfo di = new System.IO.DirectoryInfo(System.IO.Directory.GetCurrentDirectory());
                System.IO.FileInfo[] dllFiles = di.GetFiles("Wizards\\*.dll", System.IO.SearchOption.AllDirectories);
                if (dllFiles != null && dllFiles.Length > 0)
                {
                    for (int i = 0; i < dllFiles.Length; i++)
                    {
                        System.Reflection.Assembly newAssembly = System.Reflection.Assembly.LoadFile(dllFiles[i].FullName);
                        foreach (System.Type t in newAssembly.GetTypes())
                        {
                            if (t.GetInterface("IGRINGlobalDataWizard", true) != null)
                            {
                                System.Reflection.ConstructorInfo constInfo = t.GetConstructor(new Type[] { typeof(string), typeof(SharedUtils) });

                                if (constInfo != null)
                                {
                                    string pkeyCollection = ":accessionid=; :inventoryid=; :orderrequestid=; :cooperatorid=; :geographyid=; :taxonomygenusid=; :cropid=";
                                    // Instantiate an object of this type to load...
                                    Form wizardForm = (Form)constInfo.Invoke(new object[] { pkeyCollection, _sharedUtils });
                                    // Get the Form Name and button with this name...
                                    System.Reflection.PropertyInfo propInfo = t.GetProperty("FormName", typeof(string));
                                    string formName = (string)propInfo.GetValue(wizardForm, null);
                                    if (string.IsNullOrEmpty(formName)) formName = t.Name;
                                    ToolStripButton tsbWizard = new ToolStripButton(formName, Icon.ExtractAssociatedIcon(newAssembly.ManifestModule.FullyQualifiedName).ToBitmap(), ux_buttonWizard_Click, "toolStripButton" + newAssembly.ManifestModule.Name);
                                    tsbWizard.Tag = "Wizards\\" + newAssembly.ManifestModule.Name;
                                    toolStrip1.Items.Add(tsbWizard);
                                }
                            }
                        }
                    }
                }
            }
            catch (Exception err)
            {
            GRINGlobal.Client.Common.GGMessageBox ggMessageBox = new GRINGlobal.Client.Common.GGMessageBox("Error binding to Wizard Form.\nError Message: {0}", "Wizard Binding Error", MessageBoxButtons.OK, MessageBoxDefaultButton.Button1);
            ggMessageBox.Name = "GrinGlobalClient_LoadMessage2";
            _sharedUtils.UpdateControls(ggMessageBox.Controls, ggMessageBox.Name);
            if (ggMessageBox.MessageText.Contains("{0}")) ggMessageBox.MessageText = string.Format(ggMessageBox.MessageText, err.Message);
            ggMessageBox.ShowDialog();
            }

            // Create the middle tier utilities class and connect to the web services...
            _sharedUtils = new SharedUtils(url, username, passwordClearText, false);

            // Display the splash page to let the user know that things are happening...
            Splash splash = new Splash();
            splash.StartPosition = FormStartPosition.CenterScreen;
            splash.Show();
            splash.Update();

            //if (validLogin)
            if (_sharedUtils.IsConnected)
            {
                localDBInstance = _sharedUtils.Url.ToLower().Replace("http://", "").Replace("/gringlobal/gui.asmx", "").Replace('-', '_').Replace('.', '_').Replace(':', '_');
                localDBInstance = "GRINGlobal_" + localDBInstance;
            //_sharedUtils = new SharedUtils(GRINGlobalWebServices.Url, username, password, localDBInstance, cno);
                username = _sharedUtils.Username;
                password = _sharedUtils.Password;
                passwordClearText = _sharedUtils.Password_ClearText;
                url = _sharedUtils.Url;
                _usernameCooperatorID = _sharedUtils.UserCooperatorID;
            //_currentCooperatorID = _sharedUtils.UserCooperatorID;
                site = _sharedUtils.UserSite;
                languageCode = _sharedUtils.UserLanguageCode.ToString();

                // Load the application data...
                LoadApplicationData();

            // Check the status of lookup tables and warn the user if some tables are missing data...
            LookupTableStatusCheck();

                // Wire up the list of valid GG servers to the combobox...
                ux_comboboxActiveWebService.DataSource = new BindingSource(_sharedUtils.WebServiceURLs, null);
                ux_comboboxActiveWebService.DisplayMember = "Key";
                ux_comboboxActiveWebService.ValueMember = "Value";
                ux_comboboxActiveWebService.SelectedValue = _sharedUtils.Url;
            // Indicate to the user which URL is the active GG server...
            if (ux_statusCenterMessage.Tag != null)
            {
            if (ux_statusCenterMessage.Tag.ToString().Contains("{0}"))
            {
            ux_statusCenterMessage.Text = string.Format(ux_statusCenterMessage.Tag.ToString(), _sharedUtils.Url);
            }
            else
            {
            ux_statusCenterMessage.Text = ux_statusCenterMessage.Tag.ToString() + " (" + _sharedUtils.Url + ")";
            }
            }
            else
            {
            ux_statusCenterMessage.Text = ux_statusCenterMessage.Text + " (" + _sharedUtils.Url + ")";
            }

            // Get the list of Dataview Forms embedded in assemblies in the CT Forms directiory...
            localFormsAssemblies = _sharedUtils.GetDataviewFormsData();

                // Save the list of valid web service urls...
                // But first make sure the roaming profile directory exists...
                if (!System.IO.Directory.Exists(roamingUserApplicationDataPath)) System.IO.Directory.CreateDirectory(roamingUserApplicationDataPath);
                // Now save the list of GRIN-Global servers...
                System.IO.StreamWriter sw = new System.IO.StreamWriter(roamingUserApplicationDataPath + @"\WebServiceURL.txt");
                foreach (KeyValuePair<string, string> kv in ux_comboboxActiveWebService.Items)
                {
                    if (kv.Key != "New...")
                    {
                        sw.WriteLine(kv.Key + "\t" + kv.Value);
                    }
                }
                sw.Close();
                sw.Dispose();

                // Load the cursors for the DGV...
                _cursorGG = _sharedUtils.LoadCursor(@"Images\cursor_GG.cur");
                if (_cursorGG == null) _cursorGG = Cursors.Default;
                _cursorLUT = _sharedUtils.LoadCursor(@"Images\cursor_LUT.cur");
                if (_cursorLUT == null) _cursorLUT = Cursors.Default;
                _cursorREQ = _sharedUtils.LoadCursor(@"Images\cursor_REQ.cur");
                if (_cursorREQ == null) _cursorREQ = Cursors.Default;
            //this.Cursor = _cursorGG;
            ux_datagridviewMain.Cursor = _cursorGG;
            }
            else
            {
                // Login aborted - disable controls...
                ux_tabcontrolDataviewOptions.Enabled = false;
                ux_tabcontrolCTDataviews.Enabled = false;
                ux_datagridviewMain.Enabled = false;
                ux_comboboxCNO.Enabled = false;
                ux_buttonEditData.Enabled = false;
                // Close the application???
                this.Close();
            }

            // Close the splash page...
            splash.Close();
        }
示例#38
0
        public virtual Item Transmute()
        {
            CellEmitter.Get(Pos).Burst(Speck.Factory(Speck.BUBBLE), 3);
            Splash.At(Pos, new Android.Graphics.Color(0xFFFFFF), 3);

            var chances = new float[Items.Count];
            var count   = 0;

            var index = 0;

            foreach (var item in Items)
            {
                if (item is Plant.Seed)
                {
                    count           += item.quantity;
                    chances[index++] = item.quantity;
                }
                else
                {
                    count = 0;
                    break;
                }
            }

            if (count < SeedsToPotion)
            {
                return(null);
            }

            CellEmitter.Get(Pos).Burst(Speck.Factory(Speck.WOOL), 6);
            Sample.Instance.Play(Assets.SND_PUFF);

            if (pdsharp.utils.Random.Int(count) == 0)
            {
                CellEmitter.Center(Pos).Burst(Speck.Factory(Speck.EVOKE), 3);

                Destroy();

                Statistics.PotionsCooked++;
                Badge.ValidatePotionsCooked();

                return(Generator.Random(Generator.Category.POTION));
            }

            var proto = (Plant.Seed)Items[pdsharp.utils.Random.Chances(chances)];

            var itemClass = proto.AlchemyClass;

            Destroy();

            Statistics.PotionsCooked++;
            Badge.ValidatePotionsCooked();

            if (itemClass == null)
            {
                return(Generator.Random(Generator.Category.POTION));
            }

            try
            {
                return((Item)Activator.CreateInstance(itemClass));
            }
            catch (Exception)
            {
                return(null);
            }
        }
示例#39
0
        static void Main()
        {
            Console.WriteLine("If your error is about Microsoft.DirectX.DirectInput, please install the latest directx redist from here http://www.microsoft.com/en-us/download/details.aspx?id=35 \n\n");

            Application.EnableVisualStyles();
            XmlConfigurator.Configure();
            log.Info("******************* Logging Configured *******************");
            Application.SetCompatibleTextRenderingDefault(false);

            Application.ThreadException += Application_ThreadException;

            AppDomain.CurrentDomain.UnhandledException += new UnhandledExceptionEventHandler(CurrentDomain_UnhandledException);

            // fix ssl on mono
            ServicePointManager.ServerCertificateValidationCallback =
            new System.Net.Security.RemoteCertificateValidationCallback((sender, certificate, chain, policyErrors) => { return true; });

            CustomMessageBox.ApplyTheme += ArdupilotMega.Utilities.ThemeManager.ApplyThemeTo;
            ArdupilotMega.Controls.MainSwitcher.ApplyTheme += ArdupilotMega.Utilities.ThemeManager.ApplyThemeTo;
            MissionPlanner.Controls.InputBox.ApplyTheme += ArdupilotMega.Utilities.ThemeManager.ApplyThemeTo;
            MissionPlanner.Comms.CommsBase.Settings += CommsBase_Settings;

               //     string[] files = Directory.GetFiles(@"C:\Users\hog\Documents\apm logs\","*.tlog");

               //     foreach (string file in files) {
              //      Console.WriteLine(Magfitrotation.magfit(file));
            //    }
               //     Magfitrotation.magfit(@"C:\Users\hog\Downloads\flight.tlog.raw");

            //return;
            //    MissionPlanner.Utilities.CleanDrivers.Clean();

            //Application.Idle += Application_Idle;

            //MagCalib.ProcessLog();

            //MessageBox.Show("NOTE: This version may break advanced mission scripting");

            //Common.linearRegression();

            //Console.WriteLine(srtm.getAltitude(-35.115676879882812, 117.94178754638671,20));

               // Console.ReadLine();
               // return;

            /*
            Arduino.ArduinoSTKv2 comport = new Arduino.ArduinoSTKv2();

            comport.PortName = "com8";

            comport.BaudRate = 115200;

            comport.Open();

            Arduino.Chip.Populate();

            if (comport.connectAP())
            {
                Arduino.Chip chip = comport.getChipType();
                Console.WriteLine(chip);
            }
            Console.ReadLine();

            return;
            */
            /*
            Comms.SerialPort sp = new Comms.SerialPort();

            sp.PortName = "com8";
            sp.BaudRate = 115200;

            CurrentState cs = new CurrentState();

            MAVLink mav = new MAVLink();

            mav.BaseStream = sp;

            mav.Open();

            HIL.XPlane xp = new HIL.XPlane();

            xp.SetupSockets(49005, 49000, "127.0.0.1");

            HIL.Hil.sitl_fdm data = new HIL.Hil.sitl_fdm();

            while (true)
            {
                while (mav.BaseStream.BytesToRead > 0)
                    mav.readPacket();

                // update all stats
                cs.UpdateCurrentSettings(null);

                xp.GetFromSim(ref data);
                xp.GetFromAP(); // no function

                xp.SendToAP(data);
                xp.SendToSim();

                MAVLink.mavlink_rc_channels_override_t rc = new MAVLink.mavlink_rc_channels_override_t();

                rc.chan3_raw = 1500;

                mav.sendPacket(rc);

            }       */
            /*
            MAVLink mav = new MAVLink();

            mav.BaseStream = new Comms.CommsFile()
            {
                PortName = @"C:\Users\hog\AppData\Roaming\Skype\My Skype Received Files\2013-06-12 15-11-00.tlog"
            };

            mav.Open(false);

            while (mav.BaseStream.BytesToRead > 0)
            {

                byte[] packet = mav.readPacket();

                mav.DebugPacket(packet, true);
            }
            */

               // return;
              //  OSDVideo vid = new OSDVideo();

             //   vid.ShowDialog();

             //   return;

             //   new Swarm.Control().ShowDialog();
             //   return;

             //   using (MainV3 main = new MainV3(1024, 768))
            {
              //      main.Title = "Mission Planner";
               //     main.Run(30.0, 0.0);
            }

               // return;

             //   Utilities.RSA rsa = new Utilities.RSA();

              //  rsa.testit();

            //            return;

            //Utilities.S3Uploader s3 = new Utilities.S3Uploader("");

            //s3.UploadTlog(@"C:\Users\hog\Documents\apm logs\2012-10-27 15-05-54.tlog");

            float t1 = 180;
            float t2 = -180;
            float t3 = -37.123456789f;
            float t4 = 37.123456789f;
            float t5 = 150.123456789f;

            Console.WriteLine("7 digits {0} {1} {2} {3} {4}",t1,t2,t3,t4,t5);

            if (File.Exists("simple.txt"))
            {
                Application.Run(new GCSViews.Simple());
                return;
            }

            Splash = new ArdupilotMega.Splash();
            Splash.Show();

            Application.DoEvents();

            try
            {
                Thread.CurrentThread.Name = "Base Thread";
                Application.Run(new MainV2());
            }
            catch (Exception ex)
            {
                log.Fatal("Fatal app exception", ex);
                Console.WriteLine(ex.ToString());

                Console.WriteLine("\nPress any key to exit!");
                Console.ReadLine();
            }
        }
示例#40
0
 protected override void OnStart()
 {
     CoroutineRunner.instance.StartCoroutine(overflowLiquid.flood(Spill, SPILL_DEFAULT));
     Splash.Play(SPLASH);
     Spill.Play(SPILL);
 }
        private void Reload()
        {
            splash_state = Splash.nwp_Logo;

            nwp_Logo = content.Load<Texture2D>("Logo/nwp_white");

            nwp_logo_fade = 0;
            nwp_AlphaValue = 1f;
            nwp_FadeDelay = 1;

            konami = 0;

            reload = false;
        }
示例#42
0
 private void Page_SizeChanged(object sender, SizeChangedEventArgs e)
 {
     Splash.SetValue(Canvas.LeftProperty, e.NewSize.Width / 2d - Splash.ActualWidth / 2d - 67);
     Splash.SetValue(Canvas.TopProperty, e.NewSize.Height / 2d - Splash.ActualHeight / 2d - 58);
 }
示例#43
0
    public MainIDE(Splash splash)
    {
        BackColor = Color.FromArgb(255, 200, 200, 200);
        Icon = Icons.GetIcon("icons.logo", 32);
        Text = "OS Development Studio";

        //once the form has loaded, send a signal to the
        //splash screen to close.
        Load += delegate(object sender, EventArgs e) {
            splash.Ready();
            Focus();
        };

        //set the minimum size of the window to 75% of the current screen
        Size screenSize = Screen.FromPoint(Cursor.Position).WorkingArea.Size;
        MinimumSize = new Size(
                (int)(screenSize.Width * 0.75),
                (int)(screenSize.Height * 0.75));

        //create the initial panels
        StatusStrip status = new StatusStrip();
        p_WorkingArea = new Panel { Dock = DockStyle.Fill };
        ToolStrip menu = new ToolStrip {
            GripStyle = ToolStripGripStyle.Hidden,
            Renderer = new ToolStripProfessionalRenderer() {
                RoundedEdges = false
            }
        };

        //add the controls
        Controls.Add(menu);
        Controls.Add(status);
        Controls.Add(p_WorkingArea);
        p_WorkingArea.BringToFront();

        /*Build the main menu items*/
        ToolStripItem fileMenu = menu.Items.Add("File");
        fileMenu.Click += delegate(object sender, EventArgs e) {
            buildSplitContainer(
                null,
                new Control() { BackColor = Color.Red },
                p_SolutionExplorer);
        };
        ToolStripItem editMenu = menu.Items.Add("Edit");
        ToolStripItem buildMenu = menu.Items.Add("Build");
        ToolStripItem helpMenu = menu.Items.Add("Help");
        menu.Items.Add(new ToolStripSeparator());
        ToolStripItem run = menu.Items.Add(Icons.GetBitmap("tools.run", 16));
        run.ToolTipText = "Run";

        /*Test code*/
        Solution solution = new Solution("./testsolution/solution.ossln");

        //initialize the components
        p_SolutionExplorer = new SolutionBrowserControl();
        p_TextEditor = new TextEditor();
        p_SolutionExplorer.AddSolution(solution);

        //create the components to seperate the different working area
        //components.
        buildSplitContainer(null, null, p_SolutionExplorer);
    }
        private void button2_Click(object sender, EventArgs e)
        {
            Splash vMenu2 = new Splash();

            vMenu2.ShowDialog();
        }
示例#45
0
文件: Startup.cs 项目: sviridovt/wump
 //TODO add all needed global variables
 public Startup()
 {
     Splash splash = new Splash(); //Call to GUI Splash Screen, need the variables for declaring new screen
     Sound sound = new Sound();
 }
示例#46
0
 public void SetStateSplash()
 {
     Reset();
     splash = new Splash(game);
     components.Add(splash);
 }
示例#47
0
            /// <summary>
            /// Loads the plugin at startup, and updates the splash screen
            /// </summary>
            /// <param name="awb">IAutoWikiBrowser instance of AWB</param>
            /// <param name="splash">Splash Screen instance</param>
            internal static void LoadPluginsStartup(IAutoWikiBrowser awb, Splash splash)
            {
                splash.SetProgress(75);
                string path = Application.StartupPath;
                string[] pluginFiles = Directory.GetFiles(path, "*.DLL");

                LoadPlugins(awb, pluginFiles, false);
                splash.SetProgress(89);
            }
示例#48
0
文件: Form1.cs 项目: KameronHott/Work
 /// <summary>
 /// show and dispose splash screen
 /// </summary>
 private void SplashForm()
 {
     Splash newSplashForm = new Splash();
     newSplashForm.ShowDialog();
     newSplashForm.Dispose();
     this.Refresh();
 }