/// <summary>
        /// Selects the tab.
        /// </summary>
        /// <param name="activeTab">The active tab.</param>
        /// <param name="highligthOnly">if set to <c>true</c> [highligth only].</param>
        /// <exception cref="System.Exception">Unknown TabType</exception>
        public void SelectTab(TabType activeTab, bool highligthOnly = false)
        {
            ActiveTab = activeTab;

            if (highligthOnly)
            {
                this.Log().Debug("OnTabSelected (highligthOnly) => {0}", activeTab);
                return;
            }

            this.Log().Debug("OnTabSelected => {0}", activeTab);

            Tuple<IRoutableViewModel, IRoutingParams> tabViewModel = null;
            var app = Locator.CurrentMutable.GetService<IApp>();
            var viewModelPool = app.AppModel.ViewModelPool;

            //TODO: OnTabSelected-logic in RootViewModel
            if (!viewModelPool.ContainsKey(activeTab.ToString()))
            {
                this.Log().Debug("OnTabSelected => New TabViewModel {0}", activeTab);
                if (activeTab == TabType.WatchList)
                {
                    tabViewModel = Tuple.Create(new WatchListViewModel(app.AppModel) as IRoutableViewModel,
                            new CustomRoutingParams { ReuseExistingView = true } as IRoutingParams);
                    viewModelPool.Add(activeTab.ToString(), tabViewModel);
                }
                else if (activeTab == TabType.Search)
                {
                    tabViewModel = Tuple.Create(new SearchViewModel(app.AppModel) as IRoutableViewModel,
                            new CustomRoutingParams { ReuseExistingView = true } as IRoutingParams);
                    viewModelPool.Add(activeTab.ToString(), tabViewModel);
                }
                else if (activeTab == TabType.Settings)
                {
                    tabViewModel = Tuple.Create(new SettingsViewModel(app.AppModel) as IRoutableViewModel,
                            new CustomRoutingParams { ReuseExistingView = true } as IRoutingParams);
                    viewModelPool.Add(activeTab.ToString(), tabViewModel);
                }
                else
                {
                    throw new Exception("Unknown TabType");
                }
            }
            else
            {
                this.Log().Debug("OnTabSelected => Reuse TabViewModel {0}", activeTab);
                tabViewModel = viewModelPool[activeTab.ToString()];
            }

            app.Navigate(tabViewModel.Item1, tabViewModel.Item2);
        }
        public void ProcessRequest(System.Web.HttpContext context)
        {
            PortalSettings _portalSettings = PortalController.GetCurrentPortalSettings();
            int            TabId           = -1;
            int            ModuleId        = -1;

            try
            {
                if (context.Request.QueryString["tabid"] != null)
                {
                    Int32.TryParse(context.Request.QueryString["tabid"], out TabId);
                }
                if (context.Request.QueryString["mid"] != null)
                {
                    Int32.TryParse(context.Request.QueryString["mid"], out ModuleId);
                }
            }
            catch (Exception ex)
            {
                ex.ToString();
                throw new HttpException(404, "Not Found");
            }
            string Language = _portalSettings.DefaultLanguage;

            if (context.Request.QueryString["language"] != null)
            {
                Language = context.Request.QueryString["language"];
            }
            else
            {
                if (context.Request.Cookies["language"] != null)
                {
                    Language = context.Request.Cookies["language"].Value;
                }
            }
            if (Localization.Localization.LocaleIsEnabled(Language))
            {
                System.Threading.Thread.CurrentThread.CurrentCulture = new CultureInfo(Language);
                Localization.Localization.SetLanguage(Language);
            }
            string URL              = "";
            bool   blnClientCache   = true;
            bool   blnForceDownload = false;

            if (context.Request.QueryString["fileticket"] != null)
            {
                URL = "FileID=" + UrlUtils.DecryptParameter(context.Request.QueryString["fileticket"]);
            }
            if (context.Request.QueryString["userticket"] != null)
            {
                URL = "UserId=" + UrlUtils.DecryptParameter(context.Request.QueryString["userticket"]);
            }
            if (context.Request.QueryString["link"] != null)
            {
                URL = context.Request.QueryString["link"];
                if (URL.ToLowerInvariant().StartsWith("fileid="))
                {
                    URL = "";
                }
            }
            if (!String.IsNullOrEmpty(URL))
            {
                UrlController objUrls = new UrlController();
                objUrls.UpdateUrlTracking(_portalSettings.PortalId, URL, ModuleId, -1);
                TabType UrlType = Globals.GetURLType(URL);
                if (UrlType != TabType.File)
                {
                    URL = Common.Globals.LinkClick(URL, TabId, ModuleId, false);
                }
                if (UrlType == TabType.File && URL.ToLowerInvariant().StartsWith("fileid=") == false)
                {
                    FileController objFiles = new FileController();
                    URL = "FileID=" + objFiles.ConvertFilePathToFileId(URL, _portalSettings.PortalId);
                }
                if (context.Request.QueryString["clientcache"] != null)
                {
                    blnClientCache = bool.Parse(context.Request.QueryString["clientcache"]);
                }
                if ((context.Request.QueryString["forcedownload"] != null) || (context.Request.QueryString["contenttype"] != null))
                {
                    blnForceDownload = bool.Parse(context.Request.QueryString["forcedownload"]);
                }
                context.Response.Clear();
                try
                {
                    switch (UrlType)
                    {
                    case TabType.File:
                        if (TabId == Null.NullInteger)
                        {
                            if (!FileSystemUtils.DownloadFile(_portalSettings.PortalId, int.Parse(UrlUtils.GetParameterValue(URL)), blnClientCache, blnForceDownload))
                            {
                                throw new HttpException(404, "Not Found");
                            }
                        }
                        else
                        {
                            if (!FileSystemUtils.DownloadFile(_portalSettings, int.Parse(UrlUtils.GetParameterValue(URL)), blnClientCache, blnForceDownload))
                            {
                                throw new HttpException(404, "Not Found");
                            }
                        }
                        break;

                    case TabType.Url:
                        if (objUrls.GetUrl(_portalSettings.PortalId, URL) != null)
                        {
                            context.Response.Redirect(URL, true);
                        }
                        break;

                    default:
                        context.Response.Redirect(URL, true);
                        break;
                    }
                }
                catch (ThreadAbortException ex)
                {
                    ex.ToString();
                }
                catch (Exception ex)
                {
                    ex.ToString();
                    throw new HttpException(404, "Not Found");
                }
            }
            else
            {
                throw new HttpException(404, "Not Found");
            }
        }
 void SetPlaneSecondaryChoice()
 {
   this._primaryChoice = TabType.Planes;
   string[] names = new string[] { "Front" };
   string name = "Front";
   View.InitializeSecondaryChoice(names, name);
 }
 void SetHorzVertSecondaryChoice()
 {
   string[] names = new string[2] { "X-Scale", "Y-Scale" };
   string name = names[_currentScale];
   this._primaryChoice = TabType.Scales;
   View.InitializeSecondaryChoice(names, name);
 }
示例#5
0
        private void CreateNewTab(TabType tt, string tourl, bool delayed)
        {
            if (!string.IsNullOrEmpty(tourl))
            {
                for (var index = 1; index < tabControlLeft.TabPages.Count; index++)
                {
                    if (!tourl.Equals(TabGetUrl(index), StringComparison.OrdinalIgnoreCase))
                    {
                        continue;
                    }

                    if (!delayed)
                    {
                        tabControlLeft.SelectedIndex = index;
                    }

                    return;
                }
            }

            var tabc = new TabClass {
                MyType = tt, Address = tourl, AddressInit = tourl, Delayed = delayed
            };

            var tabpage = new TabPage();

            ExtendedWebBrowser browser = null;
            TextBox            textbox = null;

            if (tabc.MyType != TabType.Notepad)
            {
                browser = new ExtendedWebBrowser {
                    Dock = DockStyle.Fill, ScriptErrorsSuppressed = true, ObjectForScripting = new ScriptManager()
                };                                                                                                                                   // !!!
                browser.BeforeNewWindow += wbTab_BeforeNewWindow;
                tabc.WB = browser;
            }
            else
            {
                textbox = new TextBox
                {
                    BorderStyle = BorderStyle.None,
                    Dock        = DockStyle.Fill,
                    Font        = new Font("Courier New", 9F, FontStyle.Regular, GraphicsUnit.Point, 204),
                    Multiline   = true,
                    ScrollBars  = ScrollBars.Both,
                };

                textbox.Leave          += (sender, e) => AppVars.Profile.Notepad = ((TextBox)sender).Text;
                textbox.Text            = AppVars.Profile.Notepad;
                textbox.SelectionStart  = textbox.Text.Length;
                textbox.SelectionLength = 1;
                tabc.Note = textbox;
            }

            //  panel

            var panel = new Panel();

            if (browser != null)
            {
                panel.Controls.Add(browser);
            }
            else
            {
                panel.Controls.Add(textbox);
            }

            panel.Dock     = DockStyle.Fill;
            panel.Location = new Point(3, 28);
            panel.Name     = Guid.NewGuid().ToString();
            panel.Padding  = new Padding(0, 3, 0, 0);
            panel.Size     = new Size(666, 461);

            // buttonback

            ToolStripButton buttonback = null;

            if (tabc.MyType == TabType.Forum || tabc.MyType == TabType.Log || tabc.MyType == TabType.Other)
            {
                buttonback = new ToolStripButton
                {
                    Image = Resources._16x16_back,
                    ImageTransparentColor = Color.Magenta,
                    Name        = Guid.NewGuid().ToString(),
                    Size        = new Size(58, 22),
                    Text        = @"Назад",
                    ToolTipText = @"Возврат на предыдущую страницу",
                    Tag         = browser
                };
                buttonback.Click += buttonForumBack_Click;
            }

            // buttonrefresh

            ToolStripButton buttonrefresh = null;

            if ((tabc.MyType != TabType.Notepad) && (tabc.MyType != TabType.TodayChat))
            {
                buttonrefresh = new ToolStripButton
                {
                    Image = Resources._16x16_refresh,
                    ImageTransparentColor = Color.Magenta,
                    Name        = Guid.NewGuid().ToString(),
                    Size        = new Size(77, 22),
                    Text        = "Обновить",
                    ToolTipText = "Обновление текущей страницы",
                    Tag         = browser
                };
                buttonrefresh.Click += buttonForumRefresh_Click;
            }

            // buttonreload

            ToolStripButton buttonreload = null;

            if (tabc.MyType == TabType.TodayChat)
            {
                buttonreload = new ToolStripButton
                {
                    Image = Resources._16x16_refresh,
                    ImageTransparentColor = Color.Magenta,
                    Name        = Guid.NewGuid().ToString(),
                    Size        = new Size(77, 22),
                    Text        = "Перечитать",
                    ToolTipText = "Обновление сегодняшнего чата",
                    Tag         = browser
                };
                buttonreload.Click += buttonReload_Click;
            }

            // buttonclose

            var buttonclose = new ToolStripButton
            {
                Image = Resources._16x16_close,
                ImageTransparentColor = Color.Magenta,
                Name        = Guid.NewGuid().ToString(),
                Size        = new Size(71, 22),
                Text        = "Закрыть",
                ToolTipText = "Закрытие этой закладки",
                Tag         = tabpage
            };

            buttonclose.Click += buttonForumClose_Click;

            // toolstripseparator1

            ToolStripSeparator toolstripseparator1 = null;

            if (tabc.MyType != TabType.Notepad)
            {
                toolstripseparator1 = new ToolStripSeparator {
                    Name = Guid.NewGuid().ToString(), Size = new Size(6, 25)
                };
            }

            // buttoncompas

            ToolStripButton buttoncompas = null;

            if (tabc.MyType == TabType.PInfo || tabc.MyType == TabType.PName)
            {
                if (!string.IsNullOrEmpty(tourl))
                {
                    var nick = tabc.MyType == TabType.PInfo
                                   ?
                               HelperConverters.NickDecode(tourl.Substring(Resources.AddressPInfo.Length))
                                   :
                               HelperConverters.NickDecode(tourl.Substring(Resources.AddressPName.Length));

                    buttoncompas = new ToolStripButton
                    {
                        Image = Resources._16x16_compas,
                        ImageTransparentColor = Color.Magenta,
                        Name        = Guid.NewGuid().ToString(),
                        Size        = new Size(64, 22),
                        Text        = "Компас",
                        ToolTipText = "Поиск точного положения на природе",
                        Tag         = nick,
                        Enabled     = true
                    };
                    buttoncompas.Click += buttonCompas_Click;
                }
            }


            // buttonprivate

            ToolStripButton buttonprivate = null;

            if (tabc.MyType == TabType.PInfo || tabc.MyType == TabType.PName)
            {
                if (!string.IsNullOrEmpty(tourl))
                {
                    var nick = tabc.MyType == TabType.PInfo
                                   ?
                               HelperConverters.NickDecode(tourl.Substring(Resources.AddressPInfo.Length))
                                   :
                               HelperConverters.NickDecode(tourl.Substring(Resources.AddressPName.Length));

                    buttonprivate = new ToolStripButton
                    {
                        Image = Resources._16x16_private,
                        ImageTransparentColor = Color.Magenta,
                        Name        = Guid.NewGuid().ToString(),
                        Size        = new Size(64, 22),
                        Text        = "Приват",
                        ToolTipText = "Обратиться в приват",
                        Tag         = nick
                    };
                    buttonprivate.Click += buttonPrivate_Click;
                }
            }

            // buttoncontact

            ToolStripButton buttoncontact = null;

            if (tabc.MyType == TabType.PInfo || tabc.MyType == TabType.PName)
            {
                if (!string.IsNullOrEmpty(tourl))
                {
                    var nick = tabc.MyType == TabType.PInfo
                                   ?
                               HelperConverters.NickDecode(tourl.Substring(Resources.AddressPInfo.Length))
                                   :
                               HelperConverters.NickDecode(tourl.Substring(Resources.AddressPName.Length));

                    buttoncontact = new ToolStripButton
                    {
                        Image = Resources._16x16_person,
                        ImageTransparentColor = Color.Magenta,
                        Name        = Guid.NewGuid().ToString(),
                        Size        = new Size(64, 22),
                        Text        = "В контакты",
                        ToolTipText = "Добавить в контакты",
                        Tag         = nick
                    };

                    buttoncontact.Click += buttonContact_Click;
                }
            }

            // buttonaddclan

            ToolStripButton buttonAddClan = null;

            if (tabc.MyType == TabType.PInfo || tabc.MyType == TabType.PName)
            {
                if (!string.IsNullOrEmpty(tourl))
                {
                    var nick = tabc.MyType == TabType.PInfo
                                   ?
                               HelperConverters.NickDecode(tourl.Substring(Resources.AddressPInfo.Length))
                                   :
                               HelperConverters.NickDecode(tourl.Substring(Resources.AddressPName.Length));

                    buttonAddClan = new ToolStripButton
                    {
                        Image = Resources._16x16_person,
                        ImageTransparentColor = Color.Magenta,
                        Name        = Guid.NewGuid().ToString(),
                        Size        = new Size(64, 22),
                        Text        = @"Весь клан",
                        ToolTipText = @"Добавление всего клана в контакты",
                        Tag         = nick,
                        Enabled     = true
                    };
                    buttonAddClan.Click += buttonAddClan_Click;
                }
            }

            // buttonscreen

            ToolStripButton buttonscreen = null;

            if ((tabc.MyType != TabType.Notepad) && (tabc.MyType != TabType.TodayChat))
            {
                buttonscreen = new ToolStripButton
                {
                    Image = Resources._16x16_camera,
                    ImageTransparentColor = Color.Magenta,
                    Name        = Guid.NewGuid().ToString(),
                    Size        = new Size(64, 22),
                    Text        = "Снимок",
                    ToolTipText = "Снимок текущей закладки",
                    Tag         = browser
                };
                buttonscreen.Click += buttonForumScreen_Click;
            }

            // separator

            ToolStripSeparator toolstripseparator2 = null;

            if ((tabc.MyType != TabType.Notepad) && (tabc.MyType != TabType.TodayChat))
            {
                toolstripseparator2 = new ToolStripSeparator {
                    Name = Guid.NewGuid().ToString(), Size = new Size(6, 25)
                };
            }

            // buttonaddress

            ToolStripButton buttonaddress = null;

            if ((tabc.MyType != TabType.Notepad) && (tabc.MyType != TabType.TodayChat))
            {
                buttonaddress = new ToolStripButton
                {
                    DisplayStyle          = ToolStripItemDisplayStyle.Image,
                    Image                 = Resources._16x16_copyurl,
                    ImageTransparentColor = Color.Magenta,
                    Name        = Guid.NewGuid().ToString(),
                    Size        = new Size(23, 22),
                    ToolTipText = "Копировать адрес в клипборд"
                };
                buttonaddress.Click += buttonForumCopyAddress_Click;
            }

            // labeladdress

            ToolStripStatusLabel labeladdress = null;

            if ((tabc.MyType != TabType.Notepad) && (tabc.MyType != TabType.TodayChat))
            {
                labeladdress = new ToolStripStatusLabel
                {
                    Enabled      = false,
                    Name         = Guid.NewGuid().ToString(),
                    Size         = new Size(65, 22),
                    Text         = tabc.AddressInit,
                    TextAlign    = ContentAlignment.MiddleLeft,
                    DisplayStyle = ToolStripItemDisplayStyle.Text
                };
            }

            if (browser != null)
            {
                browser.Tag = labeladdress;
                browser.DocumentCompleted += wbTab_DocumentCompleted;
            }

            //
            //  toolstrip
            //

            var toolstrip = new ToolStrip();

            switch (tabc.MyType)
            {
            case TabType.Other:
            case TabType.Log:
            case TabType.Forum:
                toolstrip.Items.AddRange(new ToolStripItem[]
                {
                    buttonback,
                    buttonrefresh,
                    buttonclose,
                    toolstripseparator1,
                    buttonscreen,
                    toolstripseparator2,
                    buttonaddress,
                    labeladdress
                });
                break;

            case TabType.PBots:
            case TabType.Room:
                toolstrip.Items.AddRange(new ToolStripItem[]
                {
                    buttonrefresh,
                    buttonclose,
                    toolstripseparator1,
                    buttonscreen,
                    toolstripseparator2,
                    buttonaddress,
                    labeladdress
                });
                break;

            case TabType.PInfo:
            case TabType.PName:
                toolstrip.Items.AddRange(new ToolStripItem[]
                {
                    buttonrefresh,
                    buttonclose,
                    toolstripseparator1,
                    buttoncompas,
                    buttonprivate,
                    buttoncontact,
                    buttonAddClan,
                    buttonscreen,
                    toolstripseparator2,
                    buttonaddress,
                    labeladdress
                });

                break;

            case TabType.Notepad:
                toolstrip.Items.AddRange(new ToolStripItem[]
                {
                    buttonclose
                });
                break;

            case TabType.TodayChat:
                toolstrip.Items.AddRange(new ToolStripItem[]
                {
                    buttonreload,
                    buttonclose
                });
                break;
            }

            toolstrip.Location = new Point(3, 3);
            toolstrip.Name     = Guid.NewGuid().ToString();
            toolstrip.Size     = new Size(666, 25);

            tabpage.Controls.Add(panel);
            tabpage.Controls.Add(toolstrip);
            tabpage.Name     = Guid.NewGuid().ToString();
            tabpage.Location = new Point(4, 23);
            tabpage.Size     = new Size(672, 492);
            tabpage.Padding  = new Padding(3);
            tabpage.UseVisualStyleBackColor = true;

            switch (tt)
            {
            case TabType.Forum:
                tabpage.Text = "Форум";
                break;

            case TabType.PInfo:
                if (tourl != null)
                {
                    tabpage.Text = HelperConverters.NickDecode(tourl.Substring(Resources.AddressPInfo.Length));
                    tourl        = HelperConverters.AddressEncode(Resources.AddressPInfo + tabpage.Text);
                }

                tabpage.ImageIndex = 0;
                break;

            case TabType.PName:
                if (tourl != null)
                {
                    tabpage.Text = HelperConverters.NickDecode(tourl.Substring(Resources.AddressPName.Length));
                    tourl        = HelperConverters.AddressEncode(Resources.AddressPName + tabpage.Text);
                }

                tabpage.ImageIndex = 0;
                break;

            case TabType.PBots:
                if (tourl != null)
                {
                    tabpage.Text = "Бот " + tourl.Substring(Resources.AddressPBots.Length);
                }
                tabpage.ImageIndex = 0;
                break;

            case TabType.Log:
                if (tourl != null)
                {
                    var slog = tourl.Substring(Resources.AddressFightLog.Length);
                    var pos  = slog.IndexOf('&');
                    if (pos != -1)
                    {
                        slog = slog.Substring(0, pos);
                    }
                    tabpage.Text = "Бой " + slog;
                }
                break;

            case TabType.Room:
                if (tourl != null)
                {
                    tabpage.Text = "Комната " + tourl.Substring("http://www.neverlands.ru/ch.php?lo=1&r=".Length);
                }
                break;

            case TabType.Notepad:
                tabpage.Text       = "Блокнот";
                tabpage.ImageIndex = 1;
                break;

            case TabType.TodayChat:
                tabpage.Text = "Сегодняшний чат";
                break;

            case TabType.Other:
                if (tourl != null)
                {
                    tabpage.Text = new Uri(tourl).DnsSafeHost;
                }
                break;
            }

            if ((tt != TabType.Game) && (tt != TabType.Notepad) && (tt != TabType.TodayChat))
            {
                if (!delayed)
                {
                    tabc.WB.Navigate(tourl);
                }
            }

            if (tt == TabType.TodayChat)
            {
                if (!delayed)
                {
                    TabReload(buttonreload);
                }
            }

            tabc.Address = tourl;
            tabpage.Tag  = tabc;

            if ((tt == TabType.PInfo) && (tabpage.Text.Equals(AppVars.Profile.UserNick, StringComparison.OrdinalIgnoreCase)))
            {
                tabControlLeft.TabPages.Insert(1, tabpage);
            }
            else
            {
                tabControlLeft.TabPages.Add(tabpage);
            }

            if (delayed)
            {
                return;
            }

            SaveTabs();
            tabControlLeft.SelectedTab = tabpage;
        }
示例#6
0
 public PathView(string source, string destination, TabType tabName)
 {
     Source.FilePath      = source;
     Destination.FilePath = destination;
     TabName = tabName;
 }
示例#7
0
		int getTabLocation(TabType tab)
		{
			return tab == TabType.Future ? 1 : tab == TabType.Past ? 2 : 3;
		}
示例#8
0
		public EventPageStub(
			ObjectType parentObjectType,
			int parentObjectK,
			TabType tabType,
			int musicTypeK,
			int pageIndex,
			int requestedPageIndex,
			EventStub[] events)
		{
			this.parentObjectType = parentObjectType;
			this.parentObjectK = parentObjectK;
			this.tabType = tabType;
			this.musicTypeK = musicTypeK;
			this.pageIndex = pageIndex;
			this.requestedPageIndex = requestedPageIndex;
			this.events = events;
		}
示例#9
0
 public MainTabEventArgs(TabType tabStyle, string index)
 {
     TabStyle = tabStyle;
     Index = index;
 }
示例#10
0
 public void SelectTab(TabType key)
 {
     SetSelectedTab(Tabs.Single(t => t.Key == key));
 }
        private void BuildChart(List <FinancialDataModel> SchoolFinancialDataModels, string term, TabType revgroup, UnitType unit,
                                EstablishmentType estabType, ChartViewModel chart)
        {
            var historicalChartData = new List <HistoricalChartData>();

            foreach (var schoolData in SchoolFinancialDataModels)
            {
                decimal?amount    = null;
                decimal?rawAmount = null;
                try
                {
                    switch (unit)
                    {
                    case UnitType.AbsoluteMoney:
                    case UnitType.AbsoluteCount:
                        amount = GetFinancialDataValueForChartField(chart.FieldName, schoolData.FinancialDataObjectModel);
                        break;

                    case UnitType.PerTeacher:
                        rawAmount = GetFinancialDataValueForChartField(chart.FieldName, schoolData.FinancialDataObjectModel);
                        if (rawAmount == null)
                        {
                            break;
                        }
                        amount = (schoolData.TeacherCount == 0)
                                ? null
                                : (rawAmount / (decimal)schoolData.TeacherCount);
                        if (amount.HasValue)
                        {
                            amount = decimal.Round(amount.GetValueOrDefault(), 2, MidpointRounding.AwayFromZero);
                        }
                        break;

                    case UnitType.PerPupil:
                        rawAmount = GetFinancialDataValueForChartField(chart.FieldName, schoolData.FinancialDataObjectModel);
                        if (rawAmount == null)
                        {
                            break;
                        }
                        amount = (schoolData.PupilCount == 0)
                                ? null
                                : (rawAmount / (decimal)schoolData.PupilCount);
                        if (amount.HasValue)
                        {
                            amount = decimal.Round(amount.GetValueOrDefault(), 2, MidpointRounding.AwayFromZero);
                        }
                        break;

                    case UnitType.PercentageOfTotalExpenditure:
                        rawAmount = GetFinancialDataValueForChartField(chart.FieldName, schoolData.FinancialDataObjectModel);
                        if (rawAmount == null)
                        {
                            break;
                        }
                        if (schoolData.TotalExpenditure == 0)
                        {
                            amount = 0;
                        }
                        else
                        {
                            amount = (schoolData.TotalExpenditure == 0) ? 0 : (rawAmount / schoolData.TotalExpenditure) * 100;
                            amount = decimal.Round(amount.GetValueOrDefault(), 2, MidpointRounding.AwayFromZero);
                        }
                        break;

                    case UnitType.PercentageOfTotalIncome:
                        rawAmount = GetFinancialDataValueForChartField(chart.FieldName, schoolData.FinancialDataObjectModel);
                        if (rawAmount == null)
                        {
                            break;
                        }
                        if (schoolData.TotalIncome == 0)
                        {
                            amount = 0;
                        }
                        else
                        {
                            amount = (schoolData.TotalIncome == 0) ? 0 : (rawAmount / schoolData.TotalIncome) * 100;
                            amount = decimal.Round(amount.GetValueOrDefault(), 2, MidpointRounding.AwayFromZero);
                        }
                        break;

                    case UnitType.NoOfPupilsPerMeasure:
                        decimal?total = 0;
                        rawAmount = GetFinancialDataValueForChartField(chart.FieldName, schoolData.FinancialDataObjectModel);
                        if (rawAmount == null || rawAmount == 0)
                        {
                            break;
                        }
                        amount = (schoolData.PupilCount == 0)
                                ? null
                                : ((decimal)schoolData.PupilCount / rawAmount);
                        amount = decimal.Round(amount.GetValueOrDefault(), 2, MidpointRounding.AwayFromZero);
                        break;

                    case UnitType.HeadcountPerFTE:
                        string fieldNameBase = chart.FieldName.Contains("FullTimeEquivalent")
                                ? chart.FieldName.Substring(0, chart.FieldName.Length - 18)
                            : chart.FieldName.Substring(0, chart.FieldName.Length - 9);
                        total     = GetFinancialDataValueForChartField(fieldNameBase + "Headcount", schoolData.FinancialDataObjectModel);
                        rawAmount = GetFinancialDataValueForChartField(fieldNameBase + "FullTimeEquivalent", schoolData.FinancialDataObjectModel);
                        if (total == null || rawAmount == null || rawAmount == 0)
                        {
                            break;
                        }
                        if (total == 0)
                        {
                            amount = 0;
                        }
                        else
                        {
                            amount = (total == 0) ? 0 : (total / rawAmount);
                            amount = decimal.Round(amount.GetValueOrDefault(), 2, MidpointRounding.AwayFromZero);
                        }
                        break;

                    case UnitType.FTERatioToTotalFTE:
                        total     = GetFinancialDataValueForChartField(SchoolTrustFinanceDataFieldNames.WORKFORCE_TOTAL, schoolData.FinancialDataObjectModel);
                        rawAmount = GetFinancialDataValueForChartField(chart.FieldName, schoolData.FinancialDataObjectModel);
                        if (rawAmount is null)
                        {
                            break;
                        }
                        if (total == 0)
                        {
                            amount = 0;
                        }
                        else
                        {
                            amount = (total == 0) ? 0 : (rawAmount / total) * 100;
                            amount = decimal.Round(amount.GetValueOrDefault(), 2, MidpointRounding.AwayFromZero);
                        }
                        break;
                    }
                }catch (DivideByZeroException)
                {
                    amount = null;
                }

                historicalChartData.Add(new HistoricalChartData()
                {
                    Year         = (estabType == EstablishmentType.Academies || estabType == EstablishmentType.MAT) ? schoolData.Term.Replace(" / ", "/") : schoolData.Term.Replace(" / ", "-"),
                    Amount       = amount,
                    TeacherCount = schoolData.TeacherCount,
                    PupilCount   = schoolData.PupilCount,
                    Unit         = unit.ToString()
                });
            }

            chart.HistoricalData  = historicalChartData;
            chart.DataJson        = GenerateJson(historicalChartData, estabType);
            chart.LastYear        = term = (estabType == EstablishmentType.Academies || estabType == EstablishmentType.MAT) ? term.Replace(" / ", "/") : term.Replace(" / ", "-");
            chart.LastYearBalance = historicalChartData.Find(d => d.Year == term).Amount;
            chart.ShowValue       = unit;
        }
        private BenchmarkChartModel BuildBenchmarkChartModel(string fieldName, IEnumerable <CompareEntityBase> bmSchools,
                                                             List <FinancialDataModel> financialDataModels, UnitType unit, TabType revGroup, string homeSchoolId)
        {
            var chartDataList = new List <BenchmarkChartData>();

            foreach (var school in bmSchools)
            {
                var dataModel = financialDataModels.First(f => f.Id.ToString() == school.Id);

                decimal?amountPerUnit = null;
                if (revGroup == TabType.Workforce)
                {
                    amountPerUnit = CalculateWFAmount(dataModel, fieldName, unit);
                }
                else
                {
                    amountPerUnit = CalculateAmountPerUnit(dataModel, fieldName, unit);
                }

                chartDataList.Add(new BenchmarkChartData()
                {
                    School          = $"{school.Name}",
                    Amount          = amountPerUnit,
                    Urn             = school.Id,
                    TeacherCount    = dataModel.TeacherCount,
                    PupilCount      = dataModel.PupilCount,
                    Term            = dataModel.Term,
                    Type            = school.Type,
                    La              = _localAuthoritiesService.GetLaName(dataModel.LaNumber.ToString()),
                    IsCompleteYear  = dataModel.IsReturnsComplete,
                    IsWFDataPresent = dataModel.WorkforceDataPresent,
                    PartialYearsPresentInSubSchools = dataModel.PartialYearsPresentInSubSchools,
                    Unit              = unit.ToString(),
                    ProgressScore     = dataModel.ProgressScore,
                    P8Banding         = dataModel.P8Banding,
                    ProgressScoreType = dataModel.SchoolOverallPhase == "Primary" ? "ks2" : "p8",
                    TopSEN            = dataModel.TopSenCharacteristics.Select(t => new KeyValuePair <string, decimal>(t.Definition, t.Value.GetValueOrDefault())).ToList(),
                    Phase             = dataModel.SchoolPhase
                });;
            }

            var sortedChartData      = chartDataList.OrderByDescending(a => a.Amount).ToList();
            var benchmarkSchoolIndex = !string.IsNullOrEmpty(homeSchoolId)
                ? sortedChartData.IndexOf(sortedChartData.Find(s => s.Urn.ToString() == homeSchoolId))
                : -1;


            var incompleteFinanceDataIndex   = new List <int>();
            var incompleteWorkforceDataIndex = new List <int>();

            if (revGroup == TabType.Workforce)
            {
                var incompleteWorkForce = sortedChartData.FindAll(s => !s.IsWFDataPresent);
                incompleteWorkForce.ForEach(i => incompleteWorkforceDataIndex.Add(sortedChartData.IndexOf(i)));
            }
            else
            {
                var incompleteFinances = sortedChartData.FindAll(s => !s.IsCompleteYear || s.PartialYearsPresentInSubSchools);
                incompleteFinances.ForEach(i => incompleteFinanceDataIndex.Add(sortedChartData.IndexOf(i)));
            }

            return(new BenchmarkChartModel
            {
                ChartData = sortedChartData,
                BenchmarkSchoolIndex = benchmarkSchoolIndex,
                IncompleteFinanceDataIndex = incompleteFinanceDataIndex,
                IncompleteWorkforceDataIndex = incompleteWorkforceDataIndex,
            });
        }
 public void PopulateHistoricalChartsWithFinancialData(List <ChartViewModel> historicalCharts,
                                                       List <FinancialDataModel> SchoolFinancialDataModels, string term, TabType revgroup, UnitType unit,
                                                       EstablishmentType estabType)
 {
     foreach (var chart in historicalCharts.Where(c => revgroup == c.TabType || revgroup == TabType.AllIncludingSchoolPerf || revgroup == TabType.AllExcludingSchoolPerf))
     {
         BuildChart(SchoolFinancialDataModels, term, revgroup, unit, estabType, chart);
         if (chart.SubCharts != null)
         {
             foreach (var subChart in chart.SubCharts)
             {
                 BuildChart(SchoolFinancialDataModels, term, revgroup, unit, estabType, subChart);
             }
         }
     }
 }
示例#14
0
        public string GetTabContent(TabType LoadType, string Path)
        {
            TagBuilder        tabContent = new TagBuilder("div");
            string            Filestream = "";
            CSharpFormat      csformat   = new CSharpFormat();
            HtmlFormat        format     = new HtmlFormat();
            JavaScriptFormat  jsformat   = new JavaScriptFormat();
            VisualBasicFormat vbformat   = new VisualBasicFormat();
            HttpContext       context    = System.Web.HttpContext.Current;

            switch (LoadType)
            {
            case TabType.Description:
                Filestream           = ReadTabContent(context.Request.PhysicalApplicationPath + Path);
                tabContent.InnerHtml = context.Server.HtmlDecode(Filestream);
                break;

            case TabType.PartialView:
                Filestream           = ReadTabContent(context.Request.PhysicalApplicationPath + @"\Views" + Path.Replace("/", "\\"));
                tabContent.InnerHtml = format.FormatCode(Filestream).ToString();
                break;

            case TabType.View:
                Filestream           = ReadTabContent(context.Request.PhysicalApplicationPath + Path);
                tabContent.InnerHtml = format.FormatCode(Filestream).ToString();
                break;

            case TabType.VB:
            case TabType.CS:
                Filestream           = ReadTabContent(context.Request.PhysicalApplicationPath + Path);
                tabContent.InnerHtml = csformat.FormatCode(Filestream).ToString();
                break;

            case TabType.CSS:
                Filestream           = ReadTabContent(context.Request.PhysicalApplicationPath + Path);
                tabContent.InnerHtml = format.FormatCode(Filestream).ToString();
                break;

            case TabType.XML:
                Filestream           = ReadTabContent(@"/Models" + Path);
                tabContent.InnerHtml = csformat.FormatCode(Filestream).ToString();
                break;

            case TabType.JavaScript:
                Filestream           = ReadTabContent(context.Request.PhysicalApplicationPath + @"\Scripts" + Path.Replace("/", "\\"));
                tabContent.InnerHtml = jsformat.FormatCode(Filestream).ToString();
                break;

            case TabType.Model:
                Filestream           = ReadTabContent(@"/Models" + Path).ToString();
                tabContent.InnerHtml = csformat.FormatCode(Filestream).ToString();
                break;

            case TabType.Html:
                Filestream           = ReadTabContent(context.Request.PhysicalApplicationPath + Path.Replace("/", "\\"));
                tabContent.InnerHtml = jsformat.FormatCode(Filestream).ToString();
                break;

            default:
                break;
            }

            return(tabContent.ToString());
        }
	    public TabCarouselPage ( TabType tabType = TabType.TitleWithIcon ) {
	        TabType = tabType;
	    }
		private void AddTab(Selector tabControl, TabType tabType)
		{
			HeaderedContentControl tab = GetTabItem();
			tabControl.Items.Add(tab);
			tabControls.Add(tabType, tab);

			Grid tabGrid = new Grid();
			tab.Content = tabGrid;
			tabGrid.HorizontalAlignment = HorizontalAlignment.Stretch;
			tabGrid.VerticalAlignment = VerticalAlignment.Top;
			AddColumnDefinition(tabGrid, 120);
			AddColumnDefinition(tabGrid);

			if (tabType == TabType.Credentials)
			{
				tab.Header = ApiAuthManager.LoginWindowCredentialsTabText;
				AddInputToTabGrid(tabGrid, ApiAuthManager.LoginWindowUserNameLabelText, EditorControlType.Username);
				AddInputToTabGrid(tabGrid, ApiAuthManager.LoginWindowPwdLabelText, EditorControlType.Password, true);
			}
			else if (tabType == TabType.Rally)
			{
				rallyTab = tab;
				tab.Header = ApiAuthManager.LoginWindowRallyServerTabText;
				AddInputToTabGrid(tabGrid, ApiAuthManager.LoginWindowConnectionTypeText, EditorControlType.ConnectionType);
				AddInputToTabGrid(tabGrid, ApiAuthManager.LoginWindowServerLabelText, EditorControlType.RallyServer);
				AddInputToTabGrid(tabGrid, ApiAuthManager.LoginWindowServerLabelText, EditorControlType.IdpServer);
				AddInputToTabGrid(tabGrid, ApiAuthManager.LoginWindowTrustAllCertificatesText, EditorControlType.TrustAllCertificates);
			}
			else if (tabType == TabType.Proxy)
			{
				tab.Header = ApiAuthManager.LoginWindowProxyServerTabText;
				AddInputToTabGrid(tabGrid, ApiAuthManager.LoginWindowProxyServerLabelText, EditorControlType.ProxyServer);
				AddInputToTabGrid(tabGrid, ApiAuthManager.LoginWindowProxyUserNameLabelText, EditorControlType.ProxyUsername);
				AddInputToTabGrid(tabGrid, ApiAuthManager.LoginWindowProxyPwdLabelText, EditorControlType.ProxyPassword, true);
			}
			else
				throw new NotImplementedException();

			if ((tabControl.Height.ToString().Equals("NaN", StringComparison.InvariantCultureIgnoreCase)) ||
				(tabControl.Height < tabGrid.Height + 20))
			{
				tabControl.Height = tabGrid.Height + 20;
				tabControl.MinHeight = tabControl.Height;
			}
		}
 public void SetTabType(TabType tabType)
 {
     m_TabType = tabType;
 }
        private void LoadSettings()
        {
            TabStripSettings settings = new TabStripSettings();

            settings = settings.Deserialize(_outputDirectory + _settingsFileName);

            if (!string.IsNullOrEmpty(settings.SavedTabStripSettings.TabColor))
            {
                _tabColor = ColorTranslator.FromHtml(settings.SavedTabStripSettings.TabColor);
                this.TabColorEntry.Text = settings.SavedTabStripSettings.TabColor;
            }

            if (!string.IsNullOrEmpty(settings.SavedTabStripSettings.BorderColor))
            {
                _borderColor = ColorTranslator.FromHtml(settings.SavedTabStripSettings.BorderColor);
                this.BorderColorEntry.Text = settings.SavedTabStripSettings.BorderColor;
            }

            if (!string.IsNullOrEmpty(settings.SavedTabStripSettings.SelectedTabColor))
            {
                _selectedColor = ColorTranslator.FromHtml(settings.SavedTabStripSettings.SelectedTabColor);
                this.SelectedColorEntry.Text = settings.SavedTabStripSettings.SelectedTabColor;
            }

            _borderWidth = settings.SavedTabStripSettings.BorderWidth;
            this.BorderWidthEntry.Text = _borderWidth.ToString();

            //_pottomPadding = settings.SavedTabStripSettings.BottomPadding;
            _tabWidth = settings.SavedTabStripSettings.TabWidth;
            this.TabWidthEntry.Text = _tabWidth.ToString();

            _tabHeight = settings.SavedTabStripSettings.TabHeight;
            this.TabHeightEntry.Text = _tabHeight.ToString();

            _cornerHeight = settings.SavedTabStripSettings.CornerHeight * 2;
            this.CornerHeightEntry.Text = settings.SavedTabStripSettings.CornerHeight.ToString();

            _cornerWidth = settings.SavedTabStripSettings.CornerWidth * 2;
            this.CornerWidthEntry.Text = settings.SavedTabStripSettings.CornerWidth.ToString();

            if (!string.IsNullOrEmpty(settings.SavedTabStripSettings.TabType))
            {
                _tabType = (TabType)Enum.Parse(typeof(TabType), settings.SavedTabStripSettings.TabType);

                switch (_tabType)
                {
                    case TabType.LeftLean:
                        this.LeanLeftOption.Checked = true;
                        break;

                    case TabType.RightLean:
                        this.LeanRightOption.Checked = true;
                        break;

                    default:
                        this.SymetricalOption.Checked = true;
                        break;
                }
            }

            if (!string.IsNullOrEmpty(settings.SavedTabStripSettings.TabCornerType))
            {
                _cornerType = (CornerType)Enum.Parse(typeof(CornerType), settings.SavedTabStripSettings.TabCornerType);

                switch (_cornerType)
                {
                    case CornerType.Chamfered:
                        this.ChamferedOption.Checked = true;
                        break;

                    default:
                        this.RoundedOption.Checked = true;
                        break;
                }
            }

            if (this.OutputPathEntry.Text.Trim() != settings.SavedTabStripSettings.OutputDirectory.Trim())
            {
                DialogResult result = MessageBox.Show(_overrideOutputDirMessage,
                    this.Text, MessageBoxButtons.YesNo,
                    MessageBoxIcon.Question, MessageBoxDefaultButton.Button1);

                if (result == DialogResult.Yes)
                {
                    _outputDirectory = settings.SavedTabStripSettings.OutputDirectory;
                    this.OutputPathEntry.Text = _outputDirectory;
                }
            }
        }
        private void DoLayoutToolbar()
        {
            GUILayout.Space(1);

            using (new EditorGUILayout.HorizontalScope(EditorStyles.toolbar))
            {
                using (var projectScope = new EditorGUILayout.HorizontalScope(GUILayout.Width(120)))
                {
                    var buttonLabel = GetProjectButtonName();

                    if (UTinyEditorApplication.IsChanged)
                    {
                        buttonLabel += " *";
                    }

                    if (GUILayout.Button(buttonLabel, EditorStyles.toolbarDropDown))
                    {
                        var menu = new GenericMenu();

                        menu.AddItem(new GUIContent("New Project"), false, NewProject);

                        menu.AddItem(new GUIContent("New Module"), false, NewModule);

                        menu.AddSeparator(string.Empty);
                        menu.AddItem(new GUIContent("Load..."), false, LoadProject);

                        menu.AddSeparator(string.Empty);

                        var save = new GUIContent("Save");
                        if (UTinyEditorApplication.Project == null)
                        {
                            menu.AddDisabledItem(save);
                        }
                        else
                        {
                            menu.AddItem(save, false, () =>
                            {
                                UTinyEditorApplication.Save();
                            });
                        }

                        var saveAs = new GUIContent("Save As...");
                        if (UTinyEditorApplication.Project == null)
                        {
                            menu.AddDisabledItem(saveAs);
                        }
                        else
                        {
                            menu.AddItem(saveAs, false, () =>
                            {
                                UTinyEditorApplication.SaveAs();
                            });
                        }

                        menu.AddSeparator(string.Empty);

                        var closeProject = new GUIContent("Close");
                        if (UTinyEditorApplication.Project == null)
                        {
                            menu.AddDisabledItem(closeProject);
                        }
                        else
                        {
                            menu.AddItem(closeProject, false, () =>
                            {
                                if (!UTinyEditorApplication.SaveChanges())
                                {
                                    return;
                                }

                                m_TabType = TabType.Settings;
                                UTinyEditorApplication.Close();
                            });
                        }

                        menu.DropDown(projectScope.rect);
                    }
                }

                GUILayout.FlexibleSpace();

                if (UTinyEditorApplication.ContextType == EditorContextType.Project)
                {
                    var project   = UTinyEditorApplication.Project;
                    var workspace = UTinyEditorApplication.EditorContext.Workspace;

                    if (null != project && null != workspace)
                    {
                        var lastBuildConfiguration = workspace.BuildConfiguration;
                        workspace.BuildConfiguration = (UTinyBuildConfiguration)EditorGUILayout.EnumPopup(workspace.BuildConfiguration, EditorStyles.toolbarDropDown, GUILayout.Width(100));
                        if (workspace.BuildConfiguration != lastBuildConfiguration)
                        {
                            UTinyEditorUtility.RepaintAllWindows();
                        }

                        if (GUILayout.Button("Export", EditorStyles.toolbarButton, GUILayout.Width(100)))
                        {
                            UTinyBuildPipeline.Export(project);
                        }

                        workspace.Preview = GUILayout.Toggle(
                            workspace.Preview,
                            new GUIContent(UTinyIcons.Export, "Toggles preview in browser."),
                            EditorStyles.toolbarButton,
                            GUILayout.Width(35));
                    }
                }
            }
        }
示例#20
0
		/// <summary>
		/// Anything that affects the DOM goes in here.
		/// </summary>
		void initialise()
		{

			Application.Navigate += new HistoryEventHandler(Application_Navigate);
			
			#region Initialisation variables
			ClientID = View.InitClientID.Value;
			EnableEffects = bool.Parse(View.InitEnableEffects.Value);
			#endregion

			#region JQuery handles
			EventInfoHolderOuterJQ = JQueryAPI.JQuery(View.EventInfoHolderOuter);
			#endregion 

			DomEvent.AddHandler(View.EventIconsNavigationForwardHolder, "click", new DomEventHandler(pageChangeForwardClick));
			DomEvent.AddHandler(View.EventIconsNavigationBackHolder, "click", new DomEventHandler(pageChangeBackClick));
			DomEvent.AddHandler(View.MusicDropDownControl.View.DropDown, "change", new DomEventHandler(musicChangeClick));
			DomEvent.AddHandler(View.PastEventsTab, "click", new DomEventHandler(tabClickPast));
			DomEvent.AddHandler(View.FutureEventsTab, "click", new DomEventHandler(tabClickFuture));
			DomEvent.AddHandler(View.TicketsTab, "click", new DomEventHandler(tabClickTickets));
			
			#region Event data cache, and initialise first page from json data in the page
			EventPageCache = new Dictionary();

			EventPageStub firstPageData = ((EventPageStub[])Script.Eval(" [ " + View.InitFirstPage.Value + " ] "))[0];
			EventPageDetails firstPage = new EventPageDetails(this, firstPageData, false);

			firstPage.Selected = true;
			firstPage.Html.InitialiseElements(true, false, false, true, true, false, true);
			for (int i = 0; i < firstPage.Events.Length; i++)
			{
				firstPage.Events[i].ChangeSelectedState(i == 0, false, "");
			}
			CurrentlySelectedEvent = firstPage.Events[0];
			#endregion
			
			EventPageCache[firstPage.GetKey()] = firstPage;
			
			#region Set initial page spec
			InitParentObjectType = firstPage.Data.parentObjectType;
			InitParentObjectK = firstPage.Data.parentObjectK;
			InitTabType = firstPage.Data.tabType;
			InitMusicTypeK = firstPage.Data.musicTypeK;
			InitPageIndex = firstPage.Data.pageIndex;
			#endregion

			#region Set initial and current page spec - this should be done by looking at the page hash state data...
			CurrentParentObjectType = InitParentObjectType;
			CurrentParentObjectK = InitParentObjectK;
			CurrentTabType = InitTabType;
			CurrentMusicTypeK = InitMusicTypeK;
			CurrentPageIndex = InitPageIndex;
			#endregion

			if (Misc.BrowserIsIE)
				Application.AddHistoryPoint(new Dictionary());

		}
示例#21
0
 public void DrawTabs()
 {
     _tabType = (TabType)GUILayout.Toolbar((int)_tabType, Enum.GetNames(typeof(TabType)));
 }
示例#22
0
 public void SetTabActive(TabType tab)
 {
     SelectedTab = tab;
 }
示例#23
0
        private void render(TabType tabType)
        {
            int columns = NORMAL_SPACING, rows = NORMAL_SPACING;

            if (tabType == TabType.Quad)
            {
                columns = QUAD_SPACING;
                rows    = QUAD_SPACING;
            }

            grid.ColumnDefinitions.Clear();
            grid.RowDefinitions.Clear();
            grid.Children.Clear();

            borderByLocation = new Dictionary <Tuple <int, int>, Border>();

            for (int i = 0; i < columns; i++)
            {
                grid.ColumnDefinitions.Add(new ColumnDefinition());
                for (int j = 0; j < rows; j++)
                {
                    if (i == 0)
                    {
                        grid.RowDefinitions.Add(new RowDefinition());
                    }

                    Grid childGrid = new Grid();
                    childGrid.Margin = new Thickness(1);

                    Tuple <int, int> currentKey = new Tuple <int, int>(i, j);

                    if (!stashByLocation.ContainsKey(currentKey))
                    {
                        continue;
                    }

                    Item gearAtLocation = stashByLocation[currentKey];

                    setBackround(childGrid, gearAtLocation);
                    //if (search(gearAtLocation))
                    Border border = getBorder();
                    borderByLocation[currentKey] = border;
                    childGrid.Children.Add(border);

                    childGrid.Children.Add(getImage(gearAtLocation));

                    Grid.SetColumn(childGrid, i);
                    Grid.SetRow(childGrid, j);
                    if (gearAtLocation.H > 1)
                    {
                        Grid.SetRowSpan(childGrid, gearAtLocation.H);
                    }

                    if (gearAtLocation.W > 1)
                    {
                        Grid.SetColumnSpan(childGrid, gearAtLocation.W);
                    }

                    grid.Children.Add(childGrid);
                }
            }

            initialized = true;
        }
示例#24
0
 void SetLayerSecondaryChoice()
 {
   string[] names = new string[1] { "Common" };
   string name = names[0];
   this._primaryChoice = TabType.Unique;
   View.InitializeSecondaryChoice(names, name);
 }
示例#25
0
    void OnGUI()
    {
        tabType = HGUILayout.TabGroup <TabType>(tabGroupData);


        // 要被替换的(需要移除的)
        GUILayout.Space(20);

        switch (tabType)
        {
        case TabType.GUID:
        case TabType.Material:
        case TabType.Sprite:
        case TabType.Texture:
            // 在那些类型中查找(.unity\.prefab\.mat)
            GUILayout.Label("要在哪些类型中查找替换:");
            EditorGUILayout.BeginHorizontal();


            isContainScene  = GUILayout.Toggle(isContainScene, ".unity");
            isContainPrefab = GUILayout.Toggle(isContainPrefab, ".prefab");
            isContainMat    = tabType == TabType.Material ? false : GUILayout.Toggle(isContainMat, ".mat");
            isContainAsset  = GUILayout.Toggle(isContainAsset, ".asset");

            EditorGUILayout.EndHorizontal();
            break;
        }


        scrollPos = EditorGUILayout.BeginScrollView(scrollPos);
        GUILayout.Space(20);



        switch (tabType)
        {
        case TabType.GUID:
            GUI_GUID();
            break;

        case TabType.Material:
            GUI_MaterialList();
            break;

        case TabType.Sprite:
            GUI_SpriteList();
            break;

        case TabType.Texture:
            GUI_TextureList();
            break;

        case TabType.Shader:
            if (GUILayout.Button("替换内建Shader!"))
            {
                RefreshMaterialShader.RefreshMat();
            }
            break;
        }



        GUILayout.Space(20);
        EditorGUILayout.EndScrollView();
    }
示例#26
0
 void SetEdgeSecondaryChoice()
 {
   string[] names = new string[_axisStyleInfoSortedByName.Count];
   string name = string.Empty;
   for (int i = 0; i < names.Length; i++)
   {
     names[i] = _axisStyleInfoSortedByName[i].NameOfAxisStyle;
     if (_axisStyleInfoSortedByName[i].Identifier == _currentAxisID)
       name = _axisStyleInfoSortedByName[i].NameOfAxisStyle;
   }
   this._primaryChoice = TabType.Styles;
   View.InitializeSecondaryChoice(names, name);
 }
示例#27
0
        public void DrawTable(CommentExplorer owningExplorer, TabType tabType, string searchString = "", float windowWidth = 150)
        {
            Notepad[] targetNotepads;
            if (searchString != "")
            {
                targetNotepads = notepads.Count(x => x.gameObject.name.Contains(searchString)) > 0 ? notepads.Where(x => x.gameObject.name.Contains(searchString)).ToArray() : notepads.ToArray();
                // // TODO: Bug here
                // var genNotes = notepads.Count(x => x.generalNotes.Contains(searchString)) > 0 ? notepads.Where(x => x.generalNotes.Contains(searchString)).ToArray() : new Notepad[]{};
                // var otherNotes = notepads.Count(x => x.otherNotes.Contains(searchString)) > 0 ? notepads.Where(x => x.otherNotes.Contains(searchString)).ToArray() : new Notepad[]{};
                // var todoNotes = notepads.Count(x => x.toDoNotes.Contains(searchString)) > 0 ? notepads.Where(x => x.toDoNotes.Contains(searchString)).ToArray() : new Notepad[]{};

                // var finalNotetes = targetNotepads.Concat(genNotes).Concat(otherNotes).Concat(todoNotes).ToArray();
                // targetNotepads = finalNotetes;

                // if(notepads.Count(x => x.generalNotes.Contains(searchString)) > 0)
                //     targetNotepads = targetNotepads.Concat(notepads.Where(x => x.generalNotes.Contains(searchString) && !targetNotepads.Contains(x)).ToArray()).ToArray();
                // if(notepads.Count(x => x.otherNotes.Contains(searchString)) > 0)
                //     targetNotepads = targetNotepads.Concat(notepads.Where(x => x.otherNotes.Contains(searchString) && !targetNotepads.Contains(x)).ToArray()).ToArray();
                // if(notepads.Count(x => x.toDoNotes.Contains(searchString)) > 0)
                //     targetNotepads = targetNotepads.Concat(notepads.Where(x => x.toDoNotes.Contains(searchString) && !targetNotepads.Contains(x)).ToArray()).ToArray();
            }
            else
            {
                targetNotepads = notepads.ToArray();
            }

            selectedColor = GUI.skin.settings.selectionColor;

            using (var sv = new EditorGUILayout.ScrollViewScope(scrollView, GUILayout.MaxWidth(windowWidth - 30)))
            {
                scrollView = sv.scrollPosition;

                GUILayout.BeginVertical();

                GUILayout.BeginHorizontal();
                GUILayout.Label(EUIResourceManager.Instance.GetTexture("Blockout_Name"), GUILayout.Width(nameWidth), GUILayout.MaxHeight(25));

                DrawResizeHandle(ResizeOption.Name);

                GUILayout.Label(EUIResourceManager.Instance.GetTexture("Blockout_Color"), GUILayout.Width(colorWidth), GUILayout.MaxHeight(25));
                DrawResizeHandle(ResizeOption.Color);
                GUILayout.Label(EUIResourceManager.Instance.GetTexture("Blockout_General_Notes"), GUILayout.Width(generalNotesWidth), GUILayout.MaxHeight(25));
                DrawResizeHandle(ResizeOption.General);
                GUILayout.Label(EUIResourceManager.Instance.GetTexture("Blockout_To_Do_Notes"), GUILayout.Width(todoNotesWidth), GUILayout.MaxHeight(25));
                DrawResizeHandle(ResizeOption.ToDo);
                GUILayout.Label(EUIResourceManager.Instance.GetTexture("Blockout_Other_Notes"), GUILayout.Width(otherNotesWidth), GUILayout.MaxHeight(25));
                DrawResizeHandle(ResizeOption.Other);
                GUILayout.EndHorizontal();

                GUILayout.Space(5);


                if (resize)
                {
                    switch (resizeOption)
                    {
                    case ResizeOption.Name:
                        nameWidth      -= (int)(previousMosePos - Event.current.mousePosition).x;
                        previousMosePos = Event.current.mousePosition;
                        nameWidth       = Mathf.Clamp(nameWidth, 20, 400);
                        break;

                    case ResizeOption.Color:
                        colorWidth     -= (int)(previousMosePos - Event.current.mousePosition).x;
                        previousMosePos = Event.current.mousePosition;
                        colorWidth      = Mathf.Clamp(colorWidth, 20, 400);
                        break;

                    case ResizeOption.General:
                        generalNotesWidth -= (int)(previousMosePos - Event.current.mousePosition).x;
                        previousMosePos    = Event.current.mousePosition;
                        generalNotesWidth  = Mathf.Clamp(generalNotesWidth, 100, 800);
                        break;

                    case ResizeOption.ToDo:
                        todoNotesWidth -= (int)(previousMosePos - Event.current.mousePosition).x;
                        previousMosePos = Event.current.mousePosition;
                        todoNotesWidth  = Mathf.Clamp(todoNotesWidth, 100, 800);
                        break;

                    case ResizeOption.Other:
                        otherNotesWidth -= (int)(previousMosePos - Event.current.mousePosition).x;
                        previousMosePos  = Event.current.mousePosition;
                        otherNotesWidth  = Mathf.Clamp(otherNotesWidth, 100, 800);
                        break;
                    }

                    owningExplorer.Repaint();
                }
                if (Event.current.rawType == EventType.MouseUp)
                {
                    resize = false;
                }



                GUIStyle gsTest = new GUIStyle();



                for (int i = 0; i < targetNotepads.Length; ++i)
                {
                    gsTest.normal.background = selectedItem == i?MakeTex(1, 1, selectedColor) : MakeTex(1, 1, i % 2 == 0 ? oddRowColor : evenRowColor);

                    using (var he = new EditorGUILayout.HorizontalScope(gsTest))
                    {
                        using (new VerticalCenteredScope(GUILayout.Height(EditorGUIUtility.singleLineHeight * 3)))
                        {
                            GUILayout.Label(targetNotepads[i].gameObject.name, EditorStyles.boldLabel,
                                            GUILayout.Width(nameWidth));
                        }
                        GUILayout.Space(8);

                        if (targetNotepads[i].GetComponent <BlockoutSceneViewCubeGizmo>())
                        {
                            targetNotepads[i].GetComponent <BlockoutSceneViewCubeGizmo>().volumeColor =
                                EditorGUILayout.ColorField(
                                    targetNotepads[i].GetComponent <BlockoutSceneViewCubeGizmo>().volumeColor,
                                    GUILayout.Width(colorWidth));
                        }
                        else if (targetNotepads[i].GetComponent <BlockoutPinGizmo>())
                        {
                            targetNotepads[i].GetComponent <BlockoutPinGizmo>().volumeColor =
                                EditorGUILayout.ColorField(
                                    targetNotepads[i]
                                    .GetComponent <BlockoutPinGizmo>().volumeColor,
                                    GUILayout.Width(colorWidth));
                        }
                        else
                        {
                            GUILayout.Space(colorWidth + 3);
                        }
                        GUILayout.Space(10);
                        targetNotepads[i].generalNotes = GUILayout.TextArea(targetNotepads[i].generalNotes,
                                                                            GUILayout.Width(generalNotesWidth),
                                                                            GUILayout.MinHeight(EditorGUIUtility.singleLineHeight * 3));
                        GUILayout.Space(10);
                        targetNotepads[i].toDoNotes = GUILayout.TextArea(targetNotepads[i].toDoNotes,
                                                                         GUILayout.Width(todoNotesWidth),
                                                                         GUILayout.MinHeight(EditorGUIUtility.singleLineHeight * 3));
                        GUILayout.Space(10);
                        targetNotepads[i].otherNotes = GUILayout.TextArea(targetNotepads[i].otherNotes,
                                                                          GUILayout.Width(otherNotesWidth),
                                                                          GUILayout.MinHeight(EditorGUIUtility.singleLineHeight * 3));

                        if (Event.current.type == EventType.MouseDown &&
                            he.rect.Contains(Event.current.mousePosition))
                        {
                            selectedItem = i;
                            Selection.activeGameObject = notepads[i].gameObject;
                            owningExplorer.Repaint();
                        }
                    }

                    if (i == 0)
                    {
                        GUILayout.Space(10);
                    }
                }


                GUILayout.EndVertical();
            }
        }
        private async Task <FederationViewModel> BuildPartialFederationViewModelAsync(long fuid, TabType tab, ChartGroupType chartGroup, UnitType unitType)
        {
            var vm = new FederationViewModel(fuid, _benchmarkBasketService.GetSchoolBenchmarkList());

            vm.HistoricalCharts.AddRange(_historicalChartBuilder.Build(tab, chartGroup, vm.EstablishmentType, unitType));
            vm.ChartGroups = _historicalChartBuilder.Build(tab, vm.EstablishmentType).DistinctBy(c => c.ChartGroup).ToList();
            vm.LatestTerm  = await LatestFederationTermAsync();

            vm.Tab = tab;

            vm.ContextData = await _contextDataService.GetSchoolDataObjectByUrnAsync(fuid);

            vm.HistoricalFinancialDataModels = await GetFinancialDataHistoricallyAsync(fuid);

            _fcService.PopulateHistoricalChartsWithFinancialData(vm.HistoricalCharts, vm.HistoricalFinancialDataModels, vm.LatestTerm, vm.Tab, unitType, vm.EstablishmentType);

            vm.SchoolsInFederation = await _contextDataService.GetMultipleSchoolDataObjectsByUrnsAsync(vm.FederationMembersURNs.ToList());

            vm.LaName = _laService.GetLaName(vm.La.ToString());

            return(vm);
        }
示例#29
0
        public ObservableCollection <SocialUser> GetLeftMessengerListData(string userId, TabType tabType, string pageid)
        {
            SqLiteHelper sql = new SqLiteHelper();
            ObservableCollection <SocialUser> userListInfo = new ObservableCollection <SocialUser>();


            //string query = string.Format("select FacebookId,DisplayName,ImageUrl,NavigationUrl from FacebookUsers where Parent_User_Id='{0}' and JobType={1} ", userId, (int)tabType);
            string query = "select FacebookId,DisplayName,ImageUrl,NavigationUrl,PageId from FacebookUsers where Parent_User_Id='" + userId + "' and JobType='" + (int)tabType + "' and PageId='" + pageid + "'";

            var dt = sql.GetDataTable(query);

            foreach (DataRow item in dt.Rows)
            {
                string inboxUserId        = Convert.ToString(item["FacebookId"]);
                string inboxUserName      = Convert.ToString(item["DisplayName"]);
                string inboxUserImage     = Convert.ToString(item["ImageUrl"]);
                string inboxNavigationUrl = Convert.ToString(item["NavigationUrl"]);
                string pageId             = Convert.ToString(item["PageId"]);

                //if (!UserListInfo.Any(m => m.InboxUserName.Equals(M_inboxUserName)))
                if (!userListInfo.Any(m => m.InboxUserId.Equals(inboxUserId)))
                {
                    userListInfo.Add(new SocialUser()
                    {
                        InboxUserId        = inboxUserId, InboxUserName = inboxUserName,
                        InboxUserImage     = inboxUserImage,
                        InboxNavigationUrl = inboxNavigationUrl,
                        MessageUserType    = tabType.ToString(),
                        PageId             = pageId
                    });
                }
            }
            return(userListInfo);
        }
示例#30
0
        /// -----------------------------------------------------------------------------
        /// <summary>
        /// This handler handles requests for LinkClick.aspx, but only those specifc
        /// to file serving
        /// </summary>
        /// <param name="context">System.Web.HttpContext)</param>
        /// <remarks>
        /// </remarks>
        /// -----------------------------------------------------------------------------
        public void ProcessRequest(HttpContext context)
        {
            var _portalSettings = PortalController.Instance.GetCurrentPortalSettings();
            var TabId           = -1;
            var ModuleId        = -1;

            try
            {
                //get TabId
                if (context.Request.QueryString["tabid"] != null)
                {
                    Int32.TryParse(context.Request.QueryString["tabid"], out TabId);
                }

                //get ModuleId
                if (context.Request.QueryString["mid"] != null)
                {
                    Int32.TryParse(context.Request.QueryString["mid"], out ModuleId);
                }
            }
            catch (Exception)
            {
                //The TabId or ModuleId are incorrectly formatted (potential DOS)
                Handle404Exception(context, context.Request.RawUrl);
            }

            //get Language
            string Language = _portalSettings.DefaultLanguage;

            if (context.Request.QueryString["language"] != null)
            {
                Language = context.Request.QueryString["language"];
            }
            else
            {
                if (context.Request.Cookies["language"] != null)
                {
                    Language = context.Request.Cookies["language"].Value;
                }
            }
            if (LocaleController.Instance.IsEnabled(ref Language, _portalSettings.PortalId))
            {
                Localization.Localization.SetThreadCultures(new CultureInfo(Language), _portalSettings);
                Localization.Localization.SetLanguage(Language);
            }

            //get the URL
            string URL = "";

            if (context.Request.QueryString["fileticket"] != null)
            {
                URL = "FileID=" + FileLinkClickController.Instance.GetFileIdFromLinkClick(context.Request.QueryString);
            }
            if (context.Request.QueryString["userticket"] != null)
            {
                URL = "UserId=" + UrlUtils.DecryptParameter(context.Request.QueryString["userticket"]);
            }
            if (context.Request.QueryString["link"] != null)
            {
                URL = context.Request.QueryString["link"];
                if (URL.StartsWith("fileid=", StringComparison.InvariantCultureIgnoreCase))
                {
                    URL = ""; //restrict direct access by FileID
                }
            }
            if (!String.IsNullOrEmpty(URL))
            {
                URL = URL.Replace(@"\", @"/");

                //update clicks, this must be done first, because the url tracker works with unmodified urls, like tabid, fileid etc
                var objUrls = new UrlController();
                objUrls.UpdateUrlTracking(_portalSettings.PortalId, URL, ModuleId, -1);
                TabType UrlType = Globals.GetURLType(URL);
                if (UrlType == TabType.Tab)
                {
                    //verify whether the tab is exist, otherwise throw out 404.
                    if (TabController.Instance.GetTab(int.Parse(URL), _portalSettings.PortalId, false) == null)
                    {
                        Handle404Exception(context, context.Request.RawUrl);
                    }
                }
                if (UrlType != TabType.File)
                {
                    URL = Globals.LinkClick(URL, TabId, ModuleId, false);
                }

                if (UrlType == TabType.File && URL.StartsWith("fileid=", StringComparison.InvariantCultureIgnoreCase) == false)
                {
                    //to handle legacy scenarios before the introduction of the FileServerHandler
                    var fileName = Path.GetFileName(URL);

                    var folderPath = URL.Substring(0, URL.LastIndexOf(fileName, StringComparison.InvariantCulture));
                    var folder     = FolderManager.Instance.GetFolder(_portalSettings.PortalId, folderPath);

                    var file = FileManager.Instance.GetFile(folder, fileName);

                    URL = "FileID=" + file.FileId;
                }

                //get optional parameters
                bool blnForceDownload = false;
                if ((context.Request.QueryString["forcedownload"] != null) || (context.Request.QueryString["contenttype"] != null))
                {
                    bool.TryParse(context.Request.QueryString["forcedownload"], out blnForceDownload);
                }
                var contentDisposition = blnForceDownload ? ContentDisposition.Attachment : ContentDisposition.Inline;

                //clear the current response
                context.Response.Clear();
                var fileManager = FileManager.Instance;
                try
                {
                    switch (UrlType)
                    {
                    case TabType.File:
                        var download = false;
                        var file     = fileManager.GetFile(int.Parse(UrlUtils.GetParameterValue(URL)));
                        if (file != null)
                        {
                            if (!file.IsEnabled || !HasAPublishedVersion(file))
                            {
                                if (context.Request.IsAuthenticated)
                                {
                                    context.Response.Redirect(Globals.AccessDeniedURL(Localization.Localization.GetString("FileAccess.Error")), true);
                                }
                                else
                                {
                                    context.Response.Redirect(Globals.AccessDeniedURL(), true);
                                }
                            }

                            try
                            {
                                var folderMapping = FolderMappingController.Instance.GetFolderMapping(file.PortalId, file.FolderMappingID);
                                var directUrl     = fileManager.GetUrl(file);

                                EventManager.Instance.OnFileDownloaded(new FileDownloadedEventArgs()
                                {
                                    FileInfo = file,
                                    UserId   = UserController.Instance.GetCurrentUserInfo().UserID
                                });

                                if (directUrl.Contains("LinkClick") || (blnForceDownload && folderMapping.FolderProviderType == "StandardFolderProvider"))
                                {
                                    fileManager.WriteFileToResponse(file, contentDisposition);
                                    download = true;
                                }
                                else
                                {
                                    context.Response.Redirect(directUrl, /*endResponse*/ true);
                                }
                            }
                            catch (PermissionsNotMetException)
                            {
                                if (context.Request.IsAuthenticated)
                                {
                                    context.Response.Redirect(Globals.AccessDeniedURL(Localization.Localization.GetString("FileAccess.Error")), true);
                                }
                                else
                                {
                                    context.Response.Redirect(Globals.AccessDeniedURL(), true);
                                }
                            }
                            catch (ThreadAbortException)     //if call fileManager.WriteFileToResponse ThreadAbortException will shown, should catch it and do nothing.
                            {
                            }
                            catch (Exception ex)
                            {
                                Logger.Error(ex);
                            }
                        }

                        if (!download)
                        {
                            Handle404Exception(context, URL);
                        }
                        break;

                    case TabType.Url:
                        //prevent phishing by verifying that URL exists in URLs table for Portal
                        if (objUrls.GetUrl(_portalSettings.PortalId, URL) != null)
                        {
                            context.Response.Redirect(URL, true);
                        }
                        break;

                    default:
                        //redirect to URL
                        context.Response.Redirect(URL, true);
                        break;
                    }
                }
                catch (ThreadAbortException)
                {
                }
                catch (Exception)
                {
                    Handle404Exception(context, URL);
                }
            }
            else
            {
                Handle404Exception(context, URL);
            }
        }
示例#31
0
    //tolua
    public void InitBag(List <ItemViewData> list, TabType type)
    {
        while (grid.transform.childCount > 0)
        {
            DestroyImmediate(grid.transform.GetChild(0).gameObject);
        }
        viewList = new Hashtable();
        for (int index = 0; index < MAXBLOCK; index++)
        {
            //设置格子
            GameObject obj = Instantiate(itemPrefab);
            obj.SetActive(true);
            ItemView     pop  = obj.GetComponent <ItemView>();
            ItemViewData data = null;
            if (index < list.Count)
            {
                data = list[index];
                if (data != null)
                {
                    //如果指定类型就给添加到table
                    if ((type == TabType.All || type == (TabType)data.data.bagType) && data.data.isShow == 0)
                    {
                        obj.name = data.sort;
                        if (data.curCount < 1)
                        {
                            data = null;
                        }
                    }
                    else
                    {
                        data = null;
                    }
                    if (data == null)
                    {
                        obj.name = "None";
                    }
                }
            }
            else
            {
                obj.name = "None";
            }
            pop.InitData(data, index);
            if (data != null)
            {
                data.view = pop;
            }
            pop.transform.parent     = grid.transform;
            pop.transform.localScale = Vector3.one;
            viewList.Add(index, pop);
        }

        grid.Reposition();
        scroll.ResetPosition();
        grid.repositionNow = true;
        if (list != null && list.Count > 0)
        {
            BagMgr.Instance.SelectItem(grid.GetChildList()[0].gameObject.GetComponent <ItemView>());
        }
        //MoveToLastVertical();
    }
示例#32
0
 void LoadTabIconForItem(ActivityItem view, TabType type, int versionNumber)
 {
     ImageView itemPicture = view.FindViewById<ImageView> (Resource.Id.ItemPicture);
     if (view.CurrentTabType != type.Name)
         itemPicture.SetImageBitmap (type.Image);
 }
示例#33
0
        protected override void OnLoad(EventArgs e)
        {
            base.OnLoad(e);

            cmdDisplay.Click += cmdDisplay_Click;

            try
            {
                //this needs to execute always to the client script code is registred in InvokePopupCal
                cmdStartCalendar.NavigateUrl = Calendar.InvokePopupCal(txtStartDate);
                cmdEndCalendar.NavigateUrl   = Calendar.InvokePopupCal(txtEndDate);
                if (!Page.IsPostBack)
                {
                    if (!String.IsNullOrEmpty(_URL))
                    {
                        lblLogURL.Text = URL; //saved for loading Log grid
                        TabType URLType = Globals.GetURLType(_URL);
                        if (URLType == TabType.File && _URL.StartsWith("fileid=", StringComparison.InvariantCultureIgnoreCase) == false)
                        {
                            //to handle legacy scenarios before the introduction of the FileServerHandler
                            var fileName = Path.GetFileName(_URL);

                            var folderPath = _URL.Substring(0, _URL.LastIndexOf(fileName));
                            var folder     = FolderManager.Instance.GetFolder(PortalSettings.PortalId, folderPath);

                            var file = FileManager.Instance.GetFile(folder, fileName);

                            lblLogURL.Text = "FileID=" + file.FileId;
                        }
                        var             objUrls        = new UrlController();
                        UrlTrackingInfo objUrlTracking = objUrls.GetUrlTracking(PortalSettings.PortalId, lblLogURL.Text, ModuleID);
                        if (objUrlTracking != null)
                        {
                            if (String.IsNullOrEmpty(_FormattedURL))
                            {
                                lblURL.Text = Globals.LinkClick(URL, PortalSettings.ActiveTab.TabID, ModuleID, false);
                                if (!lblURL.Text.StartsWith("http") && !lblURL.Text.StartsWith("mailto"))
                                {
                                    lblURL.Text = Globals.AddHTTP(Request.Url.Host) + lblURL.Text;
                                }
                            }
                            else
                            {
                                lblURL.Text = _FormattedURL;
                            }
                            lblCreatedDate.Text = objUrlTracking.CreatedDate.ToString();

                            if (objUrlTracking.TrackClicks)
                            {
                                pnlTrack.Visible = true;
                                if (String.IsNullOrEmpty(_TrackingURL))
                                {
                                    if (!URL.StartsWith("http"))
                                    {
                                        lblTrackingURL.Text = Globals.AddHTTP(Request.Url.Host);
                                    }
                                    lblTrackingURL.Text += Globals.LinkClick(URL, PortalSettings.ActiveTab.TabID, ModuleID, objUrlTracking.TrackClicks);
                                }
                                else
                                {
                                    lblTrackingURL.Text = _TrackingURL;
                                }
                                lblClicks.Text = objUrlTracking.Clicks.ToString();
                                if (!Null.IsNull(objUrlTracking.LastClick))
                                {
                                    lblLastClick.Text = objUrlTracking.LastClick.ToString();
                                }
                            }
                            if (objUrlTracking.LogActivity)
                            {
                                pnlLog.Visible = true;

                                txtStartDate.Text = DateTime.Today.AddDays(-6).ToShortDateString();
                                txtEndDate.Text   = DateTime.Today.AddDays(1).ToShortDateString();
                            }
                        }
                    }
                    else
                    {
                        Visible = false;
                    }
                }
            }
            catch (Exception exc) //Module failed to load
            {
                Exceptions.ProcessModuleLoadException(this, exc);
            }
        }
		private void SetTabVisibility(TabType tabType, bool isVisible)
		{
			if (isVisible)
			{
				tabControls[tabType].Visibility = Visibility.Visible;
				tabControls[tabType].Width = double.NaN;
			}
			else
			{
				tabControls[tabType].Visibility = Visibility.Hidden;
				tabControls[tabType].Width = 0.0;
			}
		}
示例#35
0
 public void AddTab(TabType title, Android.Support.V4.App.Fragment frag)
 {
     Titles.Add(title);
     fragments.Add(frag);
     NotifyDataSetChanged();
 }
 private void TabType_CheckedChanged(object sender, EventArgs e)
 {
     if ((((RadioButton)sender).Checked))
     {
         _tabType = (TabType)int.Parse((string)(((RadioButton)sender).Tag));
         this.CreateImages();
     }
 }
示例#37
0
        /// <summary>
        /// The Page_Load server event handler on this page is used to populate the role information for the page
        /// </summary>
        protected void Page_Load(object sender, EventArgs e)
        {
            try
            {
                //this needs to execute always to the client script code is registred in InvokePopupCal
                cmdStartCalendar.NavigateUrl = Calendar.InvokePopupCal(txtStartDate);
                cmdEndCalendar.NavigateUrl   = Calendar.InvokePopupCal(txtEndDate);

                if (!Page.IsPostBack)
                {
                    if (!String.IsNullOrEmpty(_URL))
                    {
                        lblLogURL.Text = URL; // saved for loading Log grid

                        TabType URLType = Globals.GetURLType(_URL);
                        if (URLType == TabType.File && _URL.ToLower().StartsWith("fileid=") == false)
                        {
                            // to handle legacy scenarios before the introduction of the FileServerHandler
                            FileController objFiles = new FileController();
                            lblLogURL.Text = "FileID=" + objFiles.ConvertFilePathToFileId(_URL, PortalSettings.PortalId);
                        }

                        UrlController   objUrls        = new UrlController();
                        UrlTrackingInfo objUrlTracking = objUrls.GetUrlTracking(PortalSettings.PortalId, lblLogURL.Text, ModuleID);
                        if (objUrlTracking != null)
                        {
                            if (_FormattedURL == "")
                            {
                                if (!URL.StartsWith("http") && !URL.StartsWith("mailto"))
                                {
                                    lblURL.Text = Globals.AddHTTP(Request.Url.Host);
                                }
                                lblURL.Text += Globals.LinkClick(URL, PortalSettings.ActiveTab.TabID, ModuleID, false);
                            }
                            else
                            {
                                lblURL.Text = _FormattedURL;
                            }
                            lblCreatedDate.Text = objUrlTracking.CreatedDate.ToString();

                            if (objUrlTracking.TrackClicks)
                            {
                                pnlTrack.Visible = true;
                                if (_TrackingURL == "")
                                {
                                    if (!URL.StartsWith("http"))
                                    {
                                        lblTrackingURL.Text = Globals.AddHTTP(Request.Url.Host);
                                    }
                                    lblTrackingURL.Text += Globals.LinkClick(URL, PortalSettings.ActiveTab.TabID, ModuleID, objUrlTracking.TrackClicks);
                                }
                                else
                                {
                                    lblTrackingURL.Text = _TrackingURL;
                                }
                                lblClicks.Text = objUrlTracking.Clicks.ToString();
                                if (!Null.IsNull(objUrlTracking.LastClick))
                                {
                                    lblLastClick.Text = objUrlTracking.LastClick.ToString();
                                }
                            }

                            if (objUrlTracking.LogActivity)
                            {
                                pnlLog.Visible = true;

                                txtStartDate.Text = DateAndTime.DateAdd(DateInterval.Day, -6, DateTime.Today).ToShortDateString();
                                txtEndDate.Text   = DateAndTime.DateAdd(DateInterval.Day, 1, DateTime.Today).ToShortDateString();
                            }
                        }
                    }
                    else
                    {
                        this.Visible = false;
                    }
                }
            }
            catch (Exception exc)  //Module failed to load
            {
                Exceptions.ProcessModuleLoadException(this, exc);
            }
        }
示例#38
0
		void restorePageState(string key)
		{
			if (key == null)
			{
				EventPageDetails d = new EventPageDetails(this, new EventPageStub(InitParentObjectType, InitParentObjectK, InitTabType, InitMusicTypeK, InitPageIndex, InitPageIndex, null), false);
				key = d.GetKey();
			}

			#region Get the event page to the right place
			if (CurrentEventPage.GetKey() == key)
				return;

			CurrentEventPage.ChangeSelectedState(false, false, "");

			EventPageStub s = EventPageDetails.GetStubFromKey(key);

			CurrentParentObjectType = s.parentObjectType;
			CurrentParentObjectK = s.parentObjectK;
			CurrentMusicTypeK = s.musicTypeK;
			CurrentTabType = s.tabType;
			CurrentPageIndex = s.pageIndex;

			CurrentEventPage.ChangeSelectedState(true, false, "");

			ChangeEventNow(CurrentEventPage.Events[0], false, "");
			#endregion

			#region Set the music-type drop-down
			View.MusicDropDownControl.View.DropDown.Value = CurrentMusicTypeK.ToString();
			#endregion

			#region Set the future / past events tabs
			updateTabsUI();
			#endregion
		}
示例#39
0
        public void OpenJournal(TabType tabType)
        {
            OpenJournal();

            _journal.ShowTab(tabType);
        }
示例#40
0
		void changeTabType(TabType tabType)
		{
			if (CurrentTabType == tabType)
				return;

			int currentTab = getTabLocation(CurrentTabType);
			int newTab = getTabLocation(tabType);

			string movementDirection = "left";
			if (currentTab < newTab)
				movementDirection = "right";

			CurrentEventPage.ChangeSelectedState(false, true, movementDirection);

			CurrentPageIndex = 0;
			CurrentTabType = tabType;

			CurrentEventPage.ChangeSelectedState(true, true, movementDirection);

			ChangeEventNow(CurrentEventPage.Events[0], true, movementDirection);

			updateTabsUI();

			Dictionary d = new Dictionary();
			d["EventBox_PageKey"] = CurrentEventPage.GetKey();
			Application.AddHistoryPoint(d, "Event box - " + (CurrentTabType == TabType.Future ? "future events" : CurrentTabType == TabType.Future ? "past events" : "tickets"));
		}
示例#41
0
        // toggle between tabs
        public void ToggleTabButtonPressed()
        {
            TabType toTab = _currentTab == TabType.IAPs ? TabType.Subscriptions : TabType.IAPs;

            SwitchToTab((int)toTab);
        }
		private string GetURLType(TabType tabType)
		{
//INSTANT C# NOTE: The following VB 'Select Case' included either a non-ordinal switch expression or non-ordinal, range-type, or non-constant 'Case' expressions and was converted to C# 'if-else' logic:
//			Select Case tabType
//ORIGINAL LINE: Case Entities.Tabs.TabType.File
			if (tabType == Entities.Tabs.TabType.File)
			{
					return "F";
			}
//ORIGINAL LINE: Case Entities.Tabs.TabType.Member
			else if (tabType == Entities.Tabs.TabType.Member)
			{
					return "M";
			}
//ORIGINAL LINE: Case Entities.Tabs.TabType.Normal, Entities.Tabs.TabType.Tab
			else if ((tabType == Entities.Tabs.TabType.Normal) || (tabType == Entities.Tabs.TabType.Tab))
			{
					return "T";
			}
//ORIGINAL LINE: Case Else
			else
			{
					return "U";
			}
		}
示例#43
0
 public ChangeTabMessage(object sender, TabType tabType) : base(sender)
 {
     TabType = tabType;
 }