Ejemplo n.º 1
0
        private static ISortingStrategy GetSortingStrategy(ObjectTypeEnum objectsType)
        {
            ISortingStrategy sortingStrategy = null;

            switch (objectsType)
            {
            case ObjectTypeEnum.Resident:
                sortingStrategy = new QuickSort();
                break;

            case ObjectTypeEnum.TicketNumber:
                sortingStrategy = new MergeSort();
                break;

            case ObjectTypeEnum.Passenger:
                sortingStrategy = new HeapSort();
                break;

            default:
                break;
            }

            System.Console.WriteLine($"Type of elements in collection: {objectsType} -> Chosen Strategy: {sortingStrategy}");
            return(sortingStrategy);
        }
Ejemplo n.º 2
0
    public List <GameObject> GetPollObjects(ObjectTypeEnum typeEnum, int size)
    {
        var pool  = new List <GameObject>();
        var count = 0;

        foreach (var obj in _poolsObjects[typeEnum])
        {
            if (obj.activeSelf)
            {
                continue;
            }
            pool.Add(obj);
            count++;
            if (count == size)
            {
                break;
            }
        }
        foreach (var objDel in pool)
        {
            if (_poolsObjects[typeEnum].Contains(objDel))
            {
                _poolsObjects[typeEnum].Remove(objDel);
            }
        }
        return(pool);
    }
Ejemplo n.º 3
0
 public Logged(IAuditLogService service, IUnitOfWork unitOfWork, Operations operations, ObjectTypeEnum objectType)
 {
     _service         = service;
     this._operations = operations;
     this._objectType = objectType;
     _unityOfWork     = unitOfWork;
 }
Ejemplo n.º 4
0
        public override void OnBuildObject()
        {
            string strSql = @"SELECT O.OWNER,O.OBJECT_NAME,REPLACE(O.OBJECT_TYPE,' ','_') AS OBJECT_TYPE FROM DBA_OBJECTS O
                                WHERE O.OWNER = '{0}'
                                ORDER BY OBJECT_NAME, o.OBJECT_TYPE ASC";

            DataTable userObjects = OwnerUser.FillDataTable(String.Format(strSql, this.Name));

            if (userObjects != null && userObjects.Rows.Count > 0)
            {
                foreach (DataRow item in userObjects.Rows)
                {
                    try
                    {
                        ObjectTypeEnum objectType = (ObjectTypeEnum)Enum.Parse(typeof(ObjectTypeEnum), item["OBJECT_TYPE"].ToString(), true);
                        var            dbObject   = DatabaseObjectFactory.Instance.CreateObject(objectType, item["OBJECT_NAME"].ToString().Replace(" ", ""), this);
                        if (dbObject != null)
                        {
                            this.SchemaObjects.Add(dbObject);
                            if (OnObjectProcess != null)
                            {
                                OnObjectProcess(this, dbObject);
                            }
                        }
                    }
                    catch (Exception ex)
                    {
                        //throw;
                    }
                }
            }

            this.SchemaObjects = SortObjects();
        }
        protected override void Translate(ExpandoObject objectToTranslate)
        {
            List <string> translatedObjects = new List <string>();
            var           objectAsDict      = (IDictionary <string, object>)objectToTranslate;

            HashSet <Vector2> pointsInArea = GetPointsInArea(objectAsDict);

            if (pointsInArea != null)
            {
                ObjectTypeEnum objectType = GetObjectType(objectAsDict);
                string         objectName = GetObjectName(objectAsDict);
                if (string.IsNullOrEmpty(objectName))
                {
                    return;
                }
                string iIP   = GetIIP(objectAsDict);
                string other = GetOther(objectAsDict);
                foreach (var point in pointsInArea)
                {
                    translatedObjects.Add($"{objectType};{objectName};{iIP};{other};{point.X} {point.Y};");
                }

                foreach (var obj in translatedObjects)
                {
                    if (!string.IsNullOrEmpty(obj))
                    {
                        Console.WriteLine(obj);
                    }
                }
            }
        }
        public string Rename(ObjectTypeEnum type, string name)
        {
            var prefix = "";

            switch (type)
            {
            case ObjectTypeEnum.Index:
                prefix = IndexPrefix;
                break;

            case ObjectTypeEnum.ForeignKey:
                prefix = ForeignKeyPrefix;
                break;

            case ObjectTypeEnum.Table:
                prefix = TablePrefix;
                break;

            case ObjectTypeEnum.UniqueKey:
                prefix = UniqueKeyPrefix;
                break;
            }

            return(string.Concat(prefix, name));
        }
Ejemplo n.º 7
0
        public static ITypeConverter Create(ObjectTypeEnum type)
        {
            ITypeConverter converter = null;

            switch (type)
            {
            case ObjectTypeEnum.Value:
                converter = new ValueTypeConverter();
                break;

            case ObjectTypeEnum.Class:
                converter = new ClassTypeConverter();
                break;

            case ObjectTypeEnum.Dictionary:
                converter = new DictionaryValueConverter();
                break;

            case ObjectTypeEnum.DataRow:
                converter = new DataRowTypeConverter();
                break;

            case ObjectTypeEnum.ArrayOrList:
            case ObjectTypeEnum.DataTable:
                throw new Exception("不支持数组转换");
                break;
            }
            return(converter);
        }
 /// <summary>
 /// Construct a object
 /// </summary>
 /// <param name="objecttype">Object type</param>
 /// <param name="meshvertices">Mesh vertices</param>
 /// <param name="material">Object material</param>
 public GLWaveformObject(ObjectTypeEnum objecttype, GLMeshVertices meshvertices, string material)
 {
     ObjectType = objecttype;
     Vertices   = meshvertices;
     MatLibname = material;
     Indices    = new GLMeshIndices();
 }
Ejemplo n.º 9
0
        public static _BaseLogDA GetBaseDataAccessByObjectType(ObjectTypeEnum objType)
        {
            try
            {
                var className = "Fhs.Cachless.C_DataAccess_Log.DA." + objType.ToString() + "DA";

                var typeData = (from assembly in AppDomain.CurrentDomain.GetAssemblies()
                                from type in assembly.GetTypes()
                                where type.FullName == className
                                select type).FirstOrDefault();

                if (typeData == null)
                {
                    return(null);
                }

                if (typeData.BaseType != null &&
                    typeData.BaseType.Name != typeof(_BaseLogDA).Name)
                {
                    return(null);
                }


                return((_BaseLogDA)Activator.CreateInstance(typeData));
            }
            catch (Exception e)
            {
                return(null);
            }
        }
Ejemplo n.º 10
0
 public ObjectInContainer(Type resolvingType, Type resolvedClassType, LifeStyleEnum lifeCycleEnum, ObjectTypeEnum objectType = ObjectTypeEnum.Default)
 {
     ResolvingType     = resolvingType;
     ResolvedClassType = resolvedClassType;
     LifeCycle         = lifeCycleEnum;
     ObjectType        = objectType;
 }
Ejemplo n.º 11
0
    public IEnumerator ReturnInPool(ObjectTypeEnum typeEnum, GameObject obj, float t)
    {
        yield return(new WaitForSeconds(t));

        _poolsObjects[typeEnum].Add(obj);
        _configurateManager.ConfigurateZero(obj);
    }
        ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
        //Use: Returns Normal as UnitVetor for different type of input entities.
        //
        ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
        public static UnitVector GetNormal(object planarEntity)
        {
            ObjectTypeEnum type = GetInventorType(planarEntity);

            switch (type)
            {
            case ObjectTypeEnum.kFaceObject:
            case ObjectTypeEnum.kFaceProxyObject:

                Face face = planarEntity as Face;
                return(GetFaceNormal(face));

            case ObjectTypeEnum.kWorkPlaneObject:
            case ObjectTypeEnum.kWorkPlaneProxyObject:

                WorkPlane workplane = planarEntity as WorkPlane;
                return(workplane.Plane.Normal);

            case ObjectTypeEnum.kFacesObject:

                Face face1 = (planarEntity as Faces)[1];
                return(GetFaceNormal(face1));

            default:
                return(null);
            }
        }
        ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
        //Use: Returns Plane object from input entity. Supports Face, Workplane and Faces.
        //
        ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
        public static Plane GetPlane(object planarEntity)
        {
            ObjectTypeEnum type = GetInventorType(planarEntity);

            switch (type)
            {
            case ObjectTypeEnum.kFaceObject:
            case ObjectTypeEnum.kFaceProxyObject:

                Face face = planarEntity as Face;
                return(face.Geometry as Plane);

            case ObjectTypeEnum.kWorkPlaneObject:
            case ObjectTypeEnum.kWorkPlaneProxyObject:

                WorkPlane workplane = planarEntity as WorkPlane;
                return(workplane.Plane);

            case ObjectTypeEnum.kFacesObject:

                Face face1 = (planarEntity as Faces)[1];
                return(face1.Geometry as Plane);

            default:
                return(null);
            }
        }
Ejemplo n.º 14
0
 public SearchResult(Guid id, string title, ObjectTypeEnum objectType, int uniqueID)
 {
     ID         = id;
     Title      = title;
     ObjectType = objectType;
     UniqueID   = uniqueID;
 }
Ejemplo n.º 15
0
        public static ITypeWriter Create(ObjectTypeEnum type)
        {
            ITypeWriter writer = null;

            switch (type)
            {
            case ObjectTypeEnum.ArrayOrList:
                writer = new ArraryOrListTypeWriter();
                break;

            case ObjectTypeEnum.Class:
                writer = new ClassTypeWriter();
                break;

            case ObjectTypeEnum.Dictionary:
                writer = new DictionaryTypeWriter();
                break;

            case ObjectTypeEnum.DataTable:

                break;

            case ObjectTypeEnum.Value:
                writer = new ValueTypeWriter();
                break;
            }
            return(writer);
        }
Ejemplo n.º 16
0
 public MonsterObjectType(ObjectTypeEnum objectType, uint objectId, uint id, uint linkId, float x, float y, float z,
                          float angle, float angleX, short scale, string name, int count_data, ushort[] rIndexes_data, int[] values_data,
                          byte count_buff, byte[] buffsns, int[] buffIds, int[] ticks, byte active_atk, bool m_atkable_special, byte m_diebuff,
                          uint m_activity, uint m_owner_family_id, uint m_quest_owner_playerid, byte owner_count, uint[] m_owner_players,
                          int m_owner_team, bool m_atkable_owner, bool m_atkable_player, bool m_attack_protect, uint m_first_team_id,
                          uint m_first_player_id, byte m_visiable, int m_blend_factor, uint m_manor_familyid)
     : base(objectType, objectId, id, linkId, x, y, z, angle, angleX,
            scale, name, count_data, rIndexes_data, values_data, count_buff,
            buffsns, buffIds, ticks)
 {
     this.active_atk             = active_atk;
     this.m_atkable_special      = m_atkable_special;
     this.m_diebuff              = m_diebuff;
     this.m_activity             = m_activity;
     this.m_owner_family_id      = m_owner_family_id;
     this.m_quest_owner_playerid = m_quest_owner_playerid;
     this.owner_count            = owner_count;
     this.m_owner_players        = m_owner_players;
     this.m_owner_team           = m_owner_team;
     this.m_atkable_owner        = m_atkable_owner;
     this.m_atkable_player       = m_atkable_player;
     this.m_attack_protect       = m_attack_protect;
     this.m_first_team_id        = m_first_team_id;
     this.m_first_player_id      = m_first_player_id;
     this.m_visiable             = m_visiable;
     this.m_blend_factor         = m_blend_factor;
     this.m_manor_familyid       = m_manor_familyid;
 }
Ejemplo n.º 17
0
 public SearchResult(Guid id, string title, ObjectTypeEnum objectType, int uniqueID)
 {
     ID = id;
     Title = title;
     ObjectType = objectType;
     UniqueID = uniqueID;
 }
 public bool Equals(ObjectTypeEnum obj)
 {
     if ((object)obj == null)
     {
         return(false);
     }
     return(StringComparer.OrdinalIgnoreCase.Equals(this.Value, obj.Value));
 }
Ejemplo n.º 19
0
 private void MakeDefaults(ObjectTypeEnum objType = ObjectTypeEnum.Null)
 {
     Id             = 0;
     ObjectId       = Guid.Empty;
     ObjectType     = objType;
     CreateTime     = DateTime.Now;
     LastUpdateTime = DateTime.Now;
 }
Ejemplo n.º 20
0
        protected static Fhs_CachLessDBEntities_Log GetDbBaseContext(ObjectTypeEnum objType = ObjectTypeEnum.Null)
        {
            Fhs_CachLessDBEntities_Log context = null;

            context = new Fhs_CachLessDBEntities_Log(ConnectionString);

            return(context);
        }
Ejemplo n.º 21
0
 public static Boolean IfTypeHero(ObjectTypeEnum eOT)
 {
     if ((Int32)ObjectTypeEnum.HeroBegin < (Int32)eOT && (Int32)eOT < (Int32)ObjectTypeEnum.HeroBegin + (Int32)ConstEnum.Level1Inter)
     {
         return(true);
     }
     return(false);
 }
Ejemplo n.º 22
0
            //

            public PropertyImpl(ComponentTypeSettingsForm owner, ObjectTypeEnum objectType, Component component, string name, Metadata.TypeInfo type, /*IList<Attribute> attributes,*/ string category, object value)
                : base(owner, name, false, type, type, new Metadata.Parameter[0], false)
            {
                this.objectType = objectType;
                this.component  = component;
                //this.attributes = attributes;
                this.category = category;
                this.value    = value;
            }
Ejemplo n.º 23
0
        /// <summary>
        /// Tìm đối tượng CMS object của InventoryJournal
        /// </summary>
        /// <param name="InventoryJournalId"></param>
        /// <param name="type"></param>
        /// <returns></returns>
        public NAS.DAL.CMS.ObjectDocument.Object GetCMSInventoryJournal(
            Guid InventoryJournalId,
            ObjectTypeEnum type)
        {
            if (type != ObjectTypeEnum.INVENTORY_IN && type != ObjectTypeEnum.INVENTORY_MOVE && type != ObjectTypeEnum.INVENTORY_OUT)
            {
                throw new Exception("The Type is invalid");
            }

            if (InventoryJournalId != null && !InventoryJournalId.Equals(Guid.Empty))
            {
                NAS.DAL.CMS.ObjectDocument.Object cmsObject = null;
                using (UnitOfWork uow = XpoHelper.GetNewUnitOfWork())
                {
                    InventoryJournal       journal       = uow.GetObjectByKey <InventoryJournal>(InventoryJournalId);
                    InventoryJournalObject journalObject =
                        journal.InventoryJournalObjects.FirstOrDefault();
                    if (journalObject == null)
                    {
                        ObjectBO objectBO = new ObjectBO();
                        cmsObject = objectBO.CreateCMSObject(uow, type);
                        InventoryJournalObject newJournalObject = new InventoryJournalObject(uow)
                        {
                            ObjectId           = cmsObject,
                            InventoryJournalId = journal
                        };

                        NAS.DAL.CMS.ObjectDocument.ObjectType objectType
                            = uow.FindObject <ObjectType>(new BinaryOperator("Name", Enum.GetName(typeof(ObjectTypeEnum), type)));

                        if (objectType == null)
                        {
                            throw new Exception("The OjectType is not exist in system");
                        }

                        InventoryJournalCustomType newJournalCustomType = new InventoryJournalCustomType(uow)
                        {
                            ObjectTypeId       = objectType,
                            InventoryJournalId = journal
                        };

                        newJournalCustomType.Save();

                        uow.CommitChanges();
                    }
                    else
                    {
                        cmsObject = journalObject.ObjectId;
                    }
                    return(cmsObject);
                }
            }
            else
            {
                return(null);
            }
        }
Ejemplo n.º 24
0
    public static string GetResoursePath(ObjectTypeEnum stringPath)
    {
        string pathString;
        var    isExists = _stringsPaths.TryGetValue(stringPath, out pathString);

        if (isExists == false)
        {
            throw new UnityException("It is unknown path");
        }
        return(pathString);
    }
Ejemplo n.º 25
0
            public static ConditionType ToConditionType(ObjectTypeEnum type)
            {
                switch (type)
                {
                default:
                case ObjectTypeEnum.BUILDINGS:
                    return(ConditionType.BASEDESTROYED);

                case ObjectTypeEnum.UNITS:
                    return(ConditionType.UNITSRESTROYED);
                }
            }
Ejemplo n.º 26
0
 private void MakeDefaults(ObjectTypeEnum objType)
 {
     try
     {
         ObjectType = objType;
         ContextDb  = GetDbBaseContext(objType);
     }
     catch (Exception e)
     {
         AddExceptionData(e);
     }
 }
Ejemplo n.º 27
0
 public void SetData()
 {
     HitType        = (HitTypeEnum)((WeaponInfo >> 17) & 7);
     ObjectType     = (ObjectTypeEnum)(HitInfo & 3);
     WeaponClass    = (ClassTypeEnum)(WeaponInfo & 63);
     WeaponId       = WeaponInfo >> 6;
     WeaponDamage   = HitInfo >> 21;
     WeaponObjectId = (HitInfo >> 2) & 511;
     HitPart        = (HitInfo >> 11) & 63;
     CharaHitPart   = (HitCharaPart2Enum)HitPart;
     Range          = Vector3.DistanceRange(FirePos, HitPos);
 }
Ejemplo n.º 28
0
 //TO CONTINUE
 public CharacterObjectType(ObjectTypeEnum objectType, uint objectId, uint id, uint linkId, float x, float y, float z, float angle, float angleX,
                            short scale, string name, int count_data, ushort[] rIndexes_data, int[] values_data, byte count_buff, byte[] buffsns, int[] buffIds,
                            int[] ticks, uint characterId, byte sex, int job, int authority, int serverId, string vipbar_name, short constellation, short city,
                            byte hair_mesh, uint hair_color, byte head_mesh, uint option, uint teamId, string vendor_sentence, int slaughter, int kill_num, int fame,
                            byte pk_mode, byte pk_name, int gray_time, int prot_cool_down_start, int issf_, int items_count, ItemType[] items, byte ext_param_count,
                            byte[] index, int[] value, int title_count, int[] titles, int title_flag, byte title_count2, int[] titles2, int[] host_ids, KingdomType kingdom,
                            MasterType master, MarriageType marriage, int show_count, int[] indexes_show, int vessel_refine_lv, int vessel_equip_index, bool vessel_is_equip, bool flag_data, FlagsDataType flagsData)
     : base(objectType, objectId, id, linkId, x, y, z, angle, angleX, scale, name, count_data, rIndexes_data, values_data, count_buff, buffsns, buffIds, ticks)
 {
     this.characterId          = characterId;
     this.sex                  = sex;
     this.job                  = job;
     this.authority            = authority;
     this.serverId             = serverId;
     this.vipbar_name          = vipbar_name;
     this.constellation        = constellation;
     this.city                 = city;
     this.hair_mesh            = hair_mesh;
     this.hair_color           = hair_color;
     this.head_mesh            = head_mesh;
     this.option               = option;
     this.teamId               = teamId;
     this.vendor_sentence      = vendor_sentence;
     this.slaughter            = slaughter;
     this.kill_num             = kill_num;
     this.fame                 = fame;
     this.pk_mode              = pk_mode;
     this.pk_name              = pk_name;
     this.gray_time            = gray_time;
     this.prot_cool_down_start = prot_cool_down_start;
     this.issf_                = issf_;
     this.items_count          = items_count;
     this.items                = items;
     this.ext_param_count      = ext_param_count;
     this.index                = index;
     this.value                = value;
     this.title_count          = title_count;
     this.titles               = titles;
     this.title_flag           = title_flag;
     this.title_count          = title_count;
     this.titles2              = titles2;
     this.kingdom              = kingdom;
     this.master               = master;
     this.marriage             = marriage;
     this.show_count           = show_count;
     this.indexes_show         = indexes_show;
     this.vessel_refine_lv     = vessel_refine_lv;
     this.vessel_equip_index   = vessel_equip_index;
     this.vessel_is_equip      = vessel_is_equip;
     this.flag_data            = flag_data;
     this.flagsData            = flagsData;
 }
Ejemplo n.º 29
0
        public static ObjectTypeEnum GetObjectTypeEnum(this object obj)
        {
            Type   invokeType = obj.GetType();
            object tmp        = invokeType.InvokeMember("Type",
                                                        BindingFlags.GetProperty,
                                                        null,
                                                        obj,
                                                        null);

            ObjectTypeEnum objType = (ObjectTypeEnum)tmp;

            return(objType);
        }
Ejemplo n.º 30
0
 public SpriteObjectType(ObjectTypeEnum objectType, uint objectId, uint id, uint linkId, float x, float y, float z,
                         float angle, float angleX, short scale, string name, int count_data, ushort[] rIndexes_data, int[] values_data, byte count_buff,
                         byte[] buffsns, int[] buffIds, int[] ticks) : base(objectType, objectId, id, linkId, x, y, z, angle, angleX, scale)
 {
     this.name          = name;
     this.count_data    = count_data;
     this.rIndexes_data = rIndexes_data;
     this.values_data   = values_data;
     this.count_buff    = count_buff;
     this.buffsns       = buffsns;
     this.buffIds       = buffIds;
     this.ticks         = ticks;
 }
Ejemplo n.º 31
0
 public float Range; //Alcance, HitDistance
 public void SetData()
 {
     HitType        = (HitTypeEnum)((HitInfo >> 17) & 7);
     WeaponClass    = (ClassTypeEnum)(WeaponInfo & 63);
     ObjectType     = (ObjectTypeEnum)(HitInfo & 3);
     WeaponId       = WeaponInfo >> 6;
     WeaponDamage   = HitInfo >> 21;
     WeaponObjectId = (HitInfo >> 2) & 511;
     HitPart        = (HitInfo >> 11) & 63;
     CharaHitPart   = (HitCharaPart2Enum)HitPart;
     DeathType      = HitPart == 29 ? CharaDeathEnum.HEADSHOT : CharaDeathEnum.DEFAULT; //(CharaDeathEnum)(HitInfo & 15)
     Range          = Vector3.DistanceRange(StartBullet, EndBullet);
 }
Ejemplo n.º 32
0
 public void GetSelectedObject(GenericObject selection, out ObjectTypeEnum objectType, out NameValueMap additionalData, out ComponentOccurrence containingOccurrence, ref Object selectedObject)
 {
     InternalGetSelectedObject( selection, out  objectType, out  additionalData, out  containingOccurrence, ref  selectedObject);
 }
Ejemplo n.º 33
0
 private void InternalGetSelectedObject(GenericObject selection, out ObjectTypeEnum objectType, out NameValueMap additionalData, out ComponentOccurrence containingOccurrence, ref Object selectedObject)
 {
     PartDocumentInstance.GetSelectedObject( selection, out  objectType, out  additionalData, out  containingOccurrence, ref  selectedObject);
 }
Ejemplo n.º 34
0
 /////////////////////////////////////////////////////////////
 // Use: Add pre-selection filter.
 //
 /////////////////////////////////////////////////////////////
 public void AddPreSelectionFilter(
     ObjectTypeEnum preSelectFilter)
 {
     _PreSelectFilters.Add(preSelectFilter);
 }
Ejemplo n.º 35
0
 //public static string GetFilePath(ObjectTypeEnum type, string Id,bool isEncode,string code)
 //{
 //    if (string.IsNullOrEmpty(code))
 //        return string.Format(getFilePath(type.ToString()), isEncode ? encode(Id) : Id);
 //    else
 //        return string.Format(getFilePath(type.ToString()), isEncode ? encode(Id) : Id) + "?" + code;
 //}
 public static string GetFileNameTemplate(ObjectTypeEnum type)
 {
     return getFilePath(type.ToString());
 }
Ejemplo n.º 36
0
 public string GetRediectUrl(ObjectTypeEnum type, int? objectId)
 {
     return GetUrl(SiteTypeEnum.ResourceSite) + "Go/" + Dianda.Common.StringSecurity.DES.Encrypt(((int)type).ToString()+"," + (objectId.HasValue ?  objectId.Value.ToString() : SiteTypeEnum .Portal.ToString ()));
 }
Ejemplo n.º 37
0
 public static string GetFileOutPath(ObjectTypeEnum type, string Id, bool isEncode)
 {
     return getFilePath(type, Id, "_o", isEncode);
 }
Ejemplo n.º 38
0
 //public static string GetFilePath(ObjectTypeEnum type, string Id, bool isEncode, DateTime now)
 //{
 //   return  GetFilePath(type, Id, isEncode, now.ToString("yyyyMMddHHmmss"));
 //}
 /// <summary>
 /// 只有CourseInfo,ActivitiesInfo,ReadingEBook,CourseWareInfo才有值。
 /// </summary>
 /// <param name="type"></param>
 /// <returns></returns>
 public static string GetFilePath(ObjectTypeEnum type, string Id, bool isEncode)
 {
     return getFilePath(type, Id, string.Empty, isEncode);
 }
Ejemplo n.º 39
0
 /// <summary>
 /// 只有CourseInfo,ActivitiesInfo,ReadingEBook,CourseWareInfo才有值。
 /// </summary>
 /// <param name="type"></param>
 /// <returns></returns>
 private static string getFilePath(ObjectTypeEnum type, string Id, string prefix, bool isEncode)
 {
     Id = Id + prefix;
     return string.Format(getFilePath(type.ToString()), isEncode ? encode(Id) : Id);
 }
Ejemplo n.º 40
0
 /*
 public static string GetSortType(SortTypeEnum e)
 {
     string t = "";
     switch (e)
     {
         case SortTypeEnum.ASC:
             t = " ASC ";
             break;
         case SortTypeEnum.DESC:
             t = " DESC ";
             break;
     }
     return t;
 }
  * */
 public static string GetObjectTypeName4PortalSpecialRecommend(ObjectTypeEnum e)
 {
     string name = "";
     switch (e)
     {
         case ObjectTypeEnum.All:
             name = "全部";
             break;
         case ObjectTypeEnum.CourseInfo:
             name = "课程";
             break;
         case ObjectTypeEnum.ActivitiesInfo:
             name = "活动";
             break;
         case ObjectTypeEnum.ReadingBook:
             name = "悦读";
             break;
         case ObjectTypeEnum.CircleInfo:
             name = "团队";
             break;
         case ObjectTypeEnum.TopicInfo:
             name = "热门话题";
             break;
         case ObjectTypeEnum.Share:
             name = "最新分享";
             break;
         case ObjectTypeEnum.HotMember:
             name = "热门用户";
             break;
     }
     return name;
 }
Ejemplo n.º 41
0
 public static string Object2ReferType(ObjectTypeEnum e)
 {
     string a = "";
     switch (e)
     {
         case ObjectTypeEnum.CourseInfo:
             a = "course";
             break;
         case ObjectTypeEnum.ActivitiesInfo:
             a = "event";
             break;
         case ObjectTypeEnum.CircleInfo:
             a = "note";
             break;
     }
     return a;
 }
 public ScriptObject(ObjectTypeEnum type, ObjectActionEnum action)
 {
     this.ObjectSchema = "dbo";
     this.ObjectType = type;
     this.ObjectAction = action;
 }
Ejemplo n.º 43
0
 public static string GetObjectTypeName(ObjectTypeEnum e)
 {
     string name = "";
     switch (e)
     {
         case ObjectTypeEnum.All:
             name = "全部";
             break;
         case ObjectTypeEnum.CourseInfo:
             name = "课程";
             break;
         case ObjectTypeEnum.ActivitiesInfo:
             name = "活动";
             break;
         case ObjectTypeEnum.ReadingBook:
             name = "悦读";
             break;
         case ObjectTypeEnum.CircleInfo:
             name = "团队";
             break;
         case ObjectTypeEnum.TopicInfo:
             name = "话题";
             break;
     }
     return name;
 }
Ejemplo n.º 44
0
 public string GetUrlWithObjectType(ObjectTypeEnum type)
 {
     switch (type)
     {
         case  ObjectTypeEnum.ActivitiesApplyResult:
             return getUrl(SiteTypeEnum.Activities.ToString ());
         case ObjectTypeEnum.ActivitiesInfo:
             return getUrl(SiteTypeEnum.Activities.ToString());
         case ObjectTypeEnum.CircleInfo:
             return getUrl(SiteTypeEnum.Circle.ToString());
         case ObjectTypeEnum.CircleInfoResult:
             return getUrl(SiteTypeEnum.Circle.ToString());
         case ObjectTypeEnum.CourseInfo:
             return getUrl(SiteTypeEnum.Course.ToString());
         case ObjectTypeEnum.CourseWareInfo:
             return getUrl(SiteTypeEnum.Course.ToString());
         case ObjectTypeEnum.HotMember:
             return getUrl(SiteTypeEnum.Member.ToString());
         case ObjectTypeEnum.MemberFriendApply:
             return getUrl(SiteTypeEnum.Member.ToString());
         case ObjectTypeEnum.MemberFriendResult:
             return getUrl(SiteTypeEnum.Member.ToString());
         case ObjectTypeEnum.MsgRequest:
             return getUrl(SiteTypeEnum.Member.ToString());
         case ObjectTypeEnum.MsgResponse:
             return getUrl(SiteTypeEnum.Member.ToString());
         case ObjectTypeEnum.ReadingBook:
             return getUrl(SiteTypeEnum.Reading.ToString());
         case ObjectTypeEnum.Share:
             return getUrl(SiteTypeEnum.Share.ToString());
         case ObjectTypeEnum.TopicInfo:
             return getUrl(SiteTypeEnum.Circle.ToString());
         case ObjectTypeEnum.InformationNews:
             return getUrl(SiteTypeEnum.Information.ToString());
         default:
             return getUrl(SiteTypeEnum.Portal.ToString ());
     }
 }