예제 #1
0
        // Token: 0x06000987 RID: 2439 RVA: 0x00043410 File Offset: 0x00041610
        public FormValue LookupForm(FormKey formKey)
        {
            ExTraceGlobals.FormsRegistryCallTracer.TraceDebug <string>((long)this.GetHashCode(), "FormsRegistry.LookupForm in registry {0}", this.name);
            if (!this.forms.ContainsKey(formKey))
            {
                ExTraceGlobals.FormsRegistryDataTracer.TraceDebug <FormKey>((long)this.GetHashCode(), "FormsRegistry.LookupForm - no form found - key = ({0})", formKey);
                return(null);
            }
            FormValue formValue = this.forms[formKey];

            ExTraceGlobals.FormsRegistryDataTracer.TraceDebug <object, FormKey>((long)this.GetHashCode(), "FormsRegistry.LookupForm - found form - form = {0}, key = ({1})", formValue.Value, formKey);
            return(formValue);
        }
예제 #2
0
 public FormValue this[FormKey formKey]
 {
     get
     {
         string text = this.FindMatchingKeyClass(formKey, this.matchMode);
         if (text == null)
         {
             return(null);
         }
         string @class = formKey.Class;
         formKey.Class = text;
         FormValue result = this.formDictionary[formKey];
         formKey.Class = @class;
         return(result);
     }
 }
        private static FormValue LookupFormInExperiences(FormKey formKey, Experience[] experiences)
        {
            ExTraceGlobals.FormsRegistryCallTracer.TraceDebug <FormKey>(0L, "FormsRegistryManager.LookupFormInExperiences key = {0}", formKey);
            FormValue formValue = null;
            int       num       = experiences.Length;

            for (int i = 0; i < num; i++)
            {
                Experience experience = experiences[i];
                formKey.Experience = experience.Name;
                formValue          = experience.FormsRegistry.LookupForm(formKey);
                if (formValue != null)
                {
                    break;
                }
            }
            return(formValue);
        }
        public static FormValue LookupForm(FormKey formKey, Experience[] experiences)
        {
            ExTraceGlobals.FormsRegistryCallTracer.TraceDebug <FormKey>(0L, "FormsRegistryManager.LookupForm key = {0}", formKey);
            if (experiences == null)
            {
                throw new ArgumentNullException("experiences", "There must be at least one experience provided");
            }
            if (experiences.Length == 0)
            {
                throw new ArgumentOutOfRangeException("experiences", "There must be at least one experience provided");
            }
            FormValue formValue = FormsRegistryManager.LookupFormInExperiences(formKey, experiences);

            if (formValue == null)
            {
                ExTraceGlobals.FormsRegistryTracer.TraceDebug(0L, "Downgrading state to wildcard");
                formKey.State = string.Empty;
                formValue     = FormsRegistryManager.LookupFormInExperiences(formKey, experiences);
                if (formValue == null)
                {
                    ExTraceGlobals.FormsRegistryTracer.TraceDebug(0L, "Downgrading action to wildcard");
                    string action = formKey.Action;
                    formKey.Action = string.Empty;
                    formValue      = FormsRegistryManager.LookupFormInExperiences(formKey, experiences);
                    if (formValue == null)
                    {
                        ExTraceGlobals.FormsRegistryTracer.TraceDebug(0L, "Downgrading class to wildcard");
                        formKey.Class  = string.Empty;
                        formKey.Action = action;
                        ExTraceGlobals.FormsRegistryTracer.TraceDebug(0L, "Restoring action");
                        formValue = FormsRegistryManager.LookupFormInExperiences(formKey, experiences);
                        if (formValue == null)
                        {
                            formKey.Action = string.Empty;
                            ExTraceGlobals.FormsRegistryTracer.TraceDebug(0L, "Downgrading action to wildcard");
                            formValue = FormsRegistryManager.LookupFormInExperiences(formKey, experiences);
                        }
                    }
                }
            }
            return(formValue);
        }
예제 #5
0
 public void Add(FormKey formKey, FormValue formValue)
 {
     this.formDictionary.Add(formKey, formValue);
 }