Exemplo n.º 1
0
        /// <summary>
        /// Builds the css view class string
        /// </summary>
        /// <returns></returns>
        private string BuildViewClassString()
        {
            string retVal = String.Empty;

            if (ViewMask > 0)
            {
                string[] views = MyRootMaster.GetViewString(ViewMask).Split(new char[] { ',' }, StringSplitOptions.RemoveEmptyEntries);
                for (int i = 0; i < views.Length; i++)
                {
                    if (!views[i].Contains("."))
                    {
                        retVal += String.Format(CONTENT_CLIENT_CLASSPREFIX + " ", views[i]);
                    }
                }
            }
            return(retVal);
        }
Exemplo n.º 2
0
        /// <summary>
        /// Validates data items are registered with the DataContext.
        /// Loads them if the given key is not found.
        /// </summary>
        public void ConfirmDataItemsRegistered()
        {
            string viewContext = MyRootMaster.GetViewString(ViewMask);

            for (int i = 0; i < Controls.Count; i++)
            {
                if (Controls[i] is BaseDataControl)
                {
                    if (Controls[i] is OsHttpRequest)
                    {
                        OsHttpRequest ctl = (OsHttpRequest)Controls[i];
                        MyDataContext.RegisterDataItem(ctl, viewContext,
                                                       ctl.UseClientDataResolver, false, false);
                    }
                    else
                    {
                        MyDataContext.RegisterDataItem((BaseDataControl)Controls[i], viewContext,
                                                       ((BaseDataControl)Controls[i]).UseClientDataResolver, true, false);
                    }
                }
                else if (Controls[i] is VariableTag)
                {
                    VariableTag osvar = (VariableTag)Controls[i];
                    if (MyDataContext.MasterData.ContainsKey(osvar.VariableKey))
                    {
                        if (null == MyDataContext.MasterData[osvar.VariableKey].Data)
                        {
                            MyDataContext.MasterData[osvar.VariableKey].Data = osvar.GetVariableValue();
                        }
                    }
                    else
                    {
                        MyDataContext.RegisterDataItem(osvar.VariableKey, osvar.GetVariableValue());
                    }
                }
            }
        }