Exemplo n.º 1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            try
            {
                PageSummaryItem currentItem = new PageSummaryItem(Sitecore.Context.Item);
                Header = new HeaderItem(Sitecore.Context.Database.GetItem(ItemPaths.Header));
                Item[] ancestors = currentItem.InnerItem.Axes.SelectItems("./ancestor-or-self::*");
                //Set active flag if current page is in facilities and classes
                if (ancestors != null)
                {
                    List<Item> contextAncestorsOrSelf = ancestors.ToList();
                    Item memberSection = member.InnerItem;

                    if (SitecoreHelper.ListContainsItem(contextAncestorsOrSelf, memberSection))
                    {
                        ActiveFlag = " active";
                    }
                }
            }
            catch (Exception ex)
            {
                Log.Error(String.Format("Error printing your health Nav: {0}" + ex.Message), this);
                mm.virginactive.common.EmailMessagingService.ErrorEmailNotification.SendMail(ex);
            }
        }
Exemplo n.º 2
0
		void addItem_Click(object sender, EventArgs e)
		{
			var items = _gridViewHeader.DataStore as DataStoreCollection<HeaderItem>;
			var newItem = new HeaderItem("NewKey", "");		
			items.Add(newItem);

			var row = items.IndexOf(newItem);
			_gridViewHeader.BeginEdit(row, 0);
		}
Exemplo n.º 3
0
        void buildAdapter()
        {
            var adapter = new ArrayObjectAdapter (new ListRowPresenter ());

            var videos = Video.GetVideos (this.Activity);

            var categories = from m in videos
                select m.Categories;

            foreach (var c in categories.Distinct ()) {
                var categoryVideos = videos.Where (m => m.Categories == c);

                var categoryAdapter = new ArrayObjectAdapter (new VideoPresenter ());

                foreach (var v in categoryVideos)
                    categoryAdapter.Add (v);

                var header = new HeaderItem (c.ToLowerInvariant ());
                adapter.Add (new ListRow (header, categoryAdapter));
            }

            Adapter = adapter;
        }
 internal static void RaiseEvents(IntPtr hwnd, int eventId, object idProp, int idObject, int idChild)
 {
     if (idObject != NativeMethods.OBJID_VSCROLL && idObject != NativeMethods.OBJID_HSCROLL)
     {
         ProxyFragment      header   = new WindowsSysHeader(hwnd);
         AutomationProperty property = idProp as AutomationProperty;
         if (property == TablePattern.ColumnHeadersProperty || property == TablePattern.RowHeadersProperty)
         {
             // Check if the parent is a ListView
             IntPtr hwndParent = NativeMethodsSetLastError.GetAncestor(hwnd, NativeMethods.GA_PARENT);
             if (hwndParent != IntPtr.Zero)
             {
                 if (Misc.GetClassName(hwndParent).IndexOf("SysListView32", StringComparison.Ordinal) >= 0)
                 {
                     // Notify the Listview that the header Change
                     WindowsListView wlv = (WindowsListView)WindowsListView.Create(hwndParent, 0);
                     if (wlv != null)
                     {
                         wlv.DispatchEvents(eventId, idProp, idObject, idChild);
                     }
                 }
             }
         }
         else
         {
             if (idProp == InvokePattern.InvokedEvent)
             {
                 ProxySimple headerItem = new HeaderItem(hwnd, header, idChild);
                 headerItem.DispatchEvents(eventId, idProp, idObject, idChild);
             }
             else
             {
                 header.DispatchEvents(eventId, idProp, idObject, idChild);
             }
         }
     }
 }
Exemplo n.º 5
0
    private void BindLists()
    {
        SessionState.EditedUser.ClearNotifications();
        cv            = new HyperCatalog.Business.CollectionView(SessionState.EditedUser.Notifications);
        dg.DataSource = SessionState.EditedUser.Role.Notifications;
        dg.DataBind();
        Utils.InitGridSort(ref dg, false);

        if (!SessionState.User.HasCapability(CapabilitiesEnum.MANAGE_USERS) || SessionState.User.IsReadOnly)
        {
            TemplatedColumn colHeader      = (TemplatedColumn)dg.Columns.FromKey("Select");
            HeaderItem      cellItemHeader = colHeader.HeaderItem;
            CheckBox        cbHeader       = (CheckBox)cellItemHeader.FindControl("g_ca");
            cbHeader.Enabled = false;

            foreach (UltraGridRow r in dg.Rows)
            {
                TemplatedColumn col      = (TemplatedColumn)r.Cells.FromKey("Select").Column;
                CellItem        cellItem = (CellItem)col.CellItems[r.Index];
                CheckBox        cb       = (CheckBox)cellItem.FindControl("g_sd");
                cb.Enabled = false;
            }
        }
    }
Exemplo n.º 6
0
 protected override void OnMouseUp(MouseEventArgs e)
 {
     ChangeSizeEvent(this, new EventArgs());
     currentResizingItem = null;
     base.OnMouseUp(e);
 }
Exemplo n.º 7
0
        /// <summary>
        /// Refreshes the document outline if if it is visible
        /// and
        /// </summary>
        public void RefreshOutline(int editorLineNumber = -1)
        {
            if (Model == null || Model.AppModel == null || Model.Window == null ||
                !Model.AppModel.Configuration.IsDocumentOutlineVisible)
            {
                return;
            }

            var editor = Model.AppModel.ActiveEditor;

            if (editor == null || editor.EditorSyntax != "markdown")
            {
                Model.Window.TabDocumentOutline.Visibility = Visibility.Collapsed;
                Model.DocumentOutline = null;

                if (Model.Window.SidebarContainer.SelectedItem == Model.Window.TabDocumentOutline)
                {
                    Model.Window.SidebarContainer.SelectedItem = Model.Window.TabFolderBrowser;
                }

                return;
            }


            // make the tab visible
            Model.Window.TabDocumentOutline.Visibility = Visibility.Visible;
            Visibility = Visibility.Visible;

            // if not selected - don't update
            if (Model.Window.SidebarContainer.SelectedItem != Model.Window.TabDocumentOutline)
            {
                return;
            }

            int line = editorLineNumber;

            if (line < 0)
            {
                line = editor.GetLineNumber();
            }

            var        outline      = Model.CreateDocumentOutline(editor.MarkdownDocument.CurrentText);
            HeaderItem selectedItem = null;

            for (var index = 0; index < outline.Count; index++)
            {
                var item = outline[index];
                if (item.Line == line)
                {
                    selectedItem = item;
                    break;
                }

                if (item.Line > line && line > 0)
                {
                    index = index - 1;
                    if (index < 0)
                    {
                        index = 0;
                    }
                    selectedItem = outline[index];
                    break;
                }
            }

            Model.DocumentOutline = outline;
            if (selectedItem != null)
            {
                IgnoreSelection = DateTime.UtcNow;
                if (selectedItem != ListOutline.SelectedItem)
                {
                    ListOutline.SelectedItem = selectedItem;
                }

                ListOutline.ScrollIntoView(selectedItem);
            }
        }
Exemplo n.º 8
0
        static void Main(string[] args)
        {
            try
            {
                string[] CSVFiles = Directory.GetFiles(@"C:\CSVFiles\", "*.csv");

                if (CSVFiles.Length == 0)
                {
                    throw new Exception("No .csv files found");
                }

                foreach (var CSVFile in CSVFiles)
                {
                    // Import file
                    string            errorLog = string.Empty;
                    string            currentLine;
                    int               currentLineCounter = 1;
                    bool              firstlineFlag      = true;
                    string            textJSON           = "[" + Environment.NewLine;
                    List <HeaderItem> headerList         = new List <HeaderItem>();

                    using (FileStream fileStream = new FileStream(CSVFile, FileMode.Open, FileAccess.Read))
                    {
                        StreamReader streamReader = new StreamReader(fileStream, Encoding.UTF8);

                        while ((currentLine = streamReader.ReadLine()) != null)
                        {
                            if (firstlineFlag)
                            {
                                Console.WriteLine("Line " + currentLineCounter + " : Reading header . . .");

                                // Map headers
                                string   firstLine      = currentLine;
                                string[] firstLineArray = firstLine.Split(',');
                                int      headerCounter  = 0;

                                foreach (string header in firstLineArray)
                                {
                                    string headerType     = string.Empty;
                                    string headerListName = string.Empty;

                                    if (String.IsNullOrEmpty(header))
                                    {
                                        throw new Exception("Empty header in file : " + CSVFile);
                                    }

                                    if (header.Contains("_"))
                                    {
                                        headerType     = "List";
                                        headerListName = header.Split('_')[0];
                                    }
                                    else
                                    {
                                        headerType = "Single";
                                    }

                                    var headerItem = new HeaderItem()
                                    {
                                        Position = headerCounter,
                                        Type     = headerType,
                                        Name     = header,
                                        ListName = headerListName
                                    };

                                    headerList.Add(headerItem);
                                    headerCounter++;
                                }
                            }
                            else
                            {
                                Console.WriteLine("Line " + currentLineCounter + " : Reading body . . .");

                                // Parse lines, map to JSON
                                List <string> valueList      = new List <string>();
                                List <string> doneList       = new List <string>();
                                string        thisLine       = currentLine;
                                string[]      thisLineArray  = thisLine.Split(',');
                                int           currentCounter = 0;

                                if (textJSON.Length > 5)
                                {
                                    textJSON = textJSON + "," + Environment.NewLine;
                                }
                                textJSON = textJSON + "{";

                                foreach (string value in thisLineArray)
                                {
                                    if (String.IsNullOrEmpty(value))
                                    {
                                        throw new Exception("Empty value in file : " + CSVFile + ", line number : " + currentLineCounter);
                                    }

                                    HeaderItem thisItem = headerList.FirstOrDefault(h => h.Position == currentCounter);

                                    if (thisItem.Type == "Single")
                                    {
                                        textJSON = textJSON + Environment.NewLine + "\t\"" + thisItem.Name + "\": \"" + value + "\"";
                                        if (!headerList.Last().Equals(thisItem))
                                        {
                                            textJSON = textJSON + ",";
                                        }
                                    }
                                    else
                                    {
                                        string listType = thisItem.Name.Split('_')[0];
                                        if (!doneList.Contains(listType))
                                        {
                                            textJSON = textJSON + Environment.NewLine + "\t\"" + listType + "\": {";
                                            List <HeaderItem> headerMatchList = headerList.Where(h => h.ListName == listType).ToList();
                                            foreach (HeaderItem matchItem in headerMatchList)
                                            {
                                                textJSON = textJSON + Environment.NewLine + "\t\t\"" + matchItem.Name.Split('_')[1] + "\": \"" + thisLineArray[matchItem.Position] + "\"";
                                                if (!headerMatchList.Last().Equals(matchItem))
                                                {
                                                    textJSON = textJSON + ",";
                                                }
                                            }
                                            textJSON = textJSON + Environment.NewLine + "\t},";
                                            doneList.Add(listType);
                                        }
                                    }

                                    currentCounter++;
                                }
                                textJSON = textJSON + Environment.NewLine + "}";
                            }

                            firstlineFlag = false;
                            currentLineCounter++;
                        }

                        textJSON = textJSON + Environment.NewLine + "]";

                        File.WriteAllText(CSVFile.Replace(".csv", ".json"), textJSON);
                    }
                }
            }
            catch (Exception e)
            {
                Console.WriteLine("Error Occured : " + Environment.NewLine + Environment.NewLine + e);
            }

            Console.ReadKey();
        }
Exemplo n.º 9
0
		/*
	     * (non-Javadoc)
	     * @see android.support.v4.app.LoaderManager.LoaderCallbacks#onLoadFinished(android
	     * .support.v4.content.Loader, java.lang.Object)
	     */
		public void OnLoadFinished (Android.Content.Loader loader, Java.Lang.Object raw)
		{
			var data = Utils.GetDictionary (raw);
			mRowsAdapter = new ArrayObjectAdapter (new ListRowPresenter ());
			var cardPresenter = new CardPresenter ();

			int i = 0;
			foreach (var entry in  data) {
				var listRowAdapter = new ArrayObjectAdapter (cardPresenter);
				IList<Movie> list = entry.Value;
				foreach (Movie current in list) {
					listRowAdapter.Add (current);
				}
				var header = new HeaderItem (i, entry.Key, null);
				i++;
				mRowsAdapter.Add (new ListRow (header, listRowAdapter));
			}

			var gridHeader = new HeaderItem (i, Resources.GetString (Resource.String.preferences), null);
			var gridPresenter = new GridItemPresenter (this);
			var gridRowAdapter = new ArrayObjectAdapter (gridPresenter);

			gridRowAdapter.Add (Resources.GetString (Resource.String.grid_view));
			gridRowAdapter.Add (Resources.GetString (Resource.String.send_feeback));
			gridRowAdapter.Add (Resources.GetString (Resource.String.personal_settings));
			mRowsAdapter.Add (new ListRow (gridHeader, gridRowAdapter));
			this.Adapter = mRowsAdapter;

			UpdateRecommendations ();
		}
Exemplo n.º 10
0
 /// <inheritdoc />
 public object Add(HeaderItem item)
 {
     return(_menuBar.Add(item));
 }
Exemplo n.º 11
0
        private List <HeaderItem> CreateHeaderItems()
        {
            List <HeaderItem> headerItems = new List <HeaderItem>();

            HeaderItem headerItem = new HeaderItem()
            {
                Name        = "ID",
                DisplayName = "ID",
                DataType    = "Int64"
            };

            headerItems.Add(headerItem);

            ViewData["Id"] = headerItem;

            headerItem = new HeaderItem()
            {
                Name        = "Title",
                DisplayName = "Title",
                DataType    = "String"
            };
            headerItems.Add(headerItem);

            headerItem = new HeaderItem()
            {
                Name        = "Description",
                DisplayName = "Description",
                DataType    = "String"
            };
            headerItems.Add(headerItem);

            headerItem = new HeaderItem()
            {
                Name        = "Read",
                DisplayName = "Read",
                DataType    = "String"
            };
            headerItems.Add(headerItem);

            headerItem = new HeaderItem()
            {
                Name        = "Download",
                DisplayName = "Download",
                DataType    = "String"
            };
            headerItems.Add(headerItem);

            headerItem = new HeaderItem()
            {
                Name        = "Write",
                DisplayName = "Write",
                DataType    = "String"
            };
            headerItems.Add(headerItem);

            headerItem = new HeaderItem()
            {
                Name        = "Delete",
                DisplayName = "Delete",
                DataType    = "String"
            };
            headerItems.Add(headerItem);


            headerItem = new HeaderItem()
            {
                Name        = "Grant",
                DisplayName = "Grant",
                DataType    = "String"
            };
            headerItems.Add(headerItem);

            return(headerItems);
        }
Exemplo n.º 12
0
 public HeaderItemDesc(HeaderItem headerItem, string assemblyName)
 {
     HeaderItem   = headerItem;
     AssemblyName = assemblyName;
 }
Exemplo n.º 13
0
        public void bind(List <RecyclerItem> list, int iPosition)
        {
            HeaderItem headerObj = list[iPosition] as HeaderItem;

            mTime.Text = headerObj.Header;
        }
Exemplo n.º 14
0
        private void RecreateKeywordGroup()
        {
            HeaderItem dummy = null;

            if (_currentKeywords != null)
            {
                // This need to save buttons group from removing by HeaderControl (it removes groups with zero HeaderItems).
                dummy = new SimpleActionItem(_searchKey, "Dummy", null)
                {
                    GroupCaption = Msg.Keyword
                };
                App.HeaderControl.Add(dummy);
            }

            Action <ActionItem, Action> removeOrCreate = delegate(ActionItem item, Action factory)
            {
                if (item != null)
                {
                    App.HeaderControl.Remove(item.Key);
                    return;
                }
                factory();
            };

            removeOrCreate(_currentKeywords, delegate
            {
                _currentKeywords = new TextEntryActionItem
                {
                    GroupCaption = Msg.Keyword,
                    RootKey      = _searchKey,
                    Width        = 170,
                };
            });

            removeOrCreate(_dropdownKeywords, delegate
            {
                _dropdownKeywords = new DropDownActionItem
                {
                    AllowEditingText = true,
                    GroupCaption     = Msg.Keyword,
                    RootKey          = _searchKey,
                    Width            = 170,
                    NullValuePrompt  = "[Enter Keyword]"
                };



                _dropdownKeywords.SelectedValueChanged +=
                    delegate(object sender, SelectedValueChangedEventArgs args)
                {
                    if (args.SelectedItem == null)
                    {
                        _dropdownKeywords.SelectedItem = "";
                        return;
                    }

                    //    var current = /*_currentKeywords.Text;*/ _dropdownKeywords.SelectedItem.ToString();
                    var selected = args.SelectedItem.ToString();

                    // var hasKeywords = !string.IsNullOrWhiteSpace(current);
                    //  current = !hasKeywords
                    //                  ? selected
                    //                   : selected + KEYWORDS_SEPARATOR + " " + current;
                    //   if (hasKeywords)
                    //     {
                    // Remove "All", if new keyword was added, because All + AnyKeyword = All in searching.
                    //        current = current.Replace(KEYWORDS_SEPARATOR + " " + Keywords.Constants.RootName, string.Empty);
                    //     }

                    _currentKeywords.Text        = selected; //current;
                    _currentKeywords.ToolTipText = _currentKeywords.Text;
                };
            });
            removeOrCreate(_rbAddMoreKeywords, delegate
            {
                _rbAddMoreKeywords = new SimpleActionItem(_searchKey, Msg.Add_More_Keywords, rbKeyword_Click)
                {
                    // LargeImage = Resources.keyword_32,
                    SmallImage   = Resources.keyword_16,
                    GroupCaption = Msg.Keyword,
                    ToolTipText  = Msg.Keyword_Tooltip
                };
            });


            // Populate items by keywords
            _dropdownKeywords.Items.Clear();
            _dropdownKeywords.Items.AddRange(/*new [] {Constants.Default }*/ _searchSettings.KeywordsSettings.Keywords);

            // Add items to HeaderControl
            // App.HeaderControl.Add(_currentKeywords);
            //  _currentKeywords.Visible = false;
            // ToolStripItem t = GetItem(_currentKeywords.Key);
            App.HeaderControl.Add(_dropdownKeywords);
            App.HeaderControl.Add(_rbAddMoreKeywords);

            // Clear current keywords text
            _currentKeywords.Text = String.Empty;

            //   _currentKeywords.PropertyChanged +=

            if (dummy != null)
            {
                App.HeaderControl.Remove(dummy.Key);
                App.HeaderControl.SelectRoot(_searchKey);
            }

            UpdateKeywordsCaption();

            var selectedKeywords = _searchSettings.KeywordsSettings.SelectedKeywords.ToList();

            selectedKeywords.Add("All");
            _dropdownKeywords.SelectedItem = "All";
        }
 internal static void RaiseEvents (IntPtr hwnd, int eventId, object idProp, int idObject, int idChild)
 {
     if (idObject != NativeMethods.OBJID_VSCROLL && idObject != NativeMethods.OBJID_HSCROLL)
     {
         ProxyFragment header = new WindowsSysHeader(hwnd);
         AutomationProperty property = idProp as AutomationProperty;
         if (property == TablePattern.ColumnHeadersProperty || property == TablePattern.RowHeadersProperty)
         {
             // Check if the parent is a ListView
             IntPtr hwndParent = NativeMethodsSetLastError.GetAncestor (hwnd, NativeMethods.GA_PARENT);
             if (hwndParent != IntPtr.Zero)
             {
                 if (Misc.GetClassName(hwndParent).IndexOf("SysListView32", StringComparison.Ordinal) >= 0)
                 {
                     // Notify the Listview that the header Change
                     WindowsListView wlv = (WindowsListView) WindowsListView.Create (hwndParent, 0);
                     if (wlv != null)
                     {
                         wlv.DispatchEvents (eventId, idProp, idObject, idChild);
                     }
                 }
             }
         }
         else
         {
             if (idProp == InvokePattern.InvokedEvent)
             {
                 ProxySimple headerItem = new HeaderItem(hwnd, header, idChild);
                 headerItem.DispatchEvents(eventId, idProp, idObject, idChild);
             }
             else
             {
                 header.DispatchEvents(eventId, idProp, idObject, idChild);
             }
         }
     }
 }
        // Scroll the specified headerItem horizontally into view.
        internal void ScrollIntoView(HeaderItem headerItem)
        {
            // Check if the parent is a ListView
            IntPtr hwndParent = NativeMethodsSetLastError.GetAncestor (_hwnd, NativeMethods.GA_PARENT);
            if (hwndParent != IntPtr.Zero)
            {
                if (Misc.GetClassName(hwndParent).IndexOf("SysListView32", StringComparison.Ordinal) >= 0)
                {
                    // Determine the number of pixels or columns to scroll horizontally.
                    int pixels = 0;
                    int columns = 0;

                    // Get first and last visible header items.
                    HeaderItem firstVisibleHeaderItem;
                    HeaderItem lastVisibleHeaderItem;
                    GetVisibleHeaderItemRange(out firstVisibleHeaderItem, out lastVisibleHeaderItem);
                    if (firstVisibleHeaderItem != null && firstVisibleHeaderItem._item > headerItem._item)
                    {
                        // Scroll backward.
                        pixels = (int)(headerItem.BoundingRectangle.Left - firstVisibleHeaderItem.BoundingRectangle.Left);
                        columns = headerItem._item - firstVisibleHeaderItem._item;
                    }
                    else if (lastVisibleHeaderItem != null && headerItem._item > lastVisibleHeaderItem._item)
                    {
                        // Scroll forward.
                        pixels = (int)(headerItem.BoundingRectangle.Left - lastVisibleHeaderItem.BoundingRectangle.Left);
                        columns = headerItem._item - lastVisibleHeaderItem._item;
                    }

                    int horizontalScrollAmount = 0;
                    if (WindowsListView.IsListMode(hwndParent))
                    {
                        // In list mode, LVM_SCROLL uses a column count.
                        horizontalScrollAmount = columns;
                    }
                    else if (WindowsListView.IsDetailMode(hwndParent))
                    {
                        // In details mode, LVM_SCROLL uses a pixel count.
                        horizontalScrollAmount = pixels;
                    }

                    if (horizontalScrollAmount != 0)
                    {
                        Misc.ProxySendMessage(hwndParent, NativeMethods.LVM_SCROLL, new IntPtr(horizontalScrollAmount), IntPtr.Zero);
                    }
                }
            }
        }
        // ------------------------------------------------------
        //
        // Private Methods
        //
        // ------------------------------------------------------

        #region Private Methods

        private void GetVisibleHeaderItemRange(
            out HeaderItem firstVisibleHeaderItem, out HeaderItem lastVisibleHeaderItem)
        {
            firstVisibleHeaderItem = null;
            lastVisibleHeaderItem = null;
            for (HeaderItem headerItem = GetFirstChild() as HeaderItem;
                            headerItem != null;
                            headerItem = GetNextSibling(headerItem) as HeaderItem)
            {
                bool isOffscreen = (bool) headerItem.GetElementProperty(AutomationElement.IsOffscreenProperty);
                if (!isOffscreen)
                {
                    // Header item is visible.
                    if (firstVisibleHeaderItem == null)
                    {
                        firstVisibleHeaderItem = headerItem;
                    }
                    lastVisibleHeaderItem = headerItem;
                }
            }
        }
Exemplo n.º 18
0
        private void CreateHeaders()
        {
            var newHeaders = new List<HeaderItem>();
            for (int i = 0; i < Range; i++)
            {
                var header = new HeaderItem();
                var datebinding = new Binding("CurrentDate");
                header.DataContext = this;
                datebinding.Converter = new DateShiftConverter();
                datebinding.ConverterParameter = i;
                header.SetBinding(HeaderItem.HeaderProperty, datebinding);
                var brushBinding = new Binding("CurrentDate");
                brushBinding.Converter = new DateHeaderBrushConverter();
                brushBinding.ConverterParameter = i;
                header.SetBinding(HeaderItem.BackgroundProperty, brushBinding);

                newHeaders.Add(header);
            }
            Headers = newHeaders;
        }
Exemplo n.º 19
0
        public ActionResult Index()
        {
            ViewBag.Title = PresentationModel.GetViewTitleForTenant("Dashboard", this.Session.GetTenant());

            DashboardModel model = GetDefaultDashboardModel();

            #region mydatasetmodel

            ViewData["PageSize"]    = 10;
            ViewData["CurrentPage"] = 1;

            #region header

            List <HeaderItem> headerItems = new List <HeaderItem>();

            HeaderItem headerItem = new HeaderItem()
            {
                Name        = "ID",
                DisplayName = "ID",
                DataType    = "Int64"
            };
            headerItems.Add(headerItem);

            ViewData["Id"] = headerItem;

            headerItem = new HeaderItem()
            {
                Name        = "Title",
                DisplayName = "Title",
                DataType    = "String"
            };
            headerItems.Add(headerItem);

            headerItem = new HeaderItem()
            {
                Name        = "Description",
                DisplayName = "Description",
                DataType    = "String"
            };
            headerItems.Add(headerItem);

            headerItem = new HeaderItem()
            {
                Name        = "Read",
                DisplayName = "Read",
                DataType    = "String"
            };
            headerItems.Add(headerItem);

            headerItem = new HeaderItem()
            {
                Name        = "Download",
                DisplayName = "Download",
                DataType    = "String"
            };
            headerItems.Add(headerItem);

            headerItem = new HeaderItem()
            {
                Name        = "Write",
                DisplayName = "Write",
                DataType    = "String"
            };
            headerItems.Add(headerItem);

            headerItem = new HeaderItem()
            {
                Name        = "Delete",
                DisplayName = "Delete",
                DataType    = "String"
            };
            headerItems.Add(headerItem);

            headerItem = new HeaderItem()
            {
                Name        = "Grant",
                DisplayName = "Grant",
                DataType    = "String"
            };
            headerItems.Add(headerItem);

            headerItem = new HeaderItem()
            {
                Name        = "Valid",
                DisplayName = "is valid",
                DataType    = "String"
            };
            headerItems.Add(headerItem);

            ViewData["DefaultHeaderList"] = headerItems;

            #endregion header

            model.MyDatasets = CreateDataTable(headerItems);

            #endregion mydatasetmodel

            return(View(model));
        }
Exemplo n.º 20
0
        /// <summary>
        /// create the model of My Dataset table
        /// </summary>
        /// <remarks></remarks>
        /// <seealso cref="_CustomMyDatasetBinding"/>
        /// <param>NA</param>
        /// <returns>model</returns>
        public ActionResult ShowMyDatasets()
        {
            ViewBag.Title = PresentationModel.GetViewTitleForTenant("Dashboard", this.Session.GetTenant());

            DataTable model = new DataTable();

            ViewData["PageSize"]    = 10;
            ViewData["CurrentPage"] = 1;


            #region header
            List <HeaderItem> headerItems = new List <HeaderItem>();


            HeaderItem headerItem = new HeaderItem()
            {
                Name        = "ID",
                DisplayName = "ID",
                DataType    = "Int64"
            };
            headerItems.Add(headerItem);

            ViewData["Id"] = headerItem;

            headerItem = new HeaderItem()
            {
                Name        = "Title",
                DisplayName = "Title",
                DataType    = "String"
            };
            headerItems.Add(headerItem);

            headerItem = new HeaderItem()
            {
                Name        = "Description",
                DisplayName = "Description",
                DataType    = "String"
            };
            headerItems.Add(headerItem);

            headerItem = new HeaderItem()
            {
                Name        = "Read",
                DisplayName = "Read",
                DataType    = "String"
            };
            headerItems.Add(headerItem);

            headerItem = new HeaderItem()
            {
                Name        = "Download",
                DisplayName = "Download",
                DataType    = "String"
            };
            headerItems.Add(headerItem);

            headerItem = new HeaderItem()
            {
                Name        = "Write",
                DisplayName = "Write",
                DataType    = "String"
            };
            headerItems.Add(headerItem);

            headerItem = new HeaderItem()
            {
                Name        = "Delete",
                DisplayName = "Delete",
                DataType    = "String"
            };
            headerItems.Add(headerItem);


            headerItem = new HeaderItem()
            {
                Name        = "Grant",
                DisplayName = "Grant",
                DataType    = "String"
            };
            headerItems.Add(headerItem);

            ViewData["DefaultHeaderList"] = headerItems;

            #endregion

            model = CreateDataTable(headerItems);

            return(PartialView("_myDatasetGridView", model));
        }
Exemplo n.º 21
0
		private int GetItemIndex(HeaderItem it)
		{
			int index = 0;
			foreach (var item in headerItems)
			{
				if (item == it)
					return index;
				index++;
			}
			return 0;
		}
Exemplo n.º 22
0
 public void Add(HeaderItem item)
 {
     _menuBar.Add(item);
 }
Exemplo n.º 23
0
		protected override void OnMouseMove(MouseEventArgs e)
		{
			if (currentResizingItem == null)
			{
				ResetActiveFlag();
				var highLight = FindItem(e.X);
				if (highLight != null && highLight != highLightedItem)
				{
					highLight.isActive = true;
					highLightedItem = highLight;
					Invalidate();
				}

				Cursor = Cursors.Arrow;
				if (FindItemSplitter(e.X) != null)
					Cursor = Cursors.VSplit;
			}
			else
			{
				int width = e.X - GetItemPosition(currentResizingItem);
				if (width > 30)
					currentResizingItem.Width = width;
				Invalidate();
			}
			base.OnMouseMove(e);
		}
Exemplo n.º 24
0
        protected void Page_Load(object sender, EventArgs e)
        {
            //set current item
            currentItem = Sitecore.Context.Database.GetItem(ItemPaths.Header);

            //Header links
            Item[] links = currentItem.InnerItem.Axes.SelectItems(String.Format("child::*[@@tid='{0}']", LinkItem.TemplateId));
            if (links != null)
            {
                List<LinkItem> headerLinks = links.ToList().ConvertAll(X => new LinkItem(X));
                LinkList.DataSource = headerLinks;
                LinkList.DataBind();
            }

            //Set featured promo link and home page link
            Sitecore.Links.UrlOptions urlOptions = new Sitecore.Links.UrlOptions();
            urlOptions.AlwaysIncludeServerUrl = true;
            urlOptions.AddAspxExtension = true;
            urlOptions.LanguageEmbedding = LanguageEmbedding.Never;

            //set Featured Promo Event Teaser
            if (currentItem.InnerItem.HasChildren)
            {
                List<FeaturedPromotionEventWidgetItem> allFeatures = currentItem.InnerItem.Children.ToList().ConvertAll(X => new FeaturedPromotionEventWidgetItem(X));
                fpew = new FeaturedPromotionEventWidgetItem(allFeatures.First());
            }

            //Set home page link (set as club home if home club set)
            string startPath = Sitecore.Context.Site.StartPath.ToString();
            var homeItem = Sitecore.Context.Database.GetItem(startPath);
            hdnLastClubVisitedId.Value = "";

            //set hidden field for javascript referencing
            homePageUrl.Value = Sitecore.Links.LinkManager.GetItemUrl(homeItem, urlOptions);
            homePageUrl.Value = homePageUrl.Value.IndexOf("Home.aspx") != -1 ? homePageUrl.Value : homePageUrl.Value + "Home.aspx";

            //Set home page link
            homeOrClubPageUrl = Sitecore.Links.LinkManager.GetItemUrl(homeItem, urlOptions);

            //Set Header Text -need logic to display <h1> or <h2>
            //Format Contact Address
            System.Text.StringBuilder markupBuilder = new System.Text.StringBuilder();

            if (Sitecore.Context.Item.ID == homeItem.ID)
            {
                //Page is home page
                markupBuilder.Append(@"<h1 class=""headertext""><a href=""");
                markupBuilder.Append(HomeOrClubPageUrl + @""">");
                markupBuilder.Append(Translate.Text("Virgin Active") + " <span>");
                markupBuilder.Append(Translate.Text("Health Clubs") + "</span></a></h1>");
            }
            else
            {
                markupBuilder.Append(@"<h2 class=""headertext""><a href=""");
                markupBuilder.Append(HomeOrClubPageUrl + @""">");
                markupBuilder.Append(Translate.Text("Virgin Active") + " <span>");
                markupBuilder.Append(Translate.Text("Health Clubs") + "</span></a></h2>");
            }

            ltrHeaderText.Text = markupBuilder.ToString();

            //CREATE NEW USER SESSION
            //Check if we are loading home page for the first time
            User objUser = new User();

            //Check Session
            if (Session["sess_User"] == null)
            {
                newSession = true;
            }
            else
            {
                objUser = (User)Session["sess_User"];
            }

            //READ/SET COOKIE OPTIONS
            if (newSession)
            {
                //New Session

                //Check gallery preference
                if (!string.IsNullOrEmpty(CookieHelper.GetCookieValue(CookieKeyNames.ShowGallery)))
                {
                    //Store to session
                    objUser.ShowGallery = CookieHelper.GetCookieValue(CookieKeyNames.ShowGallery) == "Y" ? true : false;
                }

                //Check if cookie preferences session cookie exists
                if (!string.IsNullOrEmpty(CookieHelper.GetOptInCookieValue(CookieKeyNames.MarketingCookies)))
                {
                    Preferences preferences = new Preferences();

                    preferences.MarketingCookies = CookieHelper.GetOptInCookieValue(CookieKeyNames.MarketingCookies) == "Y" ? true : false;
                    preferences.MetricsCookies = CookieHelper.GetOptInCookieValue(CookieKeyNames.MetricsCookies) == "Y" ? true : false;
                    preferences.PersonalisedCookies = CookieHelper.GetOptInCookieValue(CookieKeyNames.PersonalisedCookies) == "Y" ? true : false;
                    preferences.SocialCookies = CookieHelper.GetOptInCookieValue(CookieKeyNames.SocialCookies) == "Y" ? true : false;

                    //Store to session
                    objUser.Preferences = preferences;
                }
                else
                {
                    //Interorgate the request 'Do Not Track' settings.
                    HttpContext objContext = HttpContext.Current;
                    bool headerDoNotTrack = false;

                    if (!string.IsNullOrEmpty(objContext.Request.Headers["DNT"]))
                    {
                        headerDoNotTrack = objContext.Request.Headers["DNT"] == "1" ? true : false;
                    }

                    if (headerDoNotTrack)
                    {
                        //Set Preferences in User Session -default to N
                        Preferences preferences = new Preferences();

                        preferences.MarketingCookies = false;
                        preferences.MetricsCookies = false;
                        preferences.PersonalisedCookies = false;
                        preferences.SocialCookies = false;

                        objUser.Preferences = preferences;

                        //Set Cookie Preferences Cookie
                        CookieHelper.AddUpdateOptInCookie(CookieKeyNames.MarketingCookies, "N");
                        CookieHelper.AddUpdateOptInCookie(CookieKeyNames.MetricsCookies, "N");
                        CookieHelper.AddUpdateOptInCookie(CookieKeyNames.PersonalisedCookies, "N");
                        CookieHelper.AddUpdateOptInCookie(CookieKeyNames.SocialCookies, "N");

                        //Delete Existing Personalisation Cookie
                        CookieHelper.DeleteCookie();
                    }
                }
            }

            //DEFAULT PREFERENCES
            if (objUser.Preferences == null)
            {
                //Set preferences in User Session -default to Y
                Preferences preferences = new Preferences();

                preferences.MarketingCookies = true;
                preferences.MetricsCookies = true;
                preferences.PersonalisedCookies = true;
                preferences.SocialCookies = true;

                //Store to session
                objUser.Preferences = preferences;

                //Set Cookie Preferences Cookie -default to permission allowed
                CookieHelper.AddUpdateOptInCookie(CookieKeyNames.MarketingCookies, "Y");
                CookieHelper.AddUpdateOptInCookie(CookieKeyNames.MetricsCookies, "Y");
                CookieHelper.AddUpdateOptInCookie(CookieKeyNames.PersonalisedCookies, "Y");
                CookieHelper.AddUpdateOptInCookie(CookieKeyNames.SocialCookies, "Y");
            }

            //SHOW/HIDE PERSONALISED CONTENT
            if (newSession && (Sitecore.Context.Item.ID == homeItem.ID))
            {
                //Loading home page for the first time -Check if last page visited cookie exists
                //if(!string.IsNullOrEmpty(CookieHelper.GetCookieValue(CookieKeyNames.ClubLastVisited)))
                if (!string.IsNullOrEmpty(CookieHelper.GetClubLastVisitedCookieValue(CookieKeyNames.ClubLastVisited)))
                {
                    //Display message prompting then to go to club
                    phLastClubVisitedPrompt.Visible = true;
                    //clubLastVisited = SitecoreHelper.GetClubOnClubId(CookieHelper.GetCookieValue(CookieKeyNames.ClubLastVisited));
                    clubLastVisited = SitecoreHelper.GetClubOnClubId(CookieHelper.GetClubLastVisitedCookieValue(CookieKeyNames.ClubLastVisited));
                    if (clubLastVisited != null)
                    {
                        ClubLastVisitedUrl = Sitecore.Links.LinkManager.GetItemUrl(clubLastVisited, urlOptions);
                        ClubName = clubLastVisited.Clubname.Rendered;
                        hdnLastClubVisitedId.Value = clubLastVisited.ClubId.Rendered;

                        //Store to session
                        objUser.ClubLastVisitedID = clubLastVisited.ClubId.Rendered;
                    }
                }
            }
            else
            {
                //User session already exists but only visiting home page for the first time
                if ((objUser.HomePageVisited == false) && (Sitecore.Context.Item.ID == homeItem.ID))
                {
                    //if (!string.IsNullOrEmpty(CookieHelper.GetCookieValue(CookieKeyNames.ClubLastVisited)))
                    if (!string.IsNullOrEmpty(CookieHelper.GetClubLastVisitedCookieValue(CookieKeyNames.ClubLastVisited)))
                    {
                        //Display message prompting then to go to club
                        phLastClubVisitedPrompt.Visible = true;
                        //clubLastVisited = SitecoreHelper.GetClubOnClubId(CookieHelper.GetCookieValue(CookieKeyNames.ClubLastVisited));
                        clubLastVisited = SitecoreHelper.GetClubOnClubId(CookieHelper.GetClubLastVisitedCookieValue(CookieKeyNames.ClubLastVisited));
                        if (clubLastVisited != null)
                        {
                            ClubLastVisitedUrl = Sitecore.Links.LinkManager.GetItemUrl(clubLastVisited, urlOptions);
                            ClubName = clubLastVisited.Clubname.Rendered;
                            hdnLastClubVisitedId.Value = clubLastVisited.ClubId.Rendered;

                            //Store to session
                            objUser.ClubLastVisitedID = clubLastVisited.ClubId.Rendered;
                        }
                    }
                }
            }

            //Check if a club has been set as home page
            if (!String.IsNullOrEmpty(CookieHelper.GetCookieValue(CookieKeyNames.HomeClub)))
            {
                ClubItem club = SitecoreHelper.GetClubOnClubId(CookieHelper.GetCookieValue(CookieKeyNames.HomeClub));
                if (club != null)
                {
                    homeOrClubPageUrl = Sitecore.Links.LinkManager.GetItemUrl(club, urlOptions);

                    //Store to session
                    objUser.HomeClubID = club.ClubId.Rendered;
                }
            }

            //Save session
            Session["sess_User"] = objUser;

            Sitecore.Data.Items.Item headerItem = Sitecore.Context.Database.GetItem("/sitecore/content/page-elements/header");

            //Get featured promotion event item details for banner
            Sitecore.Data.Items.Item featuredPromotionEventItem = Sitecore.Context.Database.GetItem("/sitecore/content/Widgets/featured-promotion-event");
            if (featuredPromotionEventItem != null)
            {
                //fldPromotionEventDate.DataSource = featuredPromotionEventItem.ID.ToString();

                //fldPromotionEventSubheading.DataSource = featuredPromotionEventItem.ID.ToString();
            }
        }
Exemplo n.º 25
0
		protected override void OnMouseUp(MouseEventArgs e)
		{
			ChangeSizeEvent(this, new EventArgs());
			currentResizingItem = null;
			base.OnMouseUp(e);
		}
Exemplo n.º 26
0
		private int GetItemPosition(HeaderItem it)
		{
			int offs = 0;
			foreach (var item in headerItems)
			{
				if (item == it)
					return offs;
				offs += item.Width;
			}
			return 0;
		}
Exemplo n.º 27
0
 public PlainItem(TItem item, HeaderItem <TItem> parent, int index, int depth)
     : base(item, parent, index, depth)
 {
 }
Exemplo n.º 28
0
		protected void DrawHeaderItem(Graphics g, int offs, HeaderItem item)
		{
			var rect = new Rectangle(offs + 2, 0, item.Width - 2, Height - 1);

			if (item.isActive)
			{
				g.FillRectangle(Brushes.LightBlue, rect);
			}

			g.DrawRectangle(Pens.Black, rect);

			var textDotsSize = TextRenderer.MeasureText("...", Font, new Size(100, 20), TextFormatFlags.SingleLine);
			var textSize = TextRenderer.MeasureText(item.Text, Font, new Size(item.Width, 20), TextFormatFlags.SingleLine);

			if (textSize.Width > item.Width)
			{
				g.DrawString(item.Text, Font, Brushes.Black,
				             new Rectangle(offs + 2, 0, item.Width - 2 - textDotsSize.Width, Height - 1),
				             new StringFormat(StringFormatFlags.NoWrap));
				g.DrawString("...", Font, Brushes.Black,
				             new Rectangle(offs + item.Width - 2 - textDotsSize.Width, 0, textDotsSize.Width, Height - 1),
				             new StringFormat(StringFormatFlags.NoWrap));
			}
			else
			{
				g.DrawString(item.Text, Font, Brushes.Black, rect, new StringFormat(StringFormatFlags.NoWrap));
			}
		}
Exemplo n.º 29
0
        private static SearchResultPreview GetPrevieItem()
        {
            SearchResultPreview srp = new SearchResultPreview();

            List <HeaderItem> Header  = new List <HeaderItem>();
            List <Row>        RowList = new List <Row>();

            HeaderItem hi;

            hi      = new HeaderItem();
            hi.Name = "VariableName";
            Header.Add(hi);

            hi      = new HeaderItem();
            hi.Name = "VariableParameter";
            Header.Add(hi);

            hi      = new HeaderItem();
            hi.Name = "Unit";
            Header.Add(hi);

            hi      = new HeaderItem();
            hi.Name = "Description";
            Header.Add(hi);



            //-----------------------------------------
            Row           r         = new Row();
            List <object> ValueList = new List <object>();

            ValueList.Add("Species");
            ValueList.Add("No");
            ValueList.Add("No");
            ValueList.Add("Name of species");
            r.Values = ValueList;

            RowList.Add(r);

            //-----------------------------------------
            r         = new Row();
            ValueList = new List <object>();

            ValueList.Add("Plot");
            ValueList.Add("No");
            ValueList.Add("No");
            ValueList.Add("Plot ID");
            r.Values = ValueList;

            RowList.Add(r);

            //-----------------------------------------

            r         = new Row();
            ValueList = new List <object>();

            ValueList.Add("Temperature");
            ValueList.Add("No");
            ValueList.Add("°C");
            ValueList.Add("-");
            r.Values = ValueList;

            RowList.Add(r);

            //-----------------------------------------

            r         = new Row();
            ValueList = new List <object>();

            ValueList.Add("Date");
            ValueList.Add("No");
            ValueList.Add("No");
            ValueList.Add("Date of Observation");
            r.Values = ValueList;

            RowList.Add(r);

            //-----------------------------------------

            r         = new Row();
            ValueList = new List <object>();

            ValueList.Add("Female perc");
            ValueList.Add("No");
            ValueList.Add("%");
            ValueList.Add("Female species in %");
            r.Values = ValueList;

            RowList.Add(r);

            //-----------------------------------------
            r         = new Row();
            ValueList = new List <object>();

            ValueList.Add("Male perc");
            ValueList.Add("No");
            ValueList.Add("%");
            ValueList.Add("Male species in %");
            r.Values = ValueList;

            RowList.Add(r);

            //-----------------------------------------

            r         = new Row();
            ValueList = new List <object>();

            ValueList.Add("Male perc");
            ValueList.Add("No");
            ValueList.Add("%");
            ValueList.Add("Male species in %");
            r.Values = ValueList;

            RowList.Add(r);

            //-----------------------------------------
            r         = new Row();
            ValueList = new List <object>();

            ValueList.Add("Season");
            ValueList.Add("No");
            ValueList.Add("No");
            ValueList.Add("Define season like summer");
            r.Values = ValueList;

            RowList.Add(r);


            //-----------------------------------------
            r         = new Row();
            ValueList = new List <object>();

            ValueList.Add("Weather");
            ValueList.Add("No");
            ValueList.Add("No");
            ValueList.Add("Define weather like rainy day");
            r.Values = ValueList;

            RowList.Add(r);

            //-----------------------------------------


            srp.Header = Header;
            srp.Rows   = RowList;

            return(srp);
        }
Exemplo n.º 30
0
		protected override void OnMouseDown(MouseEventArgs e)
		{
			currentResizingItem = FindItemSplitter(e.X);
			base.OnMouseDown(e);
		}
Exemplo n.º 31
0
        public static SearchResult ConvertListOfMetadataToSearchResultObject(List <Metadata> metadataList, int pageSize, int currentPage)
        {
            SearchResult sro = new SearchResult();

            sro.PageSize     = pageSize;
            sro.CurrentPage  = currentPage;
            sro.NumberOfHits = metadataList.Count();

            List <HeaderItem> Header        = new List <HeaderItem>();
            List <HeaderItem> DefaultHeader = new List <HeaderItem>();
            List <Row>        RowList       = new List <Row>();

            foreach (Metadata m in metadataList)
            {
                if (metadataList.First() == m)
                {
                    HeaderItem hi = new HeaderItem();

                    hi             = new HeaderItem();
                    hi.Name        = m.GetValueFromNode("datasetid").Item(0).Name;
                    hi.DisplayName = hi.Name.Titleize();
                    Header.Add(hi);
                    DefaultHeader.Add(hi);
                    sro.Id = hi;

                    hi             = new HeaderItem();
                    hi.Name        = m.GetValueFromNode("title").Item(0).Name;
                    hi.DisplayName = hi.Name.Titleize();
                    Header.Add(hi);
                    DefaultHeader.Add(hi);

                    hi             = new HeaderItem();
                    hi.Name        = m.GetValueFromNode("owner").Item(0).Name;
                    hi.DisplayName = hi.Name.Titleize();
                    Header.Add(hi);
                    DefaultHeader.Add(hi);

                    hi             = new HeaderItem();
                    hi.Name        = "PrimaryData";
                    hi.DisplayName = "Primary Data";
                    Header.Add(hi);
                    DefaultHeader.Add(hi);

                    hi             = new HeaderItem();
                    hi.Name        = m.GetValueFromNode("versionID").Item(0).Name;
                    hi.DisplayName = hi.Name.Titleize();
                    Header.Add(hi);
                    DefaultHeader.Add(hi);

                    hi             = new HeaderItem();
                    hi.Name        = m.GetValueFromNode("fileType").Item(0).Name;
                    hi.DisplayName = hi.Name.Titleize();
                    Header.Add(hi);

                    hi             = new HeaderItem();
                    hi.Name        = m.GetValueFromNode("dateLastModified").Item(0).Name;
                    hi.DisplayName = hi.Name.Titleize();
                    Header.Add(hi);

                    hi             = new HeaderItem();
                    hi.Name        = m.GetValueFromNode("projectLeader").Item(0).Name;
                    hi.DisplayName = hi.Name.Titleize();
                    Header.Add(hi);

                    hi             = new HeaderItem();
                    hi.Name        = m.GetValueFromNode("dateEntry").Item(0).Name;
                    hi.DisplayName = hi.Name.Titleize();
                    Header.Add(hi);

                    hi             = new HeaderItem();
                    hi.Name        = m.GetValueFromNode("qualityLevel").Item(0).Name;
                    hi.DisplayName = hi.Name.Titleize();
                    Header.Add(hi);

                    hi             = new HeaderItem();
                    hi.Name        = m.GetValueFromNode("dataStatus").Item(0).Name;
                    hi.DisplayName = hi.Name.Titleize();
                    Header.Add(hi);
                }



                Row           r         = new Row();
                List <object> ValueList = new List <object>();

                ValueList = new List <object>();
                ValueList.Add(Convert.ToInt32(m.GetValueFromNode("datasetid").Item(0).InnerText));
                ValueList.Add(m.GetValueFromNode("title").Item(0).InnerText);
                ValueList.Add(m.GetValueFromNode("owner").Item(0).InnerText);
                ValueList.Add("YES");
                ValueList.Add(m.GetValueFromNode("versionID").Item(0).InnerText);
                ValueList.Add(m.GetValueFromNode("fileType").Item(0).InnerText);
                ValueList.Add(m.GetValueFromNode("dateLastModified").Item(0).InnerText);
                ValueList.Add(m.GetValueFromNode("projectLeader").Item(0).InnerText);
                ValueList.Add(m.GetValueFromNode("dateEntry").Item(0).InnerText);
                ValueList.Add(m.GetValueFromNode("qualityLevel").Item(0).InnerText);
                ValueList.Add(m.GetValueFromNode("dataStatus").Item(0).InnerText);

                r.Values = ValueList;

                r.PreviewItem = GetPrevieItem();

                RowList.Add(r);
            }

            sro.Header = Header;
            sro.Rows   = RowList;
            sro.DefaultVisibleHeaderItem = DefaultHeader;
            sro.PageSize    = pageSize;
            sro.CurrentPage = currentPage;

            return(sro);
        }
Exemplo n.º 32
0
		protected override void OnMouseLeave(EventArgs e)
		{
			ResetActiveFlag();
			currentResizingItem = null;
			base.OnMouseLeave(e);
			Invalidate();
		}
Exemplo n.º 33
0
		protected void LoadRows (String query)
		{
			Dictionary<string, IList<Movie>> movies = VideoProvider.MovieList;
			ArrayObjectAdapter listRowAdapter = new ArrayObjectAdapter (new CardPresenter ());
			foreach (var entry in movies) {
				foreach (Movie movie in entry.Value) {
					if (movie.Title.ToLower (unitedStates)
						.Contains (query.ToLower (unitedStates))
					    || movie.Description.ToLower (unitedStates)
						.Contains (query.ToLower (unitedStates))) {
						listRowAdapter.Add (movie);
					}
				}
			}
			HeaderItem header = new HeaderItem (0, Resources.GetString (Resource.String.search_results), (string)null);
			mRowsAdapter.Add (new ListRow (header, listRowAdapter));
		}
Exemplo n.º 34
0
        private void _showReport(string fileName)
        {
            try
            {
                Mail mail = new Mail("TryIt");
                mail.Load(fileName, false);

                if (!mail.IsReport)
                {
                    MessageBox.Show("This is not a report");
                    return;
                }

                string     s      = "";
                MailReport report = mail.GetReport();
                switch (report.ReportType)
                {
                case DeliveryReportType.DeliveryReceipt:
                    s = "This is a deliver receipt.\r\n\r\n";
                    break;

                case DeliveryReportType.ReadReceipt:
                    s = "This is a read receipt.\r\n\r\n";
                    break;

                case DeliveryReportType.Deleted:
                    s = "This is a unread receipt, this email was deleted without read.\r\n\r\n";
                    break;

                case DeliveryReportType.DelayedReport:
                    s = "This is a delay report, this email will be retried later automatically.\r\n\r\n";
                    break;

                default:
                    s = "This is a failure report.\r\n\r\n";
                    break;
                }

                s += string.Format("Original Sender: {0}\r\n", report.OriginalSender);
                s += string.Format("Original Recipient: {0}\r\n", report.OriginalRecipient);
                s += string.Format("Original Message-ID: {0}\r\n\r\n", report.OriginalMessageID);

                if (report.ReportType == DeliveryReportType.FailureReport || report.ReportType == DeliveryReportType.DelayedReport)
                {
                    s += string.Format("Original Subject: {0}\r\n", report.OriginalSubject);
                    s += string.Format("Report MTA: {0}\r\n", report.ReportMTA);
                    s += string.Format("Error Code: {0}\r\n", report.ErrCode);
                    s += string.Format("Error Description: {0}\r\n\r\n", report.ErrDescription);

                    s += "---- Original Message Header ----\r\n\r\n";
                    HeaderCollection headers = report.OriginalHeaders;
                    int count = headers.Count;
                    for (int i = 0; i < count; i++)
                    {
                        HeaderItem header = headers[i] as HeaderItem;
                        s += string.Format("{0}: {1}\r\n", header.HeaderKey, header.HeaderValue);
                    }
                }

                textReport.Text = s;
            }
            catch (Exception ep)
            {
                MessageBox.Show(ep.Message);
            }
        }
 public MyCombined()
 {
     hdrItm = new HeaderItem();
     mtxItm = new MatrixItem();
 }
Exemplo n.º 36
0
 public static string Serialize(this HeaderItem aResult)
 {
     return($"ID: {aResult.ID.Value}\r\nName: {aResult.Name}");
 }
Exemplo n.º 37
0
 protected override void OnMouseDown(MouseEventArgs e)
 {
     currentResizingItem = FindItemSplitter(e.X);
     base.OnMouseDown(e);
 }