/// <summary>
        /// Retreaves StringDictionary object from database or file system
        /// </summary>
        /// <param name="exType">Extension Type</param>
        /// <param name="exId">Extension Id</param>
        /// <returns>StringDictionary object as Stream</returns>
        public object GetSettings(ExtensionType exType, string exId)
        {
            SerializableStringDictionary ssd = null;
              StringDictionary sd = new StringDictionary();
              XmlSerializer serializer = new XmlSerializer(typeof(SerializableStringDictionary));

              if (_section.DefaultProvider == "XmlTrainProvider")
              {
            Stream stm = (Stream)TrainService.LoadFromDataStore(exType, exId);
            if (stm != null)
            {
              ssd = (SerializableStringDictionary)serializer.Deserialize(stm);
              stm.Close();
              sd = (StringDictionary)ssd;
            }
              }
              else
              {
            object o = TrainService.LoadFromDataStore(exType, exId);
            if (!string.IsNullOrEmpty((string)o))
            {
              using (StringReader reader = new StringReader((string)o))
              {
            ssd = (SerializableStringDictionary)serializer.Deserialize(reader);
              }
              sd = (StringDictionary)ssd;
            }
              }
              return sd;
        }
        /// <summary>
        /// Retreaves StringDictionary object from database or file system
        /// </summary>
        /// <param name="extensionType">
        /// Extension Type
        /// </param>
        /// <param name="extensionId">
        /// Extension Id
        /// </param>
        /// <returns>
        /// StringDictionary object as Stream
        /// </returns>
        public object GetSettings(ExtensionType extensionType, string extensionId)
        {
            SerializableStringDictionary ssd;
            var sd = new StringDictionary();
            var serializer = new XmlSerializer(typeof(SerializableStringDictionary));

            if (Section.DefaultProvider == "XmlBlogProvider")
            {
                var stm = (Stream)BlogService.LoadFromDataStore(extensionType, extensionId);
                if (stm != null)
                {
                    ssd = (SerializableStringDictionary)serializer.Deserialize(stm);
                    stm.Close();
                    sd = ssd;
                }
            }
            else
            {
                var o = BlogService.LoadFromDataStore(extensionType, extensionId);
                if (!string.IsNullOrEmpty((string)o))
                {
                    using (var reader = new StringReader((string)o))
                    {
                        ssd = (SerializableStringDictionary)serializer.Deserialize(reader);
                    }

                    sd = ssd;
                }
            }

            return sd;
        }
        /// <summary>
        /// Gets settings from data store
        /// </summary>
        /// <param name="extensionType">
        /// Extension Type
        /// </param>
        /// <param name="extensionId">
        /// Extension ID
        /// </param>
        /// <returns>
        /// Settings as Stream
        /// </returns>
        public object GetSettings(ExtensionType extensionType, string extensionId)
        {
            WidgetData widgetData;
            var xml = new XmlDocument();

            if (Section.DefaultProvider == "XmlBlogProvider")
            {
                var stm = (Stream)BlogService.LoadFromDataStore(extensionType, extensionId);
                if (stm != null)
                {
                    var x = new XmlSerializer(typeof(XmlDocument));
                    xml = (XmlDocument)x.Deserialize(stm);
                    stm.Close();
                }
            }
            else
            {
                var o = BlogService.LoadFromDataStore(extensionType, extensionId);
                if (!string.IsNullOrEmpty((string)o))
                {
                    var serializer = new XmlSerializer(typeof(WidgetData));
                    using (var reader = new StringReader((string)o))
                    {
                        widgetData = (WidgetData)serializer.Deserialize(reader);
                    }

                    if (widgetData.Settings.Length > 0)
                    {
                        xml.InnerXml = widgetData.Settings;
                    }
                }
            }

            return xml;
        }
        /// <summary>
        /// Gets settings from data store
        /// </summary>
        /// <param name="exType">Extension Type</param>
        /// <param name="exId">Extension ID</param>
        /// <returns>Settings as Stream</returns>
        public object GetSettings(ExtensionType exType, string exId)
        {
            WidgetData wd = new WidgetData();
              XmlDocument xml = new XmlDocument();

              if (_section.DefaultProvider == "XmlTrainProvider")
              {
            Stream stm = (Stream)TrainService.LoadFromDataStore(exType, exId);
            if (stm != null)
            {
              XmlSerializer x = new XmlSerializer(typeof(XmlDocument));
              xml = (XmlDocument)x.Deserialize(stm);
              stm.Close();
            }
              }
              else
              {
            object o = TrainService.LoadFromDataStore(exType, exId);
            if (!string.IsNullOrEmpty((string)o))
            {
              XmlSerializer serializer = new XmlSerializer(typeof(WidgetData));
              using (StringReader reader = new StringReader((string)o))
              {
            wd = (WidgetData)serializer.Deserialize(reader);
              }

              if (wd.Settings.Length > 0)
            xml.InnerXml = wd.Settings;
            }
              }
              return xml;
        }
 //---------------------------------------------------------------------
 /// <summary>
 /// Initializes a new instance.
 /// </summary>
 /// <param name="name">The extension's name</param>
 /// <param name="type">The extension's type</param>
 /// <param name="mainClass">The AssemblyQualifiedName of the
 /// extension's main class (dervied from ExtensionMain).</param>
 public ExtensionInfo(string        name,
     ExtensionType type,
     string        mainClass)
     : base(name, typeof(ExtensionMain), mainClass)
 {
     this.type = type;
 }
Ejemplo n.º 6
0
 /// <summary>
 /// Initializes a new instance of the <see cref="ClientExtension"/> class.
 /// </summary>
 /// <param name="type">Extension type</param>
 /// <param name="scope">Extension install scope</param>
 /// <param name="manifestStream">Manifest stream, can be null</param>
 /// <param name="marketplaceAssetID">The asset ID for Office Marketplace</param>
 /// <param name="marketplaceContentMarket">The content market for Office Marketplace</param>
 /// <param name="isAvailable">Whether extension is available</param>
 /// <param name="isMandatory">Whether extension is mandatory</param>
 /// <param name="isEnabledByDefault">Whether extension is enabled by default</param>
 /// <param name="providedTo">Who the extension is provided for (e.g. "entire org" or "specific users")</param>
 /// <param name="specificUsers">List of users extension is provided for, can be null</param>
 /// <param name="appStatus">App status</param>
 /// <param name="etoken">Etoken</param>
 public ClientExtension(
     ExtensionType type,
     ExtensionInstallScope scope,
     Stream manifestStream,
     string marketplaceAssetID,
     string marketplaceContentMarket,
     bool isAvailable,
     bool isMandatory,
     bool isEnabledByDefault,
     ClientExtensionProvidedTo providedTo,
     StringList specificUsers,
     string appStatus,
     string etoken)
         : this()
 {
     this.Type = type;
     this.Scope = scope;
     this.ManifestStream = manifestStream;
     this.MarketplaceAssetID = marketplaceAssetID;
     this.MarketplaceContentMarket = marketplaceContentMarket;
     this.IsAvailable = isAvailable;
     this.IsMandatory = isMandatory;
     this.IsEnabledByDefault = isEnabledByDefault;
     this.ProvidedTo = providedTo;
     this.SpecificUsers = specificUsers;
     this.AppStatus = appStatus;
     this.Etoken = etoken;
 }
Ejemplo n.º 7
0
 public void SendMessage(object msg, ExtensionType type)
 {
     var foundExts = _extensions.Where(x => x.ExtensionType == type);
     foreach (var ext in foundExts) {
         ext.Extension.RecieveMessage(msg);
     }
 }
Ejemplo n.º 8
0
 /// <summary>
 /// Saves extension to database or file system
 /// </summary>
 /// <param name="exType">Extension Type</param>
 /// <param name="exId">Extension ID</param>
 /// <param name="settings">Extension object</param>
 /// <returns>True if saved</returns>
 public bool SaveSettings(ExtensionType exType, string exId, object settings)
 {
     try
       {
     BlogService.SaveToDataStore(exType, exId, settings);
     return true;
       }
       catch (Exception)
       {
     throw;
       }
 }
        /// <summary>
        /// Initializes new instance of Http2 server.
        /// </summary>
        /// <param name="port">Port to listen.</param>
        public Http2Server(int port)
        {
            this.Port = port;

            ExtensionType[] extensions = new ExtensionType[] { ExtensionType.Renegotiation, ExtensionType.ALPN };
            SecurityOptions options = new SecurityOptions(SecureProtocol.Tls1, extensions, ConnectionEnd.Server);

            options.VerificationType = CredentialVerification.None;
            options.Certificate = Org.Mentalis.Security.Certificates.Certificate.CreateFromCerFile(@"certificate.pfx");
            options.Flags = SecurityFlags.Default;
            options.AllowedAlgorithms = SslAlgorithms.RSA_AES_128_SHA | SslAlgorithms.NULL_COMPRESSION;
            _server = new SecureTcpListener(Port, options);
        }
Ejemplo n.º 10
0
        /// <summary>
        /// Gets the extensions available for the given type.
        /// </summary>
        /// <param name="type">The extension type</param>
        /// <param name="draft">Whether the entity is a draft or not</param>
        /// <returns>A list of extensions</returns>
        public static List<Models.Extension> GetByType(ExtensionType type, bool draft = false)
        {
            var ext = new List<Models.Extension>() ;

            Extensions.Where(extension => extension.ExtensionType.HasFlag(type)).ToList().ForEach(e => {
                ext.Add(new Models.Extension() {
                    IsDraft = draft,
                    Type = e.Type.ToString(),
                    Body = (IExtension)Activator.CreateInstance(e.Type)
                }) ;
            });
            return ext ;
        }
Ejemplo n.º 11
0
        public Load(string name, ExtensionType extensionType, BasicType basicType, object value)
        {

            this.name = name;
            
            if (extensionType != ExtensionType.List)
            {
                throw new Exception("Not supported type");
            }

            this.data = new List(basicType.ToString(), value);

        }
Ejemplo n.º 12
0
        private static bool AddExtensionToResult(byte[] buffer, ref int currentLen, Int16 extLen, ConnectionEnd end, 
                                                    ExtensionList knownExtensions, ExtensionType type, ref ExtensionList result)
        {
            foreach (var extension in knownExtensions)
            {
                if (extension.Type == type)
                {
                    result.Add(extension.Parse(buffer, ref currentLen, extLen, end));
                    return true;
                }
            }

            return false;
        }
Ejemplo n.º 13
0
        /// <summary>
        /// Gets the extensions available for the given type and entity.
        /// </summary>
        /// <param name="type">The extension type</param>
        /// <param name="id">The entity id</param>
        /// <param name="draft">Whether the entity is a draft or not</param>
        /// <returns>A list of extensions</returns>
        public static List<Models.Extension> GetByTypeAndEntity(ExtensionType type, Guid id, bool draft)
        {
            var ret = new List<Models.Extension>() ;
            var tmp = GetByType(type, draft) ;

            foreach (var e in tmp) {
                var ext = Models.Extension.GetSingle("extension_type = @0 AND extension_parent_id = @1 AND extension_draft = @2",
                    e.Type, id, draft) ;
                if (ext != null)
                    ret.Add(ext) ;
                else ret.Add(e) ;
            }
            return ret ;
        }
Ejemplo n.º 14
0
        /// <summary>
        /// Save settings to generic data store
        /// </summary>
        /// <param name="extensionType">
        /// Type of extension
        /// </param>
        /// <param name="extensionId">
        /// Extension ID
        /// </param>
        /// <param name="settings">
        /// Stream Settings
        /// </param>
        public override void SaveToDataStore(ExtensionType extensionType, string extensionId, object settings)
        {
            var fileName = string.Format("{0}{1}.xml", StorageLocation(extensionType), extensionId);
            if (!Directory.Exists(StorageLocation(extensionType)))
            {
                Directory.CreateDirectory(StorageLocation(extensionType));
            }

            using (TextWriter writer = new StreamWriter(fileName))
            {
                var x = new XmlSerializer(settings.GetType());
                x.Serialize(writer, settings);
            }
        }
Ejemplo n.º 15
0
        /// <summary>
        /// Loads settings from generic data store
        /// </summary>
        /// <param name="extensionType">
        /// Extension Type
        /// </param>
        /// <param name="extensionId">
        /// Extension ID
        /// </param>
        /// <returns>
        /// Stream Settings
        /// </returns>
        public override object LoadFromDataStore(ExtensionType extensionType, string extensionId)
        {
            var fileName = string.Format("{0}{1}.xml", StorageLocation(extensionType), extensionId);
            Stream str = null;
            if (!Directory.Exists(StorageLocation(extensionType)))
            {
                Directory.CreateDirectory(StorageLocation(extensionType));
            }

            if (File.Exists(fileName))
            {
                var reader = new StreamReader(fileName);
                str = reader.BaseStream;
            }

            return str;
        }
Ejemplo n.º 16
0
        /// <summary>
        /// Save settings to generic data store
        /// </summary>
        /// <param name="exType">Type of extension</param>
        /// <param name="exId">Extension ID</param>
        /// <param name="settings">Stream Settings</param>
        public override void SaveToDataStore(ExtensionType exType, string exId, object settings)
        {
            string _fileName = StorageLocation(exType) + exId + ".xml";
              try
              {
            if (!Directory.Exists(StorageLocation(exType)))
              Directory.CreateDirectory(StorageLocation(exType));

            TextWriter writer = new StreamWriter(_fileName);
            XmlSerializer x = new XmlSerializer(settings.GetType());
            x.Serialize(writer, settings);
            writer.Close();
              }
              catch (Exception e)
              {
            string s = e.Message;
            throw;
              }
        }
        /// <summary>
        /// Saves String Dictionary to Data Store
        /// </summary>
        /// <param name="exType">Extension Type</param>
        /// <param name="exId">Extension Id</param>
        /// <param name="settings">StringDictionary settings</param>
        /// <returns></returns>
        public bool SaveSettings(ExtensionType exType, string exId, object settings)
        {
            try
              {
            StringDictionary sd = (StringDictionary)settings;
            SerializableStringDictionary ssd = new SerializableStringDictionary();

            foreach (DictionaryEntry de in sd)
            {
              ssd.Add(de.Key.ToString(), de.Value.ToString());
            }

            TrainService.SaveToDataStore(exType, exId, ssd);
            return true;
              }
              catch (Exception)
              {
            throw;
              }
        }
Ejemplo n.º 18
0
		/// <summary>
		/// Construct an Addin for a type.
		/// </summary>
		/// <param name="type">The type to be used</param>
		public Addin( Type type )
		{
			this.typeName = type.AssemblyQualifiedName;

			object[] attrs = type.GetCustomAttributes( typeof(NUnitAddinAttribute), false );
			if ( attrs.Length == 1 )
			{
				NUnitAddinAttribute attr = (NUnitAddinAttribute)attrs[0];
				this.name = attr.Name;
				this.description = attr.Description;
				this.extensionType = attr.Type;
			}

			if ( this.name == null )
				this.name = type.Name;

			if ( this.extensionType == 0 )
				this.extensionType = ExtensionType.Core;

			this.status = AddinStatus.Enabled;
        }
Ejemplo n.º 19
0
        /// <summary>
        /// Loads settings from generic data store
        /// </summary>
        /// <param name="exType">Extension Type</param>
        /// <param name="exId">Extension ID</param>
        /// <returns>Stream Settings</returns>
        public override object LoadFromDataStore(ExtensionType exType, string exId)
        {
            string _fileName = StorageLocation(exType) + exId + ".xml";
              StreamReader reader = null;
              Stream str = null;
              try
              {
            if (!Directory.Exists(StorageLocation(exType)))
              Directory.CreateDirectory(StorageLocation(exType));

            if (File.Exists(_fileName))
            {
              reader = new StreamReader(_fileName);
              str = reader.BaseStream;
            }
              }
              catch (Exception)
              {
            throw;
              }
              return str;
        }
Ejemplo n.º 20
0
		/// <summary>
		/// Gets the extensions available for the given type.
		/// </summary>
		/// <param name="type">The extension type</param>
		/// <param name="draft">Whether the entity is a draft or not</param>
		/// <returns>A list of extensions</returns>
		public List<Models.Extension> GetByType(ExtensionType type, bool draft = false) {
			var extensions = new List<Models.Extension>() ;

			foreach (var ext in Extensions.Where(e => e.Metadata.Type.HasFlag(type))) {
				extensions.Add(new Models.Extension() {
					IsDraft = draft,
					Type = ext.Value.GetType().FullName,
					Body = (IExtension)Activator.CreateInstance(ext.Value.GetType())
				}) ;
			}
			return extensions ;
		}
Ejemplo n.º 21
0
 /// <summary>
 /// Retreaves extension object from database or file system
 /// </summary>
 /// <param name="exType">Extension Type</param>
 /// <param name="exId">Extension ID</param>
 /// <returns>Extension object as Stream</returns>
 public object GetSettings(ExtensionType exType, string exId)
 {
     return BlogService.LoadFromDataStore(exType, exId);
 }
 /// <summary>
 /// Saves extension to database or file system
 /// </summary>
 /// <param name="extensionType">
 /// Extension Type
 /// </param>
 /// <param name="extensionId">
 /// Extension ID
 /// </param>
 /// <param name="settings">
 /// Extension object
 /// </param>
 /// <returns>
 /// True if saved
 /// </returns>
 public bool SaveSettings(ExtensionType extensionType, string extensionId, object settings)
 {
     BlogService.SaveToDataStore(extensionType, extensionId, settings);
     return true;
 }
Ejemplo n.º 23
0
        /// <summary>
        /// Load user data from DataStore
        /// </summary>
        /// <param name="exType">type of info</param>
        /// <param name="exId">id of info</param>
        /// <returns>stream of detail data</returns>
        public override object LoadFromDataStore(ExtensionType exType, string exId)
        {
            //MemoryStream stream;
            object o = null;
            string connString = ConfigurationManager.ConnectionStrings[connStringName].ConnectionString;
            string providerName = ConfigurationManager.ConnectionStrings[connStringName].ProviderName;
            DbProviderFactory provider = DbProviderFactories.GetFactory(providerName);

            using (DbConnection conn = provider.CreateConnection())
            {
                conn.ConnectionString = connString;

                using (DbCommand cmd = conn.CreateCommand())
                {
                    string sqlQuery = "SELECT Settings FROM " + tablePrefix + "DataStoreSettings " +
                                        "WHERE ExtensionType = " + parmPrefix + "etype AND ExtensionId = " + parmPrefix + "eid";
                    cmd.CommandText = sqlQuery;
                    cmd.CommandType = CommandType.Text;
                    conn.Open();

                    DbParameter dpeType = provider.CreateParameter();
                    dpeType.ParameterName = parmPrefix + "etype";
                    dpeType.Value = exType.GetHashCode();
                    cmd.Parameters.Add(dpeType);
                    DbParameter dpeId = provider.CreateParameter();
                    dpeId.ParameterName = parmPrefix + "eid";
                    dpeId.Value = exId;
                    cmd.Parameters.Add(dpeId);

                    o = cmd.ExecuteScalar();
                }
            }
            return o;
        }
Ejemplo n.º 24
0
        /// <summary>
        /// Save to DataStore
        /// </summary>
        /// <param name="exType">type of info</param>
        /// <param name="exId">id of info</param>
        /// <param name="settings">data of info</param>
        public override void SaveToDataStore(ExtensionType exType, string exId, object settings)
        {
            if (settings == null)
                throw new ArgumentNullException("settings");

            // Save
            string connString = ConfigurationManager.ConnectionStrings[connStringName].ConnectionString;
            string providerName = ConfigurationManager.ConnectionStrings[connStringName].ProviderName;
            DbProviderFactory provider = DbProviderFactories.GetFactory(providerName);

            XmlSerializer xs = new XmlSerializer(settings.GetType());
            string objectXML = string.Empty;
            using (StringWriter sw = new StringWriter())
            {
              xs.Serialize(sw, settings);
              objectXML = sw.ToString();
            }

            using (DbConnection conn = provider.CreateConnection())
            {
                conn.ConnectionString = connString;
                conn.Open();
                using (DbCommand cmd = conn.CreateCommand())
                {
                    string sqlQuery = "DELETE FROM " + tablePrefix + "DataStoreSettings " +
                                      "WHERE ExtensionType = @type AND ExtensionId = @id; ";

                    if (parmPrefix != "@")
                        sqlQuery = sqlQuery.Replace("@", parmPrefix);
                    cmd.CommandText = sqlQuery;
                    cmd.CommandType = CommandType.Text;

                    DbParameter dpID = provider.CreateParameter();
                    dpID.ParameterName = parmPrefix + "type";
                    dpID.Value = exType.GetHashCode();
                    cmd.Parameters.Add(dpID);
                    DbParameter dpType = provider.CreateParameter();
                    dpType.ParameterName = parmPrefix + "id";
                    dpType.Value = exId;
                    cmd.Parameters.Add(dpType);

                    cmd.ExecuteNonQuery();

                    sqlQuery = "INSERT INTO " + tablePrefix + "DataStoreSettings " +
                        "(ExtensionType, ExtensionId, Settings) " +
                        "VALUES (@type, @id, @file)";
                    if (parmPrefix != "@")
                        sqlQuery = sqlQuery.Replace("@", parmPrefix);
                    cmd.CommandText = sqlQuery;
                    cmd.CommandType = CommandType.Text;

                    DbParameter dpFile = provider.CreateParameter();
                    dpFile.ParameterName = parmPrefix + "file";
                    dpFile.Value = objectXML; // settings.ToString(); // file;
                    cmd.Parameters.Add(dpFile);

                    cmd.ExecuteNonQuery();
                }
            }
        }
Ejemplo n.º 25
0
        /// <summary>
        /// Deletes an item from the dataStore
        /// </summary>
        /// <param name="exType">type of item</param>
        /// <param name="exId">id of item</param>
        public override void RemoveFromDataStore(ExtensionType exType, string exId)
        {
            string connString = ConfigurationManager.ConnectionStrings[connStringName].ConnectionString;
            string providerName = ConfigurationManager.ConnectionStrings[connStringName].ProviderName;
            DbProviderFactory provider = DbProviderFactories.GetFactory(providerName);

            using (DbConnection conn = provider.CreateConnection())
            {
                conn.ConnectionString = connString;
                conn.Open();
                using (DbCommand cmd = conn.CreateCommand())
                {
                    string sqlQuery = "DELETE FROM " + tablePrefix + "DataStoreSettings " +
                        "WHERE ExtensionType = " + parmPrefix + "type AND ExtensionId = " + parmPrefix + "id";
                    cmd.CommandText = sqlQuery;
                    cmd.CommandType = CommandType.Text;

                    DbParameter dpID = provider.CreateParameter();
                    dpID.ParameterName = parmPrefix + "type";
                    dpID.Value = exType;
                    cmd.Parameters.Add(dpID);
                    DbParameter dpType = provider.CreateParameter();
                    dpType.ParameterName = parmPrefix + "id";
                    dpType.Value = exId;
                    cmd.Parameters.Add(dpType);

                    cmd.ExecuteNonQuery();
                }
            }
        }
Ejemplo n.º 26
0
		private static void WriteExtension(Stream output, ExtensionType extType, byte[] extValue)
		{
			TlsUtilities.WriteUint16((int)extType, output);
			TlsUtilities.WriteOpaque16(extValue, output);
		}
Ejemplo n.º 27
0
 public Extension(ExtensionType type, byte[] data)
 {
     _type = type;
     _data = data;
 }
Ejemplo n.º 28
0
		/// <summary>
		/// Gets the extensions available for the given extension type.
		/// </summary>
		/// <param name="type">The extension type</param>
		/// <returns></returns>
		public IEnumerable<Lazy<IExtension, IExtensionMeta>> GetByExtensionType(ExtensionType type) {
			return Extensions.Where(e => e.Metadata.Type.HasFlag(type)).ToList() ;
		}
        /// <summary>
        /// Default Constructor
        /// </summary>
		public NUnitAddinAttribute()
		{
			this.Type = ExtensionType.Core;
		}
Ejemplo n.º 30
0
        /// <summary>
        /// Load user data from DataStore
        /// </summary>
        /// <param name="extensionType">
        /// type of info
        /// </param>
        /// <param name="extensionId">
        /// id of info
        /// </param>
        /// <returns>
        /// stream of detail data
        /// </returns>
        public override object LoadFromDataStore(ExtensionType extensionType, string extensionId)
        {
            // MemoryStream stream;
            object o = null;

            using (var conn = this.CreateConnection())
            {
                if (conn.HasConnection)
                {
                    var sqlQuery = string.Format("SELECT Settings FROM {0}DataStoreSettings WHERE BlogId = {1}blogid AND ExtensionType = {1}etype AND ExtensionId = {1}eid", this.tablePrefix, this.parmPrefix);
                    using (var cmd = conn.CreateTextCommand(sqlQuery))
                    {

                        var parms = cmd.Parameters;
                        parms.Add(conn.CreateParameter(FormatParamName("blogid"), Blog.CurrentInstance.Id.ToString()));
                        parms.Add(conn.CreateParameter(FormatParamName("etype"), extensionType.GetHashCode()));
                        parms.Add(conn.CreateParameter(FormatParamName("eid"), extensionId));

                        o = cmd.ExecuteScalar();
                    }
                }
            }

            return o;
        }