Inheritance: MonoBehaviour
        public void actViewDetail(contact customer)
        {
            Tab tab = new Tab(customer.lastname, new View.Customer.ShowCustomerUCView(customer), null);

            parentVM.customerTabs.Add(tab);
            parentVM.selectedTab = tab;
        }
        private void Page_Load(object sender, System.EventArgs e)
        {
            if (!IsPostBack) {

                this.DataBind();

                Tab t = new Tab();
                t.Text = "Properties";
                t.Enabled = DirectoryID != Guid.Empty;
                t.NavigateUrl = "EditLibrary.aspx?FileID=" + DirectoryID;
                TabControlDirectory.Tabs.Add(t);

                t = new Tab();
                t.Text = "Attributes";
                t.Enabled = DirectoryID != Guid.Empty;
                t.NavigateUrl = "EditLibraryAttributes.aspx?FileID=" + DirectoryID;
                TabControlDirectory.Tabs.Add(t);

                //t = new Tab();
                //t.Text = "Configuration";
                //t.Enabled = DirectoryID != Guid.Empty;
                //t.NavigateUrl = "EditDirectoryConfiguration.aspx?FileID=" + DirectoryID;
                //TabControlDirectory.Tabs.Add(t);

                TabControlDirectory.Tabs.FindByText(Selected).Selected = true;

            }
        }
        private void Page_Load(object sender, System.EventArgs e)
        {
            if (!IsPostBack) {

                this.DataBind();

                Tab t = new Tab();
                t.Text = "Properties";
                t.Enabled = FileID != Guid.Empty;
                t.NavigateUrl = "EditBlog.aspx?FileID=" + FileID;
                TabControlBlog.Tabs.Add(t);

                t = new Tab();
                t.Text = "Attributes";
                t.Enabled = FileID != Guid.Empty;
                t.NavigateUrl = "EditBlogAttributes.aspx?FileID=" + FileID;
                TabControlBlog.Tabs.Add(t);

                t = new Tab();
                t.Text = "History";
                t.Enabled = FileID != Guid.Empty;
                t.NavigateUrl = "ViewBlogHistory.aspx?FileID=" + FileID;
                TabControlBlog.Tabs.Add(t);

                TabControlBlog.Tabs.FindByText(Selected).Selected = true;

            }
        }
 public void Id_Should_Be_Composed_If_Parent_Is_Present()
 {
     var tab = new Tab("Tab2").With(() => _sut);
     var ribbon = new Ribbon("Ribbon3")
         .With(()=>tab);
     Assert.AreEqual("Ribbon3.Tab2.MyGroup", _sut.Id);
 }
        public ElectricalEquipmentConfigControl(Tab tab)
        {
            if (DesignerProperties.IsInDesignTool) { return; }

            InitializeComponent();
            mTab = tab;
            ConfigurationTreeView.LoadOnDemand += ConfigurationTreeViewLoadOnDemand;

            ObservableCollection<NodeView> configurationRootNode = new ObservableCollection<NodeView>();

            NodeView electricalTypeNode = new NodeView(null) { Name = "Electrical Equipment Types", HasChildren = true, Type = NodeType.ElectricalTypesNode, Icon = "/CmsEquipmentDatabase;component/Images/Configuration.png" };
            NodeView electricalComponentTypesNode = new NodeView(null) { Name = "Electrical Equipment Component Types", HasChildren = true, Type = NodeType.ElectricalComponentTypes, Icon = "/CmsEquipmentDatabase;component/Images/Configuration.png" };
            NodeView standardComponentPropertiesNode = new NodeView(null) { Name = "Electrical Equipment Properties", HasChildren = true, Type = NodeType.ElectricalProperties, Icon = "/CmsEquipmentDatabase;component/Images/Configuration.png" };

            NodeView reportsNode = new NodeView(null) { Name = "Reports", HasChildren = true, Type = NodeType.ReportsNode, Icon = "/CmsEquipmentDatabase;component/Images/Configuration.png" };

            NodeView manufacturersNode = new NodeView(null) { Name = "Manufacturers", HasChildren = true, Type = NodeType.ManufacturersNode, Icon = "/CmsEquipmentDatabase;component/Images/Configuration.png" };

            configurationRootNode.Add(electricalTypeNode);
            configurationRootNode.Add(electricalComponentTypesNode);
            configurationRootNode.Add(standardComponentPropertiesNode);
            configurationRootNode.Add(reportsNode);
            configurationRootNode.Add(manufacturersNode);

            ConfigurationTreeView.ItemsSource = configurationRootNode;
        }
        public InstrumentConfigControl(Tab tab)
        {
            if (DesignerProperties.IsInDesignTool) { return; }

            InitializeComponent();
            mTab = tab;
            ConfigurationTreeView.LoadOnDemand += ConfigurationTreeViewLoadOnDemand;

            ObservableCollection<NodeView> configurationRootNode = new ObservableCollection<NodeView>();

            NodeView instrumentTypesNode = new NodeView(null) { Name = "Instrument Types ", HasChildren = true, Type = NodeType.InstrumentTypesNode, Icon = "/CmsEquipmentDatabase;component/Images/Configuration.png" };
            NodeView instrumentComponentTypesNode = new NodeView(null) { Name = "Instrument Component Types", HasChildren = true, Type = NodeType.InstrumentComponentTypes, Icon = "/CmsEquipmentDatabase;component/Images/Configuration.png" };
            NodeView instrumentPropertiesNode = new NodeView(null) { Name = "Instrument Properties", HasChildren = true, Type = NodeType.InstrumentProperties, Icon = "/CmsEquipmentDatabase;component/Images/Configuration.png" };

            NodeView calibrationComponentTypesNode = new NodeView(null) { Name = "Calibration Component Types", HasChildren = true, Type = NodeType.CalibrationComponentTypes, Icon = "/CmsEquipmentDatabase;component/Images/Configuration.png" };
            NodeView calibrationPropertiesNode = new NodeView(null) { Name = "Calibration Properties", HasChildren = true, Type = NodeType.CalibrationPropertiesNode, Icon = "/CmsEquipmentDatabase;component/Images/Configuration.png" };
            NodeView reportsNode = new NodeView(null) { Name = "Reports", HasChildren = true, Type = NodeType.ReportsNode, Icon = "/CmsEquipmentDatabase;component/Images/Configuration.png" };

            NodeView manufacturersNode = new NodeView(null) { Name = "Manufacturers", HasChildren = true, Type = NodeType.ManufacturersNode, Icon = "/CmsEquipmentDatabase;component/Images/Configuration.png" };

            NodeView engineeringUnits = new NodeView(null) { Name = "Calibration Engineering Units", HasChildren = true, Type = NodeType.EngineeeringUnitsNode, Icon = "/CmsEquipmentDatabase;component/Images/Configuration.png" };

            configurationRootNode.Add(instrumentTypesNode);
            configurationRootNode.Add(instrumentComponentTypesNode);
            configurationRootNode.Add(instrumentPropertiesNode);

            configurationRootNode.Add(calibrationComponentTypesNode);
            configurationRootNode.Add(calibrationPropertiesNode);
            configurationRootNode.Add(reportsNode);
            configurationRootNode.Add(manufacturersNode);
            configurationRootNode.Add(engineeringUnits);

            ConfigurationTreeView.ItemsSource = configurationRootNode;
        }
 public AddEditReportDialog(Tab tab)
 {
     InitializeComponent();
     AddEditReportModel model = new AddEditReportModel(tab);
     model.View = this;
     DataContext = model;
 }
 public void Add(string name, GUI.WindowFunction f)
 {
     Tab t = new Tab ();
     t.name = name;
     t.f = f;
     Add (t);
 }
 /// <summary>
 /// Starts renaming of the <paramref name="tab"/> using the <paramref name="baseName"/>.
 /// </summary>
 /// <param name="tab">A <see cref="Tab"/> to rename.</param>
 /// <param name="baseName">A default name displayed in the rename textbox.</param>
 protected virtual void OnRenameTab(Tab tab, string baseName)
 {
     RenameTextBox box = this.RenamerBox;
     box.Tool = tab;
     box.Caption = baseName;
     box.Show();
 }
 //Tab
 private Tab CreateRootTab(string index)
 {
     Tab tab = new Tab();
     tab.Text = index;
     RadTabStrip1.Tabs.Add(tab);
     return tab;
 }
        public DocumentConfigControl(Tab tab)
        {
            if (DesignerProperties.IsInDesignTool){return;}

            // Required to initialize variables
            InitializeComponent();
            mTab = tab;
            ConfigurationTreeView.LoadOnDemand += ConfigurationTreeView_LoadOnDemand;
            RadTreeViewItem treeViewItem = ConfigurationTreeView.SelectedContainer;
            ObservableCollection<NodeView> configurationRootNode = new ObservableCollection<NodeView>();

            NodeView authorsNode = new NodeView(null) { Name = "Authors", HasChildren = true, Type = NodeType.DocumentAuthorsNode, Icon = "/CmsEquipmentDatabase;component/Images/Configuration.png" };
            NodeView disciplinesNode = new NodeView(null) { Name = "Disciplines", HasChildren = true, Type = NodeType.DocumentDisciplinesNode, Icon = "/CmsEquipmentDatabase;component/Images/Configuration.png" };
            NodeView locationsNode = new NodeView(null) { Name = "Locations", HasChildren = true, Type = NodeType.DocumentLocationsNode, Icon = "/CmsEquipmentDatabase;component/Images/Configuration.png" };
            NodeView purchaseOrdersNode = new NodeView(null) { Name = "Purchase Orders", HasChildren = true, Type = NodeType.DocumentPurchaseOrdersNode, Icon = "/CmsEquipmentDatabase;component/Images/Configuration.png" };
            NodeView reportsNode = new NodeView(null) { Name = "Reports", HasChildren = true, Type = NodeType.ReportsNode, Icon = "/CmsEquipmentDatabase;component/Images/Configuration.png" };
            NodeView typesNode = new NodeView(null) { Name = "Types", HasChildren = true, Type = NodeType.DocumentTypesNode, Icon = "/CmsEquipmentDatabase;component/Images/Configuration.png" };

            //alpha
            configurationRootNode.Add(authorsNode);
            configurationRootNode.Add(disciplinesNode);
            configurationRootNode.Add(locationsNode);
            configurationRootNode.Add(purchaseOrdersNode);
            configurationRootNode.Add(reportsNode);
            configurationRootNode.Add(typesNode);

            ConfigurationTreeView.ItemsSource = configurationRootNode;
        }
 private bool ShouldLoadData(Tab selectedTab) {
   JSONArray checkData = new JSONArray();
   DateTime? checkTime = null;
   switch(selectedTab) {
     case Tab.TOP_RICHER:
       checkData = topRicherList;
       checkTime = topRicherLoadTime;
     break;
     case Tab.TOP_WINNER:
       checkData = topWinnerList;
       checkTime = topWinnerLoadTime;
     break;
     default:
     return false;
   }
   
   if (checkData == null || checkData.Length == 0) {
     return true;
   } else {
     if (checkTime.HasValue) {
       if (Utils.CurrentTime().Subtract((DateTime)checkTime).TotalSeconds >= RELOAD_DATA_SECONDS) {
         return true;
       } else {
         return false;
       }
     } else {
       return true;
     }
   }
 }
      void OnGUI()
      {
         
         if (Selection.activeGameObject == null)
         {
            EditorGUILayout.LabelField("No objects selected. Please select an object with a MeshFilter and Renderer");
            return;
         }
         DrawChannelGUI();

         var ot = tab;
         tab = (Tab)GUILayout.Toolbar((int)tab, tabNames);
         if (ot != tab)
         {
            UpdateDisplayMode();
         }
         if (tab == Tab.Paint)
         {
            DrawPaintGUI();
         }
         else if (tab == Tab.Deform)
         {
            DrawDeformGUI();
         }
         else if (tab == Tab.Flow)
         {
            DrawFlowGUI();
         }
         else if (tab == Tab.Bake)
         {
            DrawBakeGUI();
         }
      }
        public ActionResult Index(FormCollection collection)
        {
            var item = new Upload();
            var whiteList = new string[] { "Artist", "Name", "Tab", "BookId" };
            if (TryUpdateModel(item, whiteList, collection.ToValueProvider()))
            {
                if (ModelState.IsValid)
                {
                    //_uploadService.Upload(item.Artist, item.Name, item.BookId, item.Tab, User.Identity.Name);

                    var tab = new Tab { Artist = item.Artist, Name = item.Name, Content = item.Tab, CreatedOn = DateTime.UtcNow, AuthorName = User.Identity.Name };
                    RavenSession.Store(tab);

                    if (item.BookId > 0)
                    {
                        var bookTasks = new BookService();
                        bookTasks.AddTabToBook(tab.Id, item.BookId.Value, RavenSession);
                    }

                    TempData.Add(Constants.TempDataMessage, "Upload successful, thanks!");

                    return RedirectToAction("Index", "Songs");
                }
            }
            return View();
        }
 public void AddTab(Tab tab)
 {
     tab.PropertyChanged += new PropertyChangedEventHandler(tab_PropertyChanged);
     Children.Add(tab);
     if (tab.IsSelected)
         ProcessSelectedTab(tab);
 }
 public void IsIdProvider_Should_Be_True()
 {
     // Arrange
     var sut = new Tab("MyTab");
     // Assert
     Assert.IsTrue(sut.IsIdProvider);
 }
        public MobilePlantConfigControl(Tab tab)
        {
            if (DesignerProperties.IsInDesignTool) { return; }

            // Required to initialize variables
            InitializeComponent();
            mTab = tab;
            ConfigurationTreeView.LoadOnDemand += ConfigurationTreeView_LoadOnDemand;
            RadTreeViewItem treeViewItem = ConfigurationTreeView.SelectedContainer;
            ObservableCollection<NodeView> configurationRootNode = new ObservableCollection<NodeView>();

            NodeView mobilePlantTypesNode = new NodeView(null) { Name = "Mobile Plant Types", HasChildren = true, Type = NodeType.MobilePlantTypesNode, Icon = "/CmsEquipmentDatabase;component/Images/Configuration.png" };
            NodeView mobilePlantComponentTypesNode = new NodeView(null) { Name = "Mobile Plant Component Types", HasChildren = true, Type = NodeType.MobilePlantComponentTypes, Icon = "/CmsEquipmentDatabase;component/Images/Configuration.png" };
            NodeView standardComponentPropertiesNode = new NodeView(null) { Name = "Mobile Plant Properties", HasChildren = true, Type = NodeType.MobilePropertiesNode, Icon = "/CmsEquipmentDatabase;component/Images/Configuration.png" };

            NodeView mobilePlantHirersNode = new NodeView(null) { Name = "Mobile Plant MobileHirers", HasChildren = true, Type = NodeType.MobileHirersNode, Icon = "/CmsEquipmentDatabase;component/Images/Configuration.png" };
            NodeView mobilePlantOwnersNode = new NodeView(null) { Name = "Mobile Plant Owners", HasChildren = true, Type = NodeType.MobileOwnersNode, Icon = "/CmsEquipmentDatabase;component/Images/Configuration.png" };
            NodeView reportsNode = new NodeView(null) { Name = "Reports", HasChildren = true, Type = NodeType.ReportsNode, Icon = "/CmsEquipmentDatabase;component/Images/Configuration.png" };
            NodeView manufacturersNode = new NodeView(null) { Name = "Manufacturers", HasChildren = true, Type = NodeType.ManufacturersNode, Icon = "/CmsEquipmentDatabase;component/Images/Configuration.png" };

            configurationRootNode.Add(mobilePlantTypesNode);
            configurationRootNode.Add(mobilePlantComponentTypesNode);
            configurationRootNode.Add(standardComponentPropertiesNode);
            configurationRootNode.Add(mobilePlantHirersNode);
            configurationRootNode.Add(mobilePlantOwnersNode);
            configurationRootNode.Add(reportsNode);
            configurationRootNode.Add(manufacturersNode);

            ConfigurationTreeView.ItemsSource = configurationRootNode;
        }
        private void Page_Load(object sender, System.EventArgs e)
        {
            if (!IsPostBack) {

                this.DataBind();

                Tab t = new Tab();
                t.Text = "Properties";
                t.Enabled = UserID != Guid.Empty;
                t.NavigateUrl = "EditUser.aspx?UserID=" + UserID;
                TabControlUser.Tabs.Add(t);

                t = new Tab();
                t.Text = "Roles";
                t.Enabled = UserID != Guid.Empty;
                t.NavigateUrl = "EditUserRoles.aspx?UserID=" + UserID;
                TabControlUser.Tabs.Add(t);

                t = new Tab();
                t.Text = "History";
                t.Enabled = UserID != Guid.Empty;
                t.NavigateUrl = "ViewUserHistory.aspx?UserID=" + UserID;
                TabControlUser.Tabs.Add(t);

                TabControlUser.Tabs.FindByText(Selected).Selected = true;

            }
        }
 private TabDefinition GetTabDefinition(Tab tab)
 {
     TabDefinition tabDefinition = TabDefinitionRepository.GetTabDefinition(tab.Name);
     if(tabDefinition == null)
         tabDefinition = new TabDefinition();
     return tabDefinition;
 }
        private void ProcessSelectedTab(Tab tab)
        {
            foreach (Tab t in Children)
                t.IsSelected = t == tab;

            if (SelectedTabChanged != null)
                SelectedTabChanged(this, EventArgs.Empty);
        }
 public static TabDefinition CreateTabDefinition(Tab tab)
 {
     TabDefinition tabDefinition = new TabDefinition();
     tabDefinition.Name = tab.Name;
     tabDefinition.RequiredAccess = tab.RequiredAccess;
     tabDefinition.SortIndex = tab.SortIndex;
     return tabDefinition;
 }
  private void LoadDataFromServer(Tab selectedTab) {
    PopupManager.Instance.ShowLoadingPopup();
    isLoading = true;
    for (int i = 0; i < wrapContent.transform.childCount; i++) {
			Utils.SetActive(wrapContent.transform.GetChild(i).gameObject, false);
    }
    UserExtensionRequest.Instance.LoadLeaderboardData(selectedTab);
  }
Exemple #23
0
 public static RibbonPanel RibbonPanel(this UIControlledApplication uiCa, Tab tab, string panelName)
 {
     if (WriteEmptyComment(uiCa, panelName, "Panel name is empty")) return null;
     foreach (var panel in uiCa.GetRibbonPanels(tab).Where(panel => panel.Name == panelName))
     {
         return panel;
     }
     return uiCa.CreateRibbonPanel(tab, panelName);
 }
Exemple #24
0
 public void LoadTabs(Guid currentUserId, IEnumerable<Tab> tabs, List<Tab> sharedTabs, Tab tab, bool isTemplateUser)
 {
     this.IsTemplateUser = isTemplateUser;
     this.CurrentTab = tab;
     this.Pages = tabs;
     this.LockedTabs = sharedTabs;
     this.CurrentUserId = currentUserId;
     this.SetupTabs();
 }
Exemple #25
0
 public void Draw()
 {
     EditorGUILayout.BeginHorizontal();
     GUILayout.FlexibleSpace();
     Current = (Tab) GUILayout.Toolbar((int) Current, ToolbarStrings, GUILayout.Width(ToolbarWidth));
     GUILayout.FlexibleSpace();
     EditorGUILayout.EndHorizontal();
     EditorWindowTools.DrawHorizontalLine();
 }
        public TabTests()
        {
            _httpContext = TestHelper.CreateMockedHttpContext();
            _viewContext = new ViewContext { HttpContext = _httpContext.Object, ViewData = new ViewDataDictionary() };

            _clientSideObjectWriterFactory = new Mock<IClientSideObjectWriterFactory>();

            _tab = new Tab(_viewContext, _clientSideObjectWriterFactory.Object) { AssetKey = jQueryViewComponentFactory.DefaultAssetKey };
        }
    public void Add(Tab t)
    {
        tabs.Add (t);

        names.Clear ();
        foreach (Tab tt in tabs) {
            names.Add (tt.name);
        }
    }
 public void Id_Should_Be_Compsited_If_Parent_Is_Present()
 {
     var group = new Group("ActionGroup1");
     var tab = new Tab("CommonTab");
     var ribbon = new Ribbon("MyRibbon");
     ribbon.With(() => tab
                           .With(() => group
                                           .With(() => _sut)));
     Assert.AreEqual("MyRibbon.CommonTab.ActionGroup1.MyLabel", _sut.Id);
 }
 public void ChildItemCount_Should_Return_Correct_Tabs_Count()
 {
     var tab1 = new Tab("Tab1");
     var tab2 = new Tab("Tab2");
     var tab3 = new Tab("Tab3");
     _sut.With(() => tab1);
     _sut.With(() => tab2);
     _sut.With(() => tab3);
     Assert.AreEqual(3, _sut._tabs.Count);
 }
        public void actViewDetail(contact customer)
        {

            View.Customer.ShowCustomerUCView showCustommerView = new View.Customer.ShowCustomerUCView(customer);
            showCustommerView.DataContext = new ViewModel.Customer.ShowCustomerViewModel(customer, parentVM);
            Tab tab = new Tab(customer.lastname, showCustommerView, null);

            parentVM.customerTabs.Add(tab);
            parentVM.selectedTab = tab;
        }
Exemple #31
0
        public Tab getTabViaID(TabIDs id)
        {
            var tab = TabsAccessManager.GetTabViaID(new TabID {
                ID_Tab = id.tabID, ID_TabsList = id.listID
            });
            Tab newTab = new Tab();

            //Convert InfosTab (.NET Lib) to Tab (WinRT Component)
            newTab.id = id;
            newTab.dateTabContentUpdated = tab.DateTabContentUpdated;

            if (tab.PathContent == null)
            {
                newTab.pathContent = "";
            }
            else
            {
                newTab.pathContent = tab.PathContent;
            }

            switch (tab.TabContentType)
            {
            case ContentType.File:
                newTab.tabContentType = ContentTypeInfos.File;
                break;

            case ContentType.Folder:
                newTab.tabContentType = ContentTypeInfos.Folder;
                break;
            }
            newTab.tabDateModified     = tab.TabDateModified;
            newTab.tabName             = tab.TabName;
            newTab.tabNewModifications = tab.TabNewModifications;
            newTab.tabType             = tab.TabType;

            return(newTab);
        }
Exemple #32
0
        private void SetupFileWindow(FileWindow window)
        {
            int i, vi = 0;

            m_viewers = new IFileViewer[MAXFILES];

            //Get viewers and load tabs
            tsFiles.Items.Clear();
            for (i = window.Low; i < window.High; i++)
            {
                int    fileID;
                string fileName;

                fileID   = window.FileIDs[i];
                fileName = window.FilePaths[i];

                Tab tab = new Tab();
                tab.Text = Path.GetFileName(fileName);
                tsFiles.Items.Add(tab);

                try {
                    m_viewers[vi++] = LoadFileControl(fileID, fileName);
                } catch (FileDownloadException er) {
                    //Redirect if we only have 1 file
                    if (window.High - window.Low == 1)
                    {
                        Response.Redirect("dlfile.aspx?FileID=" + er.FileID, true);
                    }
                    else
                    {
                        vi++;
                    }
                }
            }
            //Load up the placeholder controls
            LoadPlaceHolders(m_viewers);
        }
 public override bool[,] MovimentosPossiveis() {
     bool[,] mat = new bool[Tab.Linhas, Tab.Colunas];
     Posicao pos = new Posicao(0, 0);
     pos.DefinirValores(Posicao.Linha - 1, Posicao.Coluna);
     while (Tab.PosicaoValida(pos) && PodeMover(pos)) {
         mat[pos.Linha, pos.Coluna] = true;
         if(Tab.Peca(pos) != null && Tab.Peca(pos).Cor != Cor) {
             break;
         }
         pos.Linha --;
     }
     pos.DefinirValores(Posicao.Linha + 1, Posicao.Coluna);
     while (Tab.PosicaoValida(pos) && PodeMover(pos)) {
         mat[pos.Linha, pos.Coluna] = true;
         if (Tab.Peca(pos) != null && Tab.Peca(pos).Cor != Cor) {
             break;
         }
         pos.Linha ++;
     }
     pos.DefinirValores(Posicao.Linha, Posicao.Coluna + 1);
     while (Tab.PosicaoValida(pos) && PodeMover(pos)) {
         mat[pos.Linha, pos.Coluna] = true;
         if (Tab.Peca(pos) != null && Tab.Peca(pos).Cor != Cor) {
             break;
         }
         pos.Coluna ++;
     }
     pos.DefinirValores(Posicao.Linha, Posicao.Coluna - 1);
     while (Tab.PosicaoValida(pos) && PodeMover(pos)) {
         mat[pos.Linha, pos.Coluna] = true;
         if (Tab.Peca(pos) != null && Tab.Peca(pos).Cor != Cor) {
             break;
         }
         pos.Coluna --;
     }
     return mat;
 }
Exemple #34
0
        public void TabAddItem()
        {
            tlog.Debug(tag, $"TabAddItem START");

            var testingTarget = new Tab();

            Assert.IsNotNull(testingTarget, "null handle");
            Assert.IsInstanceOf <Tab>(testingTarget, "Should return Tab instance.");

            try
            {
                TabItemData item1 = new TabItemData();
                testingTarget.AddItem(item1);
                TabItemData item2 = new TabItemData();
                testingTarget.InsertItem(item2, 1);

                testingTarget.SelectedItemIndex = 1;

                try
                {
                    testingTarget.DeleteItem(0);
                }
                catch (Exception e)
                {
                    tlog.Debug(tag, e.Message.ToString());
                    Assert.Fail("Caught Exception : Failed!");
                }
            }
            catch (Exception e)
            {
                tlog.Debug(tag, e.Message.ToString());
                Assert.Fail("Caught Exception : Failed!");
            }

            testingTarget.Dispose();
            tlog.Debug(tag, $"TabAddItem END (OK)");
        }
        public string GetCars()
        {
            return(_cars ?? (_cars = JsonConvert.SerializeObject(CarsManager.Instance.Enabled.Select(x => new {
                id = x.Id,
                name = x.Name,
                brand = x.Brand,
                path = Tab.ConvertFilename(x.Location),
                badge = Tab.ConvertFilename(x.BrandBadge),

                // Is it needed or is it just a waste of time?
                // description = x.Description,
                // tags = x.Tags,
                // @class = x.CarClass,

                // Extra bits, not implemented yet:
                // "specs": { "bhp": "420bhp", "torque": "294Nm", "weight": "1050kg", "topspeed": "280+km/h", "acceleration": "", "pwratio": "2.50kg/hp", "range": 128 },
                // "torqueCurve": [ [ "0", "0" ], [ "500", "82" ], … ],
                // "powerCurve": [ … ],

                // This flag is to check if content has been bought or not. CM ignores all non-bought content,
                // so it’s always false
                dlc = false
            }))));
        }
Exemple #36
0
        public async Task <IActionResult> PutTab(int id, Tab tab)
        {
            if (id != tab.Id)
            {
                return(BadRequest());
            }

            dbContext.Entry(tab).State = EntityState.Modified;

            try
            {
                await dbContext.SaveChangesAsync();
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!TabExists(id))
                {
                    return(NotFound());
                }
                throw;
            }

            return(NoContent());
        }
        public static Tab GetPluginTab(string pluginId, Menu parent, Menu menu)
        {
            var tab = new Tab
            {
                Id          = menu.Id,
                Text        = menu.Text,
                IconClass   = menu.IconClass,
                Selected    = false,
                Href        = menu.Href,
                Target      = menu.Target,
                Permissions = string.Empty
            };

            var permissions = new List <string>();

            if (menu.Menus != null && menu.Menus.Count > 0)
            {
                tab.Children = new Tab[menu.Menus.Count];
                for (var i = 0; i < menu.Menus.Count; i++)
                {
                    var child           = menu.Menus[i];
                    var childPermission = GetMenuPermission(pluginId, menu, child);
                    permissions.Add(childPermission);

                    tab.Children[i] = GetPluginTab(pluginId, menu, child);
                }
            }
            else
            {
                var permission = GetMenuPermission(pluginId, parent, menu);
                permissions.Add(permission);
            }
            tab.Permissions = TranslateUtils.ObjectCollectionToString(permissions);

            return(tab);
        }
Exemple #38
0
        public void SelectTab(Tab tab)
        {
            if (GameMain.Config.UnsavedSettings)
            {
                var applyBox = new GUIMessageBox(
                    TextManager.Get("ApplySettingsLabel"),
                    TextManager.Get("ApplySettingsQuestion"),
                    new string[] { TextManager.Get("ApplySettingsYes"), TextManager.Get("ApplySettingsNo") });
                applyBox.Buttons[0].OnClicked += applyBox.Close;
                applyBox.Buttons[0].OnClicked += ApplySettings;
                applyBox.Buttons[0].UserData   = tab;
                applyBox.Buttons[1].OnClicked += applyBox.Close;
                applyBox.Buttons[1].OnClicked += DiscardSettings;
                applyBox.Buttons[1].UserData   = tab;

                return;
            }

            selectedTab = tab;

            switch (selectedTab)
            {
            case Tab.NewGame:
                campaignSetupUI.CreateDefaultSaveName();
                break;

            case Tab.LoadGame:
                campaignSetupUI.UpdateLoadMenu();
                break;

            case Tab.Settings:
                GameMain.Config.ResetSettingsFrame();
                menuTabs[(int)Tab.Settings] = GameMain.Config.SettingsFrame;
                break;
            }
        }
Exemple #39
0
        void Start()
        {
            Tab_lut = new Dictionary <Toggle, Tab>();

            foreach (Tab _tab in this.Tabs)
            {
                Tab_lut[_tab.Toggle] = _tab;

                _tab.View.gameObject.SetActive(_tab.Toggle.isOn);

                if (_tab.Toggle.isOn)
                {
                    CurrentTab = _tab;
                }
                _tab.Toggle.onValueChanged.AddListener((isSelected) =>
                {
                    if (!isSelected)
                    {
                        return;
                    }
                    OnTabSelected(_tab);
                });
            }
        }
Exemple #40
0
        void DrawHeader()
        {
            EditorGUILayout.BeginHorizontal();
            GUILayout.Space(75);
            EditorGUILayout.Space();
            EditorGUI.BeginChangeCheck();
            _activeTab = (Tab)GUILayout.Toolbar((int)_activeTab, _tabNames);

            if (EditorGUI.EndChangeCheck())
            {
                SaveIfRequired();

                if (_previewTab != null)
                {
                    _previewTab.Refresh();
                }
            }

            EditorGUILayout.Space();
            GUILayout.Space(20);
            DrawVersion();
            DrawHelp();
            EditorGUILayout.EndHorizontal();
        }
Exemple #41
0
            public void UpdateWaitingPage()
            {
                Sync(async() => {
                    if (Model == null)
                    {
                        return;
                    }
                    Tab?.Execute($@"
document.getElementById('{Model.CarId}1').innerHTML = '<img id=""mclaren_mp412c_gt3"" src=""{
                            await Tab.GetImageUrlAsync(Model.CarSkin?.PreviewImage)}"" height=""200"">';
document.getElementById('{Model.CarId}2').innerHTML = '<img style=""margin-top:145px;float:left"" src=""{
                            await Tab.GetImageUrlAsync(Model.Car?.LogoIcon)}"" width=""48"">';
document.getElementById('{Model.CarId}3').innerHTML = '<img style=""margin-left:300px;margin-right:10px;margin-top:160px;float:left"" src=""{
                            await Tab.GetImageUrlAsync(Model.CarSkin?.LiveryImage)}"" width=""32"">';
document.getElementById('{Model.CarId}6').textContent = {
                            JsonConvert.SerializeObject(Model.Car?.DisplayName ?? @"?")};
document.getElementById('{Model.CarId}7').textContent = {
                            JsonConvert.SerializeObject(Model.Track?.Name ?? @"?")};
document.getElementById('{Model.CarId}4').innerHTML = '<img src=""{
                            await Tab.GetImageUrlAsync(Model.Track?.PreviewImage)}"" width=""355"">';
document.getElementById('{Model.CarId}5').innerHTML = '<img src=""{
                            await Tab.GetImageUrlAsync(Model.Track?.OutlineImage)}"" height=""192"">';");
                });
            }
        /// <summary>
        /// 添加 Tab 由側邊欄選單調用
        /// </summary>
        /// <param name="menu"></param>
        public void AddTab(BootstrapMenu menu)
        {
            var tab = Tabs.FirstOrDefault(tb => tb.Id == menu.Id);

            if (tab == null)
            {
                tab = new Tab();
                tab.Init(menu);
                Tabs.ForEach(t => t.SetActive(false));
                Tabs.Add(tab);
                Pages.ForEach(p => p.Active = false);
                Pages.Add(new PageContentAttributes()
                {
                    Id = menu.Id, Name = menu.Url.Replace("~/", ""), Active = true
                });
            }
            else
            {
                Tabs.ForEach(t => t.SetActive(t.Id == tab.Id));
                Pages.ForEach(p => p.Active = p.Id == tab.Id);
            }
            curId = tab.Id;
            StateHasChanged();
        }
Exemple #43
0
        public ActionResult List()
        {
            var tab          = new Tab();
            var deptCategory = CategoryFactory.GetCategory("Market.ManDept", "主要承接部门", "MainDept");

            deptCategory.SetDefaultItem();
            deptCategory.Multi = false;
            tab.Categories.Add(deptCategory);

            var phaseCategory = CategoryFactory.GetCategory("Project.Phase", "当前阶段", "PhaseValue");

            phaseCategory.SetDefaultItem();
            phaseCategory.Multi = false;
            tab.Categories.Add(phaseCategory);
            var RelativeArea = CategoryFactory.GetCategory("System.RelativeArea", "地域", "Location");

            RelativeArea.SetDefaultItem();
            RelativeArea.Multi = false;
            tab.Categories.Add(RelativeArea);

            tab.IsDisplay = true;
            ViewBag.Tab   = tab;
            return(View());
        }
        protected override void OnInit(EventArgs e)
        {
            columnCount   = 2;
            features      = TableWindowFeatures.DisableContentSeparation;
            components    = TableWindowComponents.Tabs;
            tabStrip      = new TabStrip();
            tabStrip.Tabs = new TabList();

            Tab GeneralTab = new Tab("General");

            GeneralTab.Visible    = true;
            GeneralTab.RenderDiv += new TabRenderHandler(renderGeneralFolder);
            tabStrip.Tabs.Add(GeneralTab);

            Tab FlagsTab = new Tab("Flags");

            FlagsTab.RenderDiv += new TabRenderHandler(renderFlagsFolder);
            tabStrip.Tabs.Add(FlagsTab);

            Tab Status_ChangesTab = new Tab("Status Changes");

            Status_ChangesTab.RenderDiv += new TabRenderHandler(renderStatus_ChangesFolder);
            tabStrip.Tabs.Add(Status_ChangesTab);
        }
Exemple #45
0
    void CopyTabInfoToInputField(Tab tabtocopyfrom)
    {
        ModeInputField.value = tabtocopyfrom.ObjectMode;
        OnModeChange(ModeInputField.value);

        ObjectNameInputField.text = tabtocopyfrom.ObjectName;

        CodeInputField.text = tabtocopyfrom.Code;

        ParameterResolutionInputField.text = tabtocopyfrom.Resolution;
        ParameterDomainInputField.text     = tabtocopyfrom.ParameterDomain;

        BoundingBoxSizeInputField.text       = tabtocopyfrom.MarchingBoundingBoxSize;
        BoundingBoxCenterInputField.text     = tabtocopyfrom.MarchingBoundingBoxCenter;
        BoundingBoxResolutionInputField.text = tabtocopyfrom.BoundingBoxResolution;

        DiffuseColorInputField.text  = tabtocopyfrom.DiffuseColor;
        SpecularColorInputField.text = tabtocopyfrom.SpecularColor;
        TransparencyInputField.text  = tabtocopyfrom.Transparency;
        ShininessInputField.text     = tabtocopyfrom.Shininess;

        TimecycleInputField.text = tabtocopyfrom.Timecycle;
        TimerangeInputField.text = tabtocopyfrom.Timerange;
    }
Exemple #46
0
        protected override void OnMouseDown(MouseEventArgs e)
        {
            base.OnMouseDown(e);

            Tab selectedTab = PickTab(e.Location);

            if (selectedTab != null)
            {
                if (e.Button == MouseButtons.Middle)
                {
                    docManager.Close(selectedTab.Document);
                }
                else
                {
                    docManager.ActiveDocument = selectedTab.Document;
                    grabbedTab       = selectedTab;
                    originalPosition = e.X;
                }
            }
            else if (docManager.HasDocument && IsOverClosingSign(e.Location))
            {
                docManager.Close(docManager.ActiveDocument);
            }
        }
        private async Task ReplaceItemsAsync(Tab startingTab)
        {
            if (startingTab == _selectedTab)
            {
                switch (_selectedTab)
                {
                case Tab.AvailablePackages:
                    await ReplaceItemsAsync(_availablePackages);

                    break;

                case Tab.InstalledPackages:
                    await ReplaceItemsAsync(_installedPackages);

                    break;

                case Tab.LoadedPackages:
                    await ReplaceItemsAsync(_loadedPackages);

                    break;
                }
                IsLoading = false;
            }
        }
Exemple #48
0
        private bool podeMover(Posicao pos)
        {
            Peca p = Tab.peca(pos);

            return(p == null || p.Cor != Cor);
        }
Exemple #49
0
        // movimento do bispo e o da torre forma os movimentos possiveis da dama
        public override bool[,] movimentosPossiveis()
        {
            bool[,] mat = new bool[Tab.Linhas, Tab.Colunas];

            Posicao pos = new Posicao(0, 0);

            //acima
            pos.definirValores(Posicao.Linha - 1, Posicao.Coluna);
            while (Tab.posicaoValida(pos) && podeMover(pos))
            {
                mat[pos.Linha, pos.Coluna] = true;
                if (Tab.peca(pos) != null && Tab.peca(pos).Cor != Cor)
                {
                    break;
                }
                pos.Linha = pos.Linha - 1;
            }
            //esquerda
            pos.definirValores(Posicao.Linha, Posicao.Coluna - 1);
            while (Tab.posicaoValida(pos) && podeMover(pos))
            {
                mat[pos.Linha, pos.Coluna] = true;
                if (Tab.peca(pos) != null && Tab.peca(pos).Cor != Cor)
                {
                    break;
                }
                pos.Coluna = pos.Coluna - 1;
            }
            //direita
            pos.definirValores(Posicao.Linha, Posicao.Coluna + 1);
            while (Tab.posicaoValida(pos) && podeMover(pos))
            {
                mat[pos.Linha, pos.Coluna] = true;
                if (Tab.peca(pos) != null && Tab.peca(pos).Cor != Cor)
                {
                    break;
                }
                pos.Coluna = pos.Coluna + 1;
            }
            //abaixo
            pos.definirValores(Posicao.Linha + 1, Posicao.Coluna);
            while (Tab.posicaoValida(pos) && podeMover(pos))
            {
                mat[pos.Linha, pos.Coluna] = true;
                if (Tab.peca(pos) != null && Tab.peca(pos).Cor != Cor)
                {
                    break;
                }
                pos.Linha = pos.Linha + 1;
            }
            //nordeste
            pos.definirValores(Posicao.Linha - 1, Posicao.Coluna + 1);
            if (Tab.posicaoValida(pos) && podeMover(pos))
            {
                mat[pos.Linha, pos.Coluna] = true;
            }
            //sudeste
            pos.definirValores(Posicao.Linha + 1, Posicao.Coluna + 1);
            if (Tab.posicaoValida(pos) && podeMover(pos))
            {
                mat[pos.Linha, pos.Coluna] = true;
            }
            //sudoeste
            pos.definirValores(Posicao.Linha + 1, Posicao.Coluna - 1);
            if (Tab.posicaoValida(pos) && podeMover(pos))
            {
                mat[pos.Linha, pos.Coluna] = true;
            }
            //noroeste
            pos.definirValores(Posicao.Linha - 1, Posicao.Coluna - 1);
            if (Tab.posicaoValida(pos) && podeMover(pos))
            {
                mat[pos.Linha, pos.Coluna] = true;
            }
            return(mat);
        }
 public void ColocarNovaPeca(char coluna, int linha, Peca peca)
 {
     Tab.ColocarPeca(peca, new PosicaoXadrez(coluna, linha).ToPosicao());
     Pecas.Add(peca);
 }
        private async Task AfterLoadUnloadAsync(IRPackageViewModel package, Tab startingTab)
        {
            await ReplaceItemsAsync(startingTab);

            package.IsChanging = false;
        }
Exemple #52
0
    private void OnGUI()
    {
        curTab = UTGUI.EnumToolbar(curTab);
        switch (curTab)
        {
        case Tab.All:
            drawHistory(position.height / 2);
            drawBookmark();
            break;

        case Tab.Bookmark:
            drawBookmark();
            break;

        case Tab.History:
            drawHistory();
            break;
        }

        void drawHistory(float height = -1)
        {
            scrollPosHistory = height >= 0
                ? EditorGUILayout.BeginScrollView(scrollPosHistory, false, false, GUILayout.Height(height))
                : EditorGUILayout.BeginScrollView(scrollPosHistory, false, false);

            var removeCount = histories.RemoveAll(v => !v.asset);

            if (removeCount > 0)
            {
                saveHistories();
            }

            for (var i = histories.Count - 1; i >= 0; i--)
            {
                var v = histories[i];
                EditorGUILayout.ObjectField(v.asset, v.AssetType, false);
                GUILayout.Space(1.5f);
            }

            EditorGUILayout.EndScrollView();
        }

        void drawBookmark(float height = -1)
        {
            EditorGUILayout.BeginVertical("box");
            scrollPosBookmark = height >= 0
                ? EditorGUILayout.BeginScrollView(scrollPosBookmark, false, false, GUILayout.Height(height))
                : EditorGUILayout.BeginScrollView(scrollPosBookmark, false, false);

            for (var i = 0; i < bookmarks.Count; i++)
            {
                var v = bookmarks[i];
                if (v.path.IsNOE())
                {
                    bookmarks.RemoveAt(i);
                    saveBookmarks();
                    i--;
                    continue;
                }

                drawPath(v, i);
            }

            EditorGUILayout.BeginVertical("box", GUILayout.Height(30f));
            GUILayout.Space(10f);
            EditorGUILayout.BeginHorizontal();
            GUILayout.FlexibleSpace();
            GUILayout.Label("Drag folder here to add bookmark");
            GUILayout.FlexibleSpace();
            EditorGUILayout.EndHorizontal();
            GUILayout.Space(10f);
            EditorGUILayout.EndVertical();
            var dragObjs = UTGUI.HandleDrag();

            if (dragObjs != null && dragObjs.Length > 0)
            {
                foreach (var obj in dragObjs)
                {
                    if (obj != null && obj is DefaultAsset)
                    {
                        var path = AssetDatabase.GetAssetPath(obj);
                        if (!bookmarks.Exists(v => v.path == path))
                        {
                            bookmarks.Add(new Bookmark(path));
                            saveBookmarks();
                            Repaint();
                        }
                    }
                }
            }

            EditorGUILayout.EndScrollView();
            EditorGUILayout.EndVertical();
        }

        void drawPath(Bookmark bookmark, int index)
        {
            GUILayout.BeginHorizontal();

            GUILayout.BeginVertical();
            GUILayout.Space(4f);
            bookmark.path = EditorGUILayout.TextField(bookmark.path);
            GUILayout.EndVertical();

            if (GUILayout.Button(bookmark.name))
            {
                UToolsUtil.HighlightProjectPath(bookmark.path);
            }

            GUILayout.EndHorizontal();
            var dragObjs = UTGUI.HandleDrag(DragAndDropVisualMode.Copy);

            if (dragObjs != null && dragObjs.Length > 0)
            {
                foreach (var obj in dragObjs)
                {
                    if (obj.IsAsset())
                    {
                        var assetPath = AssetDatabase.GetAssetPath(obj);
                        var assetName = Path.GetFileName(assetPath);
                        var newPath   = Path.Combine(bookmark.path, assetName);
                        if (newPath == assetPath)
                        {
                            return;
                        }

                        var error = AssetDatabase.MoveAsset(assetPath, newPath);
                        if (error.IsNNOE())
                        {
                            Debug.LogError(error);
                        }
                    }
                }
            }
        }
    }
        protected internal virtual bool TabDefinitionShouldBeUpdated(TabDefinition tabDefinition, Tab tab)
        {
            if (tabDefinition.Name != tab.Name)
            {
                return(true);
            }

            if (tabDefinition.RequiredAccess != tab.RequiredAccess)
            {
                return(true);
            }

            if (tabDefinition.SortIndex != tab.SortIndex)
            {
                return(true);
            }

            return(false);
        }
 protected internal virtual void UpdateTabDefinition(TabDefinition tabDefinition, Tab tab)
 {
     tabDefinition.Name           = tab.Name;
     tabDefinition.RequiredAccess = tab.RequiredAccess;
     tabDefinition.SortIndex      = tab.SortIndex;
 }
Exemple #55
0
 protected override void OnMouseUp(MouseEventArgs e)
 {
     base.OnMouseUp(e);
     grabbedTab = null;
 }
Exemple #56
0
        private void docManager_DocumentAdded(object sender, DocumentEventArgs e)
        {
            Tab tab = new Tab(e.Document, this);

            tabs.Add(tab);
        }
Exemple #57
0
        public override bool[,] MovimentosPossiveis()
        {
            bool[,] mat = new bool[Tab.Linhas, Tab.Colunas];

            Posicao pos = new Posicao(0, 0);

            //Esquerda
            pos.DefinirValores(Posicao.Linha, Posicao.Coluna - 1);
            while (Tab.PosicaoValida(pos) && PodeMover(pos))
            {
                mat[pos.Linha, pos.Coluna] = true;
                if (Tab.PecaTab(pos) != null && Tab.PecaTab(pos).Cor != Cor)
                {
                    break;
                }
                pos.DefinirValores(pos.Linha, pos.Coluna - 1);
            }

            //Direita
            pos.DefinirValores(Posicao.Linha, Posicao.Coluna + 1);
            while (Tab.PosicaoValida(pos) && PodeMover(pos))
            {
                mat[pos.Linha, pos.Coluna] = true;
                if (Tab.PecaTab(pos) != null && Tab.PecaTab(pos).Cor != Cor)
                {
                    break;
                }
                pos.DefinirValores(pos.Linha, pos.Coluna + 1);
            }

            //Acima
            pos.DefinirValores(Posicao.Linha - 1, Posicao.Coluna);
            while (Tab.PosicaoValida(pos) && PodeMover(pos))
            {
                mat[pos.Linha, pos.Coluna] = true;
                if (Tab.PecaTab(pos) != null && Tab.PecaTab(pos).Cor != Cor)
                {
                    break;
                }
                pos.DefinirValores(pos.Linha - 1, pos.Coluna);
            }

            //Abaixo
            pos.DefinirValores(Posicao.Linha + 1, Posicao.Coluna);
            while (Tab.PosicaoValida(pos) && PodeMover(pos))
            {
                mat[pos.Linha, pos.Coluna] = true;
                if (Tab.PecaTab(pos) != null && Tab.PecaTab(pos).Cor != Cor)
                {
                    break;
                }
                pos.DefinirValores(pos.Linha + 1, pos.Coluna);
            }

            //NO
            pos.DefinirValores(Posicao.Linha - 1, Posicao.Coluna - 1);
            while (Tab.PosicaoValida(pos) && PodeMover(pos))
            {
                mat[pos.Linha, pos.Coluna] = true;
                if (Tab.PecaTab(pos) != null && Tab.PecaTab(pos).Cor != Cor)
                {
                    break;
                }
                pos.DefinirValores(pos.Linha - 1, pos.Coluna - 1);
            }

            //NE
            pos.DefinirValores(Posicao.Linha - 1, Posicao.Coluna + 1);
            while (Tab.PosicaoValida(pos) && PodeMover(pos))
            {
                mat[pos.Linha, pos.Coluna] = true;
                if (Tab.PecaTab(pos) != null && Tab.PecaTab(pos).Cor != Cor)
                {
                    break;
                }
                pos.DefinirValores(pos.Linha - 1, pos.Coluna + 1);
            }

            //SE
            pos.DefinirValores(Posicao.Linha + 1, Posicao.Coluna + 1);
            while (Tab.PosicaoValida(pos) && PodeMover(pos))
            {
                mat[pos.Linha, pos.Coluna] = true;
                if (Tab.PecaTab(pos) != null && Tab.PecaTab(pos).Cor != Cor)
                {
                    break;
                }
                pos.DefinirValores(pos.Linha + 1, pos.Coluna + 1);
            }

            //SO
            pos.DefinirValores(Posicao.Linha + 1, Posicao.Coluna - 1);
            while (Tab.PosicaoValida(pos) && PodeMover(pos))
            {
                mat[pos.Linha, pos.Coluna] = true;
                if (Tab.PecaTab(pos) != null && Tab.PecaTab(pos).Cor != Cor)
                {
                    break;
                }
                pos.DefinirValores(pos.Linha + 1, pos.Coluna - 1);
            }

            return(mat);
        }
 internal void switchToTab(Tab tab)
 {
 }
Exemple #59
0
 public async Task LeaveGroup(Tab tab)
 {
     await Groups.RemoveFromGroupAsync(Context.ConnectionId, tab.GetDisplayName());
 }
Exemple #60
0
 // Join Group and Leave Group
 public async Task JoinGroup(Tab tab)
 {
     await Groups.AddToGroupAsync(Context.ConnectionId, tab.GetDisplayName());
 }