當前位置: 首頁>>代碼示例>>Python>>正文


Python System.Uri方法代碼示例

本文整理匯總了Python中System.Uri方法的典型用法代碼示例。如果您正苦於以下問題:Python System.Uri方法的具體用法?Python System.Uri怎麽用?Python System.Uri使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在System的用法示例。


在下文中一共展示了System.Uri方法的8個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: add_radio_group

# 需要導入模塊: import System [as 別名]
# 或者: from System import Uri [as 別名]
def add_radio_group(panel):
    """add radio button group"""
    radio_data = RadioButtonGroupData("radioGroup")
    radio_button_group = panel.AddItem(radio_data)

    tb1 = ToggleButtonData("toggleButton1", "Red")
    tb1.ToolTip = "Red Option"
    tb1.LargeImage = BitmapImage(Uri(os.path.join(
        EXAMPLES_PATH, 'StartupScripts', 'red.png')))

    tb2 = ToggleButtonData("toggleButton2", "Green")
    tb2.ToolTip = "Green Option"
    tb2.LargeImage = BitmapImage(Uri(os.path.join(
        EXAMPLES_PATH, 'StartupScripts', 'green.png')))

    tb3 = ToggleButtonData("toggleButton3", "Blue")
    tb3.ToolTip = "Blue Option"
    tb3.LargeImage = BitmapImage(Uri(os.path.join(
        EXAMPLES_PATH, 'StartupScripts', 'blue.png')))

    radio_button_group.AddItem(tb1)
    radio_button_group.AddItem(tb2)
    radio_button_group.AddItem(tb3) 
開發者ID:daren-thomas,項目名稱:rps-sample-scripts,代碼行數:25,代碼來源:new_ribbon_panel.py

示例2: add_split_button

# 需要導入模塊: import System [as 別名]
# 或者: from System import Uri [as 別名]
def add_split_button(panel):
    """add a split button"""
    button_one = PushButtonData("pbButtonOne", "Option one",
                                DLL_PATH, "HelloWorld")
    button_one.LargeImage = BitmapImage(Uri(os.path.join(
        EXAMPLES_PATH, 'StartupScripts', 'one.png')))

    button_two = PushButtonData("pbButtonTwo", "Option two",
                                DLL_PATH, "HelloWorld")
    button_two.LargeImage = BitmapImage(Uri(os.path.join(
        EXAMPLES_PATH, 'StartupScripts', 'two.png')))

    button_three = PushButtonData("pbButtonThree", "Option three",
                                DLL_PATH, "HelloWorld")
    button_three.LargeImage = BitmapImage(Uri(os.path.join(
        EXAMPLES_PATH, 'StartupScripts', 'three.png')))

    split_button = panel.AddItem(SplitButtonData("splitButton", "Split"))
    split_button.AddPushButton(button_one)
    split_button.AddPushButton(button_two)
    split_button.AddPushButton(button_three) 
開發者ID:daren-thomas,項目名稱:rps-sample-scripts,代碼行數:23,代碼來源:new_ribbon_panel.py

示例3: add_push_button

# 需要導入模塊: import System [as 別名]
# 或者: from System import Uri [as 別名]
def add_push_button(panel):
    """add push button"""
    push_button = panel.AddItem(
        PushButtonData("pb_HelloWorld", "Hello, world!",
                       DLL_PATH, "HelloWorld"))
    push_button.ToolTip = "Say hello world"
    context_help = ContextualHelp(ContextualHelpType.Url, "http://www.autodesk.com")
    push_button.SetContextualHelp(context_help)

    push_button.LargeImage = BitmapImage(Uri(LARGE_IMG_PATH)) 
開發者ID:daren-thomas,項目名稱:rps-sample-scripts,代碼行數:12,代碼來源:new_ribbon_panel.py

示例4: create_url

# 需要導入模塊: import System [as 別名]
# 或者: from System import Uri [as 別名]
def create_url(cls, host, port=None, is_secure=False):
        if port is None:
            return Uri(host)
        else:
            scheme = 'wss' if is_secure else 'ws'
            builder = UriBuilder(scheme, host, port)
            return builder.Uri 
開發者ID:gramaziokohler,項目名稱:roslibpy,代碼行數:9,代碼來源:comm_cli.py

示例5: url

# 需要導入模塊: import System [as 別名]
# 或者: from System import Uri [as 別名]
def url(self, url):
        if isinstance(url, Uri):
            self._url = url
        elif isinstance(url, basestring):
            self._url = Uri(url)
        else:
            raise NotImplementedError 
開發者ID:compas-dev,項目名稱:compas,代碼行數:9,代碼來源:browser.py

示例6: test_as_bool

# 需要導入模塊: import System [as 別名]
# 或者: from System import Uri [as 別名]
def test_as_bool(self):
        """verify using expressions in if statements works correctly.  This generates an
        site whose return type is bool so it's important this works for various ways we can
        generate the body of the site, and use the site both w/ the initial & generated targets"""
        from IronPythonTest import NestedClass
        if is_netcoreapp:
            clr.AddReference("System.Runtime")
            clr.AddReference("System.Threading.Thread")
        else:
            clr.AddReference('System') # ensure test passes in ipy
        
        # instance property
        x = System.Uri('http://foo')
        for i in xrange(2):
            if x.AbsolutePath: pass
            else: self.fail('instance property')
        
        # instance property on type
        for i in xrange(2):
            if System.Uri.AbsolutePath: pass
            else: self.fail('instance property on type')
        
        # static property
        for i in xrange(2):
            if System.Threading.Thread.CurrentThread: pass
            else: self.fail('static property')
        
        # static field
        for i in xrange(2):
            if System.String.Empty: self.fail('static field')
        
        # instance field
        x = NestedClass()
        for i in xrange(2):
            if x.Field: self.fail('instance field')
        
        # instance field on type
        for i in xrange(2):
            if NestedClass.Field: pass
            else: self.fail('instance field on type')
        
        # math
        for i in xrange(2):
            if System.Int64(1) + System.Int64(1): pass
            else: self.fail('math')

        for i in xrange(2):
            if System.Int64(1) + System.Int64(1): pass
            else: self.fail('math')
        
        # GetItem
        x = System.Collections.Generic.List[str]()
        x.Add('abc')
        for i in xrange(2):
            if x[0]: pass
            else: self.fail('GetItem') 
開發者ID:IronLanguages,項目名稱:ironpython2,代碼行數:58,代碼來源:test_cliclass.py

示例7: test_as_bool

# 需要導入模塊: import System [as 別名]
# 或者: from System import Uri [as 別名]
def test_as_bool(self):
        """verify using expressions in if statements works correctly.  This generates an
        site whose return type is bool so it's important this works for various ways we can
        generate the body of the site, and use the site both w/ the initial & generated targets"""
        from IronPythonTest import NestedClass
        if is_netcoreapp:
            clr.AddReference("System.Runtime")
            clr.AddReference("System.Threading.Thread")
        else:
            clr.AddReference('System') # ensure test passes in ipy
        
        # instance property
        x = System.Uri('http://foo')
        for i in range(2):
            if x.AbsolutePath: pass
            else: self.fail('instance property')
        
        # instance property on type
        for i in range(2):
            if System.Uri.AbsolutePath: pass
            else: self.fail('instance property on type')
        
        # static property
        for i in range(2):
            if System.Threading.Thread.CurrentThread: pass
            else: self.fail('static property')
        
        # static field
        for i in range(2):
            if System.String.Empty: self.fail('static field')
        
        # instance field
        x = NestedClass()
        for i in range(2):
            if x.Field: self.fail('instance field')
        
        # instance field on type
        for i in range(2):
            if NestedClass.Field: pass
            else: self.fail('instance field on type')
        
        # math
        for i in range(2):
            if System.Int64(1) + System.Int64(1): pass
            else: self.fail('math')

        for i in range(2):
            if System.Int64(1) + System.Int64(1): pass
            else: self.fail('math')
        
        # GetItem
        x = System.Collections.Generic.List[str]()
        x.Add('abc')
        for i in range(2):
            if x[0]: pass
            else: self.fail('GetItem') 
開發者ID:IronLanguages,項目名稱:ironpython3,代碼行數:58,代碼來源:test_cliclass.py

示例8: add_stacked_buttons

# 需要導入模塊: import System [as 別名]
# 或者: from System import Uri [as 別名]
def add_stacked_buttons(panel):
    """Add a text box and combo box as stacked items"""
    combo_box_data = ComboBoxData("comboBox")
    text_data = TextBoxData("Text Box")
    text_data.Image = BitmapImage(Uri(SMALL_IMG_PATH))
    text_data.Name = "Text Box"
    text_data.ToolTip = "Enter some text here"
    text_data.LongDescription = """This is text that will appear next to the image
        when the user hovers the mouse over the control"""
    text_data.ToolTipImage = BitmapImage(Uri(LARGE_IMG_PATH))

    stacked_items = panel.AddStackedItems(text_data, combo_box_data)

    text_box = stacked_items[0]
    text_box.PromptText = "Enter a comment"
    text_box.ShowImageAsButton = True
    text_box.ToolTip = "Enter some text"
    text_box.EnterPressed += lambda sender, args: TaskDialog.Show('new_ribbon_panel', sender.Value)

    combo_box = stacked_items[1]
    combo_box.ItemText = "ComboBox"
    combo_box.ToolTip = "Select an Option"
    combo_box.LongDescription = "Select a number or letter"

    member_data_a = ComboBoxMemberData('A', 'Option A')
    member_data_a.Image = BitmapImage(Uri(os.path.join(
        EXAMPLES_PATH, 'StartupScripts', 'a.png')))
    member_data_a.GroupName = 'Letters'
    combo_box.AddItem(member_data_a)

    member_data_b = ComboBoxMemberData('B', 'Option B')
    member_data_b.Image = BitmapImage(Uri(os.path.join(
        EXAMPLES_PATH, 'StartupScripts', 'b.png')))
    member_data_b.GroupName = 'Letters'
    combo_box.AddItem(member_data_b)

    member_data_c = ComboBoxMemberData('C', 'Option C')
    member_data_c.Image = BitmapImage(Uri(os.path.join(
        EXAMPLES_PATH, 'StartupScripts', 'c.png')))
    member_data_c.GroupName = 'Letters'
    combo_box.AddItem(member_data_c)

    member_data_1 = ComboBoxMemberData('1', 'Option 1')
    member_data_1.Image = BitmapImage(Uri(os.path.join(
        EXAMPLES_PATH, 'StartupScripts', 'one_small.png')))
    member_data_1.GroupName = 'Numbers'
    combo_box.AddItem(member_data_1)

    member_data_2 = ComboBoxMemberData('2', 'Option 2')
    member_data_2.Image = BitmapImage(Uri(os.path.join(
        EXAMPLES_PATH, 'StartupScripts', 'two_small.png')))
    member_data_2.GroupName = 'Numbers'
    combo_box.AddItem(member_data_2)

    member_data_3 = ComboBoxMemberData('3', 'Option 3')
    member_data_3.Image = BitmapImage(Uri(os.path.join(
        EXAMPLES_PATH, 'StartupScripts', 'three_small.png')))
    member_data_3.GroupName = 'Numbers'
    combo_box.AddItem(member_data_3) 
開發者ID:daren-thomas,項目名稱:rps-sample-scripts,代碼行數:61,代碼來源:new_ribbon_panel.py


注:本文中的System.Uri方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。