public ChangeLifeCycleForm(long currentLifeCycleDefId, long currentLifeCycleStateId, VDF.Vault.Currency.Connections.Connection connection)
        {
            //
            // Required for Windows Form Designer support
            //
            InitializeComponent();

            LifeCycleService lifecycleSvc = connection.WebServiceManager.LifeCycleService;

            // get all of the life cycle definitions
            LfCycDef[] definitions = lifecycleSvc.GetAllLifeCycleDefinitions();
            Dictionary <long, LfCycDef> lifeCycleMap = new Dictionary <long, LfCycDef>();

            // put the life cycle definitions into a hashtable for easy lookup
            foreach (LfCycDef definition in definitions)
            {
                lifeCycleMap[definition.Id] = definition;
            }

            LfCycDef currentLifeCycleDef = lifeCycleMap[currentLifeCycleDefId];

            // list each life cycle that the current Item can move to
            foreach (LfCycTrans lifeCycleTrans in currentLifeCycleDef.TransArray)
            {
                LfCycState state = currentLifeCycleDef.StateArray.FirstOrDefault(lfState => lfState.Id == lifeCycleTrans.ToId);
                if (state != null)
                {
                    m_lifeCycleListBox.Items.Add(new ListLifeCycle(state));
                }
            }
        }
Пример #2
0
        public SoundService(IAudioPlayerFactory audioPlayerFactory, IAddressableService addressableService, LifeCycleService lifeCycleService)
        {
            _audioPlayerFactory = audioPlayerFactory;
            _addressableService = addressableService;
            _lifeCycleService   = lifeCycleService;

            Init();
        }
Пример #3
0
        private NotifyIconManager()
        {
            NotifyIcon = new NotifyIcon
            {
                Text        = "Snap Desktop",
                Icon        = Resources.SnapNewIcon,
                Visible     = true,
                ContextMenu = new ContextMenu(new[]
                {
                    new MenuItem("壁纸", (sender, e) => WindowManager.GetOrAddWindow <WallpaperWindow>().Show()),
                    itemCenterTask,
                    MenuItemSeparator,

                    new MenuItem("更新", new[] {
                        new MenuItem("检查更新", async(sender, e) => await UpdateService.GetInstance().HandleUpdateCheckAsync(false)),
                        new MenuItem("手动下载", (sender, e) => Process.Start("https://github.com/DGP-Studio/DGP.Snap/releases")),
                    }),
                    itemAutorun,//自动启动
                    MenuItemSeparator,
                    new MenuItem("关于", (sender, e) => WindowManager.GetOrAddWindow <AboutWindow>().Show()),
                    new MenuItem("退出", (sender, e) => LifeCycleService.Application_ExitAsync())
                })
            };

            NotifyIcon.Click +=
                (sender, e) =>
            {
                if (((MouseEventArgs)e).Button == MouseButtons.Left)
                {
                    System.Windows.Window sideWindow = WindowManager.GetOrAddWindow <SideWindow>();
                    if (sideWindow.IsVisible)
                    {
                        sideWindow.Close();
                    }
                    else
                    {
                        sideWindow.Show();
                    }
                }
            };
            //设置check
            NotifyIcon.ContextMenu.Popup +=
                (sender, e) =>
            {
                itemAutorun.Checked    = AutoStartupService.IsAutorun();
                itemCenterTask.Checked = TaskBarService.GetInstance().Applied;
            };
        }