示例#1
0
 public UMLClass()
 {
     ClassNodes = new List<ClassNode>();
     EnumNodes = new List<EnumNode>();
     StructNodes = new List<StructNode>();
     InterfaceNodes = new List<InterfaceNode>();
 }
示例#2
0
 public EchoBackupService()
 {
     //setup guid
     Logger.init();
     guid = Node.GetGuid();
     if (guid == Guid.Empty)
     {
         guid = Guid.NewGuid();
         Properties.Settings.Default.guid = guid;
         Properties.Settings.Default.Save();
     }
     recoverResults = new Queue<RecoverResult>();
     clientThreads = new List<ClientThread>();
     if (Node.GetTemporaryDirectory() == "")
     {
         Node.SetTemporaryDirectory(Path.Combine(Node.ExecutableDir(), "temp"));
     }
     if (Node.GetBackupDirectory() == "")
     {
         Node.SetBackupDirectory(Path.Combine(Node.ExecutableDir(), "backups"));
     }
     Logger.Debug2("About to set service name");
     this.ServiceName = "Echo Backup Service";
     Logger.Debug2("set service name");
     InitializeComponent();
     Logger.Debug2("initialized component");
 }
        public TabbedMainClubPages(List<Club> clubList, List<Club> memberClubList, List<Club> popularClubs, List<Club> newestClubs, List<string> pendingInviteList, List<string> firstLineCommentList)
        {
            ch = new ColorHandler();
            BackgroundColor = ch.fromStringToColor("purple");
            

            // BarTintColor = ch.fromStringToColor("purple");
            NavigationPage.SetHasNavigationBar(this, true);
            // NavigationPage.SetTitleIcon(CurrentPage,"CloudIcon.png");


            this.ToolbarItems.Add(new ToolbarItem
            {
                Icon = "Settings_Top.png",


                Order = ToolbarItemOrder.Primary,
                Command = new Command(() => menuPopup()),

            });
            csp = new ClubSearchPage(clubList, memberClubList, popularClubs, newestClubs, pendingInviteList, firstLineCommentList);
            mcp = new MyClubsPage(memberClubList, firstLineCommentList);
            pp = new ProfilePage();
            this.Children.Add(csp);
            this.Children.Add(mcp);
            this.Children.Add(pp);
            this.Title = "Explore";


            CurrentPageChanged += TabbedMainClubPages_CurrentPageChanged;

        }
示例#4
0
        /// <summary>
        /// Initializes a new instance of the <see cref="PrototypeBackend.BoardConfiguration"/> class.
        /// </summary>
        /// <param name="info">Info.</param>
        /// <param name="context">Context.</param>
        public BoardConfiguration(SerializationInfo info, StreamingContext context)
        {
            OnPinsUpdated = null;
            OnBoardUpdated = null;
            OnSequencesUpdated = null;
            OnSignalsUpdated = null;

            board = new Board ();
            Pins = new List<IPin> ();
            MeasurementCombinations = new List<MeasurementCombination> ();
            Sequences = new List<Sequence> ();

            board = (Board)info.GetValue ("Board", board.GetType ());
            Pins = (List<IPin>)info.GetValue ("Pins", Pins.GetType ());
            MeasurementCombinations = (List<MeasurementCombination>)info.GetValue ("MeasurementCombinations", MeasurementCombinations.GetType ());
            Sequences = (List<Sequence>)info.GetValue ("Sequences", Sequences.GetType ());
            ConfigSavePath = info.GetString ("ConfigSavePath");
            CSVSaveFolderPath = info.GetString ("CSVSaveFolderPath");
            UseMarker = info.GetBoolean ("UseMarker");
            LogRAWValues = info.GetBoolean ("LogRAWValues");

            Separator = info.GetString ("CSVSeparator");
            EmptyValueFilling = info.GetString ("EmptyValueFilling");
            UTCTimestamp = info.GetBoolean ("UTCTimestamp");
            LocalTimestamp = info.GetBoolean ("LocalTimestamp");
            TimeFormat = info.GetString ("TimeFormat");
            FileNameConvention = ((List<string>)info.GetValue ("FileNameConvention", new List<string> ().GetType ())).ToArray<string> ();
            FileNameTimeFormat = info.GetString ("FileNameTimeFormat");
            FileNameDateFormat = info.GetString ("FileNameDateFormat");
            ValueFormatCultur = info.GetString ("ValueFormatCultur");
        }
示例#5
0
 public BruteLayout()
 {
     figures = new List<TypeFigure>();
     figureToInterfaces = new Dictionary<string, SimpleTextFigure>();
     AllNodes = new List<Node>();
     implementations = new List<SimpleTextFigure>();
 }
示例#6
0
        public FriendsPage(List<FrontFriends> friendsList)
        {
            this.friendsList = friendsList;
            displayedFriends = friendsList;
            Title = "Friends";
            ch = new ColorHandler();
            Entry searchBar = new Entry
            {
                Placeholder = "Search",
                BackgroundColor = ch.fromStringToColor("white"),
                TextColor = ch.fromStringToColor("black")

            };
            searchBar.Completed += SearchBar_Completed;
            ListView listView = new ListView
            {
                ItemsSource = displayedFriends,
                ItemTemplate = new DataTemplate(typeof(FriendsListViewCell)),
                RowHeight = 75
            };
            listView.ItemSelected += ListView_ItemSelected;

            BackgroundColor = ch.fromStringToColor("lightGray");
            Content = new StackLayout
            {
                Children =
                {
                    searchBar,
                    listView
                }
            };
        }
示例#7
0
        private PlayerModel()
        {
            this.MaxHealthPoints = 100;
            this.HealthPoints = 100;
            this.phialSizeMax = 9999;
            this.isPlayerAlive = true;
            this.revivePosition = Vector3.zero;

            //Damage
            this.Damage = 42;
            this.DamageType_Bolt = DamageTypes.Standard;
            this.DamageType_Poision = DamageTypes.None;

            //Recipes
            FoundedRecipes = new List<BaseRecipe>();

            addRecipe(getRecipe(PhialType.Heal));

            // Inventory Setup
            PhialInventory = new List<PhialType>();
            addPhialToinventory(PhialType.Heal);
            addPhialToinventory(PhialType.Heal);
            addPhialToinventory(PhialType.Fire);
            addPhialToinventory(PhialType.Ice);
            addPhialToinventory(PhialType.Fire);

            ingredieceInventory = new List<BaseIngredient>();
        }
示例#8
0
 public Bracket(List<Player> players)
 {
     this.players = players;
     Matches = new List<Match>();
     CurrentMatch = 0;
     GenerateMatches();
 }
示例#9
0
 public MethodNode(string Name, string Modifier, string ReturnType)
 {
     this.Name = Name;
     this.Modifier = Modifier;
     this.ReturnType = ReturnType;
     Parameters = new List<Parameter>();
 }
示例#10
0
        public List<Result> Search(string textToSearch, int i, List<Result> previousResults)
        {
            string first;
            string last;

            while (i > 0)
            {
                first = textToSearch.Substring(0, i);
                last = textToSearch.Substring(i);

                if (AddIfExists(first, previousResults))
                {
                    return Search(last, last.Length, previousResults);
                }

                var result = SearchUsingNumbers(first);
                if (result.Count() > 0)
                {
                    previousResults.Add(new Result { Number = first, Words = result });
                    return Search(last, last.Length, previousResults);
                }

                i--;
            }

            return previousResults;
        }
示例#11
0
文件: Sequence.cs 项目: Onkeliroh/DSA
 /// <summary>
 /// Initializes a new instance of the <see cref="PrototypeBackend.Sequence"/> class.
 /// </summary>
 /// <param name="copy">Copy.</param>
 public Sequence(Sequence copy)
     : base()
 {
     Pin = new DPin (copy.Pin);
     Name = copy.Name;
     Chain = new List<SequenceOperation> (copy.Chain);
     Repetitions = copy.Repetitions;
 }
示例#12
0
 public Bracket(List<Player> players)
 {
     Matches = new List<Match>();
     MatchesPlayed = new List<Match>();
     CurrentMatch = 0;
     Players = players;
     GenerateMatches();
     
 }
示例#13
0
 /// <summary>
 /// Initializes a new instance of the <see cref="PrototypeBackend.BoardConfiguration"/> class.
 /// </summary>
 public BoardConfiguration()
 {
     board = new Board ();
     Pins = new List<IPin> ();
     MeasurementCombinations = new List<MeasurementCombination> ();
     Sequences = new List<Sequence> ();
     //just in case use the home directory of the user -> ensures write properties
     CSVSaveFolderPath = Environment.GetFolderPath (Environment.SpecialFolder.UserProfile);
 }
示例#14
0
        public MyClubsPage(List<Club> memberClubList, List<string> recentCommentsList)
        {

            ch = new ColorHandler();

            generateDisplayList(memberClubList, recentCommentsList);
            updatePage();

        }
示例#15
0
 public FriendsClubListPage(List<Club> clubList)
 {
     Content = new StackLayout
     {
         Children = {
             new Label { Text = "Hello ContentPage" }
         }
     };
 }
示例#16
0
        /// <summary>
        /// Strings to pin.
        /// </summary>
        /// <returns>The to pin.</returns>
        /// <param name="str">String.</param>
        public static List<int> StringToPin(string str)
        {
            var pairs = str.Split (new char[]{ ',' }, StringSplitOptions.RemoveEmptyEntries);
            var dict = new List<int> ();

            foreach (string s in pairs) {
                dict.Add (Convert.ToInt32 (s));
            }
            return dict;
        }
示例#17
0
        public TreeLayout()
        {
            figures     = new List<TypeFigure>();
            TreeNodes   = new List<TreeNode>();
            map         = new Dictionary<string, TreeNode>();
            Roots       = new List<TreeNode>();

            figureToInterfaces = new Dictionary<string, SimpleTextFigure>();
            Singles = new List<ClassFigure>();
        }
示例#18
0
        public List<Result> Search(string textToSearch)
        {
            var results = new List<Result>();
            if (ContainsOnlyNumbers(textToSearch))
            {
                return Search(textToSearch, textToSearch.Length, results);
            }

            return results;
        }
示例#19
0
 public Node()
 {
     this.Name = "Type Name";
     this.Methods = new List<MethodNode>();
     this.Fields = new List<FieldNode>();
     this.Properties = new List<PropertyNode>();
     this.Events = new List<EventNode>();
     this.Links = new List<string>();
     this.Implementations = new List<string>();
 }
示例#20
0
        // Loop while program is running and ping trusted nodes to determine whether they are online or offline
        // When a node comes online, distribute indexes to that node
        public void BeginIndexDistribution()
        {
            DistributionDatabase ddb = new DistributionDatabase();
            List<string> guidList = new List<string>();
            NodeDatabase ndb = new NodeDatabase();
            string online = "online";
            string offline = "offline";

            ddb.ResetStatus();

            while (distribute)
            {
                guidList = ndb.SelectGUID();

                foreach (string currentGUID in guidList)
                {
                    if (Node.GetGuid() != Guid.Parse(currentGUID))
                    {
                        Thread.Sleep(1000);
                        ddb.InsertNode(currentGUID, offline);
                        if (ndb.SelectNodeTrusted(Guid.Parse(currentGUID)) == "yes")
                        {
                            Ping pingSender = new Ping();
                            int timeout = 100;
                            try
                            {
                                IPAddress ip = ndb.SelectNodeIp(Guid.Parse(currentGUID));
                                PingReply reply = pingSender.Send(ip, timeout);

                                if (reply.Status == IPStatus.Success)
                                {
                                    if (ddb.GetStatus(currentGUID) == offline)
                                    {
                                        sendIndexes(currentGUID);
                                        ddb.UpdateStatus(currentGUID, online);
                                    }
                                }
                                else
                                {
                                    ddb.UpdateStatus(currentGUID, offline);
                                }
                            }
                            catch (Exception ex)
                            {
                                Debug.Print(ex.Message);
                            }
                        }
                        else
                        {
                            ddb.UpdateStatus(currentGUID, offline);
                        }
                    }
                }
            }
        }
示例#21
0
文件: Sequence.cs 项目: Onkeliroh/DSA
 /// <summary>
 /// Initializes a new instance of the <see cref="PrototypeBackend.Sequence"/> class.
 /// </summary>
 public Sequence()
 {
     Pin = new DPin ();
     Name = "";
     GroupName = "";
     Chain = new List<SequenceOperation> ();
     Repetitions = 0;
     Cycle = 0;
     CurrentOperation = 0;
     CurrentState = SequenceState.New;
     LastOperation = new TimeSpan (0);
 }
示例#22
0
 /// <summary>
 /// Initializes a new instance of the <see cref="PrototypeBackend.MeasurementCombination"/> class.
 /// </summary>
 /// <param name="copy">Copy.</param>
 public MeasurementCombination(MeasurementCombination copy)
     : base()
 {
     Pins = copy.Pins;
     Name = copy.Name;
     Color = copy.Color;
     Operation = copy.Operation;
     OperationString = copy.OperationString;
     Unit = copy.Unit;
     MeanValuesCount = copy.MeanValuesCount;
     Values = copy.Values;
 }
示例#23
0
 private void SearchBar_Completed(object sender, EventArgs e)
 {
     var searchedList = new List<FrontFriends>();
     for (int i = 0; i < friendsList.Count; i++)
     {
         if (friendsList[i].Username.Contains(searchBar.Text))
         {
             searchedList.Add(friendsList[i]);
         }
     }
     displayedFriends = searchedList;
 }
示例#24
0
 /// <summary>
 /// Initializes a new instance of the <see cref="PrototypeBackend.MeasurementCombination"/> class.
 /// </summary>
 public MeasurementCombination()
 {
     //Todo init
     Pins = new List<APin> ();
     Name = string.Empty;
     Color = Gdk.Color.Zero;
     Operation = null;
     OperationString_ = string.Empty;
     Unit = string.Empty;
     MeanValuesCount = 1;
     Values = new List<DateTimeValue> ();
 }
示例#25
0
        public App()
        {
            Instance = this;
            this.InitializeComponent();
            this.Suspending += OnSuspending;
            Players = new List<Player>();
            OCPlayers = new ObservableCollection<Player>();
            Leagues = new List<league>();

            OCPlayers.Add(new Player());
            OCPlayers.Add(new Player());
            OCPlayers.Add(new Player());

            //CheckNetwork();
        }
示例#26
0
 public App()
 {
     Instance = this;
     this.InitializeComponent();
     this.Suspending += OnSuspending;
     Players = new List<Player>();
     Players.Add(new Player("anders"));
     Players.Add(new Player("SindreKING"));
     //Players.Add(new Player("MarkuScrub"));
     //Players.Add(new Player("LeftEye"));
     if (NetworkInterface.GetIsNetworkAvailable())
     {
         GenerateLeague();
     }
 }
示例#27
0
文件: Sequence.cs 项目: Onkeliroh/DSA
        /// <summary>
        /// Initializes a new instance of the <see cref="PrototypeBackend.Sequence"/> class.
        /// </summary>
        /// <param name="info">Info.</param>
        /// <param name="context">Context.</param>
        public Sequence(SerializationInfo info, StreamingContext context)
        {
            Pin = new DPin ();
            Pin = (DPin)info.GetValue ("Pin", Pin.GetType ());

            Name = info.GetString ("Name");

            GroupName = info.GetString ("GroupName");

            Chain = new List<SequenceOperation> ();
            Chain = (List<SequenceOperation>)info.GetValue ("Chain", Chain.GetType ());

            Repetitions = info.GetInt32 ("Repetitions");

            Color = new Gdk.Color (info.GetByte ("RED"), info.GetByte ("GREEN"), info.GetByte ("BLUE"));
        }
示例#28
0
        /// <summary>
        /// Initializes a new instance of the <see cref="SequenceConfigurationsDialog.SequenceConfiguration"/> class.
        /// </summary>
        /// <param name="pins">Pins.</param>
        /// <param name="groups">Groups.</param>
        /// <param name="seq">Seq.</param>
        /// <param name="RefPin">Reference pin.</param>
        /// <param name="parent">Parent.</param>
        public SeqConfigDialog(DPin[] pins, List<string> groups, Sequence seq = null, DPin RefPin = null, Gtk.Window parent = null)
            : base("Digital Sequences - Dialog", parent, Gtk.DialogFlags.Modal, new object[0])
        {
            this.Build ();

            sbRadioBtnStopAfter.Adjustment.Upper = int.MaxValue;
            sbRadioBtnStopAfter.Adjustment.Lower = 0;

            DPins = pins;

            //no DPin no Sequence
            if (DPins.Length > 0) {
                for (int i = 0; i < DPins.Length; i++) {
            //					cbPin.AppendText (string.Format ("{0}(D{1})", DPins [i].Name, DPins [i].Number));
                    cbPin.AppendText (DPins [i].DisplayNumber);
                }
            }
            SetupNodeView ();
            SetupOxyPlot ();

            if (seq != null) {
                PinSequence = seq;
                if (seq.Repetitions == -1) {
                    rbRepeateContinously.Active = true;
                } else {
                    rbStopAfter.Active = true;
                    sbRadioBtnStopAfter.Sensitive = true;
                    sbRadioBtnStopAfter.Value = seq.Repetitions;
                }

                buttonOk.Label = "Apply";
                buttonOk.Image = new Image (Gtk.Stock.Apply, IconSize.Button);
            } else {
                pinSequence = new Sequence ();
                pinSequence.Repetitions = -1;
            }
            if (RefPin == null) {
                cbPin.Active = 0;
            } else {
                cbPin.Active = pins.ToList ().IndexOf (RefPin);
            }

            SetupGroups (groups);
            DisplaySequenceInfos ();
            BuildEvents ();
        }
示例#29
0
文件: APin.cs 项目: Onkeliroh/DSA
 /// <summary>
 /// Initializes a new instance of the <see cref="PrototypeBackend.APin"/> class.
 /// </summary>
 public APin()
 {
     Type = Backend.PinType.ANALOG;
     Mode = Backend.PinMode.INPUT;
     Name = "";
     Number = 0;
     PlotColor = new Gdk.Color (0, 0, 0);
     Slope = 1;
     Offset = 0;
     MeanValuesCount = 1;
     Interval = 1000;
     Values = new List<DateTimeValue> ();
     RAWValues = new List<DateTimeValue> ();
     Unit = "V";
     OnNewValue = null;
     OnNewRAWValue = null;
 }
示例#30
0
 private bool PassedNodeAvailabilityTest(List<NodeInstance> nodes)
 {
     txtUnitTests.Text += "Test 8.1.1 - Verifying node availability:";
     bool passed = true;
     foreach (NodeInstance node in nodes)
     {
         if (node.IPAddress.Length > 0)
         {
             txtUnitTests.Text += Environment.NewLine + node.Name + " is available, IP Address: " + node.IPAddress;
         }
         else
         {
             passed = false;
         }
     }
     return passed;
 }