示例#1
0
        void _uidUrl(string nUrl)
        {
            string url_ = nUrl.Substring(6);

            if (null == url_ || @"" == url_)
            {
                mUrlType = UrlType_.mError_;
                return;
            }
            int             pos0_      = url_.IndexOf(@"/");
            int             pos1_      = url_.IndexOf(@"\");
            int             pos2_      = url_.IndexOf(@"*");
            int             pos3_      = url_.IndexOf(@":");
            SortedSet <int> sortedSet_ = new SortedSet <int>();

            sortedSet_.Add(pos0_);
            sortedSet_.Add(pos1_);
            sortedSet_.Add(pos2_);
            sortedSet_.Add(pos3_);
            int beg_ = -1;

            foreach (int i in sortedSet_)
            {
                if (i > 0)
                {
                    beg_ = i;
                    break;
                }
            }
            string name_ = null;
            string left_ = null;

            if (beg_ < 0)
            {
                name_ = url_;
            }
            else
            {
                name_ = url_.Substring(0, beg_);
                left_ = url_.Substring(beg_);
            }
            UidSingleton uidSingleton_ = __singleton <UidSingleton> ._instance();

            Uid    uid_        = uidSingleton_._getUid(name_);
            Uid    optimalUid_ = uid_._getUid();
            string uidUrl_     = optimalUid_._getOptimal();

            if (null != left_)
            {
                uidUrl_ += left_;
            }
            mUrlStruct = new UrlStruct();
            mUrlStruct._parserUrl(uidUrl_);
            mUrlType = UrlType_.mUid_;
        }
示例#2
0
        string _findRidUrl(string nUrl)
        {
            string url_ = nUrl.Substring(6);

            if (null == url_ || @"" == url_)
            {
                mUrlType = UrlType_.mError_;
                return(null);
            }
            int             pos0_      = url_.IndexOf(@"/");
            int             pos1_      = url_.IndexOf(@"\");
            int             pos2_      = url_.IndexOf(@"*");
            int             pos3_      = url_.IndexOf(@":");
            SortedSet <int> sortedSet_ = new SortedSet <int>();

            sortedSet_.Add(pos0_);
            sortedSet_.Add(pos1_);
            sortedSet_.Add(pos2_);
            sortedSet_.Add(pos3_);
            int beg_ = -1;

            foreach (int i in sortedSet_)
            {
                if (i > 0)
                {
                    beg_ = i;
                    break;
                }
            }
            string name_ = null;
            string left_ = null;

            if (beg_ < 0)
            {
                name_ = url_;
            }
            else
            {
                name_ = url_.Substring(0, beg_);
                left_ = url_.Substring(beg_);
            }
            UidSingleton uidSingleton_ = __singleton <UidSingleton> ._instance();

            Rid    rid_    = uidSingleton_._getRid(name_);
            string ridUrl_ = rid_._getUrl();

            if (null != left_)
            {
                ridUrl_ += left_;
            }
            return(ridUrl_);
        }
示例#3
0
        public override void _runLoad(string nUrl)
        {
            base._runLoad(nUrl);

            string assemblyInfoUrl_ = nUrl + @"*$assembly.xml";

            mAssemblyInfo._runLoad(assemblyInfoUrl_);

            UdlHeadstream udlHeadstream_ = this._getUdlHeadstream();
            string        fileName_      = udlHeadstream_._getFileName();
            UrlParser     urlParser_     = new UrlParser(nUrl);
            string        assemblyPath_  = urlParser_._urlFile(fileName_);
            AssemblyName  assemblyName_  = AssemblyName.GetAssemblyName(assemblyPath_);
            AppDomain     appDomain_     = AppDomain.CurrentDomain;

            Assembly[] assemblies_ = appDomain_.GetAssemblies();
            foreach (Assembly i in assemblies_)
            {
                if (string.Compare(i.FullName, assemblyName_.FullName) == 0)
                {
                    mAssembly = i;
                    return;
                }
            }

            UidSingleton uidSingleton_ = __singleton <UidSingleton> ._instance();

            IEnumerable <Rid> rids_ = mAssemblyDescriptor._getRids();

            foreach (Rid i in rids_)
            {
                uidSingleton_._addRid(i);
            }

            IEnumerable <string> dependences_ = mAssemblyDescriptor._getDependences();

            foreach (string i in dependences_)
            {
                this._loadAssemblyUfl(i);
            }

            IEnumerable <Uid> uids_ = mAssemblyDescriptor._getUids();

            foreach (Uid i in uids_)
            {
                uidSingleton_._addUid(i);
                Uid    uid_    = i._getUid();
                string uidUrl_ = uid_._getOptimal();
                this._loadAssemblyUdl(uidUrl_);
            }

            IEnumerable <Uid> addins_ = mAssemblyDescriptor._getAddins();

            foreach (Uid i in addins_)
            {
                uidSingleton_._addUid(i);
                Uid    uid_    = i._getUid();
                string uidUrl_ = uid_._getOptimal();
                this._loadAddins(uidUrl_);
            }

            IEnumerable <string> plugins_ = mAssemblyDescriptor._getPlugins();

            foreach (string i in plugins_)
            {
                this._loadPlugins(i);
            }

            if (null == mAssembly)
            {
                mAssembly = Assembly.LoadFrom(assemblyPath_);
            }
        }