Наследование: ISerializable
Пример #1
1
            public void ReturnsSafeUriStringForUriWithMultipleStartingSlashes()
            {
                var inputUri = new Uri("//Views/MainPage.xaml", UriKind.RelativeOrAbsolute);
                var uri = UrlHelper.GetSafeUriString(inputUri);

                Assert.AreEqual("/Views/MainPage.xaml", uri);
            }
Пример #2
1
        /// <summary>
        /// Reads a URI.
        /// </summary>
        /// <param name="node">The node containing the URI.</param>
        /// <param name="table">The serialiser table.</param>
        /// <returns>A new instance of a <see cref="Uri"/> if the node is valid; null otherwise.</returns>
        public override object Read(XmlNode node, NetReflectorTypeTable table)
        {
            if (node == null)
            {
                // NetReflector should do this check, but doesn't
                if (this.Attribute.Required)
                {
                    throw new NetReflectorItemRequiredException(Attribute.Name + " is required");
                }
                else
                {
                    return null;
                }
            }

            Uri ret;
            if (node is XmlAttribute)
            {
                ret = new Uri(node.Value);
            }
            else
            {
                ret = new Uri(node.InnerText);
            }

            return ret;
        }
 public string Download(Uri uri)
 {
     using(var reader = new StreamReader(uri.LocalPath))
     {
         return reader.ReadToEnd();
     }
 }
        public IRedirect ProcessRedirection(string url)
        {
            var redirectResponse = new Redirect();

            // Check that we've received the url parameter
            if (string.IsNullOrEmpty(url))
            {
                redirectResponse.ErrorMessage = string.Format("Url parameter was missing or malformed - ({0}).", url);
                return redirectResponse;
            }

            // Check that url is valid as we don't want a broken redirect
            var uri = new Uri(url);
            redirectResponse.Allowed = true;
            redirectResponse.Url = uri;

            if (_siteConfiguration.SecureMode)
            {
                // Secure mode activated
                if (!uri.Host.EndsWith(_siteConfiguration.WebsiteDomain) || !uri.IsAbsoluteUri)
                {
                    redirectResponse.Allowed = false;
                    redirectResponse.Url = null;
                    redirectResponse.ErrorMessage =
                        string.Format(
                            "Potentially dangerous redirect detected and blocked. Submitted url ({0}) did not match allowed domain list or was malformed.",
                            url);
                }
            }

            return redirectResponse;
        }
Пример #5
1
        IResource IResourceResolver.Resolve(Uri uri)
        {
            IResource resource = null;
            try
            {

                string fileName = uri.LocalPath;
                string ext = Path.GetExtension(fileName).ToLower();
                if (ext == m_ext)
                {
                    using (Stream stream = File.OpenRead(fileName))
                    {
                        var reader = new CustomDomXmlReader(Globals.ResourceRoot, m_schemaLoader);
                        DomNode node = reader.Read(stream, uri);                        
                        resource = Prefab.Create(node, uri);
                    }
                }
            }
            catch (System.IO.IOException e)
            {
                Outputs.WriteLine(OutputMessageType.Warning, "Could not load resource: " + e.Message);
            }

            return resource;
        }
Пример #6
1
        private void MainForm_Load(object sender, EventArgs e)
        {
            if (!loadConfigFile())
            {
                MessageBox.Show("Can't read configuration file!");
                Application.Exit();
            }
            try
            {
                project_uri = new Uri(getCfgValue("projecturl"));
            }
            catch (UriFormatException)
            {
                MessageBox.Show("Malformed projecturl tag in the configuration file!");
                Application.Exit();
            }

            var value = new Uri(project_uri, getCfgValue("updates_page_url", "updates.html"));            

            webBrowser1.Navigate(value); 
            update_state = UpdateStates.Ready;

            this.Text = getCfgValue("application_title");

            runWhenFinished = (RunApplications)getCfgValueInt("runWhenFinished");

            workInBackground.DoWork += new DoWorkEventHandler(UpdateTheClient);
            workInBackground.RunWorkerCompleted += new RunWorkerCompletedEventHandler(UpdateTheClientCompleted);
            workInBackground.ProgressChanged += new ProgressChangedEventHandler(UpdateTheClientProgressChanged);
        }
Пример #7
1
        public static string GenerateRelativePath(string from, string to)
        {
            if(String.IsNullOrWhiteSpace(from) || String.IsNullOrWhiteSpace(to))
            {
                throw new ArgumentNullException("Requires paths");
            }

            Uri fromUri = new Uri(from);
            Uri toUri = new Uri(to);

            //The URI schemes have to match in order for the path to be made relative
            if(fromUri.Scheme != toUri.Scheme)
            {
                return to;
            }

            Uri relativeUri = fromUri.MakeRelativeUri(toUri);
            string relative = Uri.UnescapeDataString(relativeUri.ToString());

            //If neccessary to do so, normalise the use of slashes to always be the default for this platform
            if(toUri.Scheme.ToUpperInvariant() == "FILE")
            {
                relative = relative.Replace(Path.AltDirectorySeparatorChar,
                    Path.DirectorySeparatorChar);
            }

            return relative;
        }
 public FakeStorageBlobContainer(MemoryBlobStore store, string containerName, IStorageBlobClient parent)
 {
     _store = store;
     _containerName = containerName;
     _parent = parent;
     _uri = new Uri("http://localhost/" + containerName);
 }
Пример #9
1
 /// <summary>
 /// Конструктор с настройками библиотеки
 /// </summary>
 /// <param name="chunkSizeByte">Размер порции пересылаемых данных, байт</param>
 /// <param name="requestTimeOutSec">Таймаут запроса, сек</param>
 /// <param name="storageUrl">Адрес системы хранения</param>
 /// <param name="concurrentConnectionLimit">Количество одновременных потоков работы с системой хранения</param>
 public FSClient(int chunkSizeByte, int requestTimeOutSec, string storageUrl, int concurrentConnectionLimit)
 {
     _chunkSize = chunkSizeByte;
     _requestTimeOut = (int)TimeSpan.FromSeconds(requestTimeOutSec).TotalMilliseconds;
     _storageUrl = new Uri(storageUrl).ToString();
     ServicePointManager.DefaultConnectionLimit = concurrentConnectionLimit;
 }
Пример #10
1
 public RssResult(string title, string desc, string link, List<SyndicationItem> items)
 {
     _title = title;
     _desc = desc;
     _altLink = new Uri(link);
     _items = items;
 }
 public void ShouldSetShieldingWithNonIncludeExceptionDetailInFaults()
 {
     // create a mock service and its endpoint.
     Uri serviceUri = new Uri("http://tests:30003");
     ServiceHost host = new ServiceHost(typeof(MockService), serviceUri);
     host.AddServiceEndpoint(typeof(IMockService), new WSHttpBinding(), serviceUri);
     host.Open();
     try
     {
         // check that we have no ErrorHandler loaded into each channel that
         // has IncludeExceptionDetailInFaults turned off.
         foreach (ChannelDispatcher dispatcher in host.ChannelDispatchers)
         {
             Assert.AreEqual(0, dispatcher.ErrorHandlers.Count);
             Assert.IsFalse(dispatcher.IncludeExceptionDetailInFaults);
         }
         ExceptionShieldingBehavior behavior = new ExceptionShieldingBehavior();
         behavior.ApplyDispatchBehavior(null, host);
         // check that the ExceptionShieldingErrorHandler was assigned to each channel
         foreach (ChannelDispatcher dispatcher in host.ChannelDispatchers)
         {
             Assert.AreEqual(1, dispatcher.ErrorHandlers.Count);
             Assert.IsTrue(dispatcher.ErrorHandlers[0].GetType().IsAssignableFrom(typeof(ExceptionShieldingErrorHandler)));
         }
     }
     finally
     {
         if (host.State == CommunicationState.Opened)
         {
             host.Close();
         }
     }
 }
        public static void Main()
        {
            var url = new Uri(ApiUrl + "?auth-id=" + AuthenticationID + "&auth-token=" + AuthenticationToken);
            var request = (HttpWebRequest)WebRequest.Create(url);
            request.Method = "POST";

            using (var stream = request.GetRequestStream())
            using (var writer = new StreamWriter(stream))
                writer.Write(RequestPayload);

            using (var response = request.GetResponse())
            using (var stream = response.GetResponseStream())
            using (var reader = new StreamReader(stream))
            {
                var rawResponse = reader.ReadToEnd();
                Console.WriteLine(rawResponse);

                // Suppose you wanted to use Json.Net to pretty-print the response (delete the next two lines if not):
                // Json.Net: http://http://json.codeplex.com/
                dynamic parsedJson = JsonConvert.DeserializeObject(rawResponse);
                Console.WriteLine(JsonConvert.SerializeObject(parsedJson, Formatting.Indented));

                // Or suppose you wanted to deserialize the json response to a defined structure (defined below):
                var candidates = JsonConvert.DeserializeObject<CandidateAddress[]>(rawResponse);
                foreach (var address in candidates)
                    Console.WriteLine(address.DeliveryLine1);
            }

            Console.ReadLine();
        }
Пример #13
1
        protected AbstractMsmqListener(
            IQueueStrategy queueStrategy,
            Uri endpoint,
            int threadCount,
            IMessageSerializer messageSerializer,
            IEndpointRouter endpointRouter,
            TransactionalOptions transactional,
            IMessageBuilder<Message> messageBuilder)
        {
            this.queueStrategy = queueStrategy;
            this.messageSerializer = messageSerializer;
            this.endpointRouter = endpointRouter;
            this.endpoint = endpoint;

            this.threadCount = threadCount;
            threads = new Thread[threadCount];

            switch (transactional)
            {
                case TransactionalOptions.Transactional:
                    this.transactional = true;
                    break;
                case TransactionalOptions.NonTransactional:
                    this.transactional = false;
                    break;
                case TransactionalOptions.FigureItOut:
                    this.transactional = null;
                    break;
                default:
                    throw new ArgumentOutOfRangeException("transactional");
            }
            this.messageBuilder = messageBuilder;
            this.messageBuilder.Initialize(Endpoint);
        }
Пример #14
1
        public static WarmupResult Warmup(IisSite site, string warmupUrl)
        {
            var uri = new Uri(warmupUrl);
            var testUrl = uri.ToString().Replace(uri.Host, "127.0.0.1");

            var request = WebRequest.Create(testUrl) as HttpWebRequest;
            request.Host = uri.Host + ":" + uri.Port;
            HttpWebResponse response;
            try
            {
                 response = (HttpWebResponse)request.GetResponse();
                 return new WarmupResult(response);
            }
            catch (WebException ex)
            {
                var exceptionResponse = (HttpWebResponse) ex.Response;

                if (exceptionResponse == null)
                {
                    return null;
                }

                return new WarmupResult(exceptionResponse);
            }
        }
Пример #15
1
            public void ReturnsSafeUriString()
            {
                var inputUri = new Uri("/Views/MainPage.xaml", UriKind.RelativeOrAbsolute);
                var uri = UrlHelper.GetSafeUriString(inputUri);

                Assert.AreEqual("/Views/MainPage.xaml", uri);
            }
Пример #16
1
        public UpdateBarModel(Version version, string downloadUri)
        {
            if (version == null || downloadUri == null)
            {
                UpdateAvailable = false;
                return;
            }

            Version = version;
            var currentVersion = typeof(CertInspector).Assembly.GetName().Version;
            var closed = Fiddler.FiddlerApplication.Prefs.GetPref(PreferenceNames.HIDE_UPDATED_PREF, false);
            UpdateAvailable = version > currentVersion && !closed;
            Fiddler.FiddlerApplication.Log.LogString($"FiddlerCert Inspector: Current version is {currentVersion}, latest version is {version}.");
            _downloadCommand = new RelayCommand(_ =>
            {
                var uri = new Uri(downloadUri);
                if (uri?.Scheme == Uri.UriSchemeHttps)
                {
                    Process.Start(uri.AbsoluteUri);
                }
                else
                {
                    Fiddler.FiddlerApplication.Log.LogString("Refusing to open non-HTTPS page.");
                }
            });
            _closeCommand = new RelayCommand(_ =>
            {
                Fiddler.FiddlerApplication.Prefs.SetPref(PreferenceNames.HIDE_UPDATED_PREF, true);
                UpdateAvailable = false;
            });
        }
Пример #17
1
        internal static void SetGitHubBuildStatus(
            Build build,
            CommitState state,
            Func<string, string, BuildConfiguration> getBuildConfiguration,
            Func<Build, string> getBuildDescription,
            Func<string> getHost,
            Action<string, string, string, string, CommitState, Uri, string> createGitHubCommitStatus)
        {
            var buildConfiguration = getBuildConfiguration(
                build.RepositoryOwner,
                build.RepositoryName);

            if (buildConfiguration == null)
                throw new Exception("Could not find build configuration.");

            var targetUrl = new Uri(String.Format(
                "http://{0}/{1}/{2}/builds/{3}",
                getHost(),
                build.RepositoryOwner,
                build.RepositoryName,
                build.Id));

            createGitHubCommitStatus(
                buildConfiguration.Token,
                build.RepositoryOwner,
                build.RepositoryName,
                build.Revision,
                state,
                targetUrl,
                getBuildDescription(build));
        }
Пример #18
1
 public void NavigateTo(Uri pageUri)
 {
     if (EnsureMainFrame())
     {
         _mainFrame.Navigate(pageUri);
     }
 }
 /// <summary>Initializes a new instance of <see cref="MockWebRequest"/>
 /// with the response to return.</summary>
 public MockWebRequest(Uri uri, string response)
 {
     m_requestUri = uri;
     m_requestStream = new MemoryStream();
     Stream m_responseStream = new MemoryStream(System.Text.Encoding.UTF8.GetBytes(response));
     m_mockResponse = new MockWebResponse(m_responseStream);
 }
Пример #20
1
 public static void PlayBackgroundMusic(string name)
 {
     string locationString = ResourceManager.GetSoundLocationByName(name);
     Uri location = new Uri(locationString);
     MediaPlayer.Stop();
     MediaPlayer.Play(Song.FromUri(name, location));
 }
Пример #21
1
        /**
         * Creates the fiHash-object and prepares the internal fields for the call to GetFileStream.
         *
         * \param file An Uri-object pointing to the file, that the hash should be calculated for. Only supports file:/ URLs!
        */
        public fiHash(Uri file)
        {
            if (file.Scheme != Uri.UriSchemeFile)
                throw new ArgumentException("Unsupported Uri Schema!");

            filename = file.LocalPath;
        }
Пример #22
1
        private void play(string url)
        {
            this.mediaPlayer = new MediaPlayerLauncher();

            Uri uri = new Uri(url, UriKind.RelativeOrAbsolute);

            if (uri.IsAbsoluteUri)
            {
                this.mediaPlayer.Media = uri;
            }
            else
            {
                using (IsolatedStorageFile isoFile = IsolatedStorageFile.GetUserStoreForApplication())
                {
                    if (isoFile.FileExists(url))
                    {
                        this.mediaPlayer.Location = MediaLocationType.Data;
                        this.mediaPlayer.Media = uri;
                    }
                    else
                    {
                        throw new ArgumentException("Media location doesn't exists.");
                    }
                }
            }

            this.mediaPlayer.Show();
        }
        public static IEnumerable<string> GetAllStyleSheets(string searchFrom, IEnumerable<string> allowedExtensions)
        {
            var project = ProjectHelpers.GetProject(searchFrom);
            var projectPath = project.Properties.Item("FullPath").Value.ToString();
            var projectUri = new Uri(projectPath, UriKind.Absolute);
            var fileNames = new HashSet<string>();
            var projectDir = Path.GetDirectoryName(projectPath);

            if (projectDir == null)
            {
                return new string[0];
            }

            foreach (var extension in allowedExtensions)
            {
                var matchingFiles = Directory.GetFiles(projectDir, "*" + extension, SearchOption.AllDirectories);

                foreach (var file in matchingFiles)
                {
                    var mappedFile = GetStyleSheetFileForUrl(file, project, projectUri);

                    if (mappedFile != null)
                    {
                        fileNames.Add(mappedFile);
                    }
                }
            }

            return fileNames;
        }
Пример #24
1
 public ItemCrawler(Uri url)
 {
     _htmlDocument = new HtmlDocument();
     var html = new WebClient().DownloadString(url.OriginalString);
     _htmlDocument.LoadHtml(html);
     _document = _htmlDocument.DocumentNode;
 }
Пример #25
1
	    public SubscriptionClient(IServiceBus bus, SubscriptionRouter router, Uri subscriptionServiceUri,
		                          TimeSpan startTimeout)
		{
			_bus = bus;
			_router = router;
			_subscriptionServiceUri = subscriptionServiceUri;
			_startTimeout = startTimeout;
			_network = router.Network;

			if (_log.IsDebugEnabled)
				_log.DebugFormat("Starting SubscriptionClient using {0}", subscriptionServiceUri);

			VerifyClientAndServiceNotOnSameEndpoint(bus);

			_ready.Reset();

			var consumerInstance = new SubscriptionMessageConsumer(_router, _network);

			_unsubscribeAction = _bus.ControlBus.SubscribeInstance(consumerInstance);
		    _unsubscribeAction += _bus.ControlBus.SubscribeContextHandler<SubscriptionRefresh>(Consume);

		    _subscriptionEndpoint = _bus.GetEndpoint(subscriptionServiceUri);
		    _producer = new SubscriptionServiceMessageProducer(router, _subscriptionEndpoint);

			WaitForSubscriptionServiceResponse();
		}
 public Menu(string _name,Uri pathToIcon,int _enabled=1)
 {
     this.name = _name;
     this.enabled = _enabled;
     if (pathToIcon != null)
         this.sysIcon = pathToIcon;
 }
        /// <summary>
        /// Does setup of AutoCAD IO. 
        /// This method will need to be invoked once before any other methods of this
        /// utility class can be invoked.
        /// </summary>
        /// <param name="autocadioclientid">AutoCAD IO Client ID - can be obtained from developer.autodesk.com</param>
        /// <param name="autocadioclientsecret">AutoCAD IO Client Secret - can be obtained from developer.autodesk.com</param>
        public static void SetupAutoCADIOContainer(String autocadioclientid, String autocadioclientsecret)
        {
            try
            {
                String clientId = autocadioclientid;
                String clientSecret = autocadioclientsecret;

                Uri uri = new Uri("https://developer.api.autodesk.com/autocad.io/us-east/v2/");
                container = new AIO.Operations.Container(uri);
                container.Format.UseJson();

                using (var client = new HttpClient())
                {
                    var values = new List<KeyValuePair<string, string>>();
                    values.Add(new KeyValuePair<string, string>("client_id", clientId));
                    values.Add(new KeyValuePair<string, string>("client_secret", clientSecret));
                    values.Add(new KeyValuePair<string, string>("grant_type", "client_credentials"));
                    var requestContent = new FormUrlEncodedContent(values);
                    var response = client.PostAsync("https://developer.api.autodesk.com/authentication/v1/authenticate", requestContent).Result;
                    var responseContent = response.Content.ReadAsStringAsync().Result;
                    var resValues = JsonConvert.DeserializeObject<Dictionary<string, string>>(responseContent);
                    _accessToken = resValues["token_type"] + " " + resValues["access_token"];
                    if (!string.IsNullOrEmpty(_accessToken))
                    {
                        container.SendingRequest2 += (sender, e) => e.RequestMessage.SetHeader("Authorization", _accessToken);
                    }
                }
            }
            catch (System.Exception ex)
            {
                Console.WriteLine(String.Format("Error while connecting to https://developer.api.autodesk.com/autocad.io/v2/", ex.Message));
                container = null;
                throw;
            }
        }
Пример #28
0
        private string BuildIFirstRowPTEUHtmlObject(Uri link, int level)
        {
            string page = this.GetWebDocument(link);

            int start = page.IndexOf("<script type=\"text/javascript\" src=\"http://www.04stream.com/weed.js");
            int end = page.IndexOf("script>", start);
            string js = page.Substring(start, end - start + 8).Replace('"', '\'');

            start = js.IndexOf("src='");
            end = js.IndexOf("'", start + 5);

            string jslink = js.Substring(start + 5, end - start - 5);

            page = this.GetWebDocument(new Uri(jslink));

            page = page.Replace("'+document.domain+'", link.Host);

            start = page.IndexOf("src=");
            end = page.IndexOf(">", start + 4);

            string iframe = page.Substring(start + 4, end - start - 4);

            if (level == 0)
                return iframe;

            return BuildStreamHtmlObject(new Uri(iframe), level - 1);
        }
        public string AnalyzeAndRepair(Uri uri, string parentFileName, out bool success)
        {
            foreach (var newPath in from validIfContains in ContentServerData.BaseShares
                                       where uri.AbsoluteUri.ToLower(CultureInfo.CurrentCulture).Contains(validIfContains)
                                       select uri.AbsoluteUri.Substring(uri.AbsoluteUri.ToLower(CultureInfo.CurrentCulture).LastIndexOf(validIfContains, StringComparison.CurrentCulture)))
            {
                Uri newUri;
                if (Uri.TryCreate(ContentServerData.BaseUri, new Uri(newPath, UriKind.Relative), out newUri))
                {

                    if (!WebResourceExists(newUri))
                    {
                        ManualFixLog.PrintFileNotFoundMessage(uri.OriginalString, parentFileName);
                        success = false;
                        return uri.OriginalString;
                    }
                    success = true;
                    return newPath;
                }

                success = false;
                ManualFixLog.PrintBadPathOrImproperTerms(uri.OriginalString, parentFileName);
                return uri.OriginalString;
            }

            success = false;
            ManualFixLog.PrintBadPathOrImproperTerms(uri.OriginalString, parentFileName);
            return uri.OriginalString;
        }
Пример #30
0
		public static RemoteActorRegistryConfigurator ListenTo(this RemoteActorRegistryConfigurator configurator,
		                                                       string uriString)
		{
			var uri = new Uri(uriString);

			return configurator.ListenTo(uri);
		}
Пример #31
0
        public void InitializeComponent()
        {
            if (_contentLoaded)
            {
                return;
            }
            _contentLoaded = true;
            System.Uri resourceLocater = new System.Uri("/FE Berechnungen;component/tragwerksberechnung/modelldatenanzeigen/tragwerksdaten" +
                                                        "anzeigen.xaml", System.UriKind.Relative);

            #line 1 "..\..\..\..\Tragwerksberechnung\ModelldatenAnzeigen\TragwerksdatenAnzeigen.xaml"
            System.Windows.Application.LoadComponent(this, resourceLocater);

            #line default
            #line hidden
        }
Пример #32
0
        public void InitializeComponent()
        {
            if (_contentLoaded)
            {
                return;
            }
            _contentLoaded = true;
            System.Uri resourceLocater = new System.Uri("/DXNorthwindApp;component/views/sales_by_category/sales_by_categorycollectionview" +
                                                        ".xaml", System.UriKind.Relative);

            #line 1 "..\..\..\..\Views\Sales_by_Category\Sales_by_CategoryCollectionView.xaml"
            System.Windows.Application.LoadComponent(this, resourceLocater);

            #line default
            #line hidden
        }
        public void InitializeComponent()
        {
            if (_contentLoaded)
            {
                return;
            }
            _contentLoaded = true;
            System.Uri resourceLocater = new System.Uri("/Cards_of_defectation;component/%d0%9e%d0%a2%d0%93%d0%9e/windows/searchwindowbyno" +
                                                        "mzak.xaml", System.UriKind.Relative);

            #line 1 "..\..\..\..\ОТГО\Windows\SearchWindowByNomZak.xaml"
            System.Windows.Application.LoadComponent(this, resourceLocater);

            #line default
            #line hidden
        }
        public void InitializeComponent()
        {
            if (_contentLoaded)
            {
                return;
            }
            _contentLoaded = true;
            System.Uri resourceLocater = new System.Uri("/Iut.MasterAnime.Winapp;V1.0.0.0;component/codemodifierbiblioth%c3%a8que/modifier" +
                                                        "biblioth%c3%a8que.xaml", System.UriKind.Relative);

            #line 1 "..\..\..\..\CodeModifierBibliothèque\ModifierBibliothèque.xaml"
            System.Windows.Application.LoadComponent(this, resourceLocater);

            #line default
            #line hidden
        }
        public void InitializeComponent()
        {
            if (_contentLoaded)
            {
                return;
            }
            _contentLoaded = true;
            System.Uri resourceLocater = new System.Uri("/Association PAT Ukrzaliznutsa;component/addinginformationwindow/mailinfowindow.x" +
                                                        "aml", System.UriKind.Relative);

            #line 1 "..\..\..\AddingInformationWindow\MailInfoWindow.xaml"
            System.Windows.Application.LoadComponent(this, resourceLocater);

            #line default
            #line hidden
        }
Пример #36
0
        public void InitializeComponent()
        {
            if (_contentLoaded)
            {
                return;
            }
            _contentLoaded = true;
            System.Uri resourceLocater = new System.Uri("/Xceed.Wpf.Toolkit.LiveExplorer;component/samples/theming/views/themingdatagridvi" +
                                                        "ew.xaml", System.UriKind.Relative);

            #line 1 "..\..\..\..\..\..\Samples\Theming\Views\ThemingDataGridView.xaml"
            System.Windows.Application.LoadComponent(this, resourceLocater);

            #line default
            #line hidden
        }
Пример #37
0
        public void InitializeComponent()
        {
            if (_contentLoaded)
            {
                return;
            }
            _contentLoaded = true;
            System.Uri resourceLocater = new System.Uri("/呼和浩特市精细化天气预报评分系统;component/%e9%a1%b5/%e7%99%bb%e5%bd%95%e8%ae%b0%e5%bd%95%e6%9f%" +
                                                        "a5%e8%af%a2%e9%a1%b5.xaml", System.UriKind.Relative);

            #line 1 "..\..\..\..\页\登录记录查询页.xaml"
            System.Windows.Application.LoadComponent(this, resourceLocater);

            #line default
            #line hidden
        }
Пример #38
0
        public void InitializeComponent()
        {
            if (_contentLoaded)
            {
                return;
            }
            _contentLoaded = true;
            System.Uri resourceLocater = new System.Uri("/LibraryProject;component/windows/librarymainwindow/views/admin/userstab/adduser." +
                                                        "xaml", System.UriKind.Relative);

            #line 1 "..\..\..\..\..\..\..\Windows\LibraryMainWindow\Views\Admin\UsersTab\AddUser.xaml"
            System.Windows.Application.LoadComponent(this, resourceLocater);

            #line default
            #line hidden
        }
Пример #39
0
        public void InitializeComponent()
        {
            if (_contentLoaded)
            {
                return;
            }
            _contentLoaded = true;
            System.Uri resourceLocater = new System.Uri("/EscritaFiscalClient;component/view/escritafiscal/simplesnacionaldetalhelista.xam" +
                                                        "l", System.UriKind.Relative);

            #line 1 "..\..\..\..\..\View\EscritaFiscal\SimplesNacionalDetalheLista.xaml"
            System.Windows.Application.LoadComponent(this, resourceLocater);

            #line default
            #line hidden
        }
        public void InitializeComponent()
        {
            if (_contentLoaded)
            {
                return;
            }
            _contentLoaded = true;
            System.Uri resourceLocater = new System.Uri("/Project;component/view/catalog%20-%20%d0%9a%d0%be%d0%bf%d0%b8%d1%80%d0%be%d0%b2%" +
                                                        "d0%b0%d1%82%d1%8c.xaml", System.UriKind.Relative);

            #line 1 "..\..\..\View\Catalog - Копировать.xaml"
            System.Windows.Application.LoadComponent(this, resourceLocater);

            #line default
            #line hidden
        }
Пример #41
0
        public void InitializeComponent()
        {
            if (_contentLoaded)
            {
                return;
            }
            _contentLoaded = true;
            System.Uri resourceLocater = new System.Uri("/ContabilidadeClient;component/view/contabilidade/contabilencerramentoexecablista" +
                                                        ".xaml", System.UriKind.Relative);

            #line 1 "..\..\..\..\..\View\Contabilidade\ContabilEncerramentoExeCabLista.xaml"
            System.Windows.Application.LoadComponent(this, resourceLocater);

            #line default
            #line hidden
        }
Пример #42
0
        public void InitializeComponent()
        {
            if (_contentLoaded)
            {
                return;
            }
            _contentLoaded = true;
            System.Uri resourceLocater = new System.Uri("/Proyecto_ArmandoSarrionGonzalez;component/vistas-controladores/ventanalogin.xaml" +
                                                        "", System.UriKind.Relative);

            #line 1 "..\..\..\Vistas-Controladores\ventanaLogin.xaml"
            System.Windows.Application.LoadComponent(this, resourceLocater);

            #line default
            #line hidden
        }
        public void InitializeComponent()
        {
            if (_contentLoaded)
            {
                return;
            }
            _contentLoaded = true;
            System.Uri resourceLocater = new System.Uri("/Panuon.UIBrowser;component/views/partial/linechartsview%20-%20%e5%a4%8d%e5%88%b6" +
                                                        ".xaml", System.UriKind.Relative);

            #line 1 "..\..\..\..\Views\Partial\LineChartsView - 复制.xaml"
            System.Windows.Application.LoadComponent(this, resourceLocater);

            #line default
            #line hidden
        }
        public void InitializeComponent()
        {
            if (_contentLoaded)
            {
                return;
            }
            _contentLoaded = true;
            System.Uri resourceLocater = new System.Uri("/SuperMinersCustomServiceSystem;component/view/windows/editrouletteawarditemwindo" +
                                                        "w.xaml", System.UriKind.Relative);

            #line 1 "..\..\..\..\View\Windows\EditRouletteAwardItemWindow.xaml"
            System.Windows.Application.LoadComponent(this, resourceLocater);

            #line default
            #line hidden
        }
        public void InitializeComponent()
        {
            if (_contentLoaded)
            {
                return;
            }
            _contentLoaded = true;
            System.Uri resourceLocater = new System.Uri("/Xceed.Wpf.Toolkit.LiveExplorer;component/samples/propertygrid/views/propertygrid" +
                                                        "multiselectedobjectsview.xaml", System.UriKind.Relative);

            #line 1 "..\..\..\..\..\..\Samples\PropertyGrid\Views\PropertyGridMultiSelectedObjectsView.xaml"
            System.Windows.Application.LoadComponent(this, resourceLocater);

            #line default
            #line hidden
        }
        public void InitializeComponent()
        {
            if (_contentLoaded)
            {
                return;
            }
            _contentLoaded = true;
            System.Uri resourceLocater = new System.Uri("/CustomActivity;component/customexpressioneditordialogs/csharpcoding/scriptproper" +
                                                        "tywindowtest.xaml", System.UriKind.Relative);

            #line 1 "..\..\..\..\CustomExpressionEditorDialogs\CSharpCoding\ScriptPropertyWindowTest.xaml"
            System.Windows.Application.LoadComponent(this, resourceLocater);

            #line default
            #line hidden
        }
Пример #47
0
        public void cargaURL()
        {
            string url = "http://maps.google.com/mapdata?Point=b&Point.latitude_e6=";
            string tm_lat;
            string tm_lon;
            string tm_zoom;
            string tm_w;
            string tm_h;
            double xxLat;
            double xxLon;

            System.Globalization.NumberFormatInfo nfi = new System.Globalization.CultureInfo("en-US", false).NumberFormat;
            lon = double.Parse(st_lon, nfi);
            lat = double.Parse(st_lat, nfi);

            xxLat = lat * 1e6;
            if (xxLat < 0)
            {
                xxLat = xxLat + (2 ^ 32);
            }
            xxLat = Math.Floor(xxLat);

            xxLon = lon * 1e6;
            if (xxLon < 0)
            {
                xxLon = xxLon + (2 ^ 32);
            }
            xxLon = Math.Floor(xxLon);

            //System.Globalization.NumberFormatInfo nfi = new System.Globalization.CultureInfo("en-US", false).NumberFormat;
            tm_lat = xxLat.ToString(nfi);
            tm_lon = xxLon.ToString(nfi);

            tm_zoom = zoom.ToString();
            tm_w    = webBrowser1.Width.ToString();
            tm_h    = webBrowser1.Height.ToString();

            url = url + tm_lat + "&Point.longitude_e6=" + tm_lon + "&Point.iconid=15&Point=e&latitude_e6=";
            url = url + tm_lat + "&longitude_e6=" + tm_lon + "&zm=" + tm_zoom;
            url = url + "&w=" + tm_w + "&h=" + tm_h + "&cc=ES&min_priority=2";
            try
            {
                System.Uri tmp = new System.Uri(url);
                webBrowser1.Navigate(tmp);
            }
            catch { }
        }
        private static void SignPEFile(X509Certificate2 cert, System.Uri timestampUrl, string path, System.Resources.ResourceManager resources, bool useSha256)
        {
            ProcessStartInfo startInfo = new ProcessStartInfo(GetPathToTool(resources), GetCommandLineParameters(cert.Thumbprint, timestampUrl, path, useSha256));

            startInfo.CreateNoWindow         = true;
            startInfo.UseShellExecute        = false;
            startInfo.RedirectStandardError  = true;
            startInfo.RedirectStandardOutput = true;

            Process signTool = null;

            try
            {
                signTool = Process.Start(startInfo);
                signTool.WaitForExit();

                while (!signTool.HasExited)
                {
                    System.Threading.Thread.Sleep(50);
                }
                switch (signTool.ExitCode)
                {
                case 0:
                    // everything was fine
                    break;

                case 1:
                    // error, report it
                    throw new ApplicationException(String.Format(CultureInfo.InvariantCulture, resources.GetString("SecurityUtil.SigntoolFail"), path, signTool.StandardError.ReadToEnd()));

                case 2:
                    // warning, report it
                    throw new WarningException(String.Format(CultureInfo.InvariantCulture, resources.GetString("SecurityUtil.SigntoolWarning"), path, signTool.StandardError.ReadToEnd()));

                default:
                    // treat as error
                    throw new ApplicationException(String.Format(CultureInfo.InvariantCulture, resources.GetString("SecurityUtil.SigntoolFail"), path, signTool.StandardError.ReadToEnd()));
                }
            }
            finally
            {
                if (signTool != null)
                {
                    signTool.Close();
                }
            }
        }
Пример #49
0
        public void InitializeComponent()
        {
            if (_contentLoaded)
            {
                return;
            }
            _contentLoaded = true;
            System.Uri resourceLocater = new System.Uri("/MillitaryApp;component/%d0%90%d0%bd%d0%b8%d0%bc%d0%b0%d1%86%d0%b8%d0%b8%20%d1%80" +
                                                        "%d0%b5%d0%b6%d0%b8%d0%bc%d0%be%d0%b2%20%d1%80%d0%b0%d0%b1%d0%be%d1%82%d1%8b/3/mo" +
                                                        "de_2.xaml", System.UriKind.Relative);

            #line 1 "..\..\..\..\..\Анимации режимов работы\3\Mode_2.xaml"
            System.Windows.Application.LoadComponent(this, resourceLocater);

            #line default
            #line hidden
        }
Пример #50
0
 public FTPUtil(System.Uri FtpUri, string strUserName, string strPassword, WebProxy objProxy)
 {
     this.ftpWebRequest_0  = null;
     this.ftpWebResponse_0 = null;
     this.webProxy_0       = null;
     this.bool_0           = false;
     this.string_4         = "";
     this.uri_0            = new System.Uri(FtpUri.GetLeftPart(UriPartial.Authority));
     this.string_0         = FtpUri.AbsolutePath;
     if (!this.string_0.EndsWith("/"))
     {
         this.string_0 = this.string_0 + "/";
     }
     this.string_1   = strUserName;
     this.string_3   = strPassword;
     this.webProxy_0 = objProxy;
 }
        private string GetUserInfo()
        {
            try
            {
                if (!string.IsNullOrEmpty(Uri))
                {
                    System.Uri uri = new System.Uri(Uri);
                    return(uri.UserInfo);
                }
            }
            catch (UriFormatException)
            {
                // Log
                throw;
            }

            return(null);
        }
Пример #52
0
        public bool CanReach(RemoteSession session, string remoteUri, TimeSpan timeout)
        {
            CouchbaseLiteHttpClientFactory.SetupSslCallback();
            var uri = new Uri(remoteUri);

            try
            {
                Uri proxy = WebRequest.DefaultWebProxy.GetProxy(new Uri(remoteUri));
                using (var c = new TcpClient(proxy.DnsSafeHost, proxy.Port)) {
                    return(true);
                }
            } catch (Exception e) {
                Log.To.Sync.I(TAG, "Didn't get successful connection to {0}", remoteUri);
                Log.To.Sync.V(TAG, "   Cause: ", e);
                LastError = e;
                return(false);
            }
        }
Пример #53
0
    public static void LoadUrl(string hsdkProtocol, string hsdkServerName, string hsdkPort, string hsdkVDName)
    {
        protocol   = hsdkProtocol;
        serverName = hsdkServerName;
        vDName     = hsdkVDName;
        port       = hsdkPort;

        System.Uri tempWatchUrl;
        System.Uri tempFeedUrl;

        System.Uri tempLobbyUrl = new System.Uri(protocol + "://" + serverName + ":" + port + "/" + vDName + "/");
        System.Uri.TryCreate(tempLobbyUrl, "/" + vDName + "/watchService/make/", out tempWatchUrl);
        System.Uri.TryCreate(tempLobbyUrl, "/" + vDName + "/pacs/alarms/feed/", out tempFeedUrl);

        lobbyUrl = tempLobbyUrl.AbsoluteUri;
        watchUrl = tempWatchUrl.AbsoluteUri;
        feedUrl  = tempFeedUrl.AbsoluteUri;
    }
Пример #54
0
 public void InitializeComponent() {
     if (_contentLoaded) {
         return;
     }
     _contentLoaded = true;
     
     #line 5 "..\..\App.xaml"
     this.StartupUri = new System.Uri("./View/MembershipMaintenanceView.xaml", System.UriKind.Relative);
     
     #line default
     #line hidden
     System.Uri resourceLocater = new System.Uri("/Lab4_Gym_Membership;component/app.xaml", System.UriKind.Relative);
     
     #line 1 "..\..\App.xaml"
     System.Windows.Application.LoadComponent(this, resourceLocater);
     
     #line default
     #line hidden
 }
Пример #55
0
        private void btnLaunch_Click(object sender, EventArgs e)
        {
            // for the type of projects the sample is interested in, the project output will be the primary output of the
            // active output group
            int selectedIndex = this.cmbProjects.SelectedIndex + 1;
            Project selectedProject = _dte.Solution.Projects.Item(selectedIndex);

            object[] objFileNames = selectedProject.ConfigurationManager.ActiveConfiguration.OutputGroups.Item(1).FileURLs as object[];
            string fileName = objFileNames[0] as string;
            System.Uri fileUri = new System.Uri(fileName);
            _filePath = fileUri.LocalPath;

            _Command = textBoxCommandLine.Text;
            _CommandArguments = textBoxCmdArguments.Text;
            _workingDir = textBoxWorkingDir.Text;

            //this.DialogResult = DialogResult.OK;
            //this.Close();
        }
Пример #56
0
 public void InitializeComponent() {
     if (_contentLoaded) {
         return;
     }
     _contentLoaded = true;
     
     #line 5 "..\..\App.xaml"
     this.Startup += new System.Windows.StartupEventHandler(this.Application_Startup);
     
     #line default
     #line hidden
     System.Uri resourceLocater = new System.Uri("/MyWpfMVVMApp;component/app.xaml", System.UriKind.Relative);
     
     #line 1 "..\..\App.xaml"
     System.Windows.Application.LoadComponent(this, resourceLocater);
     
     #line default
     #line hidden
 }
Пример #57
0
 public void InitializeComponent() {
     if (_contentLoaded) {
         return;
     }
     _contentLoaded = true;
     
     #line 5 "..\..\App.xaml"
     this.StartupUri = new System.Uri("DataBindingDemo.xaml", System.UriKind.Relative);
     
     #line default
     #line hidden
     System.Uri resourceLocater = new System.Uri("/CodeWithCompiledMarkup;component/app.xaml", System.UriKind.Relative);
     
     #line 1 "..\..\App.xaml"
     System.Windows.Application.LoadComponent(this, resourceLocater);
     
     #line default
     #line hidden
 }
Пример #58
0
        private static object EndPointLock(string url)
        {
            System.Uri uri      = new System.Uri(url);
            string     endpoint = string.Format("{0}:{1}", uri.Host, uri.Port);

            lock (m_endpointSerializer)
            {
                object eplock = null;

                if (!m_endpointSerializer.TryGetValue(endpoint, out eplock))
                {
                    eplock = new object();
                    m_endpointSerializer.Add(endpoint, eplock);
                    // m_log.WarnFormat("[WEB UTIL] add a new host to end point serializer {0}",endpoint);
                }

                return(eplock);
            }
        }
Пример #59
0
 public void InitializeComponent() {
     if (_contentLoaded) {
         return;
     }
     _contentLoaded = true;
     
     #line 1 "..\..\App.xaml"
     this.StartupUri = new System.Uri("MainWindow.xaml", System.UriKind.Relative);
     
     #line default
     #line hidden
     System.Uri resourceLocater = new System.Uri("/ZooManagementProject;component/app.xaml", System.UriKind.Relative);
     
     #line 1 "..\..\App.xaml"
     System.Windows.Application.LoadComponent(this, resourceLocater);
     
     #line default
     #line hidden
 }
Пример #60
0
 public void InitializeComponent() {
     if (_contentLoaded) {
         return;
     }
     _contentLoaded = true;
     
     #line 5 "..\..\App.xaml"
     this.StartupUri = new System.Uri("SplashScreen.xaml", System.UriKind.Relative);
     
     #line default
     #line hidden
     System.Uri resourceLocater = new System.Uri("/foodrecipe;component/app.xaml", System.UriKind.Relative);
     
     #line 1 "..\..\App.xaml"
     System.Windows.Application.LoadComponent(this, resourceLocater);
     
     #line default
     #line hidden
 }