• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C# UI.Pair类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中System.Web.UI.Pair的典型用法代码示例。如果您正苦于以下问题:C# Pair类的具体用法?C# Pair怎么用?C# Pair使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



Pair类属于System.Web.UI命名空间,在下文中一共展示了Pair类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: SaveToRepository

        /// <summary>
        /// Page의 ViewState 정보를 특정 저장소에 저장하고, 저장 토큰 값을 <see cref="AbstractServerPageStatePersister.StateValue"/>에 저장합니다.
        /// </summary>
        protected override void SaveToRepository() {
            if(IsDebugEnabled)
                log.Debug("Page 상태정보를 저장합니다...");

            RemoveExpires(Expiration);

            var pageState = new Pair(ViewState, ControlState);

            if(StateValue.IsWhiteSpace())
                StateValue = Guid.NewGuid().ToString();

            var stateEntity = (PageStateEntity)PageStateTool.CreateStateEntity(StateValue, pageState, Compressor, CompressThreshold);

            using(var repository = CreateRepository()) {
                var query = Query.EQ(MongoTool.IdString, stateEntity.Id);
                var updated = Update.Set("Value", stateEntity.Value).Set("IsCompressed", stateEntity.IsCompressed).Set("CreatedDate",
                                                                                                                       stateEntity.
                                                                                                                           CreatedDate);

                // UPSERT
                var result = repository.FindAndModify(query, SortBy.Null, updated, true, true);

                if(IsDebugEnabled)
                    log.Debug("캐시에 Page 상태정보를 저장했습니다!!! StateValue=[{0}], Expiration=[{1}] (min), Result=[{2}]", StateValue, Expiration,
                              result.Ok);
            }
        }
开发者ID:debop,项目名称:NFramework,代码行数:30,代码来源:MongoPageStatePersister.cs


示例2: XmlDocumentViewSchema

 public XmlDocumentViewSchema(string name, Pair data, bool includeSpecialSchema)
 {
     this._includeSpecialSchema = includeSpecialSchema;
     this._children = (OrderedDictionary) data.First;
     this._attrs = (ArrayList) data.Second;
     this._name = name;
 }
开发者ID:Reegenerator,项目名称:Sample-CustomizeDatasetCS,代码行数:7,代码来源:XmlDocumentViewSchema.cs


示例3: SaveViewState

		protected override object SaveViewState ()
		{
			if (tabData != null) {
				Pair p = new Pair (tabData, titles);
				return new Pair (base.SaveViewState (), p);
			}
			return null;
		}
开发者ID:louislatreille,项目名称:xsp,代码行数:8,代码来源:tabcontrol.cs


示例4: SaveViewState

 /// <summary>
 /// Saves the current view state of the <see cref="Composition" /> object.
 /// </summary>
 /// <param name="saveAll"><c>true</c> if all values should be saved regardless
 /// of whether they are dirty; otherwise <c>false</c>.</param>
 /// <returns>An object that represents the saved state. The default is <c>null</c>.</returns>
 protected override object SaveViewState(bool saveAll)
 {
     Pair pair = new Pair();
     pair.First = base.SaveViewState(saveAll);
     if (_points != null)
         pair.Second = ((IStateManagedObject)_points).SaveViewState(saveAll);
     return (pair.First == null && pair.Second == null) ? null : pair;
 }
开发者ID:dbre2,项目名称:dynamic-image,代码行数:14,代码来源:Curve.cs


示例5: Save

 public override void Save()
 {
     Pair pair = new Pair();
     if (base.ViewState != null)
     { pair.First = base.ViewState; }
     if (base.ControlState != null)
     { pair.Second = base.ControlState; }
     this.Page.Session["__Houfeng_AjaxEngine_"+this.GetUniqueKey()] =pair;
 }
开发者ID:hjlfmy,项目名称:AjaxEngine,代码行数:9,代码来源:SessionPageStatePersister.cs


示例6: SaveViewState

 protected override object SaveViewState() {
     var myState = new Pair();
     myState.First = base.SaveViewState();
     if (_dataServiceContext != null) {
         myState.Second = _dataServiceContext.Entities.Where(ed => !String.IsNullOrEmpty(ed.ETag)).ToDictionary(
             ed => DataServiceUtilities.BuildCompositeKey(ed.Entity), ed => ed.ETag);
     }
     return myState;
 }
开发者ID:sanyaade-mobiledev,项目名称:ASP.NET-Mvc-2,代码行数:9,代码来源:DataServiceLinqDataSource.cs


示例7: ExecuteContextLoader

		/// <summary>
		/// IContextLoaderStep.ExecuteContextLoader() implementation
		/// </summary>
		/// <param name="data">The data which the values are read from.</param>
		/// <param name="contextConfig">The configuration for the context loader test step.</param>
		/// <param name="context">The context object into which the values will be written.</param>
		public void ExecuteContextLoader(Stream data, XmlNode contextConfig, Context context)
		{
			var contextNodes = contextConfig.SelectNodes("XPath");

			foreach (XmlNode contextNode in contextNodes)
			{
                var xPathPair = new Pair(contextNode.SelectSingleNode("@contextKey").Value, contextNode.SelectSingleNode(".").InnerText);
			    _xPathExpressions.Add(xPathPair);
			}

            ExecuteContextLoader(data, context);
		}
开发者ID:RobBowman,项目名称:BizUnit,代码行数:18,代码来源:XmlContextLoader.cs


示例8: Save

 /// <summary>
 /// 保存视图状态
 /// </summary>
 public override void Save()
 {
     Pair pair = new Pair();
     if (base.ViewState != null)
         pair.First = base.ViewState;
     if (base.ControlState != null)
         pair.Second = base.ControlState;
     //
     //TheCache.Insert("__Houfeng_AjaxEngine_" + this.GetUniqueKey(), pair);
     TheCache.Insert("__Houfeng_AjaxEngine_" + this.GetUniqueKey(), pair, null,
     DateTime.Now.AddMinutes(this.Timeout), Cache.NoSlidingExpiration, CacheItemPriority.Default, null);
 }
开发者ID:hjlfmy,项目名称:AjaxEngine,代码行数:15,代码来源:CachePageStatePersister.cs


示例9: SaveToRepository

        protected override void SaveToRepository() {
            if(IsDebugEnabled)
                log.Debug("Page 상태정보를 압축하여 Hidden Field에 저장합니다...");

            var pair = new Pair(ViewState, ControlState);
            var stateEntity = PageStateTool.CreateStateEntity(string.Empty, pair, Compressor, CompressThreshold);

            StateValue = Serializer.Serialize(stateEntity).Base64Encode();

            if(IsDebugEnabled)
                log.Debug("Page 상태정보를 압축하여 Hidden Field에 저장했습니다!!!");
        }
开发者ID:debop,项目名称:NFramework,代码行数:12,代码来源:CompressHiddenFieldPersister.cs


示例10: Save

        public override void Save()
        {
            if (base.Page.Form != null && (base.ControlState != null || base.ViewState != null))
            {
                var fileName = string.Concat(DateTime.Now.Ticks, 16, "-", HttpContext.Current.Session.SessionID, ".vs");
                var filePath = Path.Combine(HttpContext.Current.Server.MapPath(_stateFileFolderPath), fileName);
                var pair = new Pair(base.ViewState, base.ControlState);
                File.WriteAllText(filePath, base.StateFormatter.Serialize(pair));

                var stateField = string.Format(@"{0}<input type=""hidden"" name=""{1}"" value=""{2}"" />{0}{0}", System.Environment.NewLine, _viewstateFormFieldId, fileName);
                base.Page.Form.Controls.AddAt(0, new LiteralControl(stateField));
            }
        }
开发者ID:DeonHeyns,项目名称:heynslibrary,代码行数:13,代码来源:FileSystemPageStatePersister.cs


示例11: Load

        internal /*public*/ void Load(MobilePage page, Pair id)
        {
            _state = null;

            SessionViewStateHistory history = (SessionViewStateHistory)page.Session[ViewStateKey];
            if (history != null)
            {
                SessionViewStateHistoryItem historyItem = history.Find(id);
                if (historyItem != null)
                {
                    LoadFrom(historyItem);
                }
            }
        }
开发者ID:uQr,项目名称:referencesource,代码行数:14,代码来源:SessionViewState.cs


示例12: Save

 public override void Save()
 {
     Pair pair = new Pair();
     if (base.ViewState != null)
         pair.First = base.ViewState;
     if (base.ControlState != null)
         pair.Second = base.ControlState;
     //
     LosFormatter los = new LosFormatter();
     StringWriter writer = new StringWriter();
     los.Serialize(writer, pair);
     StreamWriter sw = File.CreateText(ViewStateFilePath);
     sw.Write(writer.ToString());
     sw.Close();
 }
开发者ID:SaintLoong,项目名称:AjaxEngine,代码行数:15,代码来源:FilePageStatePersister.cs


示例13: Process

        private void Process(DrawContainer draw, int i, Pair item, int total)
        {
            int value = (int)item.Second;
            double angleplus = 360 * value * 1.0 / total;
            double popangle = this.angle + (angleplus / 2);
            System.Drawing.Color color = this.ColorFromHSL(this.start, 0.5, 0.5);
            int delta = 30;
            System.Drawing.Color bcolor = this.ColorFromHSL(this.start, 1, 0.5);
            int r = 200;
            double rad = Math.PI / 180;

            draw.Gradients.Add(new LinearGradient
            {
                Degrees = 90,
                GradientID = "Grd" + i,
                Stops = {
                    new GradientStop{Offset = 0, Color = System.Drawing.ColorTranslator.ToHtml(bcolor)},
                    new GradientStop{Offset = 100, Color = System.Drawing.ColorTranslator.ToHtml(color)}
                }
            });

            AbstractSprite sector = this.Sector(250, 250, r, this.angle, this.angle + angleplus);
            sector.FillStyle = "url(#Grd" + i + ")";
            sector.StrokeStyle = "#fff";
            sector.LineWidth = 3;

            draw.Items.Add(sector);

            TextSprite text = new TextSprite
            {
                SpriteID = "text" + i,
                X = Convert.ToInt32(350 + (r + delta + 55) * Math.Cos(-popangle * rad)),
                Y = Convert.ToInt32(350 + (r + delta + 25) * Math.Sin(-popangle * rad)),
                Text = item.First.ToString(),
                FillStyle = System.Drawing.ColorTranslator.ToHtml(bcolor),
                StrokeStyle = "none",
                GlobalAlpha = 0,
                FontSize = "20"
            };

            draw.Items.Add(text);

            //sector.Listeners.MouseOver.Handler = string.Format("onMouseOver(this, {0});", i);
            //sector.Listeners.MouseOut.Handler = string.Format("onMouseOut(this, {0});", i);

            this.angle += angleplus;
            this.start += 0.1;
        }
开发者ID:extnet,项目名称:Ext.NET.Examples.MVC,代码行数:48,代码来源:Pie_ChartController.cs


示例14: Save

        /// <summary>
        /// Save page state.
        /// </summary>
        public override void Save()
        {
            //No processing needed if no state available
            if (ViewState == null & ControlState == null)
            {
                return;
            }

            //Save view state and control state separately
            Pair state = new Pair(ViewState, ControlState);

            //Add view state and control state to session
            HttpContext.Current.Session[base.StateKey] = state;

            base.Save();
        }
开发者ID:MonoSoftware,项目名称:WAO-ViewState-Providers,代码行数:19,代码来源:SessionProvider.cs


示例15: Save

 public override void Save()
 {
     if (ViewState == null && ControlState == null)
     {
         return;
     }
     StringBuilder key = new StringBuilder();
     {
         key.Append("VS_");
         key.Append(Page.Session == null ? Guid.NewGuid().ToString() : Page.Session.SessionID);
         key.Append("_");
         key.Append(DateTime.Now.Ticks.ToString());
     }
     Pair state = new Pair(ViewState, ControlState);
     //DataCache.SetCache(key.ToString(), state, objDependency, DateTime.Now.AddMinutes(Page.Session.Timeout), System.Web.Caching.Cache.NoSlidingExpiration, System.Web.Caching.CacheItemPriority.NotRemovable, null);
     Page.ClientScript.RegisterHiddenField(VIEW_STATE_CACHEKEY, key.ToString());
 }
开发者ID:jackiechou,项目名称:thegioicuaban.com,代码行数:17,代码来源:CachePageStatePersister.cs


示例16: SaveToRepository

        /// <summary>
        /// Page의 ViewState 정보를 특정 저장소에 저장하고, 저장 토큰 값을 <see cref="AbstractServerPageStatePersister.StateValue"/>에 저장합니다.
        /// </summary>
        protected override void SaveToRepository() {
            if(IsDebugEnabled)
                log.Debug("상태정보를 Session에 저장하려고 합니다...");

            ThrowIfSessionStateModeIsOff(Page.Session.Mode);

            if(StateValue.IsWhiteSpace())
                StateValue = CreateStateValue();

            var pair = new Pair(ViewState, ControlState);
            var stateEntity = PageStateTool.CreateStateEntity(StateValue, pair, Compressor, CompressThreshold);

            Page.Session[GetCacheKey()] = stateEntity;

            if(IsDebugEnabled)
                log.Debug("세션에 상태정보를 저장했습니다!!! StateValue=[{0}]", StateValue);
        }
开发者ID:debop,项目名称:NFramework,代码行数:20,代码来源:CompressableSessionPageStatePersister.cs


示例17: ClientJavaScript

        public ClientJavaScript()
        {
            // get the sticky id for the request
            Guid stickyId = WebContext.Current.StickyId;
            if (!scripts.ContainsKey(stickyId))
            {
                lock (syncRoot)
                {
                    if (!scripts.ContainsKey(stickyId))
                    {
                        Dictionary<string, Pair> scriptIncludes = new Dictionary<string, Pair>();
                        Dictionary<string, Pair>  scriptVariables = new Dictionary<string, Pair>();

                        scripts[stickyId] = new Pair() { First = scriptIncludes, Second = scriptVariables };
                    }
                }
            }
        }
开发者ID:ratnazone,项目名称:ratna,代码行数:18,代码来源:ClientJavaScript.ascx.cs


示例18: getAttractionsInPairs

        public List<Pair> getAttractionsInPairs()
        {
            int i = 0;
            List<Pair> attractions = new List<Pair>();
            for (i = 0; i < this.nightLife.Count; i++)
            {
                GeoCoordinate myCoor = new GeoCoordinate(Double.Parse(this.nightLife[i].location.First.ToString())
                    , Double.Parse(this.nightLife[i].location.Second.ToString()));
                int nearestIndex = this.getNearestAttr(myCoor);

                if (nearestIndex == -1)
                {
                    break;
                }

                Pair newPair = new Pair(this.nightLife[i], this.otherAttr[nearestIndex]);

                attractions.Add(newPair);

                this.otherAttr.RemoveAt(nearestIndex);
            }

            if (!(i == this.nightLife.Count - 1))
            {
                for (int j = i; j < this.nightLife.Count - 1; j += 2)
                {
                    Pair newPair = new Pair(this.nightLife[j], this.nightLife[j + 1]);
                    attractions.Add(newPair);
                }
            }

            if (this.otherAttr.Count > 1)
            {
                for (int j = 0; j < this.otherAttr.Count - 1; j += 2)
                {
                    Pair newPair = new Pair(this.otherAttr[j], this.otherAttr[j + 1]);
                    attractions.Add(newPair);
                }

            }

            return attractions;
        }
开发者ID:aboelbisher,项目名称:SindBad-Hackathon-,代码行数:43,代码来源:DataToAttract.cs


示例19: Save

 public override void Save()
 {
     Pair pair = new Pair();
     if (base.ViewState != null)
     { pair.First = base.ViewState; }
     if (base.ControlState != null)
     { pair.Second = base.ControlState; }
     //
     LosFormatter los = new LosFormatter();
     StringWriter writer = new StringWriter();
     los.Serialize(writer, pair);
     //
     string viewStateString = writer.ToString();
     Page.ClientScript.RegisterHiddenField("__AJAXVIEWSTATE", viewStateString);
     if (((IAjaxPage)Page).PageEngine.IsAjaxPostBack)
     {
         ((IAjaxPage)Page).PageEngine.OutMessages.Add(new Message(MessageType.Script, "__AJAXVIEWSTATE", string.Format("document.getElementById('__AJAXVIEWSTATE').value='{0}'", viewStateString)));
     }
 }
开发者ID:Houfeng,项目名称:AjaxEngine,代码行数:19,代码来源:HiddenFieldPageStatePersister.cs


示例20: Save

 public override void Save()
 {
     if (ViewState == null && ControlState == null)
     {
         return;
     }
     if (Page.Session != null)
     {
         if (!Directory.Exists(CacheDirectory))
         {
             Directory.CreateDirectory(CacheDirectory);
         }
         StreamWriter writer = new StreamWriter(StateFileName, false);
         IStateFormatter formatter = this.StateFormatter;
         Pair statePair = new Pair(ViewState, ControlState);
         string serializedState = formatter.Serialize(statePair);
         writer.Write(serializedState);
         writer.Close();
     }
 }
开发者ID:jackiechou,项目名称:thegioicuaban.com,代码行数:20,代码来源:DiskPageStatePersister.cs



注:本文中的System.Web.UI.Pair类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# UI.PostBackOptions类代码示例发布时间:2022-05-26
下一篇:
C# UI.Page类代码示例发布时间:2022-05-26
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap