public static string ProtocolFormatToUserDisplayString(ProtocolFormat format)
        {
            string result = "";

            switch (format)
            {
            case ProtocolFormat.RoboSepS_1_0:
                result = SeparatorResourceManager.GetSeparatorString(StringId.RoboSepS_1_0);
                break;

            case ProtocolFormat.RoboSepS_1_1:
                result = SeparatorResourceManager.GetSeparatorString(StringId.RoboSepS_1_1);
                break;

            case ProtocolFormat.RoboSepS_1_2:
                result = SeparatorResourceManager.GetSeparatorString(StringId.RoboSepS_1_2);
                break;

            case ProtocolFormat.RoboSep16:
                result = SeparatorResourceManager.GetSeparatorString(StringId.RoboSep16);
                break;

            case ProtocolFormat.RoboSep16_1_2:
                result = SeparatorResourceManager.GetSeparatorString(StringId.RoboSep16_1_2);
                break;
            }
            return(result);
        }
 public static string getLysisStringFromProtocolClass(ProtocolClass pc)
 {
     if (pc == ProtocolClass.WholeBloodPositive)
     {
         return(SeparatorResourceManager.GetSeparatorString(StringId.LysisBufferTube));
     }
     else if (pc == ProtocolClass.WholeBloodNegative)
     {
         return(SeparatorResourceManager.GetSeparatorString(StringId.LysisBufferNegativeFractionTube));
     }
     else
     {
         return(SeparatorResourceManager.GetSeparatorString(StringId.NegativeFractionTube));
     }
 }
 public static SeparatorResourceManager GetInstance()
 {
     if (theSeparatorResourceManager == null)
     {
         try
         {
             theSeparatorResourceManager = new SeparatorResourceManager();
         }
         catch
         {
             theSeparatorResourceManager = null;
         }
     }
     return(theSeparatorResourceManager);
 }
 private static void InitialiseFontTable()
 {
     Debug.Assert(((int)FontId.NUM_FONTS == theFontTable.GetLength(0)),
                  "FontId.NUM_FONTS does not equal the number of fonts defined in the font table");
     for (int i = 0; i < (int)FontId.NUM_FONTS; ++i)
     {
         string fontFamily = SeparatorResourceManager.GetInstance().
                             LookupFontFamilyString(theFontTable[i].aFontFamilyId);
         int fontSize = SeparatorResourceManager.GetInstance().
                        LookupFontSize(theFontTable[i].aFontSizeId);
         if (fontSize != 0)
         {
             Font separatorFont = new Font(fontFamily, fontSize);
             theSeparatorFonts[i] = separatorFont;
         }
     }
 }
 public static string getVialBStringFromProtocolClass(ProtocolClass pc)
 {
     // for positive protocols use positive vial name
     if ((pc == ProtocolClass.Positive) || (pc == ProtocolClass.HumanPositive) ||
         (pc == ProtocolClass.MousePositive) || (pc == ProtocolClass.WholeBloodPositive))
     {
         return(SeparatorResourceManager.GetSeparatorString(StringId.VialBpos));
     }
     // for negative protocols use negative vial name
     else if ((pc == ProtocolClass.Negative) || (pc == ProtocolClass.HumanNegative) ||
              (pc == ProtocolClass.MouseNegative) || (pc == ProtocolClass.WholeBloodNegative))
     {
         return(SeparatorResourceManager.GetSeparatorString(StringId.VialBneg));
     }
     // else use normal bead vial name
     else
     {
         return(SeparatorResourceManager.GetSeparatorString(StringId.VialB));
     }
 }
 public static ProtocolFormat GetProtocolFormat()
 {
     return(SeparatorResourceManager.GetInstance().protocolFormat);
 }
 public static void SetProtocolFormat(ProtocolFormat type)
 {
     SeparatorResourceManager.GetInstance().protocolFormat = type;
 }
 public static bool isPlatformRS16()
 {
     return(isPlatformRS16(SeparatorResourceManager.GetProtocolFormat()));
 }
        public static StringId convertNameToStringID(string name)
        {
            StringId id = StringId.WasteTube;

            if (name == SeparatorResourceManager.GetSeparatorString(StringId.WasteTube))
            {
                id = StringId.WasteTube;
            }
            else if (name == SeparatorResourceManager.GetSeparatorString(StringId.SeparationTube))
            {
                id = StringId.SeparationTube;
            }
            else if (name == SeparatorResourceManager.GetSeparatorString(StringId.LysisBufferTube))
            {
                id = StringId.LysisBufferTube;
            }
            else if (name == SeparatorResourceManager.GetSeparatorString(StringId.NegativeFractionTube))
            {
                id = StringId.NegativeFractionTube;
            }
            else if (name == SeparatorResourceManager.GetSeparatorString(StringId.LysisBufferNegativeFractionTube))
            {
                id = StringId.LysisBufferNegativeFractionTube;
            }
            else if (name == SeparatorResourceManager.GetSeparatorString(StringId.VialA))
            {
                id = StringId.VialA;
            }
            else if (name == SeparatorResourceManager.GetSeparatorString(StringId.VialB))
            {
                id = StringId.VialB;
            }
            else if (name == SeparatorResourceManager.GetSeparatorString(StringId.VialBpos))
            {
                id = StringId.VialBpos;
            }
            else if (name == SeparatorResourceManager.GetSeparatorString(StringId.VialBneg))
            {
                id = StringId.VialBneg;
            }
            else if (name == SeparatorResourceManager.GetSeparatorString(StringId.VialC))
            {
                id = StringId.VialC;
            }
            else if (name == SeparatorResourceManager.GetSeparatorString(StringId.SampleTube))
            {
                id = StringId.SampleTube;
            }
            else if (name == SeparatorResourceManager.GetSeparatorString(StringId.QuadrantBuffer))
            {
                id = StringId.QuadrantBuffer;
            }
            else if (name == SeparatorResourceManager.GetSeparatorString(StringId.QuadrantBuffer34))
            {
                id = StringId.QuadrantBuffer34;
            }
            else if (name == SeparatorResourceManager.GetSeparatorString(StringId.QuadrantBuffer56))
            {
                id = StringId.QuadrantBuffer56;
            }
            return(id);
        }
 public static string GetErrorMessageString(string key)
 {
     return(SeparatorResourceManager.GetInstance().LookupErrorMessageString(key));
 }
 public static Font GetFont(FontId lookupKey)
 {
     return(SeparatorResourceManager.GetInstance().LookupFont(lookupKey));
 }
 public static string GetSeparatorString(StringId lookupKey)
 {
     return(SeparatorResourceManager.GetInstance().
            LookupSeparatorResourceString(lookupKey));
 }
        // FUTURE: consider implementing a cache (hashtable?) based on the resource lookup
        // string.  You'd need to flush the cache if the thread culture changed, or have the
        // cache as thread-local storage (and then control the 'thread caches' individually).

        public static void GetSeparatorStateStrings(Type resourceType,
                                                    SeparatorState separatorState, out string stateName, out string stateDescription)
        {
            SeparatorResourceManager.GetInstance().LookupSeparatorStateStrings(resourceType,
                                                                               separatorState, out stateName, out stateDescription);
        }