• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C# ActivityType类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中ActivityType的典型用法代码示例。如果您正苦于以下问题:C# ActivityType类的具体用法?C# ActivityType怎么用?C# ActivityType使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



ActivityType类属于命名空间,在下文中一共展示了ActivityType类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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


示例16: ActivityBase

        protected ActivityBase(IGameLog log, Player player, string message, ActivityType type, ICard source)
        {
            Log = log;
            Player = player;
            Message = message;
            Type = type;
            Id = Guid.NewGuid();
            Hint = ActivityHint.None;

            Source = source == null ? string.Empty : source.Name;
        }
开发者ID:razzielx,项目名称:Dominion,代码行数:11,代码来源:ActivityBase.cs


示例17: Post

 public void Post(string message, ActivityType tag, Uri url = null)
 {
     var activity = new Activity
     {
         Message = message,
         Tag = tag,
         Url = url != null ? url.ToString() : null,
         UserProfileId = _userProfileRepository.Get(x=>x.UserLogin==Thread.CurrentPrincipal.Identity.Name).Id,
         Time = DateTime.UtcNow
     };
     _activityRepository.UpdateAndCommit(activity);
 }
开发者ID:Budzyn,项目名称:hunter,代码行数:12,代码来源:ActivityPostService.cs


示例18: GetActivities

        public List<Activity> GetActivities(int contactId, DateTime startDate, DateTime endDate, ActivityType type, int? count)
        {
            RestRequest request = new RestRequest(Method.GET)
                                      {
                                          RequestFormat = DataFormat.Json,
                                          Resource = string.Format("/data/activities/contact/{0}?startDate={1}&endDate={2}&type={3}&count={4}",
                                                            contactId, ConvertToUnixEpoch(startDate), ConvertToUnixEpoch(endDate), type, count)
                                      };

            IRestResponse<List<Activity>> response = _client.Execute<List<Activity>>(request);

            return response.Data;
        }
开发者ID:JordoTaylor,项目名称:eloqua-samples,代码行数:13,代码来源:ActivityClient.cs


示例19: InitializeComponent

 private void InitializeComponent()
 {
     this.SaveSearchCondition.Click += new EventHandler(this.SaveSearchCondition_Click);
     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()));
     }
 }
开发者ID:yeyong,项目名称:manageserver,代码行数:13,代码来源:global_searchactivity.aspx.cs


示例20: PostActivityType

        // POST api/ActivityTypes
        public HttpResponseMessage PostActivityType(ActivityType activitytype)
        {
            if (ModelState.IsValid)
            {
                db.ActivityTypes.Add(activitytype);
                db.SaveChanges();

                HttpResponseMessage response = Request.CreateResponse(HttpStatusCode.Created, activitytype);
                response.Headers.Location = new Uri(Url.Link("DefaultApi", new { id = activitytype.Id }));
                return response;
            }
            else
            {
                return Request.CreateErrorResponse(HttpStatusCode.BadRequest, ModelState);
            }
        }
开发者ID:nathanfl,项目名称:AAHIPro,代码行数:17,代码来源:ActivityTypesController.cs



注:本文中的ActivityType类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# Actor类代码示例发布时间:2022-05-24
下一篇:
C# ActivityParameterDictionary类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap