Beispiel #1
0
        async Task ExecuteLoadItemsCommand()
        {
            if (IsBusy)
            {
                return;
            }

            IsBusy = true;

            try
            {
                var token = await SecureStorage.GetAsync("token");

                Entries.Clear();
                var items = await PhonebookService.GetEntries(token);

                foreach (var item in items)
                {
                    Entries.Add(item);
                }
            }
            catch (Exception ex)
            {
                Debug.WriteLine(ex);
            }
            finally
            {
                IsBusy       = false;
                IsRefreshing = false;
            }
        }
Beispiel #2
0
        public override void OnResponse(NetState state, RelayInfo info)
        {
            int id = info.ButtonID;

            if (id == 0)
            {
                return;
            }

            var city = (VvVCity)id - 1;

            if (ViceVsVirtueSystem.Instance.ExemptCities.Contains(city))
            {
                ViceVsVirtueSystem.Instance.ExemptCities.Remove(city);
            }
            else
            {
                ViceVsVirtueSystem.Instance.ExemptCities.Add(city);
            }

            if (state.Gumps.Contains(this))
            {
                state.Gumps.Remove(this);
            }

            Entries.Clear();
            AddGumpLayout();

            state.Mobile.SendGump(this);
        }
Beispiel #3
0
        private void RefreshSorting()
        {
            if (IsBusy())
            {
                return;
            }

            var fn = (bool)btnSortByTime.IsChecked ? SortingFunction.ByTime : SortingFunction.ByName;
            IOrderedEnumerable <FileEntry> ordered = null;

            switch (fn)
            {
            case SortingFunction.ByName:
                ordered = Entries.ToArray().OrderBy((FileEntry fe) => fe.Title);
                break;

            case SortingFunction.ByTime:
                ordered = Entries.ToArray().OrderByDescending((FileEntry fe) => fe.Modified);
                break;
            }

            Entries.Clear();
            foreach (var fe in ordered)
            {
                Entries.Add(fe);
            }
        }
Beispiel #4
0
        public void Load(Stream stream)
        {
            var header = LfdHeader.Read(stream);

            HasTableOfContents = (header.Type == "RMAP");

            Entries.Clear();

            ResourceEntry entry = new ResourceEntry();

            if (HasTableOfContents)
            {
                var count   = header.Length / 16;
                var headers = new List <LfdHeader>(count);
                for (var i = 0; i < count; i++)
                {
                    headers.Add(LfdHeader.Read(stream));
                }
                entry = ResourceEntry.Load(stream);
            }
            else
            {
                entry.Header = header;
                entry.LoadData(stream);
            }

            while (entry.IsValid)
            {
                Entries.Add(entry);
                entry = ResourceEntry.Load(stream);
            }
            PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(nameof(Entries)));
            PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(nameof(HasTableOfContents)));
        }
Beispiel #5
0
        public async Task PopulateData()
        {
            ErrorVisible   = Visibility.Collapsed;
            LoadingVisible = Visibility.Visible;
            MultipleDaysForecast resObj = await owmClient.GetDaysForcast(City, AppResources.OWMlang, 9);

            if (resObj != null)
            {
                LoadingVisible = Visibility.Collapsed;
                resObj.Forecasts.Sort((a, b) => a.Timestamp.CompareTo(b.Timestamp));
                Entries.Clear();
                foreach (Forecast forecast in resObj.Forecasts)
                {
                    DateTime dateTime = new DateTime(1970, 1, 1, 0, 0, 0, DateTimeKind.Utc).AddSeconds(forecast.Timestamp);
                    dateTime = new DateTime(dateTime.Year, dateTime.Month, dateTime.Day);
                    if (dateTime >= DateTime.Today)
                    {
                        int    icon = Convert.ToInt32(Regex.Replace(forecast.Weathers[0].Icon, "[^0-9]", ""));
                        string info = char.ToUpper(forecast.Weathers[0].Description[0]) + forecast.Weathers[0].Description.Substring(1);
                        Entries.Add(new WeatherControlEntry(dateTime, OWAIconsWeatherStatesMap[icon],
                                                            info, Math.Round(forecast.Temperature.Min), Math.Round(forecast.Temperature.Max)));
                    }
                }
            }
            else
            {
                LoadingVisible = Visibility.Collapsed;
                ErrorVisible   = Visibility.Visible;
            }
        }
Beispiel #6
0
        private void FetchEntries(bool directCall)
        {
            if (IsBusy())
            {
                return;
            }

            Entries.Clear();

            fetchProgress.Visibility = Visibility.Visible;

            var worker = new Action(() =>
            {
                _isBusy    = true;
                _cancelled = false;
                _storage.Children(++_folderRequestId,
                                  _navState.CurrentFolderId,
                                  this.Dispatcher,
                                  AddEntry);
            });

            if (directCall)
            {
                worker();
            }
            else
            {
                new Task(worker).Start();
            }
        }
Beispiel #7
0
        public void ReadConfiguration(string configurationString)
        {
            XmlDocument config = new XmlDocument();

            config.LoadXml(configurationString);
            XmlElement root = config.DocumentElement;

            Entries.Clear();
            foreach (XmlElement queryNode in root.SelectNodes("queries/query"))
            {
                OLEDBQueryInstance queryEntry = new OLEDBQueryInstance();
                queryEntry.Name                    = queryNode.ReadXmlElementAttr("name", "");
                queryEntry.ConnectionString        = queryNode.ReadXmlElementAttr("connectionString", "");
                queryEntry.CmndTimeOut             = int.Parse(queryNode.ReadXmlElementAttr("cmndTimeOut", "60"));
                queryEntry.UsePersistentConnection = bool.Parse(queryNode.ReadXmlElementAttr("usePersistentConnection", "False"));

                XmlNode summaryQueryNode = queryNode.SelectSingleNode("summaryQuery");
                queryEntry.UseSPForSummary       = bool.Parse(summaryQueryNode.ReadXmlElementAttr("useSP", "False"));
                queryEntry.ReturnValueIsNumber   = bool.Parse(summaryQueryNode.ReadXmlElementAttr("returnValueIsNumber", "True"));
                queryEntry.ReturnValueInverted   = bool.Parse(summaryQueryNode.ReadXmlElementAttr("returnValueInverted", "False"));
                queryEntry.WarningValue          = summaryQueryNode.ReadXmlElementAttr("warningValue", "1");
                queryEntry.ErrorValue            = summaryQueryNode.ReadXmlElementAttr("errorValue", "2");
                queryEntry.SuccessValue          = summaryQueryNode.ReadXmlElementAttr("successValue", "[any]");
                queryEntry.UseRowCountAsValue    = bool.Parse(summaryQueryNode.ReadXmlElementAttr("useRowCountAsValue", "False"));
                queryEntry.UseExecuteTimeAsValue = bool.Parse(summaryQueryNode.ReadXmlElementAttr("useExecuteTimeAsValue", "False"));
                queryEntry.SummaryQuery          = summaryQueryNode.InnerText;

                XmlNode detailQueryNode = queryNode.SelectSingleNode("detailQuery");
                queryEntry.UseSPForDetail = bool.Parse(detailQueryNode.ReadXmlElementAttr("useSP", "False"));
                queryEntry.DetailQuery    = detailQueryNode.InnerText;
                Entries.Add(queryEntry);
            }
        }
Beispiel #8
0
        async Task ExecuteLoadItemsCommand()
        {
            if (IsBusy)
            {
                return;
            }

            IsBusy = true;

            try
            {
                Entries.Clear();
                var entries = await EntriesStore.GetItemsAsync();

                foreach (var entry in entries)
                {
                    Entries.Add(entry);
                }
            }
            catch (Exception ex)
            {
                Debug.WriteLine(ex);
            }
            finally
            {
                IsBusy = false;
            }
        }
        async Task ExecuteLoadEntryHistoryCommand()
        {
            if (IsBusy)
            {
                return;
            }

            IsBusy = true;

            try
            {
                Entries.Clear();
                var entries = await EntryDataStore.GetHistoryAsync(entryId, true);

                foreach (var entry in entries)
                {
                    Console.WriteLine(entry);
                    Entries.Add(entry);
                }
            }
            catch (Exception ex)
            {
                Debug.WriteLine(ex);
            }
            finally
            {
                IsBusy = false;
            }
        }
Beispiel #10
0
 public void ClearEntries()
 {
     Entries.RaiseListChangedEvents = false;
     Entries.Clear();
     Entries.RaiseListChangedEvents = true;
     Entries.ResetBindings();
 }
        private void Decrypt_Click(object sender, RoutedEventArgs e)
        {
            if (!CheckInputFields())
            {
                return;
            }
            if (!File.Exists(FileLocation))
            {
                return;
            }

            var encryptedBytes  = File.ReadAllBytes(FileLocation);
            var decryptedBytes  = _encrypter.Decrypt(encryptedBytes, Password);
            var memoryStream    = new MemoryStream();
            var binaryFormatter = new BinaryFormatter();

            memoryStream.Write(decryptedBytes, 0, decryptedBytes.Length);
            memoryStream.Position = 0;
            try
            {
                var deserialised = (SortedObservableCollection <Entry>)binaryFormatter.Deserialize(memoryStream);
                Entries.Clear();
                Entries.AddAll(deserialised);
                FileOpen = true;
            }
            catch (Exception ex) when(ex is DecoderFallbackException || ex is SerializationException)
            {
            }
        }
                public bool UpdateFilter(string filter)
                {
                    if (Filter == filter)
                    {
                        return(false);
                    }

                    Filter = filter;
                    Entries.Clear();

                    for (int i = 0; i < allItems.Length; i++)
                    {
                        if (string.IsNullOrEmpty(Filter) || allItems[i].ToLower().Contains(Filter.ToLower()))
                        {
                            Entry entry = new Entry
                            {
                                Index = i,
                                Text  = allItems[i]
                            };
                            if (string.Equals(allItems[i], Filter, StringComparison.CurrentCultureIgnoreCase))
                            {
                                Entries.Insert(0, entry);
                            }
                            else
                            {
                                Entries.Add(entry);
                            }
                        }
                    }
                    return(true);
                }
        //public List<PerfCounterCollectorEntry> Entries = new List<PerfCounterCollectorEntry>();

        //public PerfCounterCollectorConfig()
        //{
        //    Entries = new List<PerfCounterCollectorEntry>();
        //}

        #region IAgentConfig Members
        public void ReadConfiguration(string configurationString)
        {
            if (configurationString == null || configurationString.Length == 0)
            {
                return;
            }
            XmlDocument config = new XmlDocument();

            config.LoadXml(configurationString);
            XmlElement root = config.DocumentElement;

            Entries.Clear();
            foreach (XmlElement pcNode in root.SelectNodes("performanceCounters/performanceCounter"))
            {
                PerfCounterCollectorEntry entry = new PerfCounterCollectorEntry();
                entry.Computer            = pcNode.ReadXmlElementAttr("computer", ".");
                entry.Category            = pcNode.ReadXmlElementAttr("category", "Processor");
                entry.Counter             = pcNode.ReadXmlElementAttr("counter", "% Processor Time");
                entry.Instance            = pcNode.ReadXmlElementAttr("instance", "");
                entry.ReturnValueInverted = bool.Parse(pcNode.ReadXmlElementAttr("returnValueInverted", "False"));
                entry.WarningValue        = float.Parse(pcNode.ReadXmlElementAttr("warningValue", "80"));
                entry.ErrorValue          = float.Parse(pcNode.ReadXmlElementAttr("errorValue", "100"));
                Entries.Add(entry);
            }
        }
Beispiel #14
0
        public void Import(StreamReader reader)
        {
            Entries.Clear();
            while (!reader.EndOfStream)
            {
                try {
                    string str = reader.ReadLine();
                    if (str.Trim() != "")
                    {
                        string[] strArray = str.Split(TABS, StringSplitOptions.None);
                        if (strArray.Length != 3)
                        {
                            continue;
                        }
                        List <string> imported = new List <string>(3);

                        for (int i = 0; i < 3; i++)
                        {
                            string str3 = CsvUtil.Unformat(strArray [i]);
                            imported.Add(str3);
                        }
                        Entries.Add(new LocEntry(imported[0], imported[1], Boolean.Parse(imported[2])));
                    }
                } catch {}
            }
        }
Beispiel #15
0
        public void ReadConfiguration(string configurationString)
        {
            XmlDocument config = new XmlDocument();

            config.LoadXml(configurationString);
            XmlElement root = config.DocumentElement;

            Entries.Clear();
            foreach (XmlElement queryNode in root.SelectNodes("directoryServices/query"))
            {
                DirectoryServicesQueryCollectorConfigEntry dirSrvsQryEntry = new DirectoryServicesQueryCollectorConfigEntry();
                dirSrvsQryEntry.Name                = queryNode.ReadXmlElementAttr("name", "");
                dirSrvsQryEntry.DomainController    = queryNode.ReadXmlElementAttr("domainController", "");
                dirSrvsQryEntry.PropertiesToLoad    = queryNode.ReadXmlElementAttr("propertiesToLoad", "sAMAccountName");
                dirSrvsQryEntry.UseRowCountAsValue  = queryNode.ReadXmlElementAttr("useRowCountAsValue", false);
                dirSrvsQryEntry.MaxRowsToEvaluate   = queryNode.ReadXmlElementAttr("maxRows", 1);
                dirSrvsQryEntry.ReturnCheckSequence = CollectorReturnValueCompareEngine.CheckSequenceTypeFromString(queryNode.ReadXmlElementAttr("returnCheckSequence", "gwe"));
                XmlNode queryFilterNode = queryNode.SelectSingleNode("queryFilter");
                dirSrvsQryEntry.QueryFilterText = queryFilterNode.InnerText;
                XmlNode goodConditionNode = queryNode.SelectSingleNode("goodCondition");
                dirSrvsQryEntry.GoodResultMatchType = CollectorReturnValueCompareEngine.MatchTypeFromString(goodConditionNode.ReadXmlElementAttr("resultMatchType", "match"));
                dirSrvsQryEntry.GoodScriptText      = goodConditionNode.InnerText;
                XmlNode warningConditionNode = queryNode.SelectSingleNode("warningCondition");
                dirSrvsQryEntry.WarningResultMatchType = CollectorReturnValueCompareEngine.MatchTypeFromString(warningConditionNode.ReadXmlElementAttr("resultMatchType", "match"));
                dirSrvsQryEntry.WarningScriptText      = warningConditionNode.InnerText;
                XmlNode errorConditionNode = queryNode.SelectSingleNode("errorCondition");
                dirSrvsQryEntry.ErrorResultMatchType = CollectorReturnValueCompareEngine.MatchTypeFromString(errorConditionNode.ReadXmlElementAttr("resultMatchType", "match"));
                dirSrvsQryEntry.ErrorScriptText      = errorConditionNode.InnerText;
                Entries.Add(dirSrvsQryEntry);
            }
        }
        //public List<RegistryQueryInstance> Queries = new List<RegistryQueryInstance>();

        #region IAgentConfig Members
        public void ReadConfiguration(string configurationString)
        {
            XmlDocument config = new XmlDocument();

            if (configurationString == null || configurationString.Length == 0)
            {
                config.LoadXml(Properties.Resources.RegistryQueryCollectorDefaultConfig);
            }
            else
            {
                config.LoadXml(configurationString);
            }
            XmlElement root = config.DocumentElement;

            Entries.Clear();
            foreach (XmlElement queryNode in root.SelectNodes("queries/query"))
            {
                RegistryQueryInstance queryEntry = new RegistryQueryInstance();
                queryEntry.Name                   = queryNode.ReadXmlElementAttr("name", "");
                queryEntry.UseRemoteServer        = bool.Parse(queryNode.ReadXmlElementAttr("useRemoteServer", "False"));
                queryEntry.Server                 = queryNode.ReadXmlElementAttr("server", "");
                queryEntry.RegistryHive           = RegistryQueryInstance.GetRegistryHiveFromString(queryNode.ReadXmlElementAttr("registryHive", ""));
                queryEntry.Path                   = queryNode.ReadXmlElementAttr("path", "");
                queryEntry.KeyName                = queryNode.ReadXmlElementAttr("keyName", "");
                queryEntry.ExpandEnvironmentNames = bool.Parse(queryNode.ReadXmlElementAttr("expandEnvironmentNames", "False"));

                queryEntry.ReturnValueIsNumber = bool.Parse(queryNode.ReadXmlElementAttr("returnValueIsNumber", "False"));
                queryEntry.SuccessValue        = queryNode.ReadXmlElementAttr("successValue", "");
                queryEntry.WarningValue        = queryNode.ReadXmlElementAttr("warningValue", "");
                queryEntry.ErrorValue          = queryNode.ReadXmlElementAttr("errorValue", "");
                queryEntry.ReturnValueInARange = bool.Parse(queryNode.ReadXmlElementAttr("returnValueInARange", "False"));
                queryEntry.ReturnValueInverted = bool.Parse(queryNode.ReadXmlElementAttr("returnValueInverted", "False"));
                Entries.Add(queryEntry);
            }
        }
Beispiel #17
0
        internal override void ReadData(AwesomeReader ar)
        {
            Entries.Clear();

            Version = ar.ReadInt32();

            long nextString = ar.BaseStream.Position + 256;

            PackageName = ar.ReadNullString();

            ar.BaseStream.Position = nextString;
            int count = ar.ReadInt32(); // # of strings

            // Offset - Always 4
            ar.BaseStream.Position += 4;
            nextString              = ar.BaseStream.Position;

            for (int i = 0; i < count; i++)
            {
                ar.BaseStream.Position = nextString;

                // Reads string
                Entries.Add(ar.ReadNullString());
                nextString += 256;
            }
        }
Beispiel #18
0
        //public List<SqlTableSizeCollectorEntry> Entries = new List<SqlTableSizeCollectorEntry>();

        #region IAgentConfig Members
        public void ReadConfiguration(string configurationString)
        {
            XmlDocument config = new XmlDocument();

            config.LoadXml(configurationString);
            XmlElement root = config.DocumentElement;

            Entries.Clear();
            foreach (XmlElement databaseNode in root.SelectNodes("databases/database"))
            {
                SqlTableSizeCollectorEntry entry = new SqlTableSizeCollectorEntry();
                entry.SqlServer          = databaseNode.ReadXmlElementAttr("server", "");
                entry.Database           = databaseNode.ReadXmlElementAttr("name", "");
                entry.IntegratedSecurity = databaseNode.ReadXmlElementAttr("integratedSec", true);
                entry.UserName           = databaseNode.ReadXmlElementAttr("userName", "");
                entry.Password           = databaseNode.ReadXmlElementAttr("password", "");
                entry.SqlCmndTimeOutSec  = databaseNode.ReadXmlElementAttr("sqlCmndTimeOutSec", 30);

                foreach (XmlElement tableNode in databaseNode.SelectNodes("table"))
                {
                    TableSizeEntry tableSizeEntry = new TableSizeEntry();
                    tableSizeEntry.TableName    = tableNode.ReadXmlElementAttr("name", "");
                    tableSizeEntry.WarningValue = long.Parse(tableNode.ReadXmlElementAttr("warningValue", "1"));
                    tableSizeEntry.ErrorValue   = long.Parse(tableNode.ReadXmlElementAttr("errorValue", "2"));
                    entry.Tables.Add(tableSizeEntry);
                }

                Entries.Add(entry);
            }
        }
Beispiel #19
0
        private void ScreenInsideTags()
        {
            var finalString = new StringBuilder(Markdown);

            for (var i = 0; i < Entries.Count; i += 2)
            {
                foreach (var symbol in allSpecialSymbols)
                {
                    var offset  = 0;
                    var regexpr = new Regex($@"(?<!\\|{symbol})({symbol})(?:[\p{{P}}\w\s-[{symbol}]])+?(?<!\\)({symbol})");
                    var results = regexpr.Matches(finalString.ToString(), Entries.ElementAt(i).Key);
                    foreach (var result in results)
                    {
                        var match = result as Match;
                        finalString.Insert(match.Groups[1].Index + offset, "\\");
                        finalString.Insert(match.Groups[2].Index + offset + 1, "\\");
                        offset += 2;
                    }
                }
            }
            Entries.Clear();
            Screens.Clear();
            Markdown           = finalString.ToString();
            insideTagsScreened = true;
            FillEntries();
        }
Beispiel #20
0
        // private const string PATTERN = "<head.*<link( [^>]*title=\"{0}\"[^>]*)>.*</head>";
        // private static readonly Regex HREF = new Regex("href=\"(.*)\"", RegexOptions.IgnoreCase | RegexOptions.Compiled);

        ///// <summary>
        ///// Finds semantic links in a given HTML document.
        ///// </summary>
        ///// <param name="type">The type of link. Could be foaf, apml or sioc.</param>
        ///// <param name="html">The HTML to look through.</param>
        ///// <returns></returns>
        // public static List<Uri> FindLinks(string type, string html)
        // {
        // MatchCollection matches = Regex.Matches(html, string.Format(PATTERN, type), RegexOptions.IgnoreCase | RegexOptions.Singleline);
        // List<Uri> urls = new List<Uri>();

        // foreach (Match match in matches)
        // {
        // if (match.Groups.Count == 2)
        // {
        // string link = match.Groups[1].Value;
        // Match hrefMatch = HREF.Match(link);

        // if (hrefMatch.Groups.Count == 2)
        // {
        // Uri url;
        // string value = hrefMatch.Groups[1].Value;
        // if (Uri.TryCreate(value, UriKind.Absolute, out url))
        // {
        // urls.Add(url);
        // }
        // }
        // }
        // }

        // return urls;
        // }
        #region Methods

        /// <summary>
        /// Builds the entries so they can be searched.
        /// </summary>
        private static void BuildEntries()
        {
            OnIndexBuilding();

            lock (_syncRoot)
            {
                Entries.Clear();
                foreach (var post in Post.Posts.Where(post => post.IsVisibleToPublic))
                {
                    AddItem(post);
                    if (!BlogSettings.Instance.EnableCommentSearch)
                    {
                        continue;
                    }

                    foreach (var comment in post.Comments.Where(comment => comment.IsApproved))
                    {
                        AddItem(comment);
                    }
                }

                foreach (var page in Page.Pages.Where(page => page.IsVisibleToPublic))
                {
                    AddItem(page);
                }
            }

            OnIndexBuild();
        }
Beispiel #21
0
        private void SortEntries()
        {
            ArrayList list = new ArrayList();

            foreach (GumpEntry entry in new ArrayList(Entries))
            {
                if (entry is GumpBackground)
                {
                    list.Add(entry);
                    Entries.Remove(entry);
                }
            }

            foreach (GumpEntry entry in new ArrayList(Entries))
            {
                if (entry is GumpAlphaRegion)
                {
                    list.Add(entry);
                    Entries.Remove(entry);
                }
            }

            list.AddRange(Entries);

            Entries.Clear();

            foreach (GumpEntry entry in list)
            {
                Entries.Add(entry);
            }
        }
Beispiel #22
0
        public void ReadConfiguration(string configurationString)
        {
            XmlDocument config = new XmlDocument();

            config.LoadXml(configurationString);
            Entries.Clear();
            XmlElement root = config.DocumentElement;

            foreach (XmlElement powerShellScriptRunnerNode in root.SelectNodes("powerShellScripts/powerShellScriptRunner"))
            {
                PowerShellScriptRunnerEntry entry = new PowerShellScriptRunnerEntry();
                entry.Name = powerShellScriptRunnerNode.ReadXmlElementAttr("name", "");
                entry.ReturnCheckSequence = CollectorReturnValueCompareEngine.CheckSequenceTypeFromString(powerShellScriptRunnerNode.ReadXmlElementAttr("returnCheckSequence", "gwe"));
                XmlNode testScriptNode = powerShellScriptRunnerNode.SelectSingleNode("testScript");
                entry.TestScript = testScriptNode.InnerText;

                XmlNode goodScriptNode = powerShellScriptRunnerNode.SelectSingleNode("goodScript");
                entry.GoodResultMatchType = CollectorReturnValueCompareEngine.MatchTypeFromString(goodScriptNode.ReadXmlElementAttr("resultMatchType", "match"));
                entry.GoodScriptText      = goodScriptNode.InnerText;

                XmlNode warningScriptNode = powerShellScriptRunnerNode.SelectSingleNode("warningScript");
                entry.WarningResultMatchType = CollectorReturnValueCompareEngine.MatchTypeFromString(warningScriptNode.ReadXmlElementAttr("resultMatchType", "match"));
                entry.WarningScriptText      = warningScriptNode.InnerText;

                XmlNode errorScriptNode = powerShellScriptRunnerNode.SelectSingleNode("errorScript");
                entry.ErrorResultMatchType = CollectorReturnValueCompareEngine.MatchTypeFromString(errorScriptNode.ReadXmlElementAttr("resultMatchType", "match"));
                entry.ErrorScriptText      = errorScriptNode.InnerText;

                Entries.Add(entry);
            }
        }
Beispiel #23
0
        public virtual void Refresh(bool recompile = true, bool close = true)
        {
            OnBeforeRefresh();

            if (User == null || User.NetState == null)
            {
                return;
            }

            if (close)
            {
                User.NetState.Send(new CloseGump(TypeID, 0));
                User.NetState.RemoveGump(this);
            }
            else
            {
                User.NetState.RemoveGump(this);
            }

            if (recompile)
            {
                Entries.Clear();
                AddGumpLayout();
            }

            /*Children.ForEach(child =>
             *  {
             *      if(child.Open)
             *          child.Refresh(recompile, close);
             *  });*/

            User.SendGump(this);
            OnAfterRefresh();
        }
Beispiel #24
0
        public void ReadConfiguration(string configurationString)
        {
            XmlDocument config = new XmlDocument();

            config.LoadXml(configurationString);
            XmlElement root = config.DocumentElement;

            Entries.Clear();
            foreach (XmlElement addressNode in root.SelectNodes("webServices/webService"))
            {
                DynamicWSCollectorConfigEntry webServicePingEntry = new DynamicWSCollectorConfigEntry();
                webServicePingEntry.ServiceBaseURL     = addressNode.ReadXmlElementAttr("url", "");
                webServicePingEntry.ServiceBindingName = addressNode.ReadXmlElementAttr("serviceBindingName", "");
                webServicePingEntry.MethodName         = addressNode.ReadXmlElementAttr("method");
                string parameterStr = addressNode.ReadXmlElementAttr("paramatersCSV");
                webServicePingEntry.Parameters = new List <string>();
                if (parameterStr.Trim().Length > 0)
                {
                    webServicePingEntry.Parameters.AddRange(parameterStr.Split(','));
                }
                webServicePingEntry.ResultIsSuccess         = addressNode.ReadXmlElementAttr("resultIsSuccess", true);
                webServicePingEntry.ValueExpectedReturnType = WebServiceValueExpectedReturnTypeConverter.FromString(addressNode.ReadXmlElementAttr("valueExpectedReturnType", ""));
                webServicePingEntry.MacroFormatType         = WebServiceMacroFormatTypeConverter.FromString(addressNode.ReadXmlElementAttr("macroFormatType", ""));
                webServicePingEntry.CheckValueArrayIndex    = addressNode.ReadXmlElementAttr("arrayIndex", 0);
                webServicePingEntry.CheckValueColumnIndex   = addressNode.ReadXmlElementAttr("columnIndex", 0);
                webServicePingEntry.CheckValueOrMacro       = addressNode.ReadXmlElementAttr("valueOrMacro", "");
                webServicePingEntry.UseRegEx = addressNode.ReadXmlElementAttr("useRegEx", false);
                Entries.Add(webServicePingEntry);
            }
        }
Beispiel #25
0
 /// <summary>
 /// Clean up method.
 /// </summary>
 public override void Cleanup()
 {
     _isOperationable = false;
     SelectedIndex    = -1;
     Entries.Clear();
     base.Cleanup();
 }
Beispiel #26
0
        protected virtual void Clear()
        {
            NextButtonID    = 1;
            NextSwitchID    = 0;
            NextTextInputID = 0;

            Buttons.Clear();
            TileButtons.Clear();
            Switches.Clear();
            Radios.Clear();
            TextInputs.Clear();
            LimitedTextInputs.Clear();

            Entries.Clear();
            Entries.TrimExcess();

            if (Layout == null)
            {
                Layout = new SuperGumpLayout();
            }
            else
            {
                Layout.Clear();
            }
        }
        private void CreateEntries(Mapping mapping)
        {
            Entries.Clear();

            if (mapping == null)
            {
                return;
            }

            DcTable sourceTable = mapping.SourceSet;
            DcTable targetTable = mapping.TargetSet;

            foreach (DcColumn sourceColumn in sourceTable.Columns)
            {
                if (sourceColumn.IsSuper)
                {
                    continue;
                }
                if (!sourceColumn.IsPrimitive)
                {
                    continue;
                }
                if (sourceColumn == Column)
                {
                    continue;                         // Do not include the generating/projection column
                }
                ColumnMappingEntry entry = new ColumnMappingEntry(sourceColumn);

                PathMatch match = mapping.GetMatchForSource(new DimPath(sourceColumn));

                if (match != null)
                {
                    entry.Target     = match.TargetPath.FirstSegment;
                    entry.TargetType = entry.Target.Output;

                    entry.IsKey = entry.Target.IsKey;

                    entry.IsMatched = true;
                }
                else
                {
                    entry.Target     = null;
                    entry.TargetType = null;

                    if (IsImport)
                    {
                        entry.IsKey = false;
                    }
                    else
                    {
                        entry.IsKey = true;
                    }

                    entry.IsMatched = false;
                }

                Entries.Add(entry);
            }
        }
Beispiel #28
0
 public void Refresh()
 {
     Entries.Clear();
     Entries.TrimExcess();
     AddGumpLayout();
     User.CloseGump(this.GetType());
     User.SendGump(this, false);
 }
Beispiel #29
0
 public void Refresh(bool nofind = false, bool nocrit = false)
 {
     Entries.Clear();
     Entries.TrimExcess();
     AddGumpLayout(nofind, nocrit);
     User.CloseGump(this.GetType());
     User.SendGump(this, false);
 }
 public void Update()
 {
     Entries.Clear();
     foreach (WorkEntry e in NewBook.Entries)
     {
         Entries.Add(e);
     }
 }