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

C# UI.StateBag类代码示例

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

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



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

示例1: LoadViewState

 protected override void LoadViewState(object savedState)
 {
     if (savedState != null)
     {
         Triplet triplet = (Triplet) savedState;
         base.LoadViewState(triplet.First);
         if (triplet.Second != null)
         {
             if (this._inputAttributesState == null)
             {
                 this._inputAttributesState = new StateBag();
                 this._inputAttributesState.TrackViewState();
             }
             this._inputAttributesState.LoadViewState(triplet.Second);
         }
         if (triplet.Third != null)
         {
             if (this._labelAttributesState == null)
             {
                 this._labelAttributesState = new StateBag();
                 this._labelAttributesState.TrackViewState();
             }
             this._labelAttributesState.LoadViewState(triplet.Second);
         }
     }
 }
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:26,代码来源:CheckBox.cs


示例2: Create

        public static IWebSecurityAddIn Create(WebSecurityAddInData.WebSecurityAddInsRow addIn, StateBag viewStateContext, string languageCode)
        {
            IWebSecurityAddIn @in = null;
            try
            {
                if (addIn.TypeAssembly == null)
                {
                    throw new InvalidCastException();
                }
                @in = (IWebSecurityAddIn) Assembly.Load(addIn.TypeAssembly).CreateInstance(addIn.TypeNameSpace);
                @in.AddInDbId = addIn.WebSecurityAddInId;
                @in.Disabled = addIn.Disabled;
                string str = ResourceManager.GetString(addIn.Description);
                @in.Description = (str == null) ? addIn.Description : str;
                @in.SurveyId = addIn.SurveyID;
                @in.ViewState = viewStateContext;
                @in.Order = addIn.AddInOrder;
                @in.LanguageCode = languageCode;
///             return @in;
            }
            catch (NullReferenceException)
            {
                throw new InvalidCastException("specfied type " + addIn.TypeNameSpace + " could not be found in the specifed assembly " + addIn.TypeAssembly);
            }
            catch (InvalidCastException)
            {
                throw new InvalidCastException("specfied type " + addIn.TypeNameSpace + " must implement the IWebSecurityAddIn interface");
            }
            return @in;
        }
开发者ID:ChrisNelsonPE,项目名称:surveyproject_main_public,代码行数:30,代码来源:WebSecurityAddInFactory.cs


示例3: GetControlState

 public StateBag GetControlState(string controlUID)
 {
     StateBag retVal;
     if(! states.TryGetValue(controlUID, out retVal))
         states[controlUID] = retVal = new StateBag();
     return retVal;
 }
开发者ID:spib,项目名称:nhcontrib,代码行数:7,代码来源:StatefulFieldPageModule.cs


示例4: DeserializeStateBag

        public static StateBag DeserializeStateBag(SerializationReader reader)
        {
            var flags = reader.ReadOptimizedBitVector32();
            var stateBag = new StateBag(flags[StateBagIsIgnoreCase]);

            if (flags[StateBagHasDirtyEntries])
            {
                var count = reader.ReadOptimizedInt32();

                for(var i = 0; i < count; i++)
                {
                    var key = reader.ReadOptimizedString();
                    var value = reader.ReadObject();

            // ReSharper disable PossibleNullReferenceException
                    stateBag.Add(key, value).IsDirty = true;
            // ReSharper restore PossibleNullReferenceException
                }
            }

            if (flags[StateBagHasCleanEntries])
            {
                var count = reader.ReadOptimizedInt32();

                for(var i = 0; i < count; i++)
                {
                    var key = reader.ReadOptimizedString();
                    var value = reader.ReadObject();

                    stateBag.Add(key, value);
                }
            }
            return stateBag;
        }
开发者ID:bbqchickenrobot,项目名称:FastSerializer,代码行数:34,代码来源:WebFastSerializationHelper.cs


示例5: getPreselectedJobsId

 public static int getPreselectedJobsId(StateBag viewState)
 {
     string key = dict["PreselectedJobsId"].ToString();
     if(get(key, viewState) == null)
         set(key, -1, viewState);
     return (int)StateBagTask.get(key, viewState);
 }
开发者ID:bjornebjornson,项目名称:Gema2008,代码行数:7,代码来源:StateBagTask.cs


示例6: getCurrentSearchJob

 public static ISearchJobDto getCurrentSearchJob(StateBag viewState)
 {
     string key = StateBagKey.SearchJob.ToString();
     if(get(key, viewState) == null)
         set(key, new SearchJobDto(), viewState);
     return get(key, viewState) as ISearchJobDto;
 }
开发者ID:bjornebjornson,项目名称:Gema2008,代码行数:7,代码来源:StateBagTask.cs


示例7: CssStyleCollection

		internal CssStyleCollection (StateBag bag) : this ()
		{
			this.bag = bag;
			if (bag != null && bag [AttributeCollection.StyleAttribute] != null)
				_value.Append (bag [AttributeCollection.StyleAttribute]);
			InitFromStyle ();
		}
开发者ID:calumjiao,项目名称:Mono-Class-Libraries,代码行数:7,代码来源:CssStyleCollection.cs


示例8: WebPartVerb

		public WebPartVerb (string clientHandler)
		{
			this.clientClickHandler = clientHandler;
			stateBag = new StateBag ();
			stateBag.Add ("clientClickHandler", clientHandler);

		}
开发者ID:jjenki11,项目名称:blaze-chem-rendering,代码行数:7,代码来源:WebPartVerb.cs


示例9: GetPageViewStateProperty

 public static object GetPageViewStateProperty(Page p_page, StateBag p_ViewState, string p_sPropertyName, string p_sFormPropertyName, Type p_TargetType)
 {
     if (p_page.IsPostBack)
         return GetValue(p_page.Request.Form[p_sFormPropertyName], p_TargetType);
     else
         return GetValue(p_ViewState[p_sPropertyName], p_TargetType);
 }
开发者ID:popovegor,项目名称:gt,代码行数:7,代码来源:ViewStateUtils.cs


示例10: CopiarPeriodos

        internal static List<EstimadoDetDTO> CopiarPeriodos(DateTime fOrigenDesde, DateTime fOrigenHasta,
    DateTime fDestinoDesde, List<EstimadoDetDTO> lineas, StateBag viewState)
        {
            //Armo lista de elemtnos que SI reemplazo.
            //Busco en la coleccion, todas las lineas en el periodo, y con el aviso seleccionado.
            var lineasACopiar = lineas.FindAll(
                (x) =>
                    (x.Fecha >= fOrigenDesde
                    && x.Fecha <= fOrigenHasta));

            //Si encontre líneas a copiar...
            if (lineasACopiar.Count > 0)
            {
                EstimadoDetDTO nuevaLinea;
                DateTime fechaTmp;
                List<EstimadoDetDTO> lineasTmp = new List<EstimadoDetDTO>();
                TimeSpan diasEnElFuturo = fDestinoDesde.Subtract(fOrigenDesde);

                //Por cada linea que encontre, genero una nueva e igual, x dias en el futuro.
                foreach (var linea in lineasACopiar)
                {
                    nuevaLinea           = new EstimadoDetDTO();
                    nuevaLinea.RecId     = NextTempRecId(viewState);
                    nuevaLinea.DatareaId = linea.DatareaId;

                    //Avanzo la fecha tantos dias como corresponda...
                    fechaTmp                 = linea.Fecha.Add(diasEnElFuturo)  ;
                    nuevaLinea.Fecha         = fechaTmp                         ;
                    nuevaLinea.Dia           = fechaTmp.Day                     ;
                    nuevaLinea.DiaSemana     = fechaTmp.ToString("dddd", new CultureInfo("es-ES")).ToUpper().Trim();
                    nuevaLinea.Costo         = linea.Costo                      ;
                    nuevaLinea.CostoOp       = linea.CostoOp                    ;
                    nuevaLinea.CostoOpUni    = linea.CostoOpUni                 ;
                    nuevaLinea.CostoUni      = linea.CostoUni                   ;
                    nuevaLinea.Duracion      = linea.Duracion                   ;
                    nuevaLinea.Hora          = linea.Hora                       ;
                    nuevaLinea.IdentifAviso  = linea.IdentifAviso               ;
                    nuevaLinea.PautaId       = linea.PautaId                    ;
                    nuevaLinea.Salida        = linea.Salida                     ;

                    //Agrego la nueva linea.
                    lineasTmp.Add(nuevaLinea);
                }

                //Junto las dos listas (temporal y la que ya tenia).
                lineasTmp.AddRange(lineas);

                //Ordeno por fecha.
                lineasTmp.Sort(
                    (x, y) => DateTime.Compare(x.Fecha, y.Fecha));

                //Guardo la lista en el Viewstate.
                return lineasTmp;
            }
            else
            {
                return lineas;
            }
        }
开发者ID:javierlov,项目名称:PautasElectronica,代码行数:59,代码来源:ProcesoHelper.cs


示例11: Style

 /// <devdoc>
 ///    <para>
 ///       Initializes a new instance of the <see cref='System.Web.UI.WebControls.Style'/> class with the
 ///       specified state bag information.  Do not use this constructor if you are overriding
 ///       CreateControlStyle() and are changing some properties on the created style.
 ///    </para>
 /// </devdoc>
 public Style(StateBag bag) {
     statebag = bag;
     marked = false;
     setBits = 0;
     // VSWhidbey 541984: Style inherits from Component and requires finalization, resulting in bad performance
     // When inheriting, if finalization is desired, call GC.ReRegisterForFinalize
     GC.SuppressFinalize(this);
 }
开发者ID:JokerMisfits,项目名称:linux-packaging-mono,代码行数:15,代码来源:Style.cs


示例12: IStateManager_Deny_Unrestricted

		public void IStateManager_Deny_Unrestricted ()
		{
			IStateManager sm = new StateBag ();
			Assert.IsFalse (sm.IsTrackingViewState, "IsTrackingViewState");
			object state = sm.SaveViewState ();
			sm.LoadViewState (state);
			sm.TrackViewState ();
		}
开发者ID:nobled,项目名称:mono,代码行数:8,代码来源:StateBagCas.cs


示例13: CssStyleCollection

		internal CssStyleCollection (StateBag bag)
		{
			this.bag = bag;
			style = new StateBag ();
			string st_string = bag ["style"] as string;
			if (st_string != null)
				FillStyle (st_string);
		}
开发者ID:jjenki11,项目名称:blaze-chem-rendering,代码行数:8,代码来源:CssStyleCollection.cs


示例14: WebPartVerb

		public WebPartVerb (string id, WebPartEventHandler serverClickHandler, string clientClickHandler) {
			this.id = id;
			this.serverClickHandler = serverClickHandler;
			this.clientClickHandler = clientClickHandler;
			stateBag = new StateBag ();
			stateBag.Add ("serverClickHandler", serverClickHandler);
			stateBag.Add ("clientClickHandler", clientClickHandler);
		}
开发者ID:nobled,项目名称:mono,代码行数:8,代码来源:WebPartVerb.cs


示例15: beforTest

 public void beforTest()
 {
     mockery = new Mockery();
     view = mockery.NewMock<ITrackListingView>();
     task = mockery.NewMock<ITrackListingTask>();
     presenter = new TrackListingPresenter(view, task);
     stateBag = new StateBag();
 }
开发者ID:bjornebjornson,项目名称:Gema2008,代码行数:8,代码来源:TrackListingPresenter_Fixture.cs


示例16: CreateWebSecurityAddInCollection

 public static WebSecurityAddInCollection CreateWebSecurityAddInCollection(WebSecurityAddInData addIns, StateBag viewStateContext, string languageCode)
 {
     WebSecurityAddInCollection ins = new WebSecurityAddInCollection();
     foreach (WebSecurityAddInData.WebSecurityAddInsRow row in addIns.WebSecurityAddIns)
     {
         ins.Add(Create(row, viewStateContext, languageCode));
     }
     return ins;
 }
开发者ID:ChrisNelsonPE,项目名称:surveyproject_main_public,代码行数:9,代码来源:WebSecurityAddInFactory.cs


示例17: EnsureAttributes

		void EnsureAttributes ()
		{
			if (attributes == null) {
				attrBag = new StateBag (true);
				if (IsTrackingViewState)
					attrBag.TrackViewState ();
				attributes = new AttributeCollection (attrBag);
			}
		}
开发者ID:calumjiao,项目名称:Mono-Class-Libraries,代码行数:9,代码来源:UserControl.cs


示例18: SetValueToNull

		public void SetValueToNull ()
		{
			StateBag sb = new StateBag ();
			sb ["a"] = "a";
			Assert.AreEqual ("a", sb ["a"], "#1");
			sb ["a"] = null;
			Assert.IsNull (sb ["a"], "#2");
			Assert.AreEqual (0, sb.Count, "#3");
		}
开发者ID:nobled,项目名称:mono,代码行数:9,代码来源:StateBagTest.cs


示例19: SetValueToNull2

		public void SetValueToNull2 ()
		{
			StateBag sb = new StateBag ();
			sb ["a"] = "a";
			Assert.AreEqual ("a", sb ["a"], "#1");
			((IStateManager) sb).TrackViewState ();
			sb ["a"] = null;
			Assert.IsNull (sb ["a"], "#2");
			Assert.AreEqual (1, sb.Count, "#3");
		}
开发者ID:nobled,项目名称:mono,代码行数:10,代码来源:StateBagTest.cs


示例20: NextTempRecId

        internal static int NextTempRecId(StateBag viewState)
        {
            if (viewState["TempRecId"] != null)
            {
                int RecId = Convert.ToInt32(viewState["TempRecId"]) + 1;

                viewState.Add("TempRecId", RecId);
                return RecId;
            }
            else
            {
                viewState.Add("TempRecId", 1);
                return 1;
            }
        }
开发者ID:javierlov,项目名称:PautasElectronica,代码行数:15,代码来源:ProcesoHelper.cs



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
C# UI.TemplateParser类代码示例发布时间:2022-05-26
下一篇:
C# UI.ScriptReference类代码示例发布时间: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