Beispiel #1
0
        public DataEditor(umbraco.interfaces.IData Data, Options Configuration)
        {
            //load the prevalues
            savedOptions = Configuration;

            //ini the savedData object
            savedData = Data;
        }
Beispiel #2
0
 public PrevalueEditor(umbraco.cms.businesslogic.datatype.BaseDataType DataType)
 {
     _datatype = DataType;
     jsonSerializer = new JavaScriptSerializer();
     savedOptions = Configuration;
 }
Beispiel #3
0
        protected override void OnPreRender(EventArgs e)
        {
            Options renderingOptions;

            //test for postback, decide to use db or saveBox for rendering
            if (Page.IsPostBack)
            {
                //test for saveBox having a value, default if not
                if (saveBox.Text != "")
                {
                    renderingOptions = jsonSerializer.Deserialize<Options>(saveBox.Text);
                }
                else
                {
                    renderingOptions = new Options();
                }
            }
            else
            {
                renderingOptions = savedOptions;
            }

            address.Text = HttpUtility.UrlDecode(renderingOptions.address);
            lat.Text = renderingOptions.lat;
            lng.Text = renderingOptions.lng;
            zoom.Text = renderingOptions.zoom.ToString();
            //height.Text = renderingOptions.height.ToString();
            //width.Text = renderingOptions.width.ToString();
        }