/// <summary>
        /// Start connection with specified engine interface
        /// </summary>
        /// <param name="typeEngineInterface">Type of engine interface</param>
        /// <param name="urlClient">Asscoiated URL</param>
        /// <param name="ensureSecurity">Remoting security attribute</param>
        public void Start(string urlClient, bool ensureSecurity, uint timeOut, Type iProxyType)
        {
            Trace.TraceInformation("Configuring client connection");

            _ensureSecurity = ensureSecurity;

            #if MONO
            _sinkProvider = new BinaryClientFormatterSinkProvider();
            #endif

            IDictionary t = new Hashtable();
            t.Add("timeout", timeOut);
            t.Add("name", urlClient);

            Console.WriteLine("New IPC channel");

            // need to make ChannelNames unique so need to use this
            // constructor even though we dont care about the sink provider
            _channel = new IpcClientChannel(urlClient, _sinkProvider);

            Console.WriteLine("\tRegister");

            ChannelServices.RegisterChannel(_channel, _ensureSecurity);

            Console.WriteLine("\tActivate object proxy to IEngine");

            _base = (IBase)Activator.GetObject(iProxyType, urlClient);

            Console.WriteLine("\tActivated.");
        }
Example #2
0
 public int Foo(IBase x)
 {
     if (x is Derived2)
     {
         return ((Derived2)x).FooX();
     }
     return x.Foo();
 }
        public void SetUp()
        {
            _mocks = new MockRepository();

            _mockBase = _mocks.Stub<IBase>();
            _mockChild = _mocks.Stub<IChild>();

            _mocks.ReplayAll();
        }
        public StubDemoTestFixture()
        {
            _mocks = new MockRepository();

            _mockBase = _mocks.Stub<IBase>();
            _mockChild = _mocks.Stub<IChild>();

            _mocks.ReplayAll();
        }
Example #5
0
 public void AddTreeNode(IBase entity)
 {
     if (entity is PageCategory)
     {
         CreatePageCategoryNode(entity as PageCategory, Selected as TreeNode);
     }
     else
     {
         CreatePageNode(entity as PageScheme, Selected as TreeNode);
     }
 }
        public static bool IsPresentInLessThan(this ISelenium sel, int seconds, IBase iBase)
        {
            Stopwatch stopwatch = new Stopwatch();
            stopwatch.Start();

            while (stopwatch.Elapsed.Seconds < seconds)
            {
                bool present = sel.IsElementPresent(iBase.ToXPathExpression());
                if (present == true)
                {
                    return true;
                }
                //sleep for 200 ms between checks
                Thread.Sleep(200);
            }

            return false;
        }
 public Decorator1(IBase decoratee)
 {
     _decoratee = decoratee;
 }
 public BaseDecorator(IBase decoratee)
 {
     this.Decoratee = decoratee;
 }
        /// <summary>
        /// Start connection with specified engine interface
        /// </summary>
        /// <param name="typeEngineInterface">Type of engine interface</param>
        /// <param name="urlClient">Asscoiated URL</param>
        /// <param name="ensureSecurity">Remoting security attribute</param>
        public void Start(string urlClient, bool ensureSecurity, uint timeOut, Type iProxyType)
        {
            Trace.TraceInformation("Configuring client connection");

            _ensureSecurity = ensureSecurity;

            IDictionary t = new Hashtable();
            t.Add("timeout", timeOut);
            t.Add("name", urlClient);

            #if MONO
            _sinkProvider = new BinaryClientFormatterSinkProvider();
            #endif

            #if MONO
            /* MoMA moans about this line, but not clear why?
            Message	10	MonoTodo: void HttpClientChannel..ctor(IDictionary, IClientChannelSinkProvider)
            Reason: Handle the machineName, proxyName, proxyPort, servicePrincipalName, useAuthenticatedConnectionSharing properties	D:\Source\Projects\FluidEarth_Trunk\FluidEarth\SDK\src\ConnectionHttp.cs	148	14	PluginInterfaces
            */
            _channel = new HttpClientChannel(t, _sinkProvider);
            #else
            // need to make ChannelNames unique so need to use this
            // constructor even though we dont care about the sink provider
            _channel = new HttpClientChannel(t, _sinkProvider);
            #endif

            ChannelServices.RegisterChannel(_channel, _ensureSecurity);

            Trace.TraceInformation("Configured client connection");

            _base = (IBase)Activator.GetObject(iProxyType, urlClient);

            Trace.TraceInformation("Acquired proxy");
        }
        /*private void ClickMeEditor(object o) {
            try {
                integerIssue = Int32.Parse(IssueYear);
            } catch (Exception e) {
                return;
            }
            Console.WriteLine(Book);
            Book.Tytul = Title;
            Book.Autor = Author;
            Book.IssueYear = integerIssue;
            Main.UpdateBooksList();
            ((BorrowEditor)o).Close();
        }*/
        private void prepareCombos(IBase b)
        {
            ReadersObjects = new Collection<Reader>();
            BooksObjects = new Collection<Book>();

            foreach (Reader r in b.Readers) {
                ReadersObjects.Add(r);
            }
            foreach (Book bo in b.Books) {
                BooksObjects.Add(bo);
            }
            RaisePropertyChanged("ReadersObjects");
            RaisePropertyChanged("BooksObjects");
        }
 private static void BaseAction(IBase b)
 {
 }
 public static bool IsPresentNow(this ISelenium sel,IBase iBase)
 {
     return sel.IsElementPresent(iBase.ToXPathExpression());
 }
Example #13
0
 private void treePhy_NodeMouseDoubleClick(object sender, TreeNodeMouseClickEventArgs e)
 {
     if (e.Node != null)
     {
         var entity = e.Node.Tag as IBase;
         SelectedEntity = entity;
         if (entity is TDBHost)
         {
             if (IsAddChildNode(e.Node, entity))
             {
                 AddSiteNode(entity as TDBHost, e.Node);
             }
             CreateListView(DataTypeEnum.Host, entity);
         }
         else if (entity is Site)
         {
             var site = entity as Site;
             if (IsAddChildNode(e.Node, entity))
             {
                 AddEquipmentNode(site, e.Node);
             }
             if (site.DACUnitType == Com.Heguang.Entity.Server.Site.IOCTYPE)
             {
                 AddSignalNodeBySite(site, e.Node);
             }
             CreateListView(DataTypeEnum.Site, site);
         }
         else if (entity is Equipment)
         {
             if (IsAddChildNode(e.Node, entity))
             {
                 AddChildOfEquipmentNode(entity as Equipment, e.Node);
             }
             CreateListView(DataTypeEnum.Equipment, entity);
         }
         else
         {
             if (entity is Signal)
                 CreateListView(DataTypeEnum.Signal, entity);
             else if (entity is Affair)
                 CreateListView(DataTypeEnum.Affair, entity);
             else if (entity is Command)
                 CreateListView(DataTypeEnum.Command, entity);
             else if (entity is CommandDO)
                 CreateListView(DataTypeEnum.CommandDO, entity);
             else if (entity is UserInfo)
                 CreateListView(DataTypeEnum.User, entity);
         }
     }
 }
Example #14
0
 private Boolean IsAddChildNode(TreeNode node, IBase entity)
 {
     if (node.Nodes.Count <= 0 && entity.Id.IndexOf("Input") < 0)
     {
         return true;
     }
     return false;
 }
Example #15
0
 private void CreateListView(DataTypeEnum dataType, IBase entity)
 {
     if (entity.Id != SPECIAL)
     {
         var config = ConfigToolContext.Instance.ToolConfigObject[dataType.ToString()];
         if (config != null)
         {
             var datasource = new List<ConfigObject>(config);
             lvParameters.DisplayMember = "Title";
             lvParameters.ValueMember = "Name";
             lvParameters.DataSource = datasource;
         }
     }
 }
Example #16
0
 private TreeNode CreateNode(IBase entity, TreeNode parentNode)
 {
     var node = new TreeNode(entity.Name);
     node.Tag = entity;
     if (entity is TDBHost || parentNode == null)
         treePhy.Nodes.Add(node);
     else
         parentNode.Nodes.Add(node);
     treePhy.SelectedNode = node;
     return node;
 }
 public StubDemoTestFixture()
 {
     _mockBase = MockRepository.Mock<IBase>();
     _mockChild = MockRepository.Mock<IChild>();
 }
Example #18
0
 public IsPresent(IBase iBase)
 {
     this.iBase = iBase;
 }
 public static void MyIFunc(IBase derived)
 {
 }
 public DecoratorWithDependency(IBase decoratee, IDependency dependency)
 {
     _decoratee = decoratee;
     _dependency = dependency;
 }
Example #21
0
 public SysLogic(IBase custom)
     : base(custom)
 {
 }
Example #22
0
 public void AddTreeNode(IBase entity)
 {
     TreeControl.AddTreeNode(entity);
 }