Example #1
0
    public List<MediaDetails> LoadMediaForConnectId(int connection_id, out ErrCode err)
    {
        err = new ErrCode();

        List<MediaDetails> mediaList = SiteProvider.CurrentProvider.LoadMediaForConnectId(connection_id, out err);

        return mediaList;
    }
Example #2
0
 private static ProviderInfo[] EnumProviders(out uint [] provTypes)
 {
     ArrayList alProv = new ArrayList();
     ArrayList alProvType = new ArrayList();
     uint dwIndex = 0;
     uint dwReserved = 0;
     uint dwFlags = 0;
     uint dwProvType = 0;
     uint cbProvName = 0;
     StringBuilder sProv = new StringBuilder();
     while ( true )
     {
         bool retVal = Crypto.CryptEnumProviders(dwIndex, ref dwReserved, dwFlags, ref dwProvType, sProv, ref cbProvName);
         ErrCode [] eca = new ErrCode[]{ErrCode.NO_MORE_ITEMS, ErrCode.MORE_DATA};
         ErrCode ec = Error.HandleRetVal(retVal, eca);
         if ( !retVal )
         {
             if ( ec == ErrCode.NO_MORE_ITEMS )
                 break;
             if ( ec != ErrCode.MORE_DATA )
                 break;
         }
         sProv = new System.Text.StringBuilder((int)cbProvName);
         retVal = Crypto.CryptEnumProviders(dwIndex, ref dwReserved, dwFlags, ref dwProvType, sProv, ref cbProvName);
         ec = Error.HandleRetVal(retVal);
         dwIndex = dwIndex + 1;
         cbProvName = 0;
         ProviderInfo pi = new ProviderInfo();
         pi.name = sProv.ToString().TrimEnd(new char['\0']);
         pi.type = (ProvType) dwProvType;
         alProv.Add(pi);
         if(alProvType.Contains(dwProvType) == false)
             alProvType.Add(dwProvType);
     }
     provTypes = new uint[alProvType.Count];
     alProvType.CopyTo(0, provTypes, 0, provTypes.Length);
     ProviderInfo [] pia = new ProviderInfo[alProv.Count];
     alProv.CopyTo(0, pia, 0, pia.Length);
     return pia;
 }
Example #3
0
 public static ErrCode HandleRetVal(bool retVal, ErrCode expected)
 {
     ErrCode [] eca = new ErrCode[1];
     eca[0] = expected;
     return HandleRetVal(retVal, eca);
 }
Example #4
0
    public List<int> SaveAllFrequencies(FrequencyDetails[] frequencies, out ErrCode err)
    {
        List<int> ids = SiteProvider.CurrentProvider.SaveAllFrequencies(frequencies, out err);

        return ids;
    }
Example #5
0
    public ErrCode SaveChannel(DAL.Channel channel, out int id)
    {
        id = 0;
        ErrCode err = new ErrCode();
        SiteProvider.CurrentProvider.SaveChannel(channel, out id);

        return err;
    }
Example #6
0
    public List<TimeMarkDetails> LoadTimeBase(int idMark, out ErrCode err)
    {
        err = null;
        List<TimeMarkDetails> tmdl = SiteProvider.CurrentProvider.LoadTimeBase(idMark, out err);

        return tmdl;
    }
Example #7
0
    public List<VariantDetails> LoadVariants(out ErrCode err)
    {
        err = null;
        List<VariantDetails> variants = SiteProvider.CurrentProvider.LoadVariants(out err);

        return variants;
    }
Example #8
0
    public ElementPorts LoadPorts(int element_id, out ErrCode err)
    {
        err = new ErrCode();

        ElementPorts eps = SiteProvider.CurrentProvider.LoadPorts(element_id, out err);

        return eps;
    }
Example #9
0
    public List<PriorityDetails> LoadPriorities(out ErrCode err)
    {
        err = null;
        List<PriorityDetails> pds = SiteProvider.CurrentProvider.LoadAllPriorities(out err);

        return pds;
    }
Example #10
0
    public List<PEDetails> LoadPlaneElements(int variant_id, out ErrCode err)
    {
        err = null;
        List<PEDetails> pes = SiteProvider.CurrentProvider.LoadPEs(variant_id, out err);

        return pes;
    }
Example #11
0
    public List<PlaneDetails> LoadPlanes(out ErrCode err)
    {
        err = null;
        List<PlaneDetails> planes = SiteProvider.CurrentProvider.LoadPlanes(out err);

        return planes;
    }
Example #12
0
    public List<PlaneDetails> LoadNAnnientedPlanes(out ErrCode err)
    {
        err = null;
        List<PlaneDetails> pds = SiteProvider.CurrentProvider.LoadNAnnientedAndNExecutedPlanes(out err);

        return pds;
    }
Example #13
0
    public List<ModeDetails> LoadModes(out ErrCode err)
    {
        err = null;
        List<ModeDetails> mds = SiteProvider.CurrentProvider.LoadModes(out err);

        return mds;
    }
Example #14
0
    public List<MediumStyle> LoadMediumStyles(out ErrCode err)
    {
        List<MediumStyle> styles = SiteProvider.CurrentProvider.LoadMediumStyles(out err);

        return styles;
    }
Example #15
0
    public List<TemporalAxisDetails> LoadTemporalAxis(int idVariant, out ErrCode err)
    {
        err = null;
        List<TemporalAxisDetails> tadl = SiteProvider.CurrentProvider.LoadTemporalAxis(idVariant, out err);

        return tadl;
    }
Example #16
0
    public string LoadReportsPath(out ErrCode err)
    {
        err = new ErrCode();

        string rpath = SiteProvider.CurrentProvider.LoadReportsPath(out err);

        return rpath;
    }
Example #17
0
    public List<ThresholdDetails> LoadThresholds(out ErrCode err)
    {
        err = null;
        List<ThresholdDetails> thresholds = SiteProvider.CurrentProvider.LoadAllThresholds(out err);

        return thresholds;
    }
Example #18
0
    public List<ScriptDetails> LoadScriptWithIdTimeMark(int idMark, out ErrCode err)
    {
        err = null;
        List<ScriptDetails> sd = SiteProvider.CurrentProvider.LoadScriptWithTimeMark(idMark, out err);

        return sd;
    }
Example #19
0
    public List<ItemDetails> LoadUnits(int parent_id, out ErrCode err)
    {
        err = new ErrCode();
        List<ItemDetails> elements = SiteProvider.CurrentProvider.LoadUnits(parent_id, out err);

        return elements;
    }
Example #20
0
    public List<ScriptDetails> LoadScriptWithIdVariant(int variant_id, out ErrCode err)
    {
        err = null;
        List<ScriptDetails> sd = SiteProvider.CurrentProvider.LoadScriptWithIdVariant(variant_id, out err);

        return sd;
    }
Example #21
0
    public List<VariantDetails> LoadVariantsWithPlaneId(int plane_id, out ErrCode err)
    {
        err = null;
        List<VariantDetails> variants = SiteProvider.CurrentProvider.LoadVariantsWithPlaneId(plane_id, out err);

        return variants;
    }
Example #22
0
    public List<SettlementDetail> LoadSettlements(out ErrCode err)
    {
        err = null;
        List<SettlementDetail> settlements = SiteProvider.CurrentProvider.LoadSettlements(out err);

        return settlements;
    }
Example #23
0
    public List<int> SaveAllThresholds(ThresholdDetails[] thresholds, out ErrCode err)
    {
        List<int> ids = SiteProvider.CurrentProvider.SaveAllThresholds(thresholds, out err);

        return ids;
    }
Example #24
0
    public List<ItemDetails> LoadSites(int schema_id, out ErrCode err)
    {
        err = new ErrCode();

        List<ItemDetails> sites = SiteProvider.CurrentProvider.GetSites(schema_id, out err);

        return sites;
    }
Example #25
0
 public static ArrayList GetProvParam(IntPtr prov, ProvParamEnum param, uint dataLen)
 {
     ArrayList al = new ArrayList();
     byte[] data = null;
     uint flags = Const.CRYPT_FIRST;
     while ( true )
     {
         data = new byte[dataLen];
         bool retVal = Crypto.CryptGetProvParam(prov, (uint) param, data, ref dataLen, flags);
         ErrCode [] eca = new ErrCode[]{ErrCode.NO_MORE_ITEMS, ErrCode.MORE_DATA};
         ErrCode ec = Error.HandleRetVal(retVal, eca);
         if ( !retVal )
         {
             if ( ec == ErrCode.NO_MORE_ITEMS )
                 break;
             if ( ec != ErrCode.MORE_DATA )
                 break;
         }
         flags = 0;
         al.Add(data);
     }
     return al;
 }
Example #26
0
    public PicturePackage LoadStyle(int element_id, out ErrCode err)
    {
        PicturePackage style = SiteProvider.CurrentProvider.LoadStyle(element_id, out err);

        return style;
    }
Example #27
0
 public static ErrCode HandleRetVal(bool retVal)
 {
     ErrCode [] eca = new ErrCode[0];
     return HandleRetVal(retVal, eca);
 }
Example #28
0
    public List<PicturePackage> LoadStyles(out ErrCode err)
    {
        err = new ErrCode();

        List<PicturePackage> styles = SiteProvider.CurrentProvider.LoadStyles(out err);

        return styles;
    }
Example #29
0
 public static ErrCode HandleRetVal(bool retVal, ErrCode [] expected)
 {
     ErrCode ec = ErrCode.SUCCESS;
     if(retVal == false)
     {
         uint lastErr = (uint) Marshal.GetLastWin32Error();
         ec = (ErrCode) lastErr;
         bool isExpected = false;
         foreach(ErrCode expect in expected)
         {
             if(ec == expect)
                 isExpected = true;
         }
         if(isExpected == false)
             throw new Exception("bNb.Sec: " + ec.ToString());
     }
     return ec;
 }
Example #30
0
    public MediaDetails LoadMedia(int media_id, out ErrCode err)
    {
        err = new ErrCode();

        MediaDetails md = SiteProvider.CurrentProvider.LoadMedia(media_id, out err);

        return md;
    }