Inheritance: MonoBehaviour
Ejemplo n.º 1
0
        private void InitializeTreeViewContextMenu()
        {
            MainContextMenu.Items.AddRange(new[]
            {
                new DnnMenuItem
                {
                    Text     = Localization.GetString("CreateFolder", LocalResourceFile),
                    Value    = "NewFolder",
                    CssClass = "permission_ADD disabledIfFiltered",
                    ImageUrl = IconController.IconURL("FolderCreate", "16x16", "Gray")
                },
                new DnnMenuItem
                {
                    Text     = Localization.GetString("RefreshFolder", LocalResourceFile),
                    Value    = "RefreshFolder",
                    CssClass = "permission_READ permission_BROWSE",
                    ImageUrl = IconController.IconURL("FolderRefreshSync", "16x16", "Gray")
                },
                new DnnMenuItem
                {
                    Text     = Localization.GetString("RenameFolder", LocalResourceFile),
                    Value    = "RenameFolder",
                    CssClass = "permission_MANAGE",
                    ImageUrl = IconController.IconURL("FileRename", "16x16", "Black")
                },
                new DnnMenuItem
                {
                    Text     = Localization.GetString("Move", LocalResourceFile),
                    Value    = "Move",
                    CssClass = "permission_COPY",
                    ImageUrl = IconController.IconURL("FileMove", "16x16", "Black")
                },
                new DnnMenuItem
                {
                    Text     = Localization.GetString("DeleteFolder", LocalResourceFile),
                    Value    = "DeleteFolder",
                    CssClass = "permission_DELETE",
                    ImageUrl = IconController.IconURL("FileDelete", "16x16", "Black")
                },
                new DnnMenuItem
                {
                    Text     = Localization.GetString("ViewFolderProperties", LocalResourceFile),
                    Value    = "Properties",
                    CssClass = "permission_READ permission_BROWSE",
                    ImageUrl = IconController.IconURL("ViewProperties", "16x16", "CtxtMn")
                },
            });

            // Dnn Menu Item Extension Point
            foreach (var menuItem in epm.GetMenuItemExtensionPoints("DigitalAssets", "TreeViewContextMenu", Filter))
            {
                MainContextMenu.Items.Add(new DnnMenuItem
                {
                    Text     = menuItem.Text,
                    Value    = menuItem.Value,
                    CssClass = menuItem.CssClass,
                    ImageUrl = menuItem.Icon
                });
            }
        }
        /// -----------------------------------------------------------------------------
        /// <summary>
        /// Runs just before the control is rendered
        /// </summary>
        /// -----------------------------------------------------------------------------
        protected override void OnPreRender(EventArgs e)
        {
            if (_itemChanged)
            {
                //Rebind the control to the DataSource to make sure that the dependent
                //editors are updated
                DataBind();
            }
            if (String.IsNullOrEmpty(CssClass))
            {
                CssClass = "dnnForm";
            }

            //Find the Min/Max buttons
            if (GroupByMode == GroupByMode.Section && (_sections != null))
            {
                foreach (DictionaryEntry key in _sections)
                {
                    var tbl  = (Table)key.Value;
                    var icon = (Image)key.Key;
                    DNNClientAPI.EnableMinMax(icon, tbl, false, IconController.IconURL("Minus", "12X15"), IconController.IconURL("Plus", "12X15"), DNNClientAPI.MinMaxPersistanceType.Page);
                }
            }
            base.OnPreRender(e);
        }
    public void OnUninstalled(App uninstallApp)
    {
        int            index          = appList.IndexOf(uninstallApp);
        GameObject     icon           = pageChildList [index];
        IconController iconController = icon.GetComponent <IconController> ();
        //TODO 1.判断是否是page最后一个app,是就置成空位 不是就使page 的app向前移一位后再最后插入一个空位
        int pageNum = index / launcherModel.pageItemNum;

        int[] bound = getPageBoundByIndex(pageNum);
        if (index == bound[1])
        {
            DestoryIcon(index);
        }
        else
        {
            GameObject lastIconOnPage     = pageChildList [bound[1]];
            Location   lastLocationOnPage = lastIconOnPage.GetComponent <IconController> ().originLocation;
            icon.transform.DOScale(0f, ANIM_DURATION);
            IconAdvance(index, index + 1, bound[1], true);
            appList.RemoveAt(index);
            pageChildList.RemoveAt(index);
            //page 末尾插入一个占位icon
            addPlaceholder(pageNum, bound[1], lastLocationOnPage);
        }
        //清除regess与empty page 并持久化到android
        ClearEmptyPage();
        ClearRegress();
        SaveAppList();
    }
Ejemplo n.º 4
0
 private void InitializeEmptySpaceContextMenu()
 {
     EmptySpaceMenu.Items.AddRange(new[]
     {
         new DnnMenuItem
         {
             Text     = Localization.GetString("CreateFolder", LocalResourceFile),
             Value    = "NewFolder",
             CssClass = "permission_ADD",
             ImageUrl = IconController.IconURL("FolderCreate", "16x16", "Gray")
         },
         new DnnMenuItem
         {
             Text     = Localization.GetString("RefreshFolder", LocalResourceFile),
             Value    = "RefreshFolder",
             CssClass = "permission_READ permission_BROWSE",
             ImageUrl = IconController.IconURL("FolderRefreshSync", "16x16", "Gray")
         },
         new DnnMenuItem
         {
             Text     = Localization.GetString("UploadFiles.Title", LocalResourceFile),
             Value    = "UploadFiles",
             CssClass = "permission_ADD",
             ImageUrl = IconController.IconURL("UploadFiles", "16x16", "Gray")
         },
         new DnnMenuItem
         {
             Text     = Localization.GetString("ViewFolderProperties", LocalResourceFile),
             Value    = "Properties",
             CssClass = "permission_READ permission_BROWSE",
             ImageUrl = IconController.IconURL("ViewProperties", "16x16", "CtxtMn")
         },
     });
 }
Ejemplo n.º 5
0
        protected void btnSubscribe_Click(object sender, ImageClickEventArgs e)
        {
            var objEventSubscriptionController = new EventSubscriptionController();

            if (btnSubscribe.ImageUrl == IconController.IconURL("Unchecked"))
            {
                var objEventSubscription = new EventSubscriptionInfo();
                objEventSubscription.SubscriptionID = -1;
                objEventSubscription.ModuleID       = ModuleId;
                objEventSubscription.PortalID       = PortalId;
                objEventSubscription.UserID         = UserId;
                objEventSubscriptionController.EventsSubscriptionSave(objEventSubscription);
                btnSubscribe.Visible       = true;
                lblSubscribe.Text          = Localization.GetString("lblUnsubscribe", LocalResourceFile);
                btnSubscribe.AlternateText = Localization.GetString("MenuUnsubscribe", LocalResourceFile);
                btnSubscribe.ToolTip       = Localization.GetString("MenuTTUnsubscribe", LocalResourceFile);
                btnSubscribe.ImageUrl      = IconController.IconURL("Checked");
            }
            else
            {
                objEventSubscriptionController.EventsSubscriptionDeleteUser(UserId, ModuleId);
                btnSubscribe.Visible       = true;
                lblSubscribe.Text          = Localization.GetString("lblSubscribe", LocalResourceFile);
                btnSubscribe.AlternateText = Localization.GetString("MenuSubscribe", LocalResourceFile);
                btnSubscribe.ToolTip       = Localization.GetString("MenuTTSubscribe", LocalResourceFile);
                btnSubscribe.ImageUrl      = IconController.IconURL("Unchecked");
            }
        }
	public bool OnIconDrag(){
		GameObject originalObj = mIconDragController.currentDragIcon;
		IconController iconController = originalObj.GetComponent<IconController> ();
		if (oriColor.Equals(Color.clear)) {
			Image bg = originalObj.GetComponent<Image> ();
			oriColor = bg.color;
		}
		bool enter = OnIconEnterOrExit ();
		if (enter) {
			if (!controlFlag) {
				controlFlag = true;
				mLauncherController.Log (TAG, "OnIconDrag1 enter"+enter);
				iconController.hideText ();
				DoIconAnim (originalObj, Color.clear);
			}
		} else {
			if (controlFlag) {
				controlFlag = false;
				mLauncherController.Log (TAG, "OnIconDrag2 enter"+enter);
				iconController.showText ();
				DoIconAnim (mIconDragController.currentDragIcon, oriColor);
			}
		}
		return enter;
	}
Ejemplo n.º 7
0
        protected void grdDisplayColumns_ItemCreated(object sender, DataGridItemEventArgs e)
        {
            var objUpImage   = default(ImageButton);
            var objDownImage = default(ImageButton);

            switch (e.Item.ItemType)
            {
            case ListItemType.AlternatingItem:
            case ListItemType.Item:
            case ListItemType.SelectedItem:

                // Center the "visible" checkbox in its cell
                e.Item.Cells [1].Style.Add("text-align", "center");

                // imgUp
                objUpImage          = (ImageButton)e.Item.Cells [2].FindControl("imgUp");
                objUpImage.Visible  = (e.Item.ItemIndex != 0);
                objUpImage.ImageUrl = IconController.IconURL("Up", "16X16");

                // imgDown
                objDownImage          = (ImageButton)e.Item.Cells [2].FindControl("imgDown");
                objDownImage.ImageUrl = IconController.IconURL("Dn", "16X16");
                if (objUpImage.Visible == false)
                {
                    objDownImage.Style.Add("margin-left", "19px");
                }

                e.Item.CssClass = "Normal";
                break;

            case ListItemType.Header:
                e.Item.CssClass = "SubHead";
                break;
            }
        }
Ejemplo n.º 8
0
 public void handleSubIcon()
 {
     subIconController                = subIconObject.GetComponent <IconController>();
     subIconController.Image          = Resources.Load <Sprite>(jsonNode["_baseIconPath"]);
     subIconController.SpritePosition = subIconPosition;
     subIconController.SpriteScale    = subIconScale;
 }
Ejemplo n.º 9
0
        /// -----------------------------------------------------------------------------
        /// <summary>
        ///     Page load, bind tree and enable controls
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        /// <remarks>
        /// </remarks>
        /// <history>
        ///     [tamttt] 20/10/2004	Created
        /// </history>
        /// -----------------------------------------------------------------------------
        protected override void OnLoad(EventArgs e)
        {
            base.OnLoad(e);

            DNNtree.NodeClick += DNNTree_NodeClick;
            cmdAddList.Click  += cmdAddList_Click;

            try
            {
                if (!Page.IsPostBack)
                {
                    //configure tree
                    DNNtree.ImageList.Add(IconController.IconURL("Folder"));
                    DNNtree.ImageList.Add(IconController.IconURL("File"));
                    DNNtree.IndentWidth        = 10;
                    DNNtree.CollapsedNodeImage = IconController.IconURL("Max", "12X12");
                    DNNtree.ExpandedNodeImage  = IconController.IconURL("Min", "12X12");

                    if (Request.QueryString["Key"] != null)
                    {
                        Mode = "ListEntries";
                        BindList(Request.QueryString["Key"]);
                    }
                    else
                    {
                        Mode = "NoList";
                    }
                    BindTree();
                }
            }
            catch (Exception exc) //Module failed to load
            {
                Exceptions.ProcessModuleLoadException(this, exc);
            }
        }
    public void OnIconBeginDrag(PointerEventData eventData, GameObject page)
    {
//		Log (TAG, "OnIconBeginDrag eventData.position:"+eventData.position);
        iconMovingInfo.beginIconDrag = true;
        IconController action = currentDragIcon.GetComponent <IconController> ();

        action.OnBeginDrag(eventData);
    }
    public void DestoryApp(int index, bool anim)
    {
        appList.RemoveAt(index);
        IconController iconController = pageChildList [index].GetComponent <IconController> ();

        pageChildList.RemoveAt(index);
        iconController.DestorySelt(anim);
    }
Ejemplo n.º 12
0
        private static string GetFileIconUrl(string extension)
        {
            if (!string.IsNullOrEmpty(extension) && File.Exists(HttpContext.Current.Server.MapPath(IconController.IconURL("Ext" + extension, "32x32", "Standard"))))
            {
                return(IconController.IconURL("Ext" + extension, "32x32", "Standard"));
            }

            return(IconController.IconURL("ExtFile", "32x32", "Standard"));
        }
    /// <summary>
    /// Changes the index of the app by.
    /// </summary>
    /// <param name="index">Index.</param>
    /// <param name="app">App.</param>
    void ChangeAppByIndex(int index, App app)
    {
        appList.RemoveAt(index);
        appList.Insert(index, app);
        GameObject     icon           = pageChildList [index];
        IconController iconController = icon.GetComponent <IconController> ();

        iconController.setApp(app);
    }
    public void DestoryIcon(int index)
    {
        App app = appList [index];

        app.SetIsPlaceholder(true);
        IconController iconController = pageChildList [index].GetComponent <IconController> ();

        iconController.DestoryIcon();
    }
Ejemplo n.º 15
0
    void Start()
    {
        uiControl = FindObjectOfType<UIController>();
        iconControl = FindObjectOfType<IconController>();
        player = FindObjectOfType<Player>();
        nameElements = panels[0].GetComponentsInChildren<Text>();
        sliders = GetComponentsInChildren<StatSlider>();

        values = new float[4];
    }
    /// <summary>
    /// Clears the regress.
    /// </summary>
    public void ClearRegress()
    {
        List <GameObject> iconList = pageChildList;

        foreach (GameObject icon in iconList)
        {
            IconController iconController = icon.GetComponent <IconController> ();
            iconController.regressLocation = null;
        }
    }
Ejemplo n.º 17
0
    void Start()
    {
        iconContol = FindObjectOfType<IconController>();
        hex = GetComponentInParent<Hex>();
        icon = GetComponent<Image>();

        hexVeg = hex.GetVegetation();
        prevVeg = hexVeg;

        icon.color = iconContol.GetHexVegColor(hexVeg);
    }
Ejemplo n.º 18
0
    void Start()
    {
        iconContol = FindObjectOfType<IconController>();
        hex = GetComponentInParent<Hex>();
        icon = GetComponent<Image>();

        hexTemp = hex.GetTemp();
        prevTemp = hexTemp;

        icon.color = iconContol.GetHexTempColor(hexTemp);
    }
Ejemplo n.º 19
0
        public void PomodoroTest()
        {
            using (var cs = new CherryService())
            {
                var ps = new PomodoroSensor();
                cs.PluginRepository.RegisterPlugin(ps);
                var tp = new FakeTimeProvider();
                cs.PluginRepository.RegisterPlugin(tp);
                cs.PluginRepository.RegisterPlugin(new FakeWindowsController());
                cs.PluginRepository.RegisterPlugin(new FakeSettingsController());
                var ic = new IconController();
                cs.PluginRepository.RegisterPlugin(ic);
                cs.PluginRepository.RegisterPlugin(new DatabaseController());

                var im = new FakeImController();
                cs.PluginRepository.RegisterPlugin(im);

                cs.InitializeCherryServiceEventsAndCommands();
                cs.PluginRepository.TieEvents();

                cs.PluginRepository.CherryCommands["Start Pomodoro"].Do(null);
                ic.UpdateToolTipTextMessage();

                Assert.True(ps.CurrentlyInPomodoro);
                Assert.That(ps.GetCurrentStatusData().Remaining.Minutes, Is.EqualTo(25));
                Assert.That(im.InPomodoro);
                Assert.That(ps.GetCurrentStatusData().MinutesLeft, Is.EqualTo(25));
                Assert.IsTrue(ic.ToolTipText.StartsWith("In pomodoro. 25 minutes left"));

                tp.AdvanceMinutes(3);
                ic.UpdateToolTipTextMessage();
                Assert.True(ps.CurrentlyInPomodoro);
                Assert.That(ps.GetCurrentStatusData().Remaining.Minutes, Is.EqualTo(22));
                Assert.That(ps.GetCurrentStatusData().MinutesLeft, Is.EqualTo(22));
                Assert.IsTrue(ic.ToolTipText.StartsWith("In pomodoro. 22 minutes left"));

                tp.AdvanceMinutes(22);
                ps.StopPomodoroInternal(true);
                Assert.That(ic.ToolTipText, Is.EqualTo("Pomodoro completed"));

                // Poll eniough times to make icon controller stop flashing.
                ic.StopFlashing();

                tp.AdvanceMinutes(10);
                ic.UpdateToolTipTextMessage();
                //Assert.That(cs.GetTimeSinceLastPomodoro().TotalMinutes, Is.EqualTo(10));
                Assert.That(im.InPomodoro, Is.False);
                Assert.IsTrue(ic.ToolTipText.StartsWith("Out of pomodoro for 10 minutes"));

                tp.AdvanceMinutes(59);
                ic.UpdateToolTipTextMessage();
                Assert.IsTrue(ic.ToolTipText.StartsWith("Out of pomodoro for 1 hour"));
            }
        }
Ejemplo n.º 20
0
    void Start()
    {
        iconContol = FindObjectOfType<IconController>();
        hex = GetComponentInParent<Hex>();
        icon = GetComponent<Image>();

        hexClimate = hex.GetClimate();
        prevClimate = hexClimate;

        icon.color = iconContol.GetHexClimateColor(hexClimate);
    }
Ejemplo n.º 21
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (IsEditable)
     {
         string pencil = string.Format("<a href=\"{0}\" title=\"{1}\"><img src=\"{2}\" style=\"border: 0px none;\"></a>",
                                       EditUrl,
                                       Localization.GetString("cmdEdit.Text"),
                                       IconController.IconURL("Edit"));
         Label = String.Format("{0}&nbsp;{1}", pencil, Label);
     }
 }
Ejemplo n.º 22
0
 public static string IconURL(string iconKey)
 {
     return(IconController.IconURL(iconKey));
     //switch (iconKey.ToLowerInvariant()  )
     //{
     //    case "wizard":
     //        iconKey = "icon_wizard_16px";
     //        break;
     //}
     //return String.Format("~/images/{0}.gif", iconKey);
 }
    void cancelSelected()
    {
        if (currentSelectedIcon != null)
        {
//			mLauncherController.Log (TAG, "DestroySelectedBackground");
            IconController action = currentSelectedIcon.GetComponent <IconController> ();
            action.DestroySelectedBackground();
//			mLauncherController.Log (TAG, "currentSelectedIcon = null");
            currentSelectedIcon = null;
        }
    }
    void RightSildeSwap()
    {
        launcherController.Log(TAG, "RightSildeSwap");
        LauncherModel     launcherModel = launcherController.launcherModel;
        List <App>        appList       = launcherController.appList;
        List <GameObject> iconList      = launcherController.pageChildList;

        int            firstIndexOnDropPage = swapInfo.dropPage * launcherModel.pageItemNum;
        IconController iconController       = iconList [firstIndexOnDropPage].GetComponent <IconController> ();

        if (iconController.regressLocation != null)
        {
            //regress
            if (appList [swapInfo.dropIndex].isPlaceholder)
            {
                swapInfo.dropIndex    = swapInfo.firstEmptyIconIndexOnDropPage - 1;
                swapInfo.dropModel    = appList [swapInfo.dropIndex];
                swapInfo.dropIcon     = iconList [swapInfo.dropIndex];
                swapInfo.dropLocation = swapInfo.dropIcon.GetComponent <IconController> ().originLocation;
            }
            //drag page icon 往前挪
            launcherController.IconAdvance(swapInfo.dragIndex, swapInfo.dragIndex + 1, swapInfo.dropIndex, true);
            appList.RemoveAt(swapInfo.dragIndex);
            iconList.RemoveAt(swapInfo.dragIndex);
            appList.Insert(swapInfo.dropIndex, swapInfo.dragModel);
            iconList.Insert(swapInfo.dropIndex, swapInfo.dragIcon);
        }
        else
        {
            //drag page icon 往前挪
            launcherController.IconAdvance(swapInfo.dragIndex, swapInfo.dragIndex + 1, swapInfo.lastIndexOnDragPage, false);
            appList.RemoveAt(swapInfo.dragIndex);
            iconList.RemoveAt(swapInfo.dragIndex);
            //drag page 末尾插入一个占位icon
            launcherController.addPlaceholder(swapInfo.dragPage, swapInfo.lastIndexOnDragPage, swapInfo.lastLocationOnDragPage);

            if (appList [swapInfo.dropIndex].isPlaceholder)
            {
//				launcherController.Log (TAG, "RightSildeSwap DestoryFirstEmptyOnDropPageAndResetDropInfo");
                DestoryFirstEmptyOnDropPageAndResetDropInfo();
            }
            else
            {
                //drop page icon 往后挪
//				launcherController.Log (TAG, "RightSildeSwap launcherController.IconBackward");
                launcherController.IconBackward(swapInfo.dropIndex, iconList.Count - 1, true);
                appList.Insert(swapInfo.dropIndex, swapInfo.dragModel);
                iconList.Insert(swapInfo.dropIndex, swapInfo.dragIcon);
            }
        }
//		launcherController.Log (TAG, "RightSildeSwap SetOriLocation (swapInfo.dropLocation):"+swapInfo.dropLocation);
        swapInfo.dragIcon.GetComponent <IconController> ().SetOriLocation(swapInfo.dropLocation);
        iconMovingInfo.dragIndex = iconMovingInfo.dropIndex;
    }
Ejemplo n.º 25
0
        private static void LookupScriptValues(Control ctl, out string grantImagePath, out string denyImagePath, out string nullImagePath, out string lockImagePath, out string grantAltText, out string denyAltText, out string nullAltText)
        {
            grantImagePath = IconController.IconURL("Grant");
            denyImagePath  = IconController.IconURL("Deny");
            nullImagePath  = IconController.IconURL("Unchecked");
            lockImagePath  = IconController.IconURL("Lock");

            grantAltText = Localization.GetString("PermissionTypeGrant");
            denyAltText  = Localization.GetString("PermissionTypeDeny");
            nullAltText  = Localization.GetString("PermissionTypeNull");
        }
Ejemplo n.º 26
0
        protected string GetFolderIconUrl(int portalId, int folderMappingID)
        {
            var imageUrl = FolderMappingController.Instance.GetFolderMapping(portalId, folderMappingID).ImageUrl;

            if (File.Exists(HttpContext.Current.Server.MapPath(imageUrl)))
            {
                return(imageUrl);
            }

            return(IconController.IconURL("ExtClosedFolder", "32x32", "Standard"));
        }
Ejemplo n.º 27
0
    // Come up with a better method name
    public void betterMethodName(JSONNode jsonNode, GameObject menuItem)
    {
        hoverObject     = menuItem.transform.FindChild("hover").gameObject;
        hoverController = hoverObject.GetComponent <CollisionController>();

        pressObject     = menuItem.transform.FindChild("press").gameObject;
        pressController = pressObject.GetComponent <CollisionController>();

        iconController = menuItem.GetComponent <IconController>();

        audioController = GameObject.Find("MenuHolder").GetComponent <AudioController>();
    }
    void showSelected(PointerEventData eventData)
    {
        if (currentSelectedIcon == null)
        {
            int index = PointToIndex(eventData.position);
//			mLauncherController.Log (TAG, "showSelected index:"+index);
            currentSelectedIcon = mLauncherController.pageChildList [index];
            IconController action = currentSelectedIcon.GetComponent <IconController> ();
//			mLauncherController.Log (TAG, "ShowSelectedBackground");
            action.ShowSelectedBackground();
        }
    }
    public void OnIconPointerUp(PointerEventData eventData, GameObject page)
    {
//		Log (TAG, "OnIconPointerUp eventData.position:"+eventData.position);
        IconController action = currentDragIcon.GetComponent <IconController> ();

        action.OnPointerUp(eventData);
        if (!iconMovingInfo.beginIconDrag)
        {
//			Log (TAG, "!iconMovingInfo.beginIconDrag");
            action.OnEndDrag(eventData);
            OnIconEndDrag(eventData, page);
        }
    }
    /// <summary>
    /// Clears the empty page.
    /// </summary>
    public void ClearEmptyPage()
    {
        Log(TAG, "ClearEmptyPage");
        List <GameObject> iconList = pageChildList;

        foreach (GameObject icon in iconList)
        {
            IconController iconController = icon.GetComponent <IconController> ();
//			Log (TAG, "app:"+iconController.app.appName+" originLocation:"+iconController.originLocation);
        }
        List <GameObject> removes = new List <GameObject> ();

        for (int i = 0; i < pageList.Count; i++)
        {
            GameObject page    = pageList [i];
            bool       isEmpty = true;
            int[]      bound   = getPageBoundByIndex(i);
            for (int j = bound [0]; j <= bound [1]; j++)
            {
                App app = appList [j];
                if (!app.isPlaceholder)
                {
                    isEmpty = false;
                    break;
                }
            }
            Log(TAG, "page num:" + i + " isEmpty:" + isEmpty);
            if (isEmpty)
            {
                removes.Add(page);
            }
        }
        bool destoryCurrentPage = false;
        int  recordIndex        = -1;

        foreach (GameObject page in removes)
        {
            PageLayout pageLayout = page.GetComponent <PageLayout> ();
            int        pageNum    = pageLayout.pageNumber;
            if (pageNum == pageController.getCurrentPosition())
            {
                destoryCurrentPage = true;
                recordIndex        = pageNum;
            }
            DestoryPage(page);
        }
        if (destoryCurrentPage)
        {
            pageController.PageEntry(recordIndex - 1);
        }
    }
Ejemplo n.º 31
0
        public static bool Contains(string id, ref bool __result)
        {
            if (string.IsNullOrEmpty(id) || id[0] != '@')
            {
                return(true);
            }

            __result = IconController.Contains(id);
            if (!__result)
            {
                Control.LogError($"Custom icon {id} not exists!");
            }
            return(false);
        }
	public void OnDrop(PointerEventData data)
	{
		mLauncherController.Log (TAG, "OnDrop");
		Fall ();
		if (controlFlag) {
			controlFlag = false;
			GameObject originalObj = mIconDragController.currentDragIcon;
			IconController iconController = originalObj.GetComponent<IconController> ();
			iconController.showText ();
			uninstallApp = iconController.getApp ();
			AskForUninstall (uninstallApp.packageName);
		}

	}
Ejemplo n.º 33
0
        private void BindTree()
        {
            var ctlLists    = new ListController();
            var colLists    = ctlLists.GetListInfoCollection(string.Empty, string.Empty, PortalSettings.ActiveTab.PortalID);
            var indexLookup = new Hashtable();

            listTree.Nodes.Clear();

            foreach (ListInfo list in colLists)
            {
                String filteredNode;
                if (list.DisplayName.Contains(":"))
                {
                    var finalPeriod = list.DisplayName.LastIndexOf(".", StringComparison.InvariantCulture);
                    filteredNode = list.DisplayName.Substring(finalPeriod + 1);
                }
                else
                {
                    filteredNode = list.DisplayName;
                }
                var node = new DnnTreeNode {
                    Text = filteredNode
                };
                {
                    node.Value    = list.Key;
                    node.ToolTip  = String.Format(LocalizeString("NoEntries"), list.EntryCount);
                    node.ImageUrl = IconController.IconURL("Folder");
                }
                if (list.Level == 0)
                {
                    listTree.Nodes.Add(node);
                }
                else
                {
                    if (indexLookup[list.ParentList] != null)
                    {
                        var parentNode = (DnnTreeNode)indexLookup[list.ParentList];

                        parentNode.Nodes.Add(node);
                    }
                }

                //Add index key here to find it later, should suggest with Joe to add it to DNNTree
                if (indexLookup[list.Key] == null)
                {
                    indexLookup.Add(list.Key, node);
                }
            }
        }
Ejemplo n.º 34
0
        // ReSharper restore LoopCanBeConvertedToQuery

        private string GetThumbUrl(IFileInfo file)
        {
            if (IsImageFile(file.RelativePath))
            {
                return(FileManager.Instance.GetUrl(file));
            }

            var fileIcon = IconController.IconURL("Ext" + file.Extension, "32x32");

            if (!System.IO.File.Exists(Request.GetHttpContext().Server.MapPath(fileIcon)))
            {
                fileIcon = IconController.IconURL("File", "32x32");
            }
            return(fileIcon);
        }
Ejemplo n.º 35
0
 void Awake()
 {
     gridLogic = GameObject.Find("Grid").GetComponent<GridLogic>();
     iconController = GameObject.Find("Icons").GetComponent<IconController>();
 }
Ejemplo n.º 36
0
    void Awake()
    {
        backgroundSprites = IconController.GetAllHexBackgrounds();
        player = FindObjectOfType<Player>();
        turnTimer = FindObjectOfType<TurnTimer>();
        iconControl = FindObjectOfType<IconController>();
        hud = GetComponentInChildren<HexHUD>();
        Sprites = GetComponentsInChildren<SpriteRenderer>();
        happyMeter = GetComponentInChildren<HappinessMeter>();
        hudItems = GetComponentsInChildren<HexHudItem>();

        Main = FindObjectOfType<Camera>();
        Transform parentTransform = FindObjectOfType<MapController>().transform;
        transform.SetParent(parentTransform);

        if(!restrictionsPanel){
            restrictionsPanel = GetComponentInChildren<HexRestrictions>();
        }

        EnableHex();

        Sprites[0].material.color = new Color32(140, 140 , 140, 220);
        Sprites[1].color = SetTempColors();
        Sprites[2].sprite = SetBiomeSprite();

        localPlantFood = DefineMaxPlantFood();
        insectFood = DefineMaxInsectFood();
        fishFood = DefineMaxFishFood();
        meatHealth = .99f;

        if(localType == BiomeType.SALTWATER){
            fishFood *= 2;
        }
        else if(localType == BiomeType.FRESHWATER)
        {
            fishFood *= 1.5f;
        }

        CalculateFishHealth();
        CalculateInsectHealth();
        GrowFood();
        meatHealth = CalculateMeatHealth();
        CalculateWasteFood(previousExcessMeatFood);

        //print ("Hex# " + number + "  - Plants: " + localPlantFood + "  - Insects: " + insectFood + "  - Fish: " + fishFood + "\r\n");
    }