예제 #1
0
 bool IReflectorPersistance.Load(System.Xml.XPath.XPathNavigator r)
 {
     if (r.Name == "BoardPlugins")
     {
         bool everokay = false;
         bool okay;
         for (okay = r.MoveToFirstAttribute(); okay; okay = r.MoveToNext())
         {
             everokay = true;
             try
             {
                 Assembly a = Assembly.LoadFile(r.Value);
                 LoadPeices(a);
                 assemblies.Add(a);
             }
             catch
             {
             }
         }
         if (everokay)
         {
             r.MoveToParent();
         }
         return(true);
     }
     //throw new NotImplementedException();
     return(false);
 }
예제 #2
0
        internal Provider(System.Xml.XPath.XPathNavigator nav)
        {
            this._ProviderName = nav.GetAttribute("name", String.Empty);//.Value;
            this._ProviderType = nav.GetAttribute("type", String.Empty);
            var ns = nav.SelectChildren(System.Xml.XPath.XPathNodeType.Element);

            if (nav.MoveToFirstAttribute())
            {
                if ((nav.Name != "name") & (nav.Name != "type"))
                {
                    this._ProviderAttributes.Add(nav.Name, nav.Value);
                }
                while (nav.MoveToNextAttribute())
                {
                    if ((nav.Name != "name") & (nav.Name != "type"))
                    {
                        this._ProviderAttributes.Add(nav.Name, nav.Value);
                    }
                }
            }
            while (ns.MoveNext())
            {
                this._ProviderAttributes.Add(ns.Current.Name, ns.Current.Value);
            }
        }
예제 #3
0
 public bool Load(System.Xml.XPath.XPathNavigator r)
 {
     if (r.Name == "BoardInformation")
     {
         foreach (Type root_type in BoardPlugin.RootPeiceTypes)
         {
             if (r.Value == root_type.ToString())
             {
                 // call the property to setup other stuff
                 peices = BoardPlugin.PeiceTypes[root_type];
                 if (layers == null)
                 {
                     layers = new LinkedList <Layer>();
                 }
                 layers.Clear();
                 layers.AddLast(background = new Layer(this, peices[0]));
                 background.flags.bRoot    = true;
                 background.peice_instance = background.peice.CreateInstance(null, null);
             }
         }
         if (r.MoveToFirstChild())
         {
             do
             {
                 if (r.Name == "Peice")
                 {
                     foreach (PeiceRepresentation peice in peices)
                     {
                         if (r.Value == peice.GetType().ToString())
                         {
                             r.MoveToFirstChild();
                             peice.Load(r);
                             r.MoveToParent();
                             break;
                         }
                     }
                 }
             }while(r.MoveToNext());
             r.MoveToParent();
         }
         if (r.MoveToFirstAttribute())
         {
             do
             {
                 if (r.Name == "CellWidth")
                 {
                     cell_width = r.ValueAsInt;
                 }
                 if (r.Name == "CellHeight")
                 {
                     cell_height = r.ValueAsInt;
                 }
             } while(r.MoveToNextAttribute());
             r.MoveToParent();
         }
         return(true);
     }
     return(false);
 }
예제 #4
0
        public bool Load(System.Xml.XPath.XPathNavigator r)
        {
            if (r.Name == "PictureScroller")
            {
                bool   everokay = false;
                bool   okay;
                String filename = null;
                // default time.
                DateTime display_time = new DateTime(10 * 1000 * 1000 * 10);
                for (okay = r.MoveToFirstChild(); okay; okay = r.MoveToNext())
                {
                    everokay = true;
                    if (r.Name == "Image")
                    {
                        bool everokay2 = false;
                        bool okay2;
                        for (okay2 = r.MoveToFirstAttribute(); okay2; okay2 = r.MoveToNextAttribute())
                        {
                            everokay2 = true;
                            if (r.Name == "image")
                            {
                                filename = r.Value;
                            }
                            if (r.Name == "display_time")
                            {
                                try
                                {
                                    display_time = new DateTime(r.ValueAsLong);
                                }
                                catch
                                {
                                }
                            }
                        }
                        if (everokay2)
                        {
                            r.MoveToParent();
                            SomeImage i;

                            images.Add(i   = new SomeImage());
                            i.display_time = display_time;
                            i.file         = filename;
                        }
                    }
                }
                if (everokay)
                {
                    r.MoveToParent();
                }
                return(true);
            }
            return(false);
        }
예제 #5
0
        bool IReflectorPersistance.Load(System.Xml.XPath.XPathNavigator r)
        {
            switch (r.Name)
            {
            case "TextLabel":
                for (bool okay = r.MoveToFirstAttribute(); okay; okay = r.MoveToNextAttribute())
                {
                    switch (r.Name)
                    {
                    case "Font":
                        font = FontEditor.GetFontTracker(r.Value);
                        break;

                    case "Color":
                        textcolor = Color.FromArgb(Convert.ToInt32(r.Value));
                        break;

                    case "BackColor":
                        BackColor = Color.FromArgb(Convert.ToInt32(r.Value));
                        break;

                    case "Text":
                        text = r.Value;
                        break;

                    case "Align":
                        switch (r.Value)
                        {
                        case "Center":
                            centered   = true;
                            right_just = false;
                            break;

                        case "Right":
                            right_just = true;
                            centered   = false;
                            break;

                        case "Left":
                            centered   = false;
                            right_just = false;
                            break;
                        }
                        break;
                    }
                }
                r.MoveToParent();
                return(true);
            }
            return(false);
        }
예제 #6
0
 bool xperdex.core.interfaces.IReflectorPersistance.Load(System.Xml.XPath.XPathNavigator r)
 {
     if (r.Name == "displayTable")
     {
         //bool is_okay;
         if (r.MoveToFirstAttribute())
         {
             DataSource = Local.BingoDataSet.Tables[r.Value];
             if (r.MoveToNextAttribute())
             {
                 DisplayMember = r.Value;
             }
             r.MoveToParent();
         }
         return(true);
     }
     // didn't handle this node...
     return(false);
 }
예제 #7
0
 public static bool Load(System.Xml.XPath.XPathNavigator r)
 {
     switch (r.Name)
     {
     case "TextLayout":
         bool       okay;
         bool       everokay = false;
         TextLayout loading  = null;
         for (okay = r.MoveToFirstAttribute();
              okay;
              okay = r.MoveToNextAttribute())
         {
             everokay = true;
             switch (r.Name)
             {
             case "Name":
                 loading = core_common.GetLayout(r.Value);
                 break;
             }
         }
         if (everokay)
         {
             r.MoveToParent();
         }
         if (loading != null)
         {
             bool okay2;
             bool everokay2 = false;
             for (okay2 = r.MoveToFirstChild(); okay2; okay2 = r.MoveToNext())
             {
                 everokay2 = true;
                 TextLabel.Load(loading, r);
             }
             if (everokay2)
             {
                 r.MoveToParent();
             }
         }
         return(true);
     }
     return(false);
 }
예제 #8
0
        public bool Load(System.Xml.XPath.XPathNavigator r)
        {
            //throw new NotImplementedException();
            if (r.Name == "timer")
            {
                if (r.MoveToFirstAttribute())
                {
                    do
                    {
                        switch (r.Name)
                        {
                        case "add":
                            if (r.Value == "1")
                            {
                                add = true;
                            }
                            else
                            {
                                add = false;
                            }
                            break;

                        case "hours":
                            hours = r.ValueAsInt;
                            break;

                        case "minutes":
                            minutes = r.ValueAsInt;
                            break;

                        case "seconds":
                            seconds = r.ValueAsInt;
                            break;
                        }
                    }while(r.MoveToNextAttribute());
                    r.MoveToParent();
                }
                return(true);
            }
            return(false);
        }
예제 #9
0
			public new bool Load( System.Xml.XPath.XPathNavigator r )
			{
				bool everokay = false;

				switch( r.Name )
				{
				case "AcceptedImage":
					bool okay;
					for( okay = r.MoveToFirstAttribute(); okay; okay = r.MoveToNextAttribute() )
					{
						everokay = true;
						switch( r.Name )
						{
						case "location":
							FileName = r.Value;
							break;
						}
					}
					if( everokay )
						r.MoveToParent();
					break;
				}
				return everokay;
			}
예제 #10
0
        internal static bool Load(TextLayout layout, System.Xml.XPath.XPathNavigator r)
        {
            switch (r.Name)
            {
            case "TextLabel":
                bool        okay;
                int         x        = 0;
                int         y        = 0;
                Color       color    = Color.Black;
                string      name     = "NoName";
                string      fontname = "Default";
                AnchorPoint anchor   = AnchorPoint.TopLeft;
                bool        everokay = false;
                bool        center   = false;
                bool        right    = false;
                TextLabel   label    = null;
                for (okay = r.MoveToFirstAttribute(); okay; okay = r.MoveToNextAttribute())
                {
                    everokay = true;
                    switch (r.Name)
                    {
                    case "AlignCenter":
                        center = Convert.ToBoolean(r.Value);
                        break;

                    case "AlignRight":
                        right = Convert.ToBoolean(r.Value);
                        break;

                    case "color":
                        color = Color.FromArgb(Convert.ToInt32(r.Value));
                        break;

                    case "font":
                        fontname = r.Value;
                        break;

                    case "Name":
                        name = r.Value;
                        break;

                    case "X":
                        x = Convert.ToInt32(r.Value);
                        break;

                    case "Y":
                        y = Convert.ToInt32(r.Value);
                        break;

                    case "Anchor":
                        switch (r.Value)
                        {
                        case "TopLeft":
                            anchor = AnchorPoint.TopLeft;
                            break;

                        case "TopRight":
                            anchor = AnchorPoint.TopRight;
                            break;

                        case "BottomLeft":
                            anchor = AnchorPoint.BottomLeft;
                            break;

                        case "BottomRight":
                            anchor = AnchorPoint.BottomRight;
                            break;
                        }
                        break;
                    }
                }
                label = new TextLabel(name, x, y, anchor, fontname, color);
                if (label != null)
                {
                    label.bDrawRightJustified = right;
                    label.bHorizCenter        = center;
                    layout.placements.Add(label);
                }
                if (everokay)
                {
                    r.MoveToParent();
                }
                break;
            }
            return(false);
        }