示例#1
0
        /// <summary>
        /// Uses the FHIR paging mechanism to go navigate around a series of paged result Bundles
        /// </summary>
        /// <param name="current">The bundle as received from the last response</param>
        /// <param name="direction">Optional. Direction to browse to, default is the next page of results.</param>
        /// <returns>A bundle containing a new page of results based on the browse direction, or null if
        /// the server did not have more results in that direction.</returns>
        public Bundle Continue(Bundle current, PageDirection direction = PageDirection.Next)
        {
            if (current.Links == null)
            {
                return(null);
            }

            Uri continueAt = null;

            switch (direction)
            {
            case PageDirection.First:
                continueAt = current.Links.FirstLink; break;

            case PageDirection.Previous:
                continueAt = current.Links.PreviousLink; break;

            case PageDirection.Next:
                continueAt = current.Links.NextLink; break;

            case PageDirection.Last:
                continueAt = current.Links.LastLink; break;
            }

            if (continueAt != null)
            {
                return(FetchBundle(continueAt));
            }
            else
            {
                return(null);
            }
        }
 public override void EnterPage(PageDirection enterDirection)
 {
     if (enterDirection == PageDirection.Next)
     {
         PopulateForm();
     }
 }
示例#3
0
 /// <summary>
 /// Default contructor
 /// </summary>
 public GraphvizGraph()
 {
     m_Url                = null;
     m_BackgroundColor    = Color.White;
     m_IsCentered         = false;
     m_ClusterRank        = ClusterMode.Local;
     m_Comment            = null;
     m_IsCompounded       = false;
     m_IsConcentrated     = false;
     m_Font               = null;
     m_FontColor          = Color.Black;
     m_Label              = null;
     m_LabelJustification = LabelJustification.C;
     m_LabelLocation      = LabelLocation.B;
     m_Layers             = new GraphvizLayerCollection();
     m_McLimit            = 1.0;
     m_NodeSeparation     = 0.25;
     m_IsNormalized       = false;
     m_NsLimit            = -1;
     m_NsLimit1           = -1;
     m_OutputOrder        = OutputMode.BreadthFirst;
     m_PageSize           = new Size(0, 0);
     m_PageDirection      = PageDirection.BL;
     m_Quantum            = 0;
     m_RankSeparation     = 0.5;
     m_Ratio              = RatioMode.Auto;
     m_IsReMinCross       = false;
     m_Resolution         = 0.96;
     m_Rotate             = 0;
     m_SamplePoints       = 8;
     m_SearchSize         = 30;
     m_Size               = new Size(0, 0);
     m_StyleSheet         = null;
 }
示例#4
0
 internal static SearchPageDirection GetPageDirection(PageDirection direction)
 {
     if (PageDirection.Previous == direction)
     {
         return(1);
     }
     return(0);
 }
 public async Task <NavigateBundle.Model> NavigateBundleAsync(Bundle bundle, PageDirection nav)
 {
     return(await mediator.Send(new NavigateBundle.Query()
     {
         Bundle = bundle,
         Nav = nav
     }).ConfigureAwait(false));
 }
 public ActionResult Users(int userid = 0, PageDirection dir = PageDirection.Forward)
 {
     var users = userRepository.GetList(userid, PageSize + 1, dir).ToList();
     return View(new UserListViewModel
     {
         UserList = users.Take(PageSize).OrderByDescending(x => x.Id).ToList(),
         ShowPrev = PagingHelper.ShowPrev(userid, users, dir, PageSize),
         ShowNext = PagingHelper.ShowNext(users, dir, PageSize)
     });
 }
示例#7
0
 public Bundle redirect(Bundle current, PageDirection direction)
 {
     try
     {
         var res = _client.Continue(current, direction);
     }catch (Exception ex)
     {
         throw new Exception("action is invalid");
     }
     return(current);
 }
        public ActionResult Love(int loveid = 0, PageDirection dir = PageDirection.Forward)
        {
            var love = loveRepository.GetList(loveid, PageSize + 1, dir).ToList();

            return View(new LoveListViewModel
            {
                LoveList = love.Take(PageSize).OrderByDescending(x => x.Id).ToList(),
                ShowPrev = PagingHelper.ShowPrev(loveid, love, dir, PageSize),
                ShowNext = PagingHelper.ShowNext(love, dir, PageSize)
            });
        }
示例#9
0
 public PagingInfo(List <PropertyDefinition> data, SortBy sort, int pageSize, PageDirection direction, ReferenceItem referenceItem, ExTimeZone timeZone, bool excludeDuplicatesItems, PreviewItemBaseShape baseShape, List <ExtendedPropertyInfo> additionalProperties)
 {
     Util.ThrowOnNull(data, "data");
     Util.ThrowOnNull(sort, "sort");
     if (pageSize == 0)
     {
         throw new ArgumentException("Page size cannot be 0");
     }
     if (referenceItem == null && direction == PageDirection.Previous)
     {
         throw new ArgumentException("PagingInfo: Have to provide sort column value to view previous page");
     }
     if (!PagingInfo.ValidateDataColumns(data))
     {
         throw new ArgumentException("PagingInfo: Invalid data columns");
     }
     this.originalDataColumns = data;
     this.dataColumns         = new List <PropertyDefinition>(data);
     this.sort                  = sort;
     this.referenceItem         = referenceItem;
     this.direction             = direction;
     this.pageSize              = pageSize;
     this.timeZone              = timeZone;
     this.excludeDuplicateItems = excludeDuplicatesItems;
     this.baseShape             = baseShape;
     this.additionalProperties  = additionalProperties;
     if (!this.originalDataColumns.Contains(sort.ColumnDefinition))
     {
         this.dataColumns.Add(sort.ColumnDefinition);
     }
     foreach (PropertyDefinition item in PagingInfo.RequiredDataPropertiesFromStore)
     {
         if (!this.originalDataColumns.Contains(item))
         {
             this.dataColumns.Add(item);
         }
     }
     if (this.additionalProperties != null)
     {
         foreach (ExtendedPropertyInfo extendedPropertyInfo in this.additionalProperties)
         {
             if (extendedPropertyInfo.XsoPropertyDefinition != null && !this.dataColumns.Contains(extendedPropertyInfo.XsoPropertyDefinition))
             {
                 this.dataColumns.Add(extendedPropertyInfo.XsoPropertyDefinition);
             }
         }
     }
     this.sorts = new SortBy[]
     {
         sort,
         new SortBy(ItemSchema.DocumentId, SortOrder.Ascending)
     };
 }
        public async Task <ICachePatientBundle> NavigateBundleAsync(Bundle bundle, PageDirection nav)
        {
            ICachePatientBundle patientBundle;

            patientBundle = await mediator.Send(new NavigateBundle.Query()
            {
                Bundle = bundle,
                Nav    = PageDirection.Next
            }).ConfigureAwait(false);

            return(patientBundle);
        }
示例#11
0
 public bool TryGetPage(Bundle bundle, PageDirection direction, out Bundle requestedPage)
 {
     try
     {
         requestedPage = client.Continue(bundle, direction);
         return(requestedPage != null);
     }
     catch (FhirOperationException)
     {
         requestedPage = null;
         return(false);
     }
 }
 public ActionResult Index(int hateid = 0, PageDirection dir = PageDirection.Forward)
 {
     var hate = hateRepository.GetList(hateid, PageSize + 1, dir).ToList();
     var hatelist = hate.Take(PageSize).OrderByDescending(x => x.Id).ToList();
     return View(new HateListViewModel
     {
         ShowPrev = PagingHelper.ShowPrev(hateid, hate, dir, PageSize),
         ShowNext = PagingHelper.ShowNext(hate, dir, PageSize),
         HateList = hatelist,
         PrevId = hatelist.Count > 0 ? hatelist.First().Id : 0,
         NextId = hatelist.Count > 0 ? hatelist.Last().Id : 0
     });
 }
 public ActionResult Index(int hateid = 0, PageDirection dir = PageDirection.Forward)
 {
     var currentUser = userRepository.GetByEmail(HttpContext.User.Identity.Name);
     var myhate = new List<Hate>();
     if (currentUser.Token != Guid.Empty)
     {
         myhate = hateRepository.GetList(hateid, PageSize + 1, dir, currentUser.Token).ToList();
     }
     return View(new HateListViewModel
     {
         HateList = myhate.Take(PageSize).OrderByDescending(x => x.Id).ToList(),
         ShowPrev = PagingHelper.ShowPrev(hateid, myhate, dir, PageSize),
         ShowNext = PagingHelper.ShowNext(myhate, dir, PageSize)
     });
 }
示例#14
0
        public override bool LeavePage(PageDirection leaveDirection)
        {
            bool validated = true;

            if (leaveDirection == PageDirection.Next)
            {
                validated = InternalReconnectServer(true);
                if (validated)
                {
                    SaveSelectedData();
                }
            }

            return(validated);
        }
示例#15
0
 private void MoveToPage(int page)
 {
     if (lerpValue >= 1f)
     {
         lerpValue = 0f;
         //fadeSelect    = 0;
         pageDirection = PageDirection.NONE;
     }
     else
     {
         lerpValue += Time.deltaTime / length;
         _newPos.Set(_oldPos.x * page, _oldPos.y, _oldPos.z);
         _tabsTransform.position = Vector3.Lerp(_oldPos, _newPos, lerpValue);
     }
 }
示例#16
0
    public void TransitionPage()
    {
        //if ( selectedPage > previousPage )
        //{
        //    fadeSelect = 1;
        //}
        //else if ( selectedPage > previousPage )
        //{
        //    fadeSelect = 2;
        //}

        _oldPos = _tabsTransform.position;
        //fadeSelect = selectedPage > previousPage ? 1 : 2;
        pageDirection = selectedPage > previousPage ? PageDirection.LEFT : PageDirection.RIGHT;
    }
 public ActionResult Users(UpdateRolesViewModel model, int userid = 0, PageDirection dir = PageDirection.Forward)
 {
     if (ModelState.IsValid)
     {
         var user = userRepository.GetById(model.UpdateUserId);
         if (user.Roles.Contains(model.Role))
         {
             user.Roles.Remove(model.Role);
         }
         else
         {
             user.Roles.Add(model.Role);
         }
         userRepository.Save(user);
     }
     return RedirectToAction("Users", new { userid, dir });
 }
示例#18
0
        public void GoTo(PageDirection flags)
        {
            this.Client.Application.AssertApplicationAvailable();

            var application     = this.Client.Application.Get();
            var active_document = application.ActiveDocument;
            var docpages        = active_document.Pages;

            if (docpages.Count < 2)
            {
                return;
            }

            var pages = docpages;

            this._GoTo(pages, flags);
        }
示例#19
0
        public void UpdateButtons(PageDirection button, bool enabled)
        {
            switch (button)
            {
            case PageDirection.Back:
            {
                btnBack.Enabled = enabled;
                break;
            }

            case PageDirection.Next:
            case PageDirection.Finish:
            {
                btnNext.Enabled = enabled;
                break;
            }
            }
        }
示例#20
0
        public override void EnterPage(PageDirection enterDirection)
        {
            if (enterDirection == PageDirection.Next)
            {
                Tuple <IDBProvider, IConnectionInfo> selectedDatabase = this.wizardOwner.SelectedDB;

                IDBProvider dbProvider = selectedDatabase.Item1;
                if (dbProvider.IsConnected)
                {
                    dbProvider.Disconnect();
                }

                bool connectResult = dbProvider.Connect(selectedDatabase.Item2);
                if (connectResult)
                {
                    RefreshTables();
                }
            }
        }
示例#21
0
        public override bool LeavePage(PageDirection leaveDirection)
        {
            bool isValid = leaveDirection == PageDirection.Back;

            if (!isValid)
            {
                CheckNextButton();
                isValid = wizardOwner.ButtonNext.Enabled;
                if (isValid)
                {
                    isValid = CheckSelectedColumns();

                    if (isValid)
                    {
                        SaveSelectedData();
                    }
                }
            }

            return(isValid);
        }
示例#22
0
 public void ChangePage(PageDirection dir)
 {
     if (dir == PageDirection.PREVIOUS)
     {
         if (CurrentPage > 1)
         {
             ChangePage(CurrentPage - 1);
         }
     }
     else if (dir == PageDirection.NEXT)
     {
         if (CurrentPage < PageCount)
         {
             ChangePage(CurrentPage + 1);
         }
     }
     else
     {
         ChangePage(CurrentPage);
     }
 }
示例#23
0
        public void ChangePage(PageDirection dir)
        {
            var api = MainPage.api;

            if (dir == PageDirection.PREVIOUS)
            {
                if (_curPage == 1)
                {
                    return;
                }
                _curPage--;
            }
            else if (dir == PageDirection.NEXT)
            {
                _curPage++;
            }

            //TODO page count
            ThreadsCollection.Clear();
            IsLoading = true;

            api.GetThreads(_forum.ForumID, _curPage, result =>
            {
                System.Windows.Deployment.Current.Dispatcher.BeginInvoke(() =>
                {
                    foreach (Thread t in result)
                    {
                        ThreadsCollection.Add(new ThreadModel(t));
                    }
                    IsLoading = false;
                });
            }, (err, ex) =>
            {
                System.Windows.Deployment.Current.Dispatcher.BeginInvoke(() =>
                {
                    System.Windows.MessageBox.Show("Unable to load threads.");
                    IsLoading = false;
                });
            });
        }
示例#24
0
        /// <summary>
        /// Uses the FHIR paging mechanism to go navigate around a series of paged result Bundles
        /// </summary>
        /// <param name="current">The bundle as received from the last response</param>
        /// <param name="direction">Optional. Direction to browse to, default is the next page of results.</param>
        /// <returns>A bundle containing a new page of results based on the browse direction, or null if
        /// the server did not have more results in that direction.</returns>
        public Task <Bundle> ContinueAsync(Bundle current, PageDirection direction = PageDirection.Next)
        {
            if (current == null)
            {
                throw Error.ArgumentNull(nameof(current));
            }
            if (current.Link == null)
            {
                return(null);
            }

            Uri continueAt = null;

            switch (direction)
            {
            case PageDirection.First:
                continueAt = current.FirstLink; break;

            case PageDirection.Previous:
                continueAt = current.PreviousLink; break;

            case PageDirection.Next:
                continueAt = current.NextLink; break;

            case PageDirection.Last:
                continueAt = current.LastLink; break;
            }

            if (continueAt != null)
            {
                var tx = new TransactionBuilder(Endpoint).Get(continueAt).ToBundle();
                return(executeAsync <Bundle>(tx, HttpStatusCode.OK));
            }
            else
            {
                // Return a null bundle, can not return simply null because this is a task
                Bundle nullValue = null;
                return(Task.FromResult(nullValue));
            }
        }
示例#25
0
        internal static int move_in_range(int cur, int min, int max, PageDirection direction)
        {
            if (max < min)
            {
                throw new System.ArgumentOutOfRangeException("max");
            }

            if (cur < min)
            {
                throw new System.ArgumentOutOfRangeException("cur");
            }

            if (cur > max)
            {
                throw new System.ArgumentOutOfRangeException("cur");
            }

            if (direction == PageDirection.Next)
            {
                return(System.Math.Min(cur + 1, max));
            }
            else if (direction == PageDirection.Previous)
            {
                return(System.Math.Max(cur - 1, min));
            }
            else if (direction == PageDirection.First)
            {
                return(min);
            }
            else if (direction == PageDirection.Last)
            {
                return(max);
            }
            else
            {
                throw new System.ArgumentOutOfRangeException("direction");
            }
        }
        public IEnumerable<Love> GetList(int id = 0, int count = 21, PageDirection direction = PageDirection.Forward)
        {
            var result = new List<Love>();
            using (var conn = Connection)
            {
                conn.Open();
                MySqlCommand command;

                if (id == 0)
                {
                    command = new MySqlCommand("SELECT * FROM love ORDER BY Id DESC LIMIT @Count;", conn);
                    command.Parameters.AddWithValue("@Count", count);
                }
                else
                {
                    if (direction == PageDirection.Forward)
                    {
                        command = new MySqlCommand("SELECT * FROM love WHERE id < @Id ORDER BY Id DESC LIMIT @Count", conn);
                        command.Parameters.AddWithValue("@Id", id);
                        command.Parameters.AddWithValue("@Count", count);
                    }
                    else
                    {
                        command = new MySqlCommand("SELECT * FROM love WHERE id > @Id ORDER BY Id ASC LIMIT @Count", conn);
                        command.Parameters.AddWithValue("@Id", id);
                        command.Parameters.AddWithValue("@Count", count);
                    }
                }

                var reader = command.ExecuteReader();
                while (reader.Read())
                {
                    var item = ParseLove(reader);
                    result.Add(item);
                }
            }
            return result;
        }
示例#27
0
        /// <summary>
        /// Uses the FHIR paging mechanism to go navigate around a series of paged result Bundles
        /// </summary>
        /// <param name="current">The bundle as received from the last response</param>
        /// <param name="direction">Optional. Direction to browse to, default is the next page of results.</param>
        /// <returns>A bundle containing a new page of results based on the browse direction, or null if
        /// the server did not have more results in that direction.</returns>
        public Bundle Continue(Bundle current, PageDirection direction = PageDirection.Next)
        {
            if (current == null)
            {
                throw Error.ArgumentNull("current");
            }
            if (current.Link == null)
            {
                return(null);
            }

            Uri continueAt = null;

            switch (direction)
            {
            case PageDirection.First:
                continueAt = current.FirstLink; break;

            case PageDirection.Previous:
                continueAt = current.PreviousLink; break;

            case PageDirection.Next:
                continueAt = current.NextLink; break;

            case PageDirection.Last:
                continueAt = current.LastLink; break;
            }

            if (continueAt != null)
            {
                var tx = new TransactionBuilder(Endpoint).Get(continueAt).ToBundle();
                return(execute <Bundle>(tx, HttpStatusCode.OK));
            }
            else
            {
                return(null);
            }
        }
示例#28
0
        private void _GoTo(IVisio.Pages pages, PageDirection flags)
        {
            this.AssertApplicationAvailable();

            if (pages == null)
            {
                throw new System.ArgumentNullException("pages");
            }

            var app             = pages.Application;
            var active_document = app.ActiveDocument;

            if (pages.Document != active_document)
            {
                throw new VA.Scripting.ScriptingException("Page.Document is not application's ActiveDocument");
            }

            if (pages.Count < 2)
            {
                throw new VA.Scripting.ScriptingException("Only 1 page available. Navigation not possible.");
            }

            var activepage = app.ActivePage;

            int       cur_index = activepage.Index;
            const int min_index = 1;
            int       max_index = pages.Count;
            int       new_index = move_in_range(cur_index, min_index, max_index, flags);

            if (cur_index != new_index)
            {
                var doc_pages = active_document.Pages;
                var page      = doc_pages[new_index];

                var active_window = app.ActiveWindow;
                active_window.Page = page;
            }
        }
示例#29
0
 public PagingInfo(List <PropertyDefinition> data, SortBy sort, int pageSize, PageDirection direction, ReferenceItem referenceItem, ExTimeZone timeZone) : this(data, sort, pageSize, direction, referenceItem, timeZone, false)
 {
 }
示例#30
0
        private static string FormPageLink <TResult, TSort>(ResultSetSearchVm <TResult, TSort> searchResultVm, PageDirection direction)
        {
            string empty = string.Empty;

            if (searchResultVm.PageSize == 0 || searchResultVm.PageNumber == 0)
            {
                return(empty);
            }
            if (direction == PageDirection.Next)
            {
                if ((float)searchResultVm.PageNumber < (float)searchResultVm.TotalCount / (float)searchResultVm.PageSize)
                {
                    empty = MslcUrlBuilder.PagingUrl(searchResultVm, searchResultVm.PageNumber + 1);
                }
            }
            else if (searchResultVm.PageNumber > 1)
            {
                empty = MslcUrlBuilder.PagingUrl(searchResultVm, searchResultVm.PageNumber - 1);
            }
            return(empty);
        }
        internal static int move_in_range(int cur, int min, int max, PageDirection direction)
        {
            if (max < min)
            {
                throw new System.ArgumentOutOfRangeException(nameof(max));
            }

            if (cur < min)
            {
                throw new System.ArgumentOutOfRangeException(nameof(cur));
            }

            if (cur > max)
            {
                throw new System.ArgumentOutOfRangeException(nameof(cur));
            }

            if (direction == PageDirection.Next)
            {
                return System.Math.Min(cur + 1, max);
            }
            else if (direction == PageDirection.Previous)
            {
                return System.Math.Max(cur - 1, min);
            }
            else if (direction == PageDirection.First)
            {
                return min;
            }
            else if (direction == PageDirection.Last)
            {
                return max;
            }
            else
            {
                throw new System.ArgumentOutOfRangeException(nameof(direction));
            }
        }
示例#32
0
        private void ChangeActivePage(PageDirection direction)
        {
            var lastActivePage = ActivePage;

            switch (direction)
            {
            case PageDirection.Back:
            {
                if (ActivePage == null)
                {
                    throw new Exception();
                }

                bool leavingLastPage = ActivePage == this.Pages.Last();

                if (ActivePage.LeavePage(direction))
                {
                    SetActivePage(this.Pages[activePageIndex - 1]);
                    ActivePage.EnterPage(direction);
                }

                if (leavingLastPage)
                {
                    UpdateButtonNextToFinish(false);
                }

                break;
            }

            case PageDirection.Next:
            {
                if (ActivePage == null)
                {
                    SetActivePage(this.Pages.First());
                    ActivePage.EnterPage(direction);
                }
                else
                {
                    if (ActivePage == this.Pages.Last())
                    {
                        bool finishResult = ActivePage.LeavePage(PageDirection.Finish);
                        if (finishResult)
                        {
                            CloseDialog(true);
                        }
                    }
                    else
                    {
                        bool leaveValidated = ActivePage.LeavePage(direction);
                        if (leaveValidated)
                        {
                            SetActivePage(this.Pages[activePageIndex + 1]);
                            ActivePage.EnterPage(direction);
                            if (ActivePage == this.Pages.Last())
                            {
                                UpdateButtonNextToFinish(true);
                            }
                        }
                    }
                }
                break;
            }

            default:
            {
                throw new InvalidOperationException("PageDirection.Finish");
            }
            }

            UpdateButtons(PageDirection.Back, activePageIndex > 0);
            UpdateButtons(PageDirection.Next, true); //ActivePage != this.Pages.Last());

            phPages.Controls.Clear();

            if (lastActivePage != null)
            {
                Control lastActivePageControl = lastActivePage as Control;
                lastActivePageControl.Visible = false;
            }

            Control control = ActivePage as Control;

            phPages.Controls.Add(control);
            control.Dock    = DockStyle.Fill;
            control.Visible = true;
            ChangePageTitle(ActivePage.DefaultPageTitle);

            //UpdateControls();
        }
 public static bool ShowPrev(int id, ICollection list, PageDirection direction, int pageSize )
 {
     return (direction == PageDirection.Forward && id != 0) ||
            (direction == PageDirection.Backward && list.Count == pageSize + 1);
 }
        public IEnumerable<Hate> GetList(int id = 0,  int count = 21, PageDirection direction = PageDirection.Forward, Guid? token = null)
        {
            var result = new List<Hate>();
            using (var conn = Connection)
            {
                conn.Open();

                MySqlCommand command;
                if(id == 0)
                {
                    var whereClause = "";
                    if (token.HasValue) whereClause = "WHERE token = @Token";
                    command = new MySqlCommand($"SELECT * FROM hate {whereClause} ORDER BY Id DESC LIMIT @Count", conn);
                    command.Parameters.AddWithValue("@Count", count);
                    if (token.HasValue) command.Parameters.AddWithValue("@Token", token.Value);
                }
                else
                {
                    var extendedWhere = "";
                    if (token.HasValue) extendedWhere = "AND token = @Token";

                    if (direction == PageDirection.Forward)
                    {
                        command = new MySqlCommand($"SELECT * FROM hate WHERE id < @Id {extendedWhere}  ORDER BY Id DESC LIMIT @Count", conn);
                        command.Parameters.AddWithValue("@Id", id);
                        command.Parameters.AddWithValue("@Count", count);
                        if (token.HasValue) command.Parameters.AddWithValue("@Token", token.Value);
                    }
                    else
                    {
                        command = new MySqlCommand($"SELECT * FROM hate WHERE id > @Id {extendedWhere} ORDER BY Id ASC LIMIT @Count", conn);
                        command.Parameters.AddWithValue("@Id", id);
                        command.Parameters.AddWithValue("@Count", count);
                        if (token.HasValue) command.Parameters.AddWithValue("@Token", token.Value);
                    }
                }

                using (var reader = command.ExecuteReader())
                {
                    while (reader.Read())
                    {
                        var item = ParseHate(reader);
                        result.Add(item);
                    }
                }

                foreach (var item in result)
                {
                    var categoryCommand = new MySqlCommand("SELECT * FROM `hate-categories` WHERE hateId=@Id", conn);
                    categoryCommand.Parameters.AddWithValue("@Id", item.Id);
                    using (var categoryReader = categoryCommand.ExecuteReader())
                    {
                        item.Categories = new List<string>();
                        while (categoryReader.Read())
                        {
                            item.Categories.Add(categoryReader.GetString("category"));
                        }
                    }
                }
            }
            return result;
        }
示例#35
0
        /// <summary>
        /// Converts to dot code
        /// </summary>
        /// <returns>dot code</returns>
        public String ToDot()
        {
            Hashtable pairs = new Hashtable();

            if (Url != null)
            {
                pairs["URL"] = Url;
            }
            if (BackgroundColor != Color.White)
            {
                pairs["bgcolor"] = BackgroundColor;
            }
            if (IsCentered)
            {
                pairs["center"] = true;
            }
            if (ClusterRank != ClusterMode.Local)
            {
                pairs["clusterrank"] = ClusterRank.ToString().ToLower();
            }
            if (Comment != null)
            {
                pairs["comment"] = Comment;
            }
            if (IsCompounded)
            {
                pairs["compound"] = IsCompounded;
            }
            if (IsConcentrated)
            {
                pairs["concentrated"] = IsConcentrated;
            }
            if (Font != null)
            {
                pairs["fontname"] = Font.Name;
                pairs["fontsize"] = Font.SizeInPoints;
            }
            if (FontColor != Color.Black)
            {
                pairs["fontcolor"] = FontColor;
            }
            if (Label != null)
            {
                pairs["label"] = Label;
            }

            if (LabelJustification != LabelJustification.C)
            {
                pairs["labeljust"] = LabelJustification.ToString().ToLower();
            }

            if (LabelLocation != LabelLocation.B)
            {
                pairs["labelloc"] = LabelLocation.ToString().ToLower();
            }

            if (Layers.Count != 0)
            {
                pairs["layers"] = Layers.ToDot();
            }

            if (McLimit != 1.0)
            {
                pairs["mclimit"] = McLimit;
            }

            if (NodeSeparation != 0.25)
            {
                pairs["nodesep"] = NodeSeparation;
            }
            if (IsNormalized)
            {
                pairs["normalize"] = IsNormalized;
            }
            if (NsLimit > 0)
            {
                pairs["nslimit"] = NsLimit;
            }
            if (NsLimit1 > 0)
            {
                pairs["nslimit1"] = NsLimit1;
            }

            if (OutputOrder != OutputMode.BreadthFirst)
            {
                pairs["outputorder"] = OutputOrder.ToString().ToLower();
            }

            if (!PageSize.IsEmpty)
            {
                pairs["page"] = String.Format("({0},{1})", PageSize.Width, PageSize.Height);
            }
            if (PageDirection != PageDirection.BL)
            {
                pairs["pagedir"] = PageDirection.ToString().ToLower();
            }
            if (Quantum > 0)
            {
                pairs["quantum"] = Quantum;
            }
            if (RankSeparation != 0.5)
            {
                pairs["ranksep"] = RankSeparation;
            }
            if (Ratio != RatioMode.Auto)
            {
                pairs["ratio"] = Ratio.ToString().ToLower();
            }
            if (IsReMinCross)
            {
                pairs["remincross"] = IsReMinCross;
            }
            if (Resolution != 0.96)
            {
                pairs["resolution"] = Resolution;
            }
            if (Rotate != 0)
            {
                pairs["rotate"] = Rotate;
            }
            if (SamplePoints != 8)
            {
                pairs["samplepoints"] = SamplePoints;
            }
            if (SearchSize != 30)
            {
                pairs["searchsize"] = SearchSize;
            }
            if (!Size.IsEmpty)
            {
                pairs["size"] = String.Format("({0},{1})", Size.Width, Size.Height);
            }
            if (StyleSheet != null)
            {
                pairs["stylesheet"] = StyleSheet;
            }

            return(GenerateDot(pairs));
        }
示例#36
0
 /// <summary>
 /// Uses the FHIR paging mechanism to go navigate around a series of paged result Bundles
 /// </summary>
 /// <param name="current">The bundle as received from the last response</param>
 /// <param name="direction">Optional. Direction to browse to, default is the next page of results.</param>
 /// <returns>A bundle containing a new page of results based on the browse direction, or null if
 /// the server did not have more results in that direction.</returns>
 public Bundle Continue(Bundle current, PageDirection direction = PageDirection.Next)
 {
     return(ContinueAsync(current, direction).WaitResult());
 }
示例#37
0
 public virtual void EnterPage(PageDirection enterDirection)
 {
 }
 public override bool LeavePage(PageDirection leaveDirection)
 {
     return(true);
 }
示例#39
0
 public PagingInfo(List <PropertyDefinition> data, SortBy sort, int pageSize, PageDirection direction, ReferenceItem referenceItem, ExTimeZone timeZone, bool excludeDuplicatesItems) : this(data, sort, pageSize, direction, referenceItem, timeZone, excludeDuplicatesItems, PreviewItemBaseShape.Default, null)
 {
 }
        public void GoTo(PageDirection flags)
        {
            this.Client.Application.AssertApplicationAvailable();

            var application = this.Client.Application.Get();
            var active_document = application.ActiveDocument;
            var docpages = active_document.Pages;
            if (docpages.Count < 2)
            {
                return;
            }

            var pages = docpages;
            this._GoTo(pages, flags);
        }
 public static bool ShowNext(ICollection list, PageDirection direction, int pageSize)
 {
     return (direction == PageDirection.Forward && list.Count == pageSize + 1) ||
            (direction == PageDirection.Backward);
 }
        private void _GoTo(IVisio.Pages pages, PageDirection flags)
        {
            this.Client.Application.AssertApplicationAvailable();

            if (pages == null)
            {
                throw new System.ArgumentNullException(nameof(pages));
            }

            var app = pages.Application;
            var active_document = app.ActiveDocument;
            if (pages.Document != active_document)
            {
                throw new VisioOperationException("Page.Document is not application's ActiveDocument");
            }

            if (pages.Count < 2)
            {
                throw new VisioOperationException("Only 1 page available. Navigation not possible.");
            }

            var activepage = app.ActivePage;

            int cur_index = activepage.Index;
            const int min_index = 1;
            int max_index = pages.Count;
            int new_index = PageCommands.move_in_range(cur_index, min_index, max_index, flags);
            if (cur_index != new_index)
            {
                var doc_pages = active_document.Pages;
                var page = doc_pages[new_index];

                var active_window = app.ActiveWindow;
                active_window.Page = page;
            }
        }
示例#43
0
 /// <summary>
 /// Default contructor
 /// </summary>
 public GraphvizGraph()
 {
     m_Url=null;
     m_BackgroundColor=Color.White;
     m_IsCentered=false;
     m_ClusterRank=ClusterMode.Local;
     m_Comment=null;
     m_IsCompounded=false;
     m_IsConcentrated=false;
     m_Font=null;
     m_FontColor=Color.Black;
     m_Label=null;
     m_LabelJustification=LabelJustification.C;
     m_LabelLocation=LabelLocation.B;
     m_Layers=new GraphvizLayerCollection();
     m_McLimit=1.0;
     m_NodeSeparation=0.25;
     m_IsNormalized=false;
     m_NsLimit=-1;
     m_NsLimit1=-1;
     m_OutputOrder=OutputMode.BreadthFirst;
     m_PageSize=new Size(0,0);
     m_PageDirection=PageDirection.BL;
     m_Quantum=0;
     m_RankSeparation=0.5;
     m_Ratio = RatioMode.Auto;
     m_IsReMinCross=false;
     m_Resolution=0.96;
     m_Rotate=0;
     m_SamplePoints=8;
     m_SearchSize=30;
     m_Size=new Size(0,0);
     m_StyleSheet=null;
 }
 public ActionResult Index(ModerateHateViewModel model, int hateid = 0, PageDirection dir = PageDirection.Forward)
 {
     hateRepository.DeleteHate(model.DeleteId);
     return RedirectToAction("Index", new { hateid, dir});
 }