コード例 #1
0
ファイル: GApp.cs プロジェクト: nwtajcky/RDManager
        static void Main(string[] args)
        {
            //Application.EnableVisualStyles();
            //Application.SetCompatibleTextRenderingDefault(false);
            //Application.Run(new MainForm());

            try {
                if (args.Length > 0)
                {
                    if (InterProcessService.SendShortCutFileNameToExistingInstance(args[0]))
                    {
                        return;
                    }
                }

                GApp.Run(args);
            }
            catch (Exception e) {
#if DEBUG
                Debug.WriteLine(e.Message);
                Debug.WriteLine(e.StackTrace);
#else
                GUtil.ReportCriticalError(e);
#endif
            }
        }
コード例 #2
0
ファイル: GApp.cs プロジェクト: nwtajcky/RDManager
        public static void UpdateOptions(ContainerOptions opt)
        {
            GEnv.Options = opt;
            _frame.ApplyOptions(_options, opt);
            _history.LimitCount(opt.MRUSize);
            _frame.AdjustMRUMenu();

            if (_options.Language != opt.Language)            //言語のリロードが必要なとき
            {
                System.Threading.Thread.CurrentThread.CurrentUICulture = opt.Language == Language.Japanese? new CultureInfo("ja") : CultureInfo.InvariantCulture;
                GApp.ReloadStringResource();
                Granados.SSHC.Strings.Reload();
                GApp.MacroManager.ReloadLanguage();
                _frame.ReloadLanguage(opt.Language);
            }

            //デフォルトのままであった場合には更新をかける
            RenderProfile newprof = new RenderProfile(opt);

            foreach (ConnectionTag ct in GEnv.Connections)
            {
                if (ct.RenderProfile == null && ct.AttachedPane != null)
                {
                    ct.AttachedPane.ApplyRenderProfile(newprof);
                }
            }
            GEnv.DefaultRenderProfile = newprof;
            _options = opt;
        }
コード例 #3
0
 public CommandResult CloseAllDisconnected()
 {
     foreach (ConnectionTag ct in GEnv.Connections.GetSnapshot())
     {
         if (ct.Connection.IsClosed)
         {
             GApp.GetConnectionCommandTarget(ct).Close();
         }
     }
     GApp.Frame.RefreshConnection(GEnv.Connections.ActiveTag);
     return(CommandResult.Success);
 }
コード例 #4
0
        public CommandResult SetFrameStyle(GFrameStyle fs)
        {
            if (fs == GApp.Options.FrameStyle)
            {
                return(CommandResult.Ignored);
            }
            GEnv.TextSelection.Clear();

            ContainerOptions opt = (ContainerOptions)GApp.Options.Clone();

            opt.FrameStyle = fs;
            GApp.UpdateOptions(opt);
            return(CommandResult.Success);
        }
コード例 #5
0
        public override void ProcessMessage(IntPtr wParam, IntPtr lParam)
        {
            switch ((CService)(int)wParam)
            {
            case CService.SetPanePosition:
                GEnv.Frame.ActivateConnection(GEnv.Connections.FindTag(_connection));
                if (GApp.Options.FrameStyle == GFrameStyle.DivHorizontal)
                {
                    GApp.GlobalCommandTarget.MoveActivePane(_destinationPanePosition == PanePosition.First? Keys.Up : Keys.Down);
                }
                else if (GApp.Options.FrameStyle == GFrameStyle.DivVertical)
                {
                    GApp.GlobalCommandTarget.MoveActivePane(_destinationPanePosition == PanePosition.First? Keys.Left : Keys.Right);
                }
                break;

            case CService.SetFrameStyle:
                SetFrameStyle();
                break;

            case CService.MacroFinished:
                GApp.MacroManager.IndicateMacroFinished();
                break;

            case CService.OpenConnection:
                _resultConnection = GApp.GlobalCommandTarget.SilentNewConnection(_terminalParam);
                break;

            case CService.OpenShortcut:
                _resultConnection = GApp.GlobalCommandTarget.SilentOpenShortCut(_shortcutFile);
                break;

            case CService.ActivateConnection:
                GApp.GlobalCommandTarget.ActivateConnection(_connection);
                break;

            case CService.CloseConnection:
                GApp.GetConnectionCommandTarget(_connection).Close();
                break;

            default:
                base.ProcessMessage(wParam, lParam);
                break;
            }
        }