当前位置: 首页>>代码示例>>C#>>正文


C# ServiceType类代码示例

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


ServiceType类属于命名空间,在下文中一共展示了ServiceType类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: SaveServiceType

 public void SaveServiceType(ServiceType servicetypeObj)
 {
     using (var db = new eTempleDbDB())
     {
         db.Save(servicetypeObj);
     }
 }
开发者ID:prabhuashwin,项目名称:eTempleVinayaka,代码行数:7,代码来源:ServiceTypesDao.cs

示例2: UpdateServiceType

 public int UpdateServiceType(ServiceType servicetypeObj)
 {
     using (var db = new eTempleDbDB())
     {
         return db.Update(servicetypeObj);
     }
 }
开发者ID:prabhuashwin,项目名称:eTempleVinayaka,代码行数:7,代码来源:ServiceTypesDao.cs

示例3: InvalidOperationException

        IMessageProcessor IServiceConnector.Connect(IServiceAddress address, ServiceType type)
        {
            if (!connected) {
                if (!OnConnect(address, type)) {
                    logger.Warning(this, "Unable to connect to '" + address + "' after check.");
                    return null;
                }

                try {
                    processor = Connect(address, type);
                } catch (Exception e) {
                    logger.Error(this, "Error while connecting.", e);
                    throw;
                }

                connected = true;

                if (processor == null) {
                    logger.Error(this, "It was not possible to obtain a valid message processor for the connection.");

                    connected = false;
                    throw new InvalidOperationException("Was not able to connect.");
                }

                OnConnected(address, type);

                logger.Info(this, "Connected to '" + address + "'.");
            }

            return processor;
        }
开发者ID:ikvm,项目名称:cloudb,代码行数:31,代码来源:ServiceConnector.cs

示例4: _GetAccountInfo

        private async Task<ExtAccount> _GetAccountInfo(ServiceType type, AccessResponse access)
        {
            if (access == null) throw new ArgumentNullException("access");

            var config = _openIdConfigService.GetConfig(type);

            string url = config.GetUserInfoQueryUrl(access.access_token);
            WebRequest request = WebRequest.Create(new Uri(url)) as HttpWebRequest;
            if (request == null) return null;

            request.Method = WebRequestMethods.Http.Get;

            WebResponse response = await request.GetResponseAsync();
            string responseContent = _ReadStreamFromResponse(response);

            var responseObj = JsonConvert.DeserializeObject(responseContent, Type.GetType(config.UserInfoObjectType)) as IUserInfoResponse;

            if (responseObj == null) return null;

            ExtAccount extAccount = responseObj.ToAccount();
            //externalUserInfo.AccessToken = access.access_token;
            //externalUserInfo.ExpiresIn = access.expires_in;
            //externalUserInfo.LastAccess = DateTime.Now;

            return extAccount;
        }
开发者ID:altaricka,项目名称:vDesign,代码行数:26,代码来源:OpenIdService.cs

示例5: PacketOut

 public PacketOut(LogonServerOpCode opcode)
     : base(new MemoryStream())
 {
     packetId = new PacketId(opcode);
     Service = ServiceType.Logon;
     this.Write((byte)opcode);
 }
开发者ID:remixod,项目名称:NetLibClient,代码行数:7,代码来源:PacketOut.cs

示例6: Request

 public Request(PacketType packetType, string nasIpAddress, ServiceType serviceType, string userName)
 {
     _packet = new Packet(packetType);
     _packet.Attributes.Add(new IpAddressAttribute(AttributeType.NasIpAddress, nasIpAddress));
     _packet.Attributes.Add(new ServiceTypeAttribute(serviceType));
     _packet.Attributes.Add(new StringAttribute(AttributeType.UserName, userName));
 }
开发者ID:OlegUA,项目名称:dotnet-radius-client-library,代码行数:7,代码来源:Request.cs

示例7: DoSomethingForService

		/// <summary>
		///		Do something to the specified service type.
		/// </summary>
		/// <param name="serviceType">
		///		The service type.
		/// </param>
		public void DoSomethingForService(ServiceType serviceType)
		{
			if (serviceType == ServiceType.None)
				throw new InvalidOperationException("Service type is none.");

			serviceType = ServiceType.None;
		}
开发者ID:digidenz,项目名称:RoslynCodeAnalysis,代码行数:13,代码来源:SampleClass.cs

示例8: DynDnsUpdater

 public DynDnsUpdater(Dictionary<string,string> args)
 {
     // Parse the arguments by type
     // GANDI & GANDI TEST Environment
     if (args.ContainsKey("ganditest") || args.ContainsKey("gandi"))
     {
         // require apikey, zonename, hostname
         if (args.ContainsKey("apikey")
             && args.ContainsKey("zonename")
             && args.ContainsKey("hostname")
             )
         {
             if (args.ContainsKey("gandi"))
             {
                 _selectedService = ServiceType.Gandi;
                 _gandiConfig.UseTest = false;
             }
             else
             {
                 _selectedService = ServiceType.GandiTest;
                 _gandiConfig.UseTest = true;
             }
             _gandiConfig.ApiKey = args["apikey"];
             _gandiConfig.HostName = args["hostname"];
             _gandiConfig.ZoneName = args["zonename"];
             _gandiConfig.Simulate = args.ContainsKey("simulate");
         }
     }
 }
开发者ID:ryanbarlow,项目名称:DynDnsUpdater,代码行数:29,代码来源:DynDnsUpdater.cs

示例9: ClientCommandEventArgs

 internal ClientCommandEventArgs(string localEndPoint, string remoteEndPoint, ServiceType serviceType, Message requestMessage, DateTime requestTime, Message responseMessage, DateTime responseTime)
     : this(localEndPoint, remoteEndPoint, serviceType, requestMessage, requestTime)
 {
     this.responseMessage = responseMessage;
     this.responseTime = responseTime;
     hasResponse = true;
 }
开发者ID:ikvm,项目名称:cloudb,代码行数:7,代码来源:ClientCommandEventArgs.cs

示例10: CalculateEmission

        public CalculationResult CalculateEmission(DateTime effectiveDate, decimal distance, ServiceType serviceType,
                                                   decimal chargeMass,bool reversal)
        {
            var distanceType = GetDistanceType(distance, serviceType);
            var factorId = FactorMapping[distanceType];
            var factorValue = context.FactorValue(effectiveDate, factorId);
            if (factorValue == null)
            {
                var message = string.Format(Resources.FactorValueNotFound, factorId, effectiveDate);
                throw new NullReferenceException(message);
            }
            var emissions = distance*(chargeMass/1000)*factorValue;
            if (reversal)
            {
                emissions = emissions*-1;
            }
            var calculationDate = context.CalculationDateForFactorId(factorId);

            return new CalculationResult
                {
                    CalculationDate = calculationDate,
                    ActivityGroupId = ActivityMapping[distanceType],
                    Emissions = emissions
                };
        }
开发者ID:Warrenn,项目名称:Carbon.MVC,代码行数:25,代码来源:CourierCalculationService.cs

示例11: ReportServiceDownClientReport

        public void ReportServiceDownClientReport(IServiceAddress address, ServiceType type)
        {
            if (log.IsInterestedIn(LogLevel.Information))
                log.Info(string.Format("reportServiceDownClientReport {0} {1}", address, type));

            ReportServiceDown(address, type, ServiceStatus.DownClientReport);
        }
开发者ID:erpframework,项目名称:cloudb,代码行数:7,代码来源:ServiceStatusTracker.cs

示例12: ServiceAnnouncement

 internal ServiceAnnouncement(UpnpClient client, ServiceType type, string deviceUdn, IEnumerable<string> locations)
 {
     this.client = client;
     this.type = type;
     this.deviceUdn = deviceUdn;
     this.locations = locations;
 }
开发者ID:MustafaUzumcuCom,项目名称:mono-upnp,代码行数:7,代码来源:ServiceAnnouncement.cs

示例13: WhereNot

        public static List<string> WhereNot(ServiceType serviceType) {
            _whereNot.Add("is_dead");

            switch(serviceType) {
                case ServiceType.Store:
                    _whereNot.Add("has_wheelchair_accessability");
                    _whereNot.Add("has_bilingual_services");
                    _whereNot.Add("has_product_consultant");
                    _whereNot.Add("has_tasting_bar");
                    _whereNot.Add("has_beer_cold_room");
                    _whereNot.Add("has_special_occasion_permits");
                    _whereNot.Add("has_vintages_corner");
                    _whereNot.Add("has_parking");
                    _whereNot.Add("has_transit_access");

                    break;
                case ServiceType.Product:
                    _where.Add("is_discontinued");
                    _where.Add("has_value_added_promotion");
                    _where.Add("has_limited_time_offer");
                    _where.Add("has_bonus_reward_miles");
                    _where.Add("is_seasonal");
                    _where.Add("is_vqa");
                    _where.Add("is_ocb");
                    _where.Add("is_kosher");

                    break;
            }

            return _whereNot;
        }
开发者ID:MobilePractice,项目名称:drink-windows,代码行数:31,代码来源:Endpoint.cs

示例14: ActivityData

 public ActivityData(
     string id, string html = null, string text = null, StyleElement parsedText = null, bool? isEditable = null, Uri postUrl = null,
     int? commentLength = null, CommentData[] comments = null,
     DateTime? postDate = null,
     DateTime? editDate = null,
     ServiceType serviceType = null, PostStatusType? status = null, IAttachable attachedContent = null,
     ProfileData owner = null, DateTime? getActivityDate = null,
     ActivityUpdateApiFlag updaterTypes = ActivityUpdateApiFlag.Unloaded)
 {
     LoadedApiTypes = updaterTypes;
     Id = id;
     IsEditable = isEditable;
     Html = html;
     Text = text;
     ParsedText = parsedText;
     CommentLength = commentLength;
     Comments = comments;
     PostUrl = postUrl;
     PostDate = postDate;
     EditDate = editDate;
     GetActivityDate = getActivityDate;
     PostStatus = status;
     Owner = owner;
     AttachedContent = attachedContent;
     ServiceType = serviceType;
 }
开发者ID:namoshika,项目名称:SnkLib.Web.GooglePlus,代码行数:26,代码来源:ActivityData.cs

示例15: Create

        public static ServiceController Create(string machineName, string serviceName, string displayName,
                                               ServiceType serviceType, ServiceStartMode startType,
                                               ServiceErrorControl errorControl, string binaryPathName,
                                               string loadOrderGroup, string[] dependencies, string serviceStartName,
                                               string password)
        {
            var hScManager = OpenSCManager(machineName, null, ScmAccessRights.CreateService);
            if (hScManager == IntPtr.Zero)
            {
                throw new Win32Exception();
            }
            try
            {
                var dependencyList = dependencies == null || dependencies.Length == 0
                                         ? null
                                         : string.Join("\0", dependencies);
                var hService = CreateService(hScManager, serviceName, displayName, ServiceAccessRights.AllAccess,
                                             serviceType, startType, errorControl, binaryPathName, loadOrderGroup,
                                             IntPtr.Zero, dependencyList, serviceStartName, password);
                if (hService == IntPtr.Zero)
                {
                    throw new Win32Exception();
                }
                CloseServiceHandle(hService);

                return new ServiceController(serviceName, machineName);
            }
            finally
            {
                CloseServiceHandle(hScManager);
            }
        }
开发者ID:ashwinrayaprolu1984,项目名称:cassia-1,代码行数:32,代码来源:ServiceHelper.cs


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