Esempio n. 1
0
        /// <summary>
        /// Deserialize a ColumnMapMsx
        /// </summary>
        /// <param name="tr"></param>
        /// <returns></returns>

        internal static void DeserializeSpotfireLinkParameter(
            XmlTextReader tr,
            SpotfireViewProps svp)
        {
            XmlUtil.VerifyElementName(tr, "SpotfireLinkParameter");

            SpotfireLinkParameter p = new SpotfireLinkParameter();

            if (XmlUtil.GetStringAttribute(tr, "Name", ref p.Name) &&
                XmlUtil.GetStringAttribute(tr, "Value", ref p.Value))
            {
                svp.SpotfireLinkParameters[p.Name] = p;
            }

            XmlUtil.VerifyAtEndOfElement(tr, "SpotfireLinkParameter");

            return;
        }
Esempio n. 2
0
        public static SpotfireViewProps Deserialize(
            XmlTextReader tr)
        {
            string txt;

            SpotfireViewProps sl = new SpotfireViewProps(null);

            XmlUtil.GetStringAttribute(tr, "Server", ref sl.WebplayerUrl);
            XmlUtil.GetStringAttribute(tr, "LibraryPath", ref sl.AnalysisPath);
            XmlUtil.GetStringAttribute(tr, "Description", ref sl.Description);

            //txt = tr.GetAttribute("Name");
            //if (txt != null) sl.UserObject.Name = txt;

            if (!tr.IsEmptyElement)
            {
                while (true)                 // loop on Parameters
                {
                    tr.Read();               // get Parameter element or end element
                    tr.MoveToContent();

                    if (tr.NodeType == XmlNodeType.Element && Lex.Eq(tr.Name, "Parameter"))
                    {
                        SpotfireLinkParameter sp = new SpotfireLinkParameter();
                        XmlUtil.GetStringAttribute(tr, "Name", ref sp.Name);
                        XmlUtil.GetStringAttribute(tr, "Value", ref sp.Value);
                        sl.SpotfireLinkParameters[sp.Name] = sp;
                    }

                    else if (tr.NodeType == XmlNodeType.EndElement &&                     // end element?
                             Lex.Eq(tr.Name, "SpotfireLink"))
                    {
                        break;
                    }

                    else
                    {
                        throw new Exception("Expected SpotfireLink end element");
                    }
                }
            }

            return(sl);
        }
Esempio n. 3
0
/// <summary>
/// Set bool Spotfire Parameter
/// </summary>
/// <param name="parmName"></param>
/// <param name="value"></param>

        public void SetParameter(
            string parmName,
            bool value)
        {
            SpotfireLinkParameter p;

            if (SpotfireLinkParameters.ContainsKey(parmName.ToUpper()))
            {
                p       = SpotfireLinkParameters[parmName.ToUpper()];
                p.Value = value.ToString();
            }

            else
            {
                p = new SpotfireLinkParameter(parmName, value.ToString());
            }

            return;
        }