コード例 #1
0
 public virtual void RemoveEntityExtension(System.Type specType, Net.Vpc.Upa.Extensions.EntityExtensionDefinition specObject)
 {
     objectMap.Remove(specObject);
     System.Collections.Generic.IList <Net.Vpc.Upa.Impl.ExtensionSupportInfo> list = Net.Vpc.Upa.Impl.FwkConvertUtils.GetMapValue <System.Type, System.Collections.Generic.IList <Net.Vpc.Upa.Impl.ExtensionSupportInfo> >(extensionsMap, specType);
     if (list != null)
     {
         for (int i = (list).Count; i >= 0; i--)
         {
             Net.Vpc.Upa.Impl.ExtensionSupportInfo tss = list[i];
             if (tss.GetExtension().Equals(specObject))
             {
                 list.RemoveAt(i);
             }
         }
     }
     foreach (System.Collections.Generic.KeyValuePair <System.Type, System.Collections.Generic.IList <Net.Vpc.Upa.Impl.ExtensionSupportInfo> > e in new System.Collections.Generic.HashSet <System.Collections.Generic.KeyValuePair <System.Type, System.Collections.Generic.IList <Net.Vpc.Upa.Impl.ExtensionSupportInfo> > >(new System.Collections.Generic.Dictionary <System.Type, System.Collections.Generic.IList <Net.Vpc.Upa.Impl.ExtensionSupportInfo> >(extensionsSupportMap)))
     {
         System.Collections.Generic.IList <Net.Vpc.Upa.Impl.ExtensionSupportInfo> tss2 = (e).Value;
         for (int i2 = (tss2).Count; i2 >= 0; i2--)
         {
             Net.Vpc.Upa.Impl.ExtensionSupportInfo tss3 = tss2[i2];
             if (tss3.GetExtension().Equals(specObject))
             {
                 tss2.RemoveAt(i2);
             }
         }
         if ((tss2.Count == 0))
         {
             extensionsSupportMap.Remove((e).Key);
         }
     }
     for (System.Collections.Generic.IEnumerator <System.Collections.Generic.KeyValuePair <System.Type, System.Collections.Generic.IList <Net.Vpc.Upa.Impl.ExtensionSupportInfo> > > i = new System.Collections.Generic.HashSet <System.Collections.Generic.KeyValuePair <System.Type, System.Collections.Generic.IList <Net.Vpc.Upa.Impl.ExtensionSupportInfo> > >(extensionsSupportMap).GetEnumerator(); i.MoveNext();)
     {
     }
 }
コード例 #2
0
 public virtual void ReleaseFile(string fileName)
 {
     lock (openFiles)
     {
         openFiles.Remove(fileName);
     }
 }
コード例 #3
0
 public static void RemoveLogId(string logId)
 {
     if (logIds == null)
     {
         logIds = new NeoDatis.Tool.Wrappers.Map.OdbHashMap <string, string>();
     }
     logIds.Remove(logId);
 }
コード例 #4
0
        public static V RemoveMapKey <K, V>(System.Collections.Generic.IDictionary <K, V> map, K key)
        {
            V r = default(V);

            map.TryGetValue(key, out r);
            map.Remove(key);
            return(r);
        }
コード例 #5
0
 public virtual Net.Vpc.Upa.Expressions.UserExpression RemoveParameter(string name, object @value)
 {
     if (parameters != null)
     {
         parameters.Remove(name);
     }
     return(this);
 }
コード例 #6
0
 public void Off(System.Action value)
 {
     if (_wrappers.TryGetValue(value, out var wrapper))
     {
         Off(wrapper);
         _wrappers.Remove(value);
     }
 }
コード例 #7
0
 public override Net.Vpc.Upa.Query RemoveParameter(string name)
 {
     if (parametersByName != null)
     {
         parametersByName.Remove(name);
     }
     return(this);
 }
コード例 #8
0
ファイル: Connection.cs プロジェクト: ekicyou/pasta
 /// <exception cref="System.Exception"></exception>
 public virtual void UnlockObjectWithOid(NeoDatis.Odb.OID oid)
 {
     lock (this)
     {
         connectionManager.UnlockOidForConnection(oid, this);
         oidsLockedForUpdate.Remove(oid);
     }
 }
コード例 #9
0
 public override Net.Vpc.Upa.Query RemoveParameter(int index)
 {
     if (parametersByIndex != null)
     {
         parametersByIndex.Remove(index);
     }
     return(this);
 }
コード例 #10
0
 public override void Remove(string key)
 {
     nfo.ResetToDefaultValue(userObject, key);
     if (extra != null)
     {
         extra.Remove(key);
     }
 }
コード例 #11
0
        protected internal override void  DoSetNorm(int n, string field, byte value_Renamed)
        {
            lock (normsCache)
            {
                normsCache.Remove(field);                               // clear cache
            }
            int i = ReaderIndex(n);                                     // find segment num

            subReaders[i].SetNorm(n - starts[i], field, value_Renamed); // dispatch
        }
コード例 #12
0
 public virtual void SetRecord(string entityName, Net.Vpc.Upa.Record record)
 {
     if (record == null)
     {
         records.Remove(entityName);
     }
     else
     {
         records[entityName] = record;
     }
 }
コード例 #13
0
 public virtual void Update()
 {
     System.Collections.Generic.ISet <string> visited = new System.Collections.Generic.HashSet <string>();
     persistSequenceGeneratorFields.Clear();
     updateSequenceGeneratorFields.Clear();
     insertExpressions.Clear();
     updateExpressions.Clear();
     System.Collections.Generic.IList <Net.Vpc.Upa.Field> fields1 = entity.GetFields();
     foreach (Net.Vpc.Upa.Field field in fields1)
     {
         visited.Remove(field.GetName());
         Net.Vpc.Upa.Impl.Persistence.FieldPersistenceInfo fieldPersistenceInfo = Net.Vpc.Upa.Impl.FwkConvertUtils.GetMapValue <string, Net.Vpc.Upa.Impl.Persistence.FieldPersistenceInfo>(fields, field.GetName());
         if (fieldPersistenceInfo == null)
         {
             fieldPersistenceInfo    = new Net.Vpc.Upa.Impl.Persistence.FieldPersistenceInfo();
             fields[field.GetName()] = fieldPersistenceInfo;
         }
         fieldPersistenceInfo.field            = field;
         fieldPersistenceInfo.persistenceStore = persistenceStore;
         fieldPersistenceInfo.Synchronize();
         if (fieldPersistenceInfo.persistFieldPersister != null)
         {
             persistSequenceGeneratorFields.Add(fieldPersistenceInfo);
         }
         if (fieldPersistenceInfo.updateFieldPersister != null)
         {
             updateSequenceGeneratorFields.Add(fieldPersistenceInfo);
         }
         if (fieldPersistenceInfo.insertExpression != null)
         {
             insertExpressions.Add(fieldPersistenceInfo);
         }
         if (fieldPersistenceInfo.updateExpression != null)
         {
             updateExpressions.Add(fieldPersistenceInfo);
         }
         if (field.GetDataType() is Net.Vpc.Upa.Types.ManyToOneType)
         {
             ((Net.Vpc.Upa.Impl.AbstractField)field).SetFieldPersister(new Net.Vpc.Upa.Impl.EntityTypeFieldPersister());
         }
         else if (Net.Vpc.Upa.Impl.Util.UPAUtils.IsPasswordTransform(Net.Vpc.Upa.Impl.Util.UPAUtils.GetTypeTransformOrIdentity(field)))
         {
             ((Net.Vpc.Upa.Impl.AbstractField)field).SetFieldPersister(new Net.Vpc.Upa.Impl.Transform.PasswordTypeFieldPersister());
         }
         else
         {
             ((Net.Vpc.Upa.Impl.AbstractField)field).SetFieldPersister(new Net.Vpc.Upa.Impl.SimpleFieldPersister());
         }
     }
     foreach (string r in visited)
     {
         fields.Remove(r);
     }
 }
コード例 #14
0
 public override Net.Vpc.Upa.Query SetHint(string key, object @value)
 {
     if (@value == null)
     {
         hints.Remove(key);
     }
     else
     {
         hints[key] = @value;
     }
     return(this);
 }
コード例 #15
0
 internal virtual void Add(K key, T value)
 {
     if (m_places[m_index])
     {
         // remove existing element from the cache
         m_places[m_index] = false;
         m_hashTable.Remove(m_lru[m_index]);
     }
     m_hashTable[key]  = value;
     m_lru[m_index]    = key;
     m_places[m_index] = true;
     m_index           = (m_index + 1) % m_lru.Length;
 }
コード例 #16
0
ファイル: Cache.cs プロジェクト: Orvid/SQLInterfaceCollection
        public virtual void RemoveObjectWithOid(NeoDatis.Odb.OID oid)
        {
            if (oid == null)
            {
                throw new ODBRuntimeException(NeoDatisError.CacheNullOid);
            }
            object o = null;

            oids.TryGetValue(oid, out o);
            oids.Remove(oid);
            if (o != null)
            {
                objects.Remove(o);
            }
            // FIXME URL in HashMap What should we do?
            objectInfoPointersCacheFromOid.Remove(oid);
            unconnectedZoneOids.Remove(oid);
            // For monitoring purpose
            nbObjects = objects.Count;
            nbOids    = oids.Count;
            nbOih     = objectInfoPointersCacheFromOid.Count;
        }
コード例 #17
0
        protected void SetEnvironmentVariable(System.Collections.Generic.IDictionary <string, string> environment, string name, string value)
        {
#endif
            if (value == null)
            {
                Logger.LogInformation("Removing environment variable {name}", name);
                environment.Remove(name);
            }
            else
            {
                Logger.LogInformation("SET {name}={value}", name, value);
                environment[name] = value;
            }
        }
コード例 #18
0
        public static bool ChangeKey <TKey, TValue>(this System.Collections.Generic.IDictionary <TKey, TValue> dict,
                                                    TKey oldKey, TKey newKey)
        {
            TValue value;

            if (!dict.TryGetValue(oldKey, out value))
            {
                return(false);
            }

            dict.Remove(oldKey);  // do not change order
            dict[newKey] = value; // or dict.Add(newKey, value) depending on ur comfort
            return(true);
        }
コード例 #19
0
ファイル: Cache.cs プロジェクト: Orvid/SQLInterfaceCollection
        public virtual void EndInsertingObject(object o)
        {
            ObjectInsertingInfo oii = (ObjectInsertingInfo)insertingObjects[o];

            if (oii.level == 1)
            {
                insertingObjects.Remove(o);
                oii = null;
            }
            else
            {
                oii.level--;
            }
        }
コード例 #20
0
        public virtual object DeleteNode(NeoDatis.Btree.IBTreeNode o)
        {
            NeoDatis.Odb.OID oid = engine.Delete(o);
            oids.Remove(oid);
            int position = modifiedObjectOids.Remove2(oid);

            //TODO
            if (position != null)
            {
                // Just replace the element by null, to not modify all the other
                // positions
                modifiedObjectOidList.Set(position, null);
            }
            return(o);
        }
コード例 #21
0
        public void UnRegistrate(string key)
        {
            // checking argument
            // key
            if (string.IsNullOrWhiteSpace(key))
            {
                throw new ArgumentNullException(nameof(key));
            }
            if (!factory.ContainsKey(key))
            {
                throw new InvalidOperationException($"No such key '{key}'");
            }

            // removing
            factory.Remove(key);
        }
コード例 #22
0
        /// <summary>
        /// Unregistrates type by current key
        /// </summary>
        /// <param name="key">
        /// A key by which Type was registered
        /// </param>
        /// <exception cref="ArgumentNullException">
        /// Throws when <paramref name="key"/> is null.
        /// </exception>
        /// <exception cref="InvalidOperationException">
        /// Throws when factory does not contain current key
        /// </exception>
        public void UnRegistrate(string key)
        {
            // checking argument
            // key
            if (string.IsNullOrWhiteSpace(key))
            {
                throw new ArgumentNullException(nameof(key));
            }
            if (!factory.ContainsKey(key))
            {
                throw new InvalidOperationException(string.Format(Core.Messages.Error.View.NAVIGATION_MANAGER_NO_SUCH_KEY_FORMAT, key));
            }

            // removing
            factory.Remove(key);
        }
コード例 #23
0
 public virtual Net.Vpc.Upa.Persistence.ExpressionCompilerConfig BindAliastoEntity(string alias, string entityName)
 {
     if (aliasToEntityContext == null)
     {
         aliasToEntityContext = new System.Collections.Generic.Dictionary <string, string>();
     }
     if (entityName == null)
     {
         aliasToEntityContext.Remove(alias);
     }
     else
     {
         aliasToEntityContext[alias] = entityName;
     }
     return(this);
 }
コード例 #24
0
 public Net.Vpc.Upa.Query SetHint(string key, object @value)
 {
     if (query != null)
     {
         throw new System.ArgumentException("Query is already executed");
     }
     if (@value == null)
     {
         hints.Remove(key);
     }
     else
     {
         hints[key] = @value;
     }
     return(this);
 }
コード例 #25
0
        private JsonWebSecurityToken ReadActor(System.Collections.Generic.IDictionary <string, string> payload)
        {
            if (!this.JsonWebSecurityTokenRequirement.AllowActorToken)
            {
                return(null);
            }
            JsonWebSecurityToken result = null;
            string text;

            payload.TryGetValue("actortoken", out text);
            if (!string.IsNullOrEmpty(text))
            {
                result = (this.ReadTokenCore(text, true) as JsonWebSecurityToken);
                payload.Remove("actortoken");
            }
            return(result);
        }
コード例 #26
0
 public virtual void SetProperty(string name, object @value) /* throws Net.Vpc.Upa.Exceptions.UPAException */
 {
     if (@value == null)
     {
         if (properties != null)
         {
             properties.Remove(name);
         }
     }
     else
     {
         if (properties == null)
         {
             properties = new System.Collections.Generic.Dictionary <string, object>();
         }
         properties[name] = @value;
     }
 }
コード例 #27
0
        protected override void OnPageEncountered(Uri url, System.Collections.Generic.IDictionary <string, string> query, System.Collections.Generic.IDictionary <string, string> fragment)
        {
            // Remove state from dictionaries.
            // We are ignoring request state forgery status
            // as we're hitting an ASP.NET service which forwards
            // to a third-party OAuth service itself
            if (query.ContainsKey("state"))
            {
                query.Remove("state");
            }

            if (fragment.ContainsKey("state"))
            {
                fragment.Remove("state");
            }

            base.OnPageEncountered(url, query, fragment);
        }
コード例 #28
0
 public Net.Vpc.Upa.RemoveOptions SetHint(string name, object @value)
 {
     if (@value == null)
     {
         if (hints != null)
         {
             hints.Remove(name);
         }
     }
     else
     {
         if (hints == null)
         {
             hints = new System.Collections.Generic.Dictionary <string, object>();
         }
         hints[name] = @value;
     }
     return(this);
 }
コード例 #29
0
 public virtual Net.Vpc.Upa.Persistence.EntityExecutionContext SetHint(string name, object @value)
 {
     if (@value == null)
     {
         if (hints != null)
         {
             hints.Remove(name);
         }
     }
     else
     {
         if (hints == null)
         {
             hints = new System.Collections.Generic.Dictionary <string, object>();
         }
         hints[name] = @value;
     }
     return(this);
 }
コード例 #30
0
ファイル: Cache.cs プロジェクト: Orvid/SQLInterfaceCollection
        // Object is in memory, do not need to re-put in map. The key has
        // not changed
        // readingObjectInfo.put(oid, objects);
        public virtual void EndReadingObjectInfo(NeoDatis.Odb.OID oid)
        {
            if (oid == null)
            {
                throw new ODBRuntimeException(NeoDatisError.CacheNullOid.AddParameter(oid));
            }
            object[] values = (object[])readingObjectInfo[oid];
            if (values == null || values[0] == null)
            {
                throw new ODBRuntimeException(NeoDatisError.ObjectInfoNotInTempCache
                                              .AddParameter(oid).AddParameter("?"));
            }
            short readCount = ((short)values[0]);

            if (readCount == 1)
            {
                readingObjectInfo.Remove(oid);
            }
            else
            {
                values[0] = (short)(readCount - 1);
            }
        }