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


C# Service类代码示例

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


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


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