private bool SetFaved(MapIdentity identity) { var map = DbOperate.GetMapFromDb(identity); var album = DbOperate.GetCollectionsByMap(map); bool faved = album != null && album.Any(k => k.Locked); BtnLike.Background = faved ? (ViewModel.IsMiniMode ? (Brush)ToolControl.FindResource("FavedS") : (Brush)ToolControl.FindResource("Faved")) : (ViewModel.IsMiniMode ? (Brush)ToolControl.FindResource("FavS") : (Brush)ToolControl.FindResource("Fav")); return(faved); }
//dont write settings in mobile public static void writeSettings(object control, IEnvironment env, ISettings settings) { if (control != null && env != null && settings != null) { object[] items = ToolControl.destruct(control); foreach (object item in items) { var glob_ = item as IControlGlobalInit; if (glob_ != null) { glob_.globalWrite(env, settings); } } } }
public void UiInitAndInvoke() { MapInit(); RegisterEventHandlers(); //ToolControl控件动态加载 m_toolControl = new ToolControl(); this.Controls.Add(m_toolControl); m_toolControl.Location = new System.Drawing.Point(30, 5); m_toolControl.Size = new System.Drawing.Size(92, 28); m_toolControl.Dock = DockStyle.None; m_toolControl.BringToFront(); m_toolControl.Map = Map; m_toolControl.MapForm = this; m_toolControl.InitAttri(); }
static void set(object pTarget, TranslaterText trans) { //first model ISelfDestructable and ITranslateable if (pTarget == null) { return; } foreach (object o_ in ToolControl.destruct(pTarget)) { var t_ = o_ as ITranslateable; if (t_ != null) { t_.setTranslatingText(trans.get(t_.getTranslatingText())); } } }
private async Task SetPlayMode(PlayerMode playmode) { switch (playmode) { case PlayerMode.Normal: Normal.IsChecked = true; break; case PlayerMode.Random: Random.IsChecked = true; break; case PlayerMode.Loop: Loop.IsChecked = true; break; case PlayerMode.LoopRandom: LoopRandom.IsChecked = true; break; case PlayerMode.Single: Single.IsChecked = true; break; case PlayerMode.SingleLoop: SingleLoop.IsChecked = true; break; } string flag = ViewModel.IsMiniMode ? "S" : ""; BtnMode.Background = (ImageBrush)ToolControl.FindResource(playmode + flag); if (playmode == InstanceManage.GetInstance <PlayerList>().PlayerMode) { return; } InstanceManage.GetInstance <PlayerList>().PlayerMode = playmode; await InstanceManage.GetInstance <PlayerList>().RefreshPlayListAsync(PlayerList.FreshType.IndexOnly); PlayerConfig.Current.Play.PlayListMode = playmode; PlayerConfig.SaveCurrent(); }
private void SetPlayMode(PlayerMode playmode) { switch (playmode) { case PlayerMode.Normal: Normal.IsChecked = true; break; case PlayerMode.Random: Random.IsChecked = true; break; case PlayerMode.Loop: Loop.IsChecked = true; break; case PlayerMode.LoopRandom: LoopRandom.IsChecked = true; break; case PlayerMode.Single: Single.IsChecked = true; break; case PlayerMode.SingleLoop: SingleLoop.IsChecked = true; break; } string flag = ViewModel.IsMiniMode ? "S" : ""; BtnMode.Background = (ImageBrush)ToolControl.FindResource(playmode + flag); if (playmode == App.PlayerList.PlayerMode) { return; } App.PlayerList.PlayerMode = playmode; App.PlayerList.RefreshPlayList(PlayerList.FreshType.IndexOnly); App.Config.Play.PlayListMode = playmode; App.SaveConfig(); }
public static void disposeControl(object pControl) { if (pControl == null) { return; } try { //add, destructed orlinks will be lost object[] arr_ = ToolControl.destruct(pControl); foreach (object o_ in arr_) { ToolDispose.dispose(o_); } } catch (Exception exc) { ToolMobile.setExceptionInner(exc); } }
private void Widget_MouseOverChanged(object sender, MouseEventArgs e) { if (sender.GetType() != typeof(ToolControl)) { return; } if (!_isTargeting || sender.Equals(_targetSource)) { return; } var element = sender as ToolControl; if (element != null && element.IsMouseOver) { element.SetSelected(true); _lastSelected = element; } else { element?.SetSelected(false); } }
private void AddToolWidget(Tool tool) { var toolControl = new ToolControl(ChaosShell, tool); AddWidgetToCanvas(toolControl); }
public void ClientTestInitialize() { bool pageInitialized = false; bool isInitializingCompleted = false; EnqueueConditional(() => TestGlobals.Initialized); EnqueueCallback(() => { roomPage = new RoomPage(); viewModelFactory = roomPage.ViewModelFactory; viewModelFactory.MessageService = new TestMessageService(); viewModelFactory.RoomService.CreateClient(); companyVm = viewModelFactory.GetViewModel <CompanyViewModel>(); companyVm.Model = TestGlobals.Company; authenticationGroupVm = viewModelFactory.GetViewModel <AuthenticationGroupViewModel>(); authenticationGroupVm.Model = TestGlobals.AuthenticationGroup; localUserVm = viewModelFactory.GetViewModel <LocalUserViewModel>(); localUserVm.CompanyInfo = new TestCompanyInfo(); roomVm = viewModelFactory.GetViewModel <RoomViewModel>(); // Simulates the results of the private InitializeAsync() method. roomVm.UserTag = TestGlobals.OwnerUserTag; roomVm.RoomName = TestGlobals.RoomName; DataGlobals.LoginSession = localUserVm.LoginSession; DataGlobals.OwnerUserTag = TestGlobals.OwnerUserTag; DataGlobals.RoomName = TestGlobals.RoomName; localUserVm.Login(TestGlobals.UserTag, TestGlobals.Password, loginError => roomVm.JoinRoom(joinRoomError => { roomPage.PageInitialized += (page, initializedArgs) => Deployment.Current.Dispatcher.BeginInvoke(() => { workspaceVm = viewModelFactory.GetViewModel <WorkspaceViewModel>(); roomController = initializedArgs.Value; Assert.IsNotNull(initializedArgs.Value, "RoomController is Null"); toolControl = roomPage.AlantaControls.SingleOrDefault(c => c is ToolControl) as ToolControl; Assert.IsNotNull(toolControl, "ToolControl is Null"); workspacePanel = roomPage.AlantaControls.SingleOrDefault(c => c is WorkspacePanel) as WorkspacePanel; Assert.IsNotNull(workspacePanel, "WorkspacePanel is Null"); webcamerasControl = roomPage.AlantaControls.SingleOrDefault(c => c is WebCamerasControl) as WebCamerasControl; Assert.IsNotNull(webcamerasControl, "WebCamerasPanel is Null"); loginControl = roomPage.AlantaControls.SingleOrDefault(c => c is RoomHeaderControl) as RoomHeaderControl; Assert.IsNotNull(loginControl, "LoginControl is Null"); pageInitialized = true; TestInitializing(() => isInitializingCompleted = true); }); //rb 7/7/2010 fix roomPage.MinWidth = 800; roomPage.MinHeight = 600; var parentPanel = roomPage.Parent as Panel; if (parentPanel != null) { parentPanel.Children.Remove(roomPage); } var scrll = new ScrollViewer { HorizontalScrollBarVisibility = ScrollBarVisibility.Auto, VerticalScrollBarVisibility = ScrollBarVisibility.Auto, Content = roomPage }; TestPanel.Children.Add(scrll); roomPage.Initialize(new TestRoomInfo()); })); }); EnqueueConditional(() => pageInitialized && isInitializingCompleted); EnqueueTestComplete(); }
private void LoadRedactor(string path, string name) { try { foreach (TabPage tab in RedactorsTabControl.TabPages) { if (tab.Controls.Count == 1) { var redactor = tab.Controls[0] as IResourceControl; if (redactor != null) { if (redactor.ResourcePath == path) { RedactorsTabControl.SelectedTab = tab; return; } } } } var type = Resource.GetType(path); Control control = null; switch (type) { case ResourceType.Texture: control = new TextureControl(path); break; case ResourceType.Sprite: control = new SpriteControl(path); break; case ResourceType.Ragdoll: control = new RagdollControl(path); break; case ResourceType.Animation: control = new AnimationControl(path); break; case ResourceType.Tool: control = new ToolControl(path); break; case ResourceType.Entity: control = new EntityControl(path); break; case ResourceType.Tile: control = new TileControl(path); break; case ResourceType.Event: control = new EventControl(path); break; case ResourceType.Outfit: control = new OutfitControl(path); break; default: MessageBox.Show(this, "Resource [" + Resource.TypeToString(type) + "] redactor does not implemented!", "Warning!", MessageBoxButtons.OK, MessageBoxIcon.Warning); break; } if (control == null) { return; } control.Dock = DockStyle.Fill; var page = new TabPage(name); page.ImageIndex = Resource.TypeToIcon(type); bool refresh = RedactorsTabControl.TabPages.Count == 0; RedactorsTabControl.TabPages.Add(page); page.Controls.Add(control); var iresource = control as IResourceControl; iresource.StateChanged += Redactor_StateChanged; RedactorsTabControl.SelectedTab = page; if (RedactorsTabControl.TabPages.Count == 1) { RedactorsTabControl.SelectedTab.Text = iresource.ResourceName + (iresource.Saved ? "" : "*"); UndoToolStripMenuItem.Enabled = iresource.UndoEnabled; RedoToolStripMenuItem.Enabled = iresource.RedoEnabled; CloseToolStripMenuItem.Enabled = true; SaveToolStripMenuItem.Enabled = !iresource.Saved; SaveAsToolStripMenuItem.Enabled = true; CloseOthersToolStripMenuItem.Enabled = true; ResourceToolStripMenuItem.DropDownItems.Clear(); ResourceToolStripMenuItem.DropDownItems.AddRange(iresource.MenuTabs); ResourceToolStripMenuItem.Enabled = true; } } catch (Exception ex) { MessageBox.Show(this, ex.ToString(), "Error: Can not load resource redactor [" + name + "].", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
void Awake() { state = APPROACHING_RACK; currentRack = 0; agent = GetComponent<UnityEngine.AI.NavMeshAgent>(); character = GetComponent<ThirdPersonCharacter>(); toolControl = GetComponent<ToolControl>(); agent.updateRotation = false; agent.updatePosition = true; priorityGoals = new LinkedList<GameObject>(); }
void Start() { spotlight = transform.Find ("Spotlight").gameObject; nextToolTransform = transform.Find ("First Tool Location"); toolControl = GameObject.FindGameObjectWithTag (Tags.player).GetComponent<ToolControl>(); gameControl = GameObject.FindGameObjectWithTag (Tags.gameController).GetComponent<GameControl>(); foreach (Transform box in transform.Find ("Spawn Zone")) spawnZone.AddLast (box.GetComponent<BoxCollider>()); }