示例#1
0
        void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target)
        {
            switch (connectionId)
            {
            case 1:
                this.mainWindow = ((AtomSimulator.Classes.Painter)(target));
                return;

            case 2:
                this.canvas = ((System.Windows.Controls.Canvas)(target));

            #line 12 "..\..\..\Classes\Painter.xaml"
                this.canvas.MouseLeftButtonDown += new System.Windows.Input.MouseButtonEventHandler(this.Canvas_MouseDown);

            #line default
            #line hidden

            #line 12 "..\..\..\Classes\Painter.xaml"
                this.canvas.MouseWheel += new System.Windows.Input.MouseWheelEventHandler(this.canvas_MouseWheel);

            #line default
            #line hidden
                return;

            case 3:
                this.st = ((System.Windows.Media.ScaleTransform)(target));
                return;
            }
            this._contentLoaded = true;
        }
示例#2
0
        public Atom(DataAtom a, Point c, Painter p, double direction, int number)
        {
            molName        = number;
            this.direction = direction;
            parent         = p;
            picsPerSec     = 24;
            center         = c;
            this.name      = a.Name;
            int weight = a.Weight - a.OuterWeight;

            shells = new List <Shell>();
            int counter = 1;
            int data;

            while (weight > 0)
            {
                data = (int)(2 * Math.Pow(counter, 2));
                shells.Add(new Shell(counter, (weight > data ? data : weight), Center));
                weight -= data;
                counter++;
            }
            shells.Add(new Shell(a.Shells, a.OuterWeight, center));
            myRadius = 17 * shells.Count() + 10;
        }