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

C# Service类代码示例

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

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



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

示例1: USB_Rejoin

        public USB_Rejoin(Service s, string sl)
        {
            InitializeComponent();

            service = s;
            serial.Text = sl;
        }
开发者ID:gawallsibya,项目名称:BIT_TeamProject,代码行数:7,代码来源:USB_Rejoin.xaml.cs


示例2: Load

        public static DisaSettings Load(Service ds)
        {
            var path = GetPath(ds);

            if (!File.Exists(path))
            {
                return null;
            }

            try
            {
                using (var sr = new StreamReader(path))
                {
                    var loadedObj = Load(sr, ds.Information.Settings);

                    return loadedObj;
                }
            }
            catch (Exception ex)
            {
                Utils.DebugPrint("Failed (exception) to load settings for "
                + ds.Information.ServiceName + ". Nuking!");
                File.Delete(path);
                return null;
            }
        }
开发者ID:akonsand,项目名称:DisaOpenSource,代码行数:26,代码来源:SettingsManager.cs


示例3: Init

 public void Init(Service service)
 {
     DataContext = contentManagerViewModel = new ContentManagerViewModel(service);
     service.ContentUpdated += (type, name) =>
     {
         RefreshContentList();
         ContentLoader.RemoveResource(name);
         if (isContentReadyForUse)
             Dispatcher.Invoke(
                 new Action(
                     () =>
                         contentManagerViewModel.SelectedContent =
                             new ContentIconAndName(contentManagerViewModel.GetContentTypeIcon(type), name)));
     };
     service.ContentDeleted += name =>
     {
         RefreshContentList();
         ContentLoader.RemoveResource(name);
     };
     service.ProjectChanged += () =>
     {
         isContentReadyForUse = false;
         RefreshContentList();
     };
     service.ContentReady += () =>
     {
         Dispatcher.Invoke(new Action(contentManagerViewModel.ShowStartContent));
         isContentReadyForUse = true;
     };
 }
开发者ID:remy22,项目名称:DeltaEngine,代码行数:30,代码来源:ContentManagerView.xaml.cs


示例4: Load

        private static DisaServiceUserSettings Load(Service service)
        {
            var path = GetPath(service);
            if (!File.Exists(path))
            {
                return null;
            }

            try
            {
                using (var sr = new StreamReader(path))
                {
                    var serializer = new XmlSerializer(typeof(DisaServiceUserSettings));
                    return (DisaServiceUserSettings) serializer.Deserialize(sr);
                }
            }
            catch (Exception ex)
            {
                Utils.DebugPrint("Failed to load service user settings for " + service.Information.ServiceName +
                    ". Corruption. Nuking... " + ex.Message);
                if (File.Exists(path))
                {
                    File.Delete(path);
                }
            }

            return null;
        }
开发者ID:Zaldroc,项目名称:DisaOpenSource,代码行数:28,代码来源:ServiceUserSettingsManager.cs


示例5: AddWindow

        public AddWindow(Requests request, Service.Service service)
        {
            this.InitializeComponent();
            this.InitializeMembers(service);
            this.InitializeComboBoxes();

            // Fill TextBoxes
            this.textBoxClient.Text = request.Clients.FullName;
            this.textBoxAdress.Text = request.Address;
            this.textBoxComment.Text = request.Comment;

            // Fill ComboBoxes
            this.comboBoxServices.SelectedIndex     = this.comboBoxServices.FindStringExact(request.Services.Name);
            this.comboBoxOperators.SelectedIndex    = this.comboBoxOperators.FindStringExact(request.Operators.FullName);
            this.comboBoxMasters.SelectedIndex      = this.comboBoxMasters.FindStringExact(request.Masters.FullName);

            // Fill DateTimePickers
            this.dateTimePickerRequest.Value = request.RequestDate;
            this.dateTimePickerCloseRequest.Value = request.CloseDate ?? DateTime.Now;
            this.dateTimePickerDepature.Value = request.DateOfDeparture ?? DateTime.Now;

            this.buttonAdd.Text = "Изменить";
            this.isEditMode = true;
            this.requestToEdit = request;
        }
开发者ID:Morgolt,项目名称:qwerty,代码行数:25,代码来源:AddWindow.cs


示例6: MedicsWindow

        public MedicsWindow()
        {
            InitializeComponent();

            medico = new Medicos();

            medic = new Medic();
            service = new Service();
            speciality = new Speciality();


            medics = medic.GetAll();
            medicsGrid.ItemsSource = medics.ToArray();

            services = service.GetAll();
            foreach (ServicioMedico service in services)
            {
                comboService.Items.Add(service.nombre + " - " + service.descripcion);
            }

            specialities = speciality.GetAll();
            foreach (Especialidades speciality in specialities)
            {
                comboSpeciality.Items.Add(speciality.nombre + " - " + speciality.descripcion);
            }


        }
开发者ID:Maldercito,项目名称:adat,代码行数:28,代码来源:1453801388$MedicsWindow.xaml.cs


示例7: Manager

 public Manager()
 {
     dbus_connection = Bus.GetSystemBus();
     dbus_service = Service.Get(dbus_connection, INTERFACE_NAME);
     manager = (ManagerProxy)dbus_service.GetObject(typeof(ManagerProxy), PATH_NAME);
     dbus_service.SignalCalled += OnSignalCalled;
 }
开发者ID:RoDaniel,项目名称:featurehouse,代码行数:7,代码来源:Manager.cs


示例8: ComposeBubble

 public ComposeBubble(long time, BubbleDirection direction, Service service, 
     VisualBubble bubbleToSend, Contact.ID[] ids) 
     : base(time, direction, service)
 {
     Ids = ids;
     BubbleToSend = bubbleToSend;
 }
开发者ID:Xanagandr,项目名称:DisaOpenSource,代码行数:7,代码来源:ComposeBubble.cs


示例9: Main

        private static void Main(string[] args)
        {
            Directory.SetCurrentDirectory(AppDomain.CurrentDomain.BaseDirectory);

            if (!Environment.UserInteractive) // Running as service
            {
                using (var service = new Service())
                    ServiceBase.Run(service);
            }
            else // Running as console app
            {
                var parameter = string.Concat(args);
                switch (parameter)
                {
                    case "--install":
                        ManagedInstallerClass.InstallHelper(new[]
                        {"/LogFile=", Assembly.GetExecutingAssembly().Location});
                        return;

                    case "--uninstall":
                        ManagedInstallerClass.InstallHelper(new[]
                        {"/LogFile=", "/u", Assembly.GetExecutingAssembly().Location});
                        return;
                }
                Start(args);
            }
        }
开发者ID:itplanes,项目名称:DNSAgent,代码行数:27,代码来源:Program.cs


示例10: MessageIntradayTick

 internal MessageIntradayTick(CorrelationID corr, Service service)
     : base(new Name("IntradayTickResponse"), corr, service)
 {
     this._parent = null;
     this._responseError = new ElementIntradayTickResponseError();
     this._isResponseError = true;
 }
开发者ID:rowlandwatkins,项目名称:BEmu,代码行数:7,代码来源:MessageIntradayTick.cs


示例11: RegisterDomainSyncAPI

 /// <summary>
 /// Registers the domain sync APIs in the provided service.
 /// </summary>
 /// <param name="service">The provided service.</param>
 public void RegisterDomainSyncAPI(Service service)
 {
     service["serverSync.getDoR"] = (Func<string>)GetDoR;
     service["serverSync.getDoI"] = (Func<string>)GetDoI;
     service["serverSync.updateDoI"] = (Action<Connection, string>)HandleRemoteDoIChanged;
     service["serverSync.updateDoR"] = (Action<Connection, string>)HandleRemoteDoRChanged;
 }
开发者ID:fakusb,项目名称:FiVES-Nao-Visualisation,代码行数:11,代码来源:DomainSync.cs


示例12: SleepProcessor

        public SleepProcessor(ProcessorElement config, Service service)
            : base(config, service)
        {
            mode = SleepMode.Normal;
            if (config.Options["mode"] != null && !string.IsNullOrEmpty(config.Options["mode"].Value))
            {
                foreach (SleepMode item in Enum.GetValues(typeof(SleepMode)))
                {
                    if (item.ToString().ToLower().Equals(config.Options["mode"].Value.ToLower()))
                        mode = item;
                }
            }

            interval = null;
            if (config.Options["interval"] != null && !string.IsNullOrEmpty(config.Options["interval"].Value))
            {
                interval = config.Options["interval"].Value;
            }
            else
            {
                Log.Warn("sleep interval not defined");
            }

            if (mode == SleepMode.Random)
            {
                rnd = new Random();
            }
        }
开发者ID:vokac,项目名称:F2B,代码行数:28,代码来源:Sleep.cs


示例13: ComponentNotRegisteredException

 /// <summary>
 /// Initializes a new instance of the <see cref="ComponentNotRegisteredException"/> class.
 /// </summary>
 /// <param name="service">The service.</param>
 /// <param name="innerException">The inner exception.</param>
 public ComponentNotRegisteredException(Service service, Exception innerException)
     : base(string.Format(CultureInfo.CurrentCulture,
     ComponentNotRegisteredExceptionResources.Message, 
     Enforce.ArgumentNotNull(service, "service")),
     innerException)
 {
 }
开发者ID:shiftkey,项目名称:bearded-dangerzone,代码行数:12,代码来源:ComponentNotRegisteredException.cs


示例14: EditWindow

        public EditWindow(Service.Service service, int rowIndex, object selectedItem, DataGrid grid)
        {
            InitializeComponent();
            this.selectedItem = selectedItem;
            this.service = service;
            this.rowIndex = rowIndex;
            this.grid = grid;
            this.grid.IsReadOnly = true;

            List<String> categories = new List<String>();
            categories.Add("Discount pris");
            categories.Add("Hverdags oste");
            categories.Add("Luxus oste");
            categories.Add("Eksklusive oste");
            categories.Add("Styk ost");
            categories.Add("Osteborde");

            comboBoxCategoryEdit.ItemsSource = categories.ToList();

            TxtName.Text = service.filldata(service.getProducts()).Rows[rowIndex]["name"].ToString();
            txtUnitprice.Text = service.filldata(service.getProducts()).Rows[rowIndex]["unitPrice"].ToString();
            txtCountAvailable.Text = service.filldata(service.getProducts()).Rows[rowIndex]["countAvailable"].ToString();
            txtCountry.Text = service.filldata(service.getProducts()).Rows[rowIndex]["country"].ToString();
            txtDescription.Text = service.filldata(service.getProducts()).Rows[rowIndex]["description"].ToString();
        }
开发者ID:Nabulion,项目名称:LeWebShop,代码行数:25,代码来源:EditWindow.xaml.cs


示例15: Run

        private void Run()
        {
            Console.WriteLine("Run a ServiceHost via programmatic configuration...");
            Console.WriteLine();

            string baseAddress = "http://" + Environment.MachineName + ":8000/Service.svc";
            Console.WriteLine("BaseAddress: {0}", baseAddress);

            using (ServiceHost serviceHost = new ServiceHost(typeof(Service)))
            {
                Console.WriteLine("Opening the host");
                serviceHost.Open();

                try
                {
                    var service = new Service();
                    Console.WriteLine(service);
                    Console.WriteLine("The service is ready.");
                    Console.WriteLine("Press <ENTER> to terminate service.");
                }
                catch (Exception ex)
                {
                    Console.WriteLine("Error on initializing the service host.");
                    Console.WriteLine(ex.Message);
                }

                Console.WriteLine();
                Console.ReadLine();
                serviceHost.Close();
            }
        }
开发者ID:TheHunter,项目名称:WcfExtensions,代码行数:31,代码来源:WcfHost.cs


示例16: AddCategory

        public ActionResult AddCategory(Service.DTO.CategoryModel category, IEnumerable<HttpPostedFileBase> images)
        {
            if(!ModelState.IsValid)
            {
                return View(category);
            }

            //Service.DTO.ImageModel imageToSave = new Service.DTO.ImageModel();
            //category.Images = new List<Service.DTO.ImageModel>();
            //if (images != null)
            //{
            //    foreach (HttpPostedFileBase image in images)
            //    {

            //        if (image != null)
            //        {
            //            //TODO: Felmeddelande om filen inte är en bild
            //            if (IsImage(image) == false) return RedirectToAction("AddCategory");

            //            imageToSave = new Service.DTO.ImageModel();
            //            imageToSave.ImageData = new byte[image.ContentLength];
            //            imageToSave.ImageMimeType = image.ContentType;
            //            image.InputStream.Read(imageToSave.ImageData, 0, image.ContentLength);
            //            category.Images.Add(imageToSave);

            //        }
            //    }
            //}

            Service.DTO.CategoryModel cat = categoryService.SaveCategory(category);
            //TODO: Maybe check if 'cat' is null, meaning it wasn't saved

            return RedirectToAction("Category", new { id = cat.Id });
        }
开发者ID:sebastian-f,项目名称:Examensarbete,代码行数:34,代码来源:AdminController.cs


示例17: BaseProcessor

 public BaseProcessor(ProcessorElement config, Service service)
 {
     Name = config.Name;
     goto_next = config.Goto.Next;
     goto_error = config.Goto.Error;
     Service = service;
 }
开发者ID:vokac,项目名称:F2B,代码行数:7,代码来源:Base.cs


示例18: btnSyncNewWords_Click

        private void btnSyncNewWords_Click(object sender, EventArgs e)
        {
            var uid = Convert.ToInt32(txbUserId.Text);
            ShowMessage("读取用户生词本...");
            //读取用户不认识的词
            var newWordList = HujiangWebService.GetUserItems(uid, Convert.ToDateTime("2000-1-1"));

            ShowMessage("生词:" + newWordList.Count + "个");
            //dbOperator.SaveUserNewWords(newWordList);
            ShowMessage("读取用户背诵记录...");
            //读取用户背诵过的书和单元,得到用户已认识词列表
            var histories = new Dictionary<int, int>();
            var userBooks = HujiangWebService.GetPublicBooks(uid, "en");
            foreach (var userBook in userBooks)
            {
                var unitId = HujiangWebService.GetUserUnitMax(uid, userBook.BookID);
                if (unitId > 0)
                {
                    richTextBox1.AppendText(userBook.BookName + " UnitId:" + unitId + "\r\n");
                    histories.Add(userBook.BookID, unitId);
                }
            }
            //将用户记录写入数据库
            //dbOperator.SaveUserLearnHistory(histories);
            ShowMessage("统计用户的已知和未知词汇...");
            var list = CalcUserVocabulary(newWordList, histories);
            foreach (var vocabulary in list)
            {
                ShowMessage(vocabulary.ToString());
            }
            ShowMessage("开始同步到本地");
            Service service = new Service();
            service.SaveUserVocabulary(list,"开心词场");
            ShowMessage("同步完成");
        }
开发者ID:studyzy,项目名称:LearnEnglishBySubtitle,代码行数:35,代码来源:MainForm.cs


示例19:

 /// <summary>
 /// Gets the service description for service.
 /// </summary>
 /// <param name="service">The service to get the cache for.</param>
 public ServiceDescription this[Service service]
 {
     get
     {
         return this[service.COMDevice, service.COMService];
     }
 }
开发者ID:jogibear9988,项目名称:ManagedUPnP,代码行数:11,代码来源:ServiceDescriptionCache.cs


示例20: InputProcessor

        public InputProcessor(ProcessorElement config, Service service)
            : base(config, service)
        {
            itype = null;
            if (config.Options["type"] != null && !string.IsNullOrEmpty(config.Options["type"].Value))
            {
                itype = new Regex(config.Options["type"].Value);
            }

            input = null;
            if (config.Options["input"] != null && !string.IsNullOrEmpty(config.Options["input"].Value))
            {
                input = new Regex(config.Options["input"].Value);
            }

            selector = null;
            if (config.Options["selector"] != null && !string.IsNullOrEmpty(config.Options["selector"].Value))
            {
                selector = new Regex(config.Options["selector"].Value);
            }

            if (input == null && itype == null && selector == null)
            {
                Log.Warn("input type, input name and selector name regexp is empty (all events will pass this configuration)");
            }
        }
开发者ID:vokac,项目名称:F2B,代码行数:26,代码来源:Input.cs



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
C# Service1Client类代码示例发布时间:2022-05-24
下一篇:
C# Server_Client.Client类代码示例发布时间: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