當前位置: 首頁>>代碼示例>>C#>>正文


C# ActivityType類代碼示例

本文整理匯總了C#中ActivityType的典型用法代碼示例。如果您正苦於以下問題:C# ActivityType類的具體用法?C# ActivityType怎麽用?C# ActivityType使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


ActivityType類屬於命名空間,在下文中一共展示了ActivityType類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: Activity

        public Activity(string name, string path, string args, string t)
        {
            _name = name;
            _pathfile = path;
            _argument = args;

            if (t.CompareTo("Wallpaper") == 0)
            {
                _type = ActivityType.Wallpaper;
            }
            else
            {
                if (t.CompareTo("ExeFile") == 0)
                {
                    _type = ActivityType.ExeFile;
                }
                else
                {
                    if (t.CompareTo("BatchFile") == 0)
                    {
                        _type = ActivityType.BatchFile;
                    }
                }
            }
        }
開發者ID:poros,項目名稱:whereless,代碼行數:25,代碼來源:Activity.cs

示例2: LoadActivityInf

        public void LoadActivityInf(int id)
        {
            #region 加載活動信息

            ActivityInfo actInfo = Activities.GetActivityInfo(id);
            act_title.Text = actInfo.Atitle;
            postdatetimeStart.SelectedDate = Convert.ToDateTime(actInfo.Begintime);
            postdatetimeEnd.SelectedDate = Convert.ToDateTime(actInfo.Endtime);
            act_style.Text = actInfo.Stylecode;
            act_script.Text = actInfo.Scriptcode;
            templatenew.Text = actInfo.Desccode;
            seotitle.Text = actInfo.Seotitle;
            seokeyword.Text = actInfo.Seokeyword;
            seodesc.Text = actInfo.Seodesc;
            act_status.SelectedValue = actInfo.Enabled.ToString();
            act_rssimg.Text = actInfo.RssImg;

            ActivityType ate = new ActivityType();
            typeid.Items.Clear();
            typeid.Items.Add(new ListItem("全部", "0"));
            foreach (string atname in Enum.GetNames(ate.GetType()))
            {
                int s_value = Convert.ToInt16(Enum.Parse(ate.GetType(), atname));
                string s_text = EnumCatch.GetActivityType(s_value);
                typeid.Items.Add(new ListItem(s_text, s_value.ToString()));
            }
            typeid.SelectedValue = actInfo.Atype.ToString();

            #endregion
        }
開發者ID:yeyong,項目名稱:manageserver,代碼行數:30,代碼來源:global_editactivity.aspx.cs

示例3: IsAccessAllowed

        public static bool IsAccessAllowed(string Controller, string Action, CustomPrincipal User, string IP, ActivityType activity)
        {
            IMenuService menuService = UnityConfigurator.GetConfiguredContainer().Resolve<IMenuService>();

            if (User != null)
            {
                //default controller for all user
                if (Controller.ToLower().Contains("account") || Controller.ToLower().Contains("home"))
                {
                    return true;
                }
                else
                {
                    bool allowed = false;
                    //check if user have access to controller
                    //ensure that 1 form/modul = 1 controller
                    allowed = menuService.isAccessAllowed(Controller, User.RoleId);

                    //if activity type is supplied, check the activity permission too
                    if (activity != ActivityType.None)
                    {
                        allowed = allowed && menuService.isAccessAllowed(Controller, activity.ToString(), User.RoleId);
                    }

                    return allowed;
                }
            }
            else
            {
                return false;
            }
        }
開發者ID:sbudihar,項目名稱:SIRIUSrepo,代碼行數:32,代碼來源:PageAccessManager.cs

示例4: ActivityTypeDoesNotSaveWithIndicatorWith1Character

        public void ActivityTypeDoesNotSaveWithIndicatorWith1Character()
        {
            //Invalid Indicator
            var activityType = new ActivityType
            {
                ActivityCategory = ActivityCategory,
                Indicator = "1",
                Name = ValidValueName
            };

            try
            {
                using (var ts = new TransactionScope())
                {
                    _activityTypeRepository.EnsurePersistent(activityType);

                    ts.CommitTransaction();
                }
            }
            catch (Exception)
            {
                var results = activityType.ValidationResults().AsMessageList();
                Assert.AreEqual(1, results.Count);
                results.AssertContains("Indicator: length must be between 2 and 2");
                //Assert.AreEqual("Object of type FSNEP.Core.Domain.ActivityType could not be persisted\n\n\r\nValidation Errors: Indicator, The length of the value must fall within the range \"2\" (Inclusive) - \"2\" (Inclusive).\r\n", message.Message, "Expected Exception Not encountered");
                throw;
            }
        }
開發者ID:ucdavis,項目名稱:FSNEP,代碼行數:28,代碼來源:ActivityTypeRepositiryTests.cs

示例5: GetUserActivities

		public ActivitiesResponse GetUserActivities(int page, int count, ActivityType type)
		{
			EnsureIsAuthorized();
			var parameters = BuildPagingParametersWithCount(page, count);
			if (type != ActivityType.All) parameters.Add("type", type.ToString().ToLower());
			return _restTemplate.GetForObject<ActivitiesResponse>(BuildUrl("user/activity", parameters));
		}
開發者ID:coolya,項目名稱:CSharp.Geeklist,代碼行數:7,代碼來源:ActivityTemplate.cs

示例6: PutActivityType

        // PUT api/ActivityTypes/5
        public HttpResponseMessage PutActivityType(int id, ActivityType activitytype)
        {
            if (!ModelState.IsValid)
            {
                return Request.CreateErrorResponse(HttpStatusCode.BadRequest, ModelState);
            }

            if (id != activitytype.Id)
            {
                return Request.CreateResponse(HttpStatusCode.BadRequest);
            }

            db.Entry(activitytype).State = EntityState.Modified;

            try
            {
                db.SaveChanges();
            }
            catch (DbUpdateConcurrencyException ex)
            {
                return Request.CreateErrorResponse(HttpStatusCode.NotFound, ex);
            }

            return Request.CreateResponse(HttpStatusCode.OK);
        }
開發者ID:nathanfl,項目名稱:AAHIPro,代碼行數:26,代碼來源:ActivityTypesController.cs

示例7: InitializeComponent

        private void InitializeComponent()
        {
            AddBrandInfo.Click += new EventHandler(AddBrandInfo_Click);

            ActivityType ate = new ActivityType();
            brandclass.BuildTree(tpb.GetAllCategoryList(), "name", "cid");
        }
開發者ID:yeyong,項目名稱:manageserver,代碼行數:7,代碼來源:taobao_addgoodsbrand.aspx.cs

示例8: WorkPackage

        public WorkPackage(UInt64       Id,
                           String       Name,
                           ActivityType ActivityType,
                           UInt32       StartMonth,
                           UInt32       EndMonth,
                           Double       Force,
                           IGenericPropertyGraph<UInt64, Int64, String, String, Object,
                                                 UInt64, Int64, String, String, Object,
                                                 UInt64, Int64, String, String, Object,
                                                 UInt64, Int64, String, String, Object> Graph)
        {
            this.Id         = Id;
            this.Name       = Name;
            this.StartMonth = StartMonth;
            this.Graph      = Graph;

            this.Vertex     = Graph.AddVertex(v => v.SetProperty("Id_",          Id).
                                                     SetProperty("Name",         Name).
                                                     SetProperty("Type",         "WorkPackage").
                                                     SetProperty("ActivityType", ActivityType).
                                                     SetProperty("StartMonth",   StartMonth).
                                                     SetProperty("EndMonth",     EndMonth).
                                                     SetProperty("Force",        Force).
                                                     SetProperty("class",        this));
        }
開發者ID:Alex9,項目名稱:ProjectGraph,代碼行數:25,代碼來源:WorkPackage.cs

示例9: Score

 /// <summary>
 /// Creates a score for a game level or quiz
 /// </summary>
 /// <param name="p">The Player Name</param>
 /// <param name="t">The Activity Type</param>
 /// <param name="s"></param>
 /// <param name="title"></param>
 public Score(String p, ActivityType t, int s, String title)
 {
     _date = DateTime.Now;
     Value = s;
     Type = t;
     PlayerName = p;
     ItemTitle = title;
 }
開發者ID:eloreyen,項目名稱:XNAGames,代碼行數:15,代碼來源:Score.cs

示例10: ActivityBase

 protected ActivityBase(IGameLog log, Player player, string message, ActivityType type)
 {
     Log = log;
     Player = player;
     Message = message;
     Type = type;
     Id = Guid.NewGuid();
 }
開發者ID:trentkerin,項目名稱:Dominion,代碼行數:8,代碼來源:ActivityBase.cs

示例11: ActivityTypeGetResponse

 internal ActivityTypeGetResponse(
     CoreRegistrationModel.ActivityTypeGetResponse internalResponse,
     DataFactoryManagementClient client)
     : this()
 {
     DataFactoryOperationUtilities.CopyRuntimeProperties(internalResponse, this);
     this.ActivityType =
         ((ActivityTypeOperations)client.ActivityTypes).Converter.ToWrapperType(internalResponse.ActivityType);
 }
開發者ID:RossMerr,項目名稱:azure-sdk-for-net,代碼行數:9,代碼來源:ActivityTypeGetResponse.cs

示例12: Explore

 public async Task<List<SegmentSummary>> Explore(LatLng southWest, LatLng northEast, ActivityType activityType = ActivityType.Ride)
 {
     var request = new RestRequest(EndPoint + "/explore", Method.GET);
     request.AddParameter("bounds",
         string.Format("{0},{1},{2},{3}", southWest.Latitude.ToString(CultureInfo.InvariantCulture), southWest.Longitude.ToString(CultureInfo.InvariantCulture),
         northEast.Latitude.ToString(CultureInfo.InvariantCulture), northEast.Longitude.ToString(CultureInfo.InvariantCulture)));
     var response = await _client.RestClient.Execute<SegmentCollection>(request);
     return response.Data.Segments;
 }
開發者ID:gabornemeth,項目名稱:StravaSharp,代碼行數:9,代碼來源:SegmentClient.cs

示例13: UploadActivityAsync

        /// <summary>
        /// Uploads an activity.
        /// </summary>
        /// <param name="file">The path to the activity file on your local hard disk.</param>
        /// <param name="dataFormat">The format of the file.</param>
        /// <param name="activityType">The type of the activity.</param>
        /// <returns>The status of the upload.</returns>
        public async Task<UploadStatus> UploadActivityAsync(StorageFile file, DataFormat dataFormat, ActivityType activityType = ActivityType.Ride)
        {
            String format = String.Empty;

            switch (dataFormat)
            {
                case DataFormat.Fit:
                    format = "fit";
                    break;
                case DataFormat.FitGZipped:
                    format = "fit.gz";
                    break;
                case DataFormat.Gpx:
                    format = "gpx";
                    break;
                case DataFormat.GpxGZipped:
                    format = "gpx.gz";
                    break;
                case DataFormat.Tcx:
                    format = "tcx";
                    break;
                case DataFormat.TcxGZipped:
                    format = "tcx.gz";
                    break;
            }
           
            HttpClient client = new HttpClient();
            client.DefaultRequestHeaders.Add("Authorization", String.Format("Bearer {0}", Authentication.AccessToken));

            MultipartFormDataContent content = new MultipartFormDataContent();

            byte[] fileBytes = null;
            using (IRandomAccessStreamWithContentType stream = await file.OpenReadAsync())
            {
                fileBytes = new byte[stream.Size];
                using (DataReader reader = new DataReader(stream))
                {
                    await reader.LoadAsync((uint)stream.Size);
                    reader.ReadBytes(fileBytes);
                }
            }

            var byteArrayContent = new ByteArrayContent(fileBytes);

            content.Add(byteArrayContent, "file", file.Name);

            HttpResponseMessage result = await client.PostAsync(
                String.Format("https://www.strava.com/api/v3/uploads?data_type={0}&activity_type={1}",
                format,
                activityType.ToString().ToLower()),
                content);

            String json = await result.Content.ReadAsStringAsync();

            return Unmarshaller<UploadStatus>.Unmarshal(json);
        }
開發者ID:TiBall,項目名稱:stravadotnet,代碼行數:63,代碼來源:UploadClient.cs

示例14: CreateActivityAsync

        /// <summary>
        /// Creates a manual entry on Strava.
        /// </summary>
        /// <param name="name">The name of the activity.</param>
        /// <param name="type">The type of the activity.</param>
        /// <param name="dateTime">The time when the activity was started.</param>
        /// <param name="elapsedSeconds">The elapsed time in seconds.</param>
        /// <param name="description">The description (otpional).</param>
        /// <param name="distance">The distance of the activity (optional).</param>
        public async Task<Activity> CreateActivityAsync(String name, ActivityType type, DateTime dateTime, int elapsedSeconds, String description, float distance = 0f)
        {
            String t = type.ToString().ToLower();
            String timeString = dateTime.ToString("o");

            String postUrl = String.Format("https://www.strava.com/api/v3/activities?name={0}&type={1}&start_date_local={2}&elapsed_time={3}&description={4}&distance={5}&access_token={6}",
                name, t, timeString, elapsedSeconds, description, distance.ToString(CultureInfo.InvariantCulture), Authentication.AccessToken);
            
            String json = await Http.WebRequest.SendPostAsync(new Uri(postUrl));
            return Unmarshaller<Activity>.Unmarshal(json);
        }
開發者ID:neilortoo,項目名稱:stravadotnet,代碼行數:20,代碼來源:ActivityClient.cs

示例15: GetActvitiesByType

 /// <summary>
 /// 根據類型獲取活動信息
 /// </summary>
 /// <param name="nums"></param>
 /// <param name="atype"></param>
 public static List<ActivityInfo> GetActvitiesByType(int nums, ActivityType atype)
 {
     List<ActivityInfo> actlist = new List<ActivityInfo>();
     IDataReader reader = DatabaseProvider.GetInstance().GetActvitiesByType(nums, atype);
     while (reader.Read())
     {
         actlist.Add(LoadSingleActivityInfo(reader));
     }
     reader.Close();
     return actlist;
 }
開發者ID:yeyong,項目名稱:manageserver,代碼行數:16,代碼來源:Activities.cs


注:本文中的ActivityType類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。